Merge pull request #5202 from xkqian/pr/add_rsa_pkcsv15

Pr/add rsa pkcsv15
This commit is contained in:
Ronald Cron 2021-11-26 08:07:11 +01:00 committed by GitHub
commit 74217ee03c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View file

@ -6376,6 +6376,7 @@ static uint16_t ssl_preset_default_sig_algs[] = {
#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) #if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT)
MBEDTLS_TLS13_SIG_RSA_PSS_RSAE_SHA256, MBEDTLS_TLS13_SIG_RSA_PSS_RSAE_SHA256,
#endif #endif
MBEDTLS_TLS13_SIG_RSA_PKCS1_SHA256,
MBEDTLS_TLS13_SIG_NONE MBEDTLS_TLS13_SIG_NONE
}; };
@ -6395,6 +6396,7 @@ static uint16_t ssl_preset_suiteb_sig_algs[] = {
#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) #if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT)
MBEDTLS_TLS13_SIG_RSA_PSS_RSAE_SHA256, MBEDTLS_TLS13_SIG_RSA_PSS_RSAE_SHA256,
#endif #endif
MBEDTLS_TLS13_SIG_RSA_PKCS1_SHA256,
MBEDTLS_TLS13_SIG_NONE MBEDTLS_TLS13_SIG_NONE
}; };

View file

@ -376,7 +376,7 @@ static int ssl_tls13_parse_certificate_verify( mbedtls_ssl_context *ssl,
break; break;
#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) #if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT)
case MBEDTLS_TLS13_SIG_RSA_PSS_RSAE_SHA256: case MBEDTLS_TLS13_SIG_RSA_PSS_RSAE_SHA256:
MBEDTLS_SSL_DEBUG_MSG( 4, ( "Certificate Verify: using RSA" ) ); MBEDTLS_SSL_DEBUG_MSG( 4, ( "Certificate Verify: using RSA PSS" ) );
md_alg = MBEDTLS_MD_SHA256; md_alg = MBEDTLS_MD_SHA256;
sig_alg = MBEDTLS_PK_RSASSA_PSS; sig_alg = MBEDTLS_PK_RSASSA_PSS;
break; break;

View file

@ -1538,6 +1538,10 @@ int main( int argc, char *argv[] )
{ {
sig_alg_list[i++] = MBEDTLS_TLS13_SIG_RSA_PSS_RSAE_SHA256; sig_alg_list[i++] = MBEDTLS_TLS13_SIG_RSA_PSS_RSAE_SHA256;
} }
else if( strcmp( q, "rsa_pkcs1_sha256" ) == 0 )
{
sig_alg_list[i++] = MBEDTLS_TLS13_SIG_RSA_PKCS1_SHA256;
}
else else
{ {
mbedtls_printf( "unknown signature algorithm %s\n", q ); mbedtls_printf( "unknown signature algorithm %s\n", q );
@ -1546,6 +1550,7 @@ int main( int argc, char *argv[] )
mbedtls_printf( "ecdsa_secp384r1_sha384 " ); mbedtls_printf( "ecdsa_secp384r1_sha384 " );
mbedtls_printf( "ecdsa_secp521r1_sha512 " ); mbedtls_printf( "ecdsa_secp521r1_sha512 " );
mbedtls_printf( "rsa_pss_rsae_sha256 " ); mbedtls_printf( "rsa_pss_rsae_sha256 " );
mbedtls_printf( "rsa_pkcs1_sha256 " );
mbedtls_printf( "\n" ); mbedtls_printf( "\n" );
goto exit; goto exit;
} }