From 38391bf9b6a28be7e0bf90d9775462f5856369f9 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Fri, 16 Sep 2022 11:19:27 +0200 Subject: [PATCH] tls13: Do not impose minimum hash size for RSA PSS signatures When providing proof of possession of an RSA private key, allow the usage for RSA PSS signatures of a hash with a security level lower that the security level of the RSA private key. We did not allow this in the first place to align with the ECDSA case. But as it is not mandated by the TLS 1.3 specification (in contrary to ECDSA), let's allow it. Signed-off-by: Ronald Cron --- library/ssl_tls13_generic.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/library/ssl_tls13_generic.c b/library/ssl_tls13_generic.c index 507c587db8..54884e9ff2 100644 --- a/library/ssl_tls13_generic.c +++ b/library/ssl_tls13_generic.c @@ -906,12 +906,8 @@ int mbedtls_ssl_tls13_check_sig_alg_cert_key_match( uint16_t sig_alg, case MBEDTLS_SSL_SIG_RSA: switch( sig_alg ) { - case MBEDTLS_TLS1_3_SIG_RSA_PSS_RSAE_SHA256: - return( key_size <= 3072 ); - - case MBEDTLS_TLS1_3_SIG_RSA_PSS_RSAE_SHA384: - return( key_size <= 7680 ); - + case MBEDTLS_TLS1_3_SIG_RSA_PSS_RSAE_SHA256: /* Intentional fallthrough */ + case MBEDTLS_TLS1_3_SIG_RSA_PSS_RSAE_SHA384: /* Intentional fallthrough */ case MBEDTLS_TLS1_3_SIG_RSA_PSS_RSAE_SHA512: return( 1 );