tris: restore retry logic on warning alerts

Not sure why the retry logic was removed since 0-RTT works even in
presence of the special alerts handling (alertEndOfEarlyData is
processed before the warning alert). To reduce divergence from upstream
code (which adds a restriction on the number of consecutive warnings),
restore the original retry logic.

Do not do anything fancy here, later drafts will remove the special
alert handling since it becomes a special handshake message.

Fixes: ("crypto/tls: implement TLS 1.3 server 0-RTT")
This commit is contained in:
Peter Wu 2017-11-14 13:32:40 +00:00
parent 710e9e9631
commit 9e22da5ecc

View File

@ -649,6 +649,7 @@ func (c *Conn) readRecord(want recordType) error {
}
}
Again:
if c.rawInput == nil {
c.rawInput = c.in.newBlock()
}
@ -776,7 +777,7 @@ func (c *Conn) readRecord(want recordType) error {
case alertLevelWarning:
// drop on the floor
c.in.freeBlock(b)
return nil
goto Again
case alertLevelError:
c.in.setErrorLocked(&net.OpError{Op: "remote error", Err: alert(data[1])})
default: