lnd icon indicating copy to clipboard operation
lnd copied to clipboard

Refactoring for encrypting Tor key

Open orbitalturtle opened this issue 3 years ago • 4 comments

This PR lays the groundwork for #6500, which adds the ability to encrypt a Tor private key on disk. We originally had this all in one PR, but needed to split out this refactoring up because changes to the Tor module need to be added in another PR.

Summary of Changes:

  • Lays groundwork in Tor package for encrypting private key

  • Moves onionfile into a new package of Tor

orbitalturtle avatar May 11 '22 19:05 orbitalturtle

Great, thanks for the review @tvolk131 ! Made those changes.

orbitalturtle avatar May 19 '22 05:05 orbitalturtle

@orbitalturtle, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Jun 02 '22 06:06 lightninglabs-deploy

LGTM! I left one comment about a potential cleanup.

tvolk131 avatar Jun 03 '22 04:06 tvolk131

Rebased this just FYI :)

orbitalturtle avatar Aug 02 '22 19:08 orbitalturtle

Thanks for the reviews @Crypt-iQ and @guggero! I made those changes as well as rebased the PR.

orbitalturtle avatar Aug 30 '22 04:08 orbitalturtle

@Crypt-iQ Ah so the original intent of moving onionfile comes from this conversation from way back when: https://github.com/lightningnetwork/lnd/pull/4458#discussion_r620729177 But perhaps since the Tor directory has evolved into being a module instead of a package, this no longer makes sense? Will defer to you and @guggero on that one.

orbitalturtle avatar Aug 31 '22 01:08 orbitalturtle

@Crypt-iQ Ah so the original intent of moving onionfile comes from this conversation from way back when: #4458 (comment) But perhaps since the Tor directory has evolved into being a module instead of a package, this no longer makes sense? Will defer to you and @guggero on that one.

Ah, I was trying to remember why we decided to move the file in the first place. I knew there was a reason but couldn't recall. I think the EncrypterDecrypter interface decouples things sufficiently so we don't have a dependency to lnencrypt. Therefore we can probably revert the move. Sorry about the back and forth...

guggero avatar Aug 31 '22 08:08 guggero

@guggero Ahh that's right, I forgot we had completely removed lnencrypt as a dependency. No worries! Updated the code to remove the new onionfile package and I updated the PR description, so this is ready for another look.

orbitalturtle avatar Aug 31 '22 19:08 orbitalturtle

Pushed a new tag tor/v1.1.0 with the merge commit.

guggero avatar Sep 09 '22 11:09 guggero