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

Muxer selection in security handshake #446

Merged
merged 56 commits into from
Dec 12, 2022
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
dbde5fd
Muxer selection in security handshake spec
julian88110 Sep 8, 2022
a8804dd
Add cross version and security sections
julian88110 Sep 9, 2022
ad1bae7
Add security and more sections
julian88110 Sep 9, 2022
0d35e15
Address review feedback points, add protobuf.
julian88110 Sep 12, 2022
ec2e959
Address some more review points.
julian88110 Sep 13, 2022
0042384
Correct some typos
julian88110 Sep 13, 2022
dcac239
Address feedback points and update noise section
julian88110 Sep 15, 2022
245361c
update Noise extention protobuf
julian88110 Sep 15, 2022
a5b3ef0
Remove TBD item
julian88110 Sep 15, 2022
349ac76
Remove some redandant info
julian88110 Sep 15, 2022
d6eb581
add alternative options considered
julian88110 Sep 20, 2022
07f5d70
rebase from master
julian88110 Sep 23, 2022
808a6f6
Merge remote-tracking branch 'origin/master' into MuxerSel-inSecHands…
julian88110 Sep 23, 2022
c7a1db0
Update noise registration with NoiseExtensions field for muxers.
julian88110 Sep 23, 2022
811fc05
Update connections/muxer-sel-in-sec-handshake.md
julian88110 Sep 27, 2022
239dfca
Revise noise handshake section to reflect early data carrier msg change.
julian88110 Sep 27, 2022
f0fe69a
Merge branch 'MuxerSel-inSecHandshake' of https://github.com/libp2p/s…
julian88110 Sep 27, 2022
1c716e2
Correct sequence example in noise handshake
julian88110 Sep 27, 2022
24d021d
Update connections/muxer-sel-in-sec-handshake.md
julian88110 Sep 27, 2022
5c28fc1
replace nextproto with ALPN extension
julian88110 Sep 27, 2022
3e3394a
Merge branch muxerSel-inSecHandshake' of https://github.com/libp2p/sp…
julian88110 Sep 27, 2022
c6b8ed2
Update connections/muxer-sel-in-sec-handshake.md
julian88110 Oct 16, 2022
54379a9
Update title
julian88110 Oct 16, 2022
06896c3
Merge branch 'MuxerSel-inSecHandshake' of https://github.com/libp2p/s…
julian88110 Oct 16, 2022
cc2bbcb
Update connections/muxer-sel-in-sec-handshake.md
julian88110 Oct 16, 2022
f81c6f4
Update connections/muxer-sel-in-sec-handshake.md
julian88110 Oct 16, 2022
0b73a38
address some review points
julian88110 Oct 16, 2022
aecfbb8
Address some review points
julian88110 Oct 16, 2022
5192ad1
Revise some typos
julian88110 Oct 16, 2022
4ff74a7
Revise the Noise selection process so that the selection of muxer is …
julian88110 Oct 17, 2022
f69b691
Editorial
julian88110 Oct 17, 2022
8e51f46
formatting
julian88110 Oct 17, 2022
eb4e697
Update muxer-sel-in-sec-handshake.md
julian88110 Oct 18, 2022
ef8657d
Update muxer-sel-in-sec-handshake.md
julian88110 Oct 18, 2022
8296442
Update muxer-sel-in-sec-handshake.md
julian88110 Oct 19, 2022
0fc4452
Consolidate some sections again and simplify some descriptiosn.
julian88110 Oct 19, 2022
a11ff1d
remove accidentally checked file
julian88110 Oct 19, 2022
b4ce114
Editorial changes
julian88110 Oct 19, 2022
9b11a68
Update connections/muxer-sel-in-sec-handshake.md
julian88110 Nov 9, 2022
002e37f
Update connections/muxer-sel-in-sec-handshake.md
julian88110 Nov 14, 2022
e3fcb38
Update connections/muxer-sel-in-sec-handshake.md
julian88110 Nov 14, 2022
4a167d1
Update connections/muxer-sel-in-sec-handshake.md
julian88110 Nov 14, 2022
3e9586b
Apply some suggestions from code review
marten-seemann Nov 16, 2022
f682f6b
add myself to list of authors
marten-seemann Nov 16, 2022
c07fb79
rewrite the Security section
marten-seemann Nov 16, 2022
1e7a3c0
use the client's preference in Noise
marten-seemann Nov 16, 2022
eafbffc
rename document, link to it from connections README
marten-seemann Dec 6, 2022
1e52c1e
remove section describing current muxer selection
marten-seemann Dec 6, 2022
fe88ccf
remove repetitive section introducing muxer selection
marten-seemann Dec 6, 2022
da63658
improve TLS section
marten-seemann Dec 6, 2022
1306199
condense Noise section
marten-seemann Dec 6, 2022
bb070b2
Apply suggestions from code review
marten-seemann Dec 6, 2022
d90a15e
Apply suggestions from code review
marten-seemann Dec 6, 2022
447be1f
Apply suggestions from code review
marten-seemann Dec 6, 2022
c23af93
bump revisions
marten-seemann Dec 6, 2022
6fe4166
Apply suggestions from code review
marten-seemann Dec 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply some suggestions from code review
  • Loading branch information
