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 May 29, 2023
1 parent 3be08c2 commit 5ad0b8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion handshake_client_tls13.go
Expand Up @@ -282,6 +282,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 Expand Up @@ -750,7 +751,7 @@ func (c *Conn) handleNewSessionTicket(msg *newSessionTicketMsgTLS13) error {

cacheKey := c.clientSessionCacheKey()
if cacheKey != "" {
c.config.ClientSessionCache.Put(cacheKey, toClientSessionState(session))
c.config.ClientSessionCache.Put(cacheKey, toClientSessionState(session))
}

return nil
Expand Down
5 changes: 5 additions & 0 deletions handshake_server_tls13.go
Expand Up @@ -495,6 +495,11 @@ func (hs *serverHandshakeStateTLS13) doHelloRetryRequest(selectedGroup CurveID)
return errors.New("tls: client illegally modified second ClientHello")
}

if illegalClientHelloChange(clientHello, hs.clientHello) {
c.sendAlert(alertIllegalParameter)
return errors.New("tls: client illegally modified second ClientHello")
}

hs.clientHello = clientHello
return nil
}
Expand Down

0 comments on commit 5ad0b8b

Please sign in to comment.