Conversation
|
Great! Maybe add some tests to https://github.com/multiformats/go-multiaddr/blob/master/multiaddr_test.go to make sure it encodes/decodes as expected |
|
How could I forget that, done. |
multiaddr_test.go
Outdated
|
|
||
| func randMaddrString() string { | ||
| good_corpus := []string{"tcp", "ip", "udp", "ipfs", "0.0.0.0", "127.0.0.1", "12345", "QmbHVEEepCi7rn7VL7Exxpd2Ci9NNB6ifvqwhsrbRMgQFP"} | ||
| good_corpus := []string{"tcp", "ip", "udp", "ipfs", "shs", "0.0.0.0", "127.0.0.1", "12345", "QmbHVEEepCi7rn7VL7Exxpd2Ci9NNB6ifvqwhsrbRMgQFP", ""} |
There was a problem hiding this comment.
empty is fine? this is the good corpus so should be a valid shs addr, no?
Weird that tests pass... cc @Kubuxu
There was a problem hiding this comment.
No, empty is not fine. Copypaste mistake.
I realized that the shs protocol only uses ed25519 keys, so I changed it from length prefixed var size to ed25519.PublicKeySize and added length checks in codec.go. The test still passes both with the correct and with empty string, though.
Should I import agl's ed25519 just for using that constant or should I copy it into this package? In case I should import it, how? By vendoring, gx or directly?
There was a problem hiding this comment.
I realized that the shs protocol only uses ed25519 keys
Ahh, only ed25519? bummer
The test still passes both with the correct and with empty string, though.
yeah this is weird, and seems incorrect. @Kubuxu thoughts?
Should I import agl's ed25519 just for using that constant or should I copy it into this package? In case I should import it, how? By vendoring, gx or directly?
if its just that constant, nah, just copy it in, i think. (deps are unfortunately expensive :( )
There was a problem hiding this comment.
We had similar issue in go-ipfs, even empty, no protocol maddr is a valid maddr.
Should we change it?
There was a problem hiding this comment.
I realized that the shs protocol only uses ed25519 keys, so I changed it from length prefixed var size to ed25519.PublicKeySize and added length checks in codec.go. The test still passes both with the correct and with empty string, though.
is there a chance that SHS will support other key algorithms in the future? if so, it should stay variable-length. cc @dominictarr
There was a problem hiding this comment.
short answer: no.
shs is designed to be maximally metadata private (as is reasonable). so for this reason, there is no ciphersuite negioation. That also means downgrade attacks are simply not possible.
This also means you can't change shs -- to change shs you have to change it into another protocol, and then the new protocol gets a new multiformat name.
The plan is, as you are phasing in a new protocol, you just run it in parallel, say, on a different port.
then remove it when enough of the network has upgraded.
|
Rest LGTM |
|
I would be for making csv registry of transports and then assigning them and keeping parsing in packages with the transports. Which will be possible with #42 |
|
I didn't get your plan from that one sentence but I also don't get what this has to do with this PR. I mean this was laying around for a month now (idk why it wasn't merged). |
|
Is there a chance of this being merged? Is there something I can do to make it happen? paging @jbenet @whyrusleeping |
|
Or when #42 is merged the parser can be part of the shs transport itself. |
|
The protocol number should be added to protocols.csv in multiformats/multiaddr before merging. |
Make PacketConn more idiomatic and direct
…github.com/onsi/ginkgo-1.10.3 Bump github.com/onsi/ginkgo from 1.8.0 to 1.10.3
Here is a pull request to add the shs protocol suite designed and first implemented in JS by @dominictarr.
It is used by go-libp2p-shs.
I used protocol code 350 because it feels like it belongs below
ipfsbut in top ofudt/utp.