• 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
handshake_messages.go 31.1 KB