lnd
lnd copied to clipboard
Refactoring for encrypting Tor key
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
Great, thanks for the review @tvolk131 ! Made those changes.
@orbitalturtle, remember to re-request review from reviewers when ready
LGTM! I left one comment about a potential cleanup.
Rebased this just FYI :)
Thanks for the reviews @Crypt-iQ and @guggero! I made those changes as well as rebased the PR.
@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.
@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 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.
Pushed a new tag tor/v1.1.0 with the merge commit.