Skip to content

Commit

Permalink
Clear CIDs on potential session resumption
Browse files Browse the repository at this point in the history
Updates the flight0handler to clear connection IDs in the event the
client is attempting to resume an existing session. If connection IDs
are to be used in the resumed session, they should be negotiated afresh.

https://datatracker.ietf.org/doc/html/rfc9146#section-3

Signed-off-by: Daniel Mangum <[email protected]>
  • Loading branch information
hasheddan committed Aug 28, 2023
1 parent e142ee1 commit 609e5be
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flight0handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ func flight0Parse(_ context.Context, _ flightConn, state *State, cache *handshak
// No valid message received. Keep reading
return 0, nil, nil
}

// Connection Identifiers must be negotiated afresh on session resumption.
// https://datatracker.ietf.org/doc/html/rfc9146#name-the-connection_id-extension
state.localConnectionID = nil
state.remoteConnectionID = nil

state.handshakeRecvSequence = seq

var clientHello *handshake.MessageClientHello
Expand Down

0 comments on commit 609e5be

Please sign in to comment.