Skip to content

Commit

Permalink
fix: lost secondary keyshares (#238)
Browse files Browse the repository at this point in the history
Fix an unchecked overriding behavior which may lose pre-created handshake keys.
  • Loading branch information
gaukas authored Sep 4, 2023
1 parent fc79497 commit 67192c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion u_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,9 @@ func (c *UConn) clientHandshake(ctx context.Context) (err error) {
hs13 := c.HandshakeState.toPrivate13()
hs13.serverHello = serverHello
hs13.hello = hello
hs13.keySharesParams = NewKeySharesParameters()
if hs13.keySharesParams == nil {
hs13.keySharesParams = NewKeySharesParameters()
}
if !sessionIsLocked {
hs13.earlySecret = earlySecret
hs13.binderKey = binderKey
Expand Down

0 comments on commit 67192c2

Please sign in to comment.