Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
don't offer 0-RTT after a HelloRetryRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Mar 18, 2023
1 parent 7673484 commit 3d7ffb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions handshake_client_tls13.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ func (hs *clientHandshakeStateTLS13) processHelloRetryRequest() error {
}
}

hs.hello.earlyData = false // disable 0-RTT
if _, err := hs.c.writeHandshakeRecord(hs.hello, hs.transcript); err != nil {
return err
}
Expand Down
5 changes: 5 additions & 0 deletions handshake_server_tls13.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,11 @@ func (hs *serverHandshakeStateTLS13) doHelloRetryRequest(selectedGroup CurveID)
return errors.New("tls: client illegally modified second ClientHello")
}

if clientHello.earlyData {
c.sendAlert(alertIllegalParameter)
return errors.New("tls: client offered 0-RTT data in second ClientHello")
}

hs.clientHello = clientHello
return nil
}
Expand Down

0 comments on commit 3d7ffb3

Please sign in to comment.