libp2p / specs

Technical specifications for the libp2p networking stack
https://libp2p.io
1.58k stars 275 forks source link

noise: introduce an extension registry #453

Closed marten-seemann closed 2 years ago

marten-seemann commented 2 years ago

Fixes #450.

This PR removes the data field from the NoiseHandshakePayload protobuf, and adds an extensions field. extensions is NoiseExtensions protobuf, modeled after the extension registries that TLS and QUIC use. By using a new ID (data was 3, extensions is 4), this change won’t break implementations that used early data (I’m not aware of any, but just in case).

I’ve added code points for WebTransport, WebRTC and Early Muxer Negotiation to this PR, mostly to demonstrate how this would look like. Given that none of the specs for these are merged yet, it might make sense to define an empty NoiseExtensions protobuf here, and have the respective PRs add their code point (we’ll have to deal with merge conflicts then). Let me know if I should make that change.

marten-seemann commented 2 years ago

I rebased this PR on top of master, bumped the version number and added a Changelog.

This should be good to merge now.