diff options
author | Benjamin Kaduk <bkaduk@akamai.com> | 2018-01-11 13:39:30 -0600 |
---|---|---|
committer | Benjamin Kaduk <bkaduk@akamai.com> | 2018-01-25 12:05:54 -0600 |
commit | f55e99f7dd7e88d9758d2f8baf57a30a8c6e429d (patch) | |
tree | 6bd6e0380cc9cf2e15f85804e8e11c4d719a44fa /ssl | |
parent | f27f5cd4870de6e2b269e7c3715df86756d67ba3 (diff) | |
download | openssl-f55e99f7dd7e88d9758d2f8baf57a30a8c6e429d.tar.gz |
Add TLS 1.3 draft-23 PSS signature algorithms
We now have a split in the signature algorithms codepoint space for
whether the certificate's key is for rsaEncryption or a PSS-specific
key, which should let us get rid of some special-casing that we
previously needed to try to coax rsaEncryption keys into performing PSS.
(This will be done in a subsequent commit.)
Send the new PSS-with-PSS-specific key first in our list, so that
we prefer the new technology to the old one.
We need to update the expected certificate type in one test,
since the "RSA-PSS+SHA256" form now corresponds to a public key
of type rsaEncryption, so we should expect the server certificate
type to be just "RSA". If we want to get a server certificate
type of "RSA-PSS", we need to use a new signature algorithm
that cannot be represented as signature+hash, so add a test for that
as well.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5068)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/ssl_locl.h | 9 | ||||
-rw-r--r-- | ssl/t1_lib.c | 24 |
2 files changed, 24 insertions, 9 deletions
diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index 00795776f8..369361c2a7 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -1918,9 +1918,12 @@ typedef enum downgrade_en { #define TLSEXT_SIGALG_ecdsa_secp521r1_sha512 0x0603 #define TLSEXT_SIGALG_ecdsa_sha224 0x0303 #define TLSEXT_SIGALG_ecdsa_sha1 0x0203 -#define TLSEXT_SIGALG_rsa_pss_sha256 0x0804 -#define TLSEXT_SIGALG_rsa_pss_sha384 0x0805 -#define TLSEXT_SIGALG_rsa_pss_sha512 0x0806 +#define TLSEXT_SIGALG_rsa_pss_rsae_sha256 0x0804 +#define TLSEXT_SIGALG_rsa_pss_rsae_sha384 0x0805 +#define TLSEXT_SIGALG_rsa_pss_rsae_sha512 0x0806 +#define TLSEXT_SIGALG_rsa_pss_pss_sha256 0x0809 +#define TLSEXT_SIGALG_rsa_pss_pss_sha384 0x080a +#define TLSEXT_SIGALG_rsa_pss_pss_sha512 0x080b #define TLSEXT_SIGALG_rsa_pkcs1_sha256 0x0401 #define TLSEXT_SIGALG_rsa_pkcs1_sha384 0x0501 #define TLSEXT_SIGALG_rsa_pkcs1_sha512 0x0601 diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 7f39a2e5d0..7f896d58d3 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -624,9 +624,12 @@ static const uint16_t tls12_sigalgs[] = { TLSEXT_SIGALG_ed25519, #endif - TLSEXT_SIGALG_rsa_pss_sha256, - TLSEXT_SIGALG_rsa_pss_sha384, - TLSEXT_SIGALG_rsa_pss_sha512, + TLSEXT_SIGALG_rsa_pss_pss_sha256, + TLSEXT_SIGALG_rsa_pss_pss_sha384, + TLSEXT_SIGALG_rsa_pss_pss_sha512, + TLSEXT_SIGALG_rsa_pss_rsae_sha256, + TLSEXT_SIGALG_rsa_pss_rsae_sha384, + TLSEXT_SIGALG_rsa_pss_rsae_sha512, TLSEXT_SIGALG_rsa_pkcs1_sha256, TLSEXT_SIGALG_rsa_pkcs1_sha384, @@ -676,13 +679,22 @@ static const SIGALG_LOOKUP sigalg_lookup_tbl[] = { NID_sha1, SSL_MD_SHA1_IDX, EVP_PKEY_EC, SSL_PKEY_ECC, NID_ecdsa_with_SHA1, NID_undef}, #endif - {"rsa_pss_sha256", TLSEXT_SIGALG_rsa_pss_sha256, + {"rsa_pss_rsae_sha256", TLSEXT_SIGALG_rsa_pss_rsae_sha256, + NID_sha256, SSL_MD_SHA256_IDX, EVP_PKEY_RSA_PSS, SSL_PKEY_RSA, + NID_undef, NID_undef}, + {"rsa_pss_rsae_sha384", TLSEXT_SIGALG_rsa_pss_rsae_sha384, + NID_sha384, SSL_MD_SHA384_IDX, EVP_PKEY_RSA_PSS, SSL_PKEY_RSA, + NID_undef, NID_undef}, + {"rsa_pss_rsae_sha512", TLSEXT_SIGALG_rsa_pss_rsae_sha512, + NID_sha512, SSL_MD_SHA512_IDX, EVP_PKEY_RSA_PSS, SSL_PKEY_RSA, + NID_undef, NID_undef}, + {"rsa_pss_pss_sha256", TLSEXT_SIGALG_rsa_pss_pss_sha256, NID_sha256, SSL_MD_SHA256_IDX, EVP_PKEY_RSA_PSS, SSL_PKEY_RSA_PSS_SIGN, NID_undef, NID_undef}, - {"rsa_pss_sha384", TLSEXT_SIGALG_rsa_pss_sha384, + {"rsa_pss_pss_sha384", TLSEXT_SIGALG_rsa_pss_pss_sha384, NID_sha384, SSL_MD_SHA384_IDX, EVP_PKEY_RSA_PSS, SSL_PKEY_RSA_PSS_SIGN, NID_undef, NID_undef}, - {"rsa_pss_sha512", TLSEXT_SIGALG_rsa_pss_sha512, + {"rsa_pss_pss_sha512", TLSEXT_SIGALG_rsa_pss_pss_sha512, NID_sha512, SSL_MD_SHA512_IDX, EVP_PKEY_RSA_PSS, SSL_PKEY_RSA_PSS_SIGN, NID_undef, NID_undef}, {"rsa_pkcs1_sha256", TLSEXT_SIGALG_rsa_pkcs1_sha256, |