Skip to content
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

Onion addresses need 12 bytes, not 10 #19

Open
sbuss opened this issue Mar 6, 2016 · 2 comments
Open

Onion addresses need 12 bytes, not 10 #19

sbuss opened this issue Mar 6, 2016 · 2 comments

Comments

@sbuss
Copy link

sbuss commented Mar 6, 2016

In codec.go you append the onion address to the port, which results in 12 bytes, but according to your spec, onion addresses are only 10 bytes (80 bits)

This mismatch results in being unable to decode the onion addresses correctly, since you can't get the port number back.

Should the spec be updated to be 12 bytes, or is prepending a varint to the (addr, port) bytes better?

@ghost
Copy link

ghost commented Jan 18, 2017

Is this still an issue?

cc @david415 @cpacia

@david415
Copy link
Contributor

david415 commented Jan 18, 2017

it's true that we need to use 12 bytes... but i thought we fixed that a while ago. i guess we missed this bug. good catch!

Stebalien pushed a commit that referenced this issue May 20, 2020
marten-seemann pushed a commit to marten-seemann/go-multiaddr that referenced this issue Feb 25, 2021
improve correctness of closing connections on failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants