• Adam Langley's avatar
    crypto/tls: fix parsing of SNI extension. · 6a34206c
    Adam Langley authored
    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/11059Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    6a34206c
Name
Last commit
Last update
..
testdata Loading commit data...
alert.go Loading commit data...
cipher_suites.go Loading commit data...
common.go Loading commit data...
conn.go Loading commit data...
conn_test.go Loading commit data...
example_test.go Loading commit data...
generate_cert.go Loading commit data...
handshake_client.go Loading commit data...
handshake_client_test.go Loading commit data...
handshake_messages.go Loading commit data...
handshake_messages_test.go Loading commit data...
handshake_server.go Loading commit data...
handshake_server_test.go Loading commit data...
handshake_test.go Loading commit data...
key_agreement.go Loading commit data...
prf.go Loading commit data...
prf_test.go Loading commit data...
ticket.go Loading commit data...
tls.go Loading commit data...
tls_test.go Loading commit data...