]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: implement TLS 1.3 server handshake (base)
authorFilippo Valsorda <filippo@golang.org>
Fri, 2 Nov 2018 04:57:30 +0000 (00:57 -0400)
committerFilippo Valsorda <filippo@golang.org>
Fri, 2 Nov 2018 22:07:43 +0000 (22:07 +0000)
commitc21ba09bcd83e58e862b1acc676dc36f31444022
tree1780ffc7b91f1fff782159e3c682c59af1debaad
parent4caa1276a1a184edf0ba8027619ecfe71e8c0804
crypto/tls: implement TLS 1.3 server handshake (base)

Implement a basic TLS 1.3 server handshake, only enabled if explicitly
requested with MaxVersion.

This CL intentionally leaves for future CLs:
  - PSK modes and resumption
  - client authentication
  - compatibility mode ChangeCipherSpecs
  - early data skipping
  - post-handshake messages
  - downgrade protection
  - KeyLogWriter support
  - TLS_FALLBACK_SCSV processing

It also leaves a few areas up for a wider refactor (maybe in Go 1.13):
  - the certificate selection logic can be significantly improved,
    including supporting and surfacing signature_algorithms_cert, but
    this isn't new in TLS 1.3 (see comment in processClientHello)
  - handshake_server_tls13.go can be dried up and broken into more
    meaningful, smaller functions, but it felt premature to do before
    PSK and client auth support
  - the monstrous ClientHello equality check in doHelloRetryRequest can
    get both cleaner and more complete with collaboration from the
    parsing layer, which can come at the same time as extension
    duplicates detection

Updates #9671

Change-Id: Id9db2b6ecc2eea21bf9b59b6d1d9c84a7435151c
Reviewed-on: https://go-review.googlesource.com/c/147017
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
19 files changed:
src/crypto/tls/auth.go
src/crypto/tls/common.go
src/crypto/tls/handshake_messages.go
src/crypto/tls/handshake_server.go
src/crypto/tls/handshake_server_test.go
src/crypto/tls/handshake_server_tls13.go [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv12-P256 [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv12-X25519 [moved from src/crypto/tls/testdata/Server-TLSv12-X25519-ECDHE-RSA-AES-GCM with 100% similarity]
src/crypto/tls/testdata/Server-TLSv13-AES128-SHA256 [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-AES256-SHA384 [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-ALPN [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-ALPN-NoMatch [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-CHACHA20-SHA256 [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-ECDHE-ECDSA-AES [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-ExportKeyingMaterial [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-HelloRetryRequest [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-P256 [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-RSA-RSAPSS [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-X25519 [new file with mode: 0644]