]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: ignore empty TLS records.
authorAdam Langley <agl@golang.org>
Wed, 15 May 2013 14:25:54 +0000 (10:25 -0400)
committerAdam Langley <agl@golang.org>
Wed, 15 May 2013 14:25:54 +0000 (10:25 -0400)
commita1dbfee15b7283a41ae01c482a3862d2148798b8
treeff3b3468e8a41549327367b6ce81d1923c040ef6
parent133cdb6707ba88f83746db1efd15c4cb3034ff62
crypto/tls: ignore empty TLS records.

OpenSSL can be configured to send empty records in order to randomise
the CBC IV. This is an early version of 1/n-1 record splitting (that Go
does) and is quite reasonable, but it results in tls.Conn.Read
returning (0, nil).

This change ignores up to 100 consecutive, empty records to avoid
returning (0, nil) to callers.

Fixes 5309.

R=golang-dev, r, minux.ma
CC=golang-dev
https://golang.org/cl/8852044
src/pkg/crypto/tls/conn.go
src/pkg/crypto/tls/handshake_client_test.go