]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: implement TLS 1.3 client authentication
authorFilippo Valsorda <filippo@golang.org>
Tue, 6 Nov 2018 00:23:25 +0000 (19:23 -0500)
committerFilippo Valsorda <filippo@golang.org>
Mon, 12 Nov 2018 20:43:55 +0000 (20:43 +0000)
commit106db71f3779b0ae3e6dc83b22df0cf04bc36629
treeeab24a2a8eaa432d0fdf3a459b5bc524068329ba
parent6435d0cfbf72f405f31430e60766add6d6762fe1
crypto/tls: implement TLS 1.3 client authentication

Note that the SignatureSchemes passed to GetClientCertificate in TLS 1.2
are now filtered by the requested certificate type. This feels like an
improvement anyway, and the full list can be surfaced as well when
support for signature_algorithms_cert is added, which actually matches
the semantics of the CertificateRequest signature_algorithms in TLS 1.2.

Also, note a subtle behavior change in server side resumption: if a
certificate is requested but not required, and the resumed session did
not include one, it used not to invoke VerifyPeerCertificate. However,
if the resumed session did include a certificate, it would. (If a
certificate was required but not in the session, the session is rejected
in checkForResumption.) This inconsistency could be unexpected, even
dangerous, so now VerifyPeerCertificate is always invoked. Still not
consistent with the client behavior, which does not ever invoke
VerifyPeerCertificate on resumption, but it felt too surprising to
entirely change either.

Updates #9671

Change-Id: Ib2b0dbc30e659208dca3ac07d6c687a407d7aaaf
Reviewed-on: https://go-review.googlesource.com/c/147599
Reviewed-by: Adam Langley <agl@golang.org>
16 files changed:
src/crypto/tls/common.go
src/crypto/tls/conn.go
src/crypto/tls/handshake_client.go
src/crypto/tls/handshake_client_test.go
src/crypto/tls/handshake_client_tls13.go
src/crypto/tls/handshake_messages.go
src/crypto/tls/handshake_messages_test.go
src/crypto/tls/handshake_server.go
src/crypto/tls/handshake_server_test.go
src/crypto/tls/handshake_server_tls13.go
src/crypto/tls/testdata/Client-TLSv13-ClientCert-ECDSA-RSA [new file with mode: 0644]
src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-ECDSA [new file with mode: 0644]
src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-RSAPSS [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndECDSAGiven [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndGiven [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedNotGiven [new file with mode: 0644]