• Filippo Valsorda's avatar
    crypto/tls: rewrite some messages with golang.org/x/crypto/cryptobyte · 4c8b09e9
    Filippo Valsorda authored
    As a first round, rewrite those handshake message types which can be
    reused in TLS 1.3 with golang.org/x/crypto/cryptobyte. All other types
    changed significantly in TLS 1.3 and will require separate
    implementations. They will be ported to cryptobyte in a later CL.
    
    The only semantic changes should be enforcing the random length on the
    marshaling side, enforcing a couple more "must not be empty" on the
    unmarshaling side, and checking the rest of the SNI list even if we only
    take the first.
    
    Change-Id: Idd2ced60c558fafcf02ee489195b6f3b4735fe22
    Reviewed-on: https://go-review.googlesource.com/c/144115
    Run-TryBot: Filippo Valsorda <filippo@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarAdam Langley <agl@golang.org>
    4c8b09e9
handshake_server_test.go 50.2 KB