]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: fix parsing of SNI extension.
authorAdam Langley <agl@golang.org>
Sun, 14 Jun 2015 15:15:41 +0000 (08:15 -0700)
committerAdam Langley <agl@golang.org>
Sun, 14 Jun 2015 17:55:53 +0000 (17:55 +0000)
commit6a34206ca9aed71eeffba0e07e63a60b48c436bc
tree44651a87e6ca5cd7203ada14cd5ff8a0aeec446d
parent71e83b8855c787093dae340d365c5fbd21eab7f9
crypto/tls: fix parsing of SNI extension.

The previous code had a brain fart: it took one of the length prefixes
as an element count, not a length. This didn't actually affect anything
because the loop stops as soon as it finds a hostname element, and the
hostname element is always the first and only element. (No other element
types have ever been defined.)

This change fixes the parsing in case SNI is ever changed in the future.

Fixes #10793.

Change-Id: Iafdf3381942bc22b1f33595315c53dc6cc2e9f0f
Reviewed-on: https://go-review.googlesource.com/11059
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/crypto/tls/handshake_messages.go