-
-
Notifications
You must be signed in to change notification settings - Fork 361
Support Tor .onion address #1642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThe changes introduce explicit support for Tor v3 onion addresses in network address handling, including parsing, routability checks, string representation, and serialization. Tor hidden service key management is updated to use Ed25519 v3 keys instead of RSA1024. A protocol version constant for Tor v3 serialization was added. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CNetAddr
participant TorControl
User->>CNetAddr: SetSpecial(onion address)
alt v2 onion (16 chars)
CNetAddr->>CNetAddr: Decode base32, set IP, isTorV3 = false
else v3 onion (56 chars)
CNetAddr->>CNetAddr: Store full address in onionV3Addr, isTorV3 = true
end
User->>CNetAddr: IsRoutable()
alt isTorV3 or IsTor()
CNetAddr-->>User: true
else
CNetAddr-->>User: Routability logic
end
User->>CNetAddr: ToStringIP()
alt isTorV3
CNetAddr-->>User: Return onionV3Addr
else
CNetAddr-->>User: Return standard representation
end
User->>TorControl: CreateHiddenService()
TorControl->>TorControl: Use "NEW:ED25519-V3" key type
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code Graph Analysis (1)src/protocol.h (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
🔇 Additional comments (2)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
src/netaddress.h
Outdated
|
||
if (ser_action.ForRead()) { | ||
bool v3Flag; | ||
READWRITE(v3Flag); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not compatible with previously saved data, this read will throw an exception if there isn't more data to read. Where do we save IP addresses to (peers.dat, etc)?
EDIT: Fixes #1545