marten-seemann authored Nov 16, 2022
commit 3e9586b05b2c4981c8c354e84be754445991860b
36 changes: 10 additions & 26 deletions connections/muxer-sel-in-sec-handshake.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ section into one step. Multiplexer negotiation can be performed as part of the
security protocol handshake, thus there is no need to perform another
multistream-selection negotiation for multiplexer negotiation.

In order to achieve the above stated goal, each candidate multiplexer will be
represented by a protocol name/code, and the candidate multiplexers are supplied
to the security protocol's handshake process as a list of protocol names.

If the client and server agree upon the common multiplexer to be used, then the
result of the multiplexer negotiation is used as the selected stream
multiplexer. If no agreement is reached upon by the client and server then the
Expand All @@ -88,30 +84,20 @@ protocols as part of the TLS ClientHello message. The server chooses
a protocol and sends the selected protocol as part of the TLS
ServerHello message.

For the purpose of multiplexer negotiation, the types of multiplexers are coded
as protocol names in the form of a list of strings, and inserted in the ALPN
extension field.
For the purpose of multiplexer negotiation, the protocol IDs of the stream
multiplexers are sent, followed by "libp2p".
An example list:

["/yamux/1.0.0", "/mplex/6.7.0", "libp2p"]

The multiplexer list is ordered by preference, with the most preferred
multiplexer at the beginning. The server SHOULD choose the supported protocol by
going through its preferred protocol list and search if the protocol is
supported by the client too. If no mutually supported protocol is found the TLS
handshake will fail.
The multiplexer list is ordered by the client's preference, with the most preferred
multiplexer at the beginning. The server SHOULD pick the first protocol from the
list that it supports.

The "libp2p" protocol code MUST always be the last item in the multiplexer list.
The reason for adding this special protocol code is to ensure backward
compatibility. In the previous versions that do not support this feature, the
ALPN extension field is alwasy populated with a key "libp2p". By appending the
key of "libp2p" to the end of the supported multiplexer list, the overlap of the
peer's supported ALPN protocols is always guaranteed when different versions of
libp2p are negotiating a TLS connection.

In the case that "libp2p" is the result of TLS ALPN, The upgrade process MUST
fall back to the multistream-selection protocol to negotiate the multiplexer to
be used. This fallback behavior ensures backward compatibility.
According to [tls], nodes that don't implement the optimization described in this document
use "libp2p" for their ALPN. If "libp2p" is the result of the ALPN process, nodes MUST use
multistream negotiation of the stream multiplexer as described in [connections].

### Multiplexer negotiation over Noise

Expand Down Expand Up @@ -171,10 +157,8 @@ supported multiplexers in plain text, but this is not a weakening of security
posture. In the future when [ECH] is ready the multiplexer info can be protected
marten-seemann marked this conversation as resolved.
Show resolved Hide resolved
too.

The early data in Noise handshake is only sent after the peers establish a
shared key, in the second and third handshake messages in the XX pattern. So the
early data is encrypted and the multiplexer info carried over is protected.
There is no security weakening in this case either.
Early data in the Noise handshake is sent after the peers have established a
shared key, so an on-path observer won't be able to read the early data.


## Alternative options considered
Expand Down