From 9e22da5ecc059f6a9f52312e29042419e5da5dfe Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 14 Nov 2017 13:32:40 +0000 Subject: [PATCH] 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") --- conn.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conn.go b/conn.go index e73582d..325385c 100644 --- a/conn.go +++ b/conn.go @@ -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: