]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: flush the buffer on handshake errors
authorFilippo Valsorda <hi@filippo.io>
Fri, 9 Sep 2016 13:07:30 +0000 (14:07 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sun, 11 Sep 2016 23:29:03 +0000 (23:29 +0000)
commit5a59b66f23bc2eb11cc8445aea1dcf7a71bf2954
tree2424ad1c315851ecc4b4a85cdd51875082266f30
parent2e4dc86bfb19b1eb2a69ac36c87ada22bacc98c9
crypto/tls: flush the buffer on handshake errors

Since 2a8c81ff handshake messages are not written directly to wire but
buffered.  If an error happens at the wrong time the alert will be
written to the buffer but never flushed, causing an EOF on the client
instead of a more descriptive alert.

Thanks to Brendan McMillion for reporting this.

Fixes #17037

Change-Id: Ie093648aa3f754f4bc61c2e98c79962005dd6aa2
Reviewed-on: https://go-review.googlesource.com/28818
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/crypto/tls/conn.go
src/crypto/tls/handshake_client_test.go