go-libp2p icon indicating copy to clipboard operation
go-libp2p copied to clipboard

noise: implement an early data API

Open marten-seemann opened this issue 3 years ago • 2 comments

This is recreating https://github.com/libp2p/go-libp2p-noise/pull/110. There were a few merge conflicts, so I'm asking for a re-review.

marten-seemann avatar Jul 07 '22 21:07 marten-seemann

Hm. Isn't our early data a bit too early here? I assume the initiator would send early data on the second message (when the connection is encrypted, and the client is authenticated) instead of the first.

That wouldn't be early data, that would just be using the established Noise connection. In our case, we do want to send unencrypted, unauthenticated data. This data is, as far as I can tell, included in the handshake transcript hash, so if an attacker modifies it, the handshake will fail.

For WebTransport, we only need to send early data from the client to the server (the certificate hashes), we don't have anything to send in the opposite direction.

marten-seemann avatar Jul 13 '22 14:07 marten-seemann

That wouldn't be early data, that would just be using the established Noise connection

Not quite. The initiator would still send data before the connection has been authenticated, allowing the receiver to open streams ASAP.

For WebTransport, we only need to send early data from the client to the server (the certificate hashes), we don't have anything to send in the opposite direction.

Oh! I see, I thought this was for multistream.

Stebalien avatar Jul 13 '22 14:07 Stebalien

2022-08-19 conversation: need to update the PR based off recent Noise changes. This is being driven by WebTransport initiative work.

BigLep avatar Aug 19 '22 16:08 BigLep