]> Cypherpunks.ru repositories - gostls13.git/commit
crypto/tls: disable RSA-PSS in TLS 1.2 again
authorFilippo Valsorda <filippo@golang.org>
Thu, 13 Jun 2019 22:33:33 +0000 (18:33 -0400)
committerFilippo Valsorda <filippo@golang.org>
Wed, 19 Jun 2019 19:59:14 +0000 (19:59 +0000)
commit0b3a57b5374bba3fdf88258e2be4c8be65e6a5de
tree60f2c993a944c3c0f7f82a5c265ac8d5d956b375
parent0ab1cc33ef35147b0e1248f2a9d669ae193d6b3e
crypto/tls: disable RSA-PSS in TLS 1.2 again

Signing with RSA-PSS can uncover faulty crypto.Signer implementations,
and it can fail for (broken) small keys. We'll have to take that
breakage eventually, but it would be nice for it to be opt-out at first.

TLS 1.3 requires RSA-PSS and is opt-out in Go 1.13. Instead of making a
TLS 1.3 opt-out influence a TLS 1.2 behavior, let's wait to add RSA-PSS
to TLS 1.2 until TLS 1.3 is on without opt-out.

Note that since the Client Hello is sent before a protocol version is
selected, we have to advertise RSA-PSS there to support TLS 1.3.
That means that we still support RSA-PSS on the client in TLS 1.2 for
verifying server certificates, which is fine, as all issues arise on the
signing side. We have to be careful not to pick (or consider available)
RSA-PSS on the client for client certificates, though.

We'd expect tests to change only in TLS 1.2:

    * the server won't pick PSS to sign the key exchange
      (Server-TLSv12-* w/ RSA, TestHandshakeServerRSAPSS);
    * the server won't advertise PSS in CertificateRequest
      (Server-TLSv12-ClientAuthRequested*, TestClientAuth);
    * and the client won't pick PSS for its CertificateVerify
      (Client-TLSv12-ClientCert-RSA-*, TestHandshakeClientCertRSAPSS,
      Client-TLSv12-Renegotiate* because "R" requests a client cert).

Client-TLSv13-ClientCert-RSA-RSAPSS was updated because of a fix in the test.

This effectively reverts 88343530720a52c96b21f2bd5488c8fb607605d7.

Testing was made more complex by the undocumented semantics of OpenSSL's
-[client_]sigalgs (see openssl/openssl#9172).

Updates #32425

Change-Id: Iaddeb2df1f5c75cd090cc8321df2ac8e8e7db349
Reviewed-on: https://go-review.googlesource.com/c/go/+/182339
Reviewed-by: Adam Langley <agl@golang.org>
39 files changed:
src/crypto/tls/auth.go
src/crypto/tls/common.go
src/crypto/tls/handshake_client.go
src/crypto/tls/handshake_client_test.go
src/crypto/tls/handshake_server.go
src/crypto/tls/handshake_server_test.go
src/crypto/tls/handshake_test.go
src/crypto/tls/key_agreement.go
src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-AES256-GCM-SHA384
src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-ECDSA
src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSA
src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSAPKCS1v15
src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSAPSS
src/crypto/tls/testdata/Client-TLSv12-RenegotiateOnce
src/crypto/tls/testdata/Client-TLSv12-RenegotiateTwice
src/crypto/tls/testdata/Client-TLSv12-RenegotiateTwiceRejected
src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-RSAPSS
src/crypto/tls/testdata/Server-TLSv12-ALPN
src/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch
src/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceECDSA
src/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceRSA
src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven
src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndEd25519Given
src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven
src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndPKCS1v15Given
src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven
src/crypto/tls/testdata/Server-TLSv12-ExportKeyingMaterial
src/crypto/tls/testdata/Server-TLSv12-P256
src/crypto/tls/testdata/Server-TLSv12-RSA-3DES
src/crypto/tls/testdata/Server-TLSv12-RSA-AES
src/crypto/tls/testdata/Server-TLSv12-RSA-AES-GCM
src/crypto/tls/testdata/Server-TLSv12-RSA-AES256-GCM-SHA384
src/crypto/tls/testdata/Server-TLSv12-RSA-RC4
src/crypto/tls/testdata/Server-TLSv12-RSA-RSAPKCS1v15
src/crypto/tls/testdata/Server-TLSv12-RSA-RSAPSS
src/crypto/tls/testdata/Server-TLSv12-SNI
src/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificate
src/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificateNotFound
src/crypto/tls/testdata/Server-TLSv12-X25519