ssl: call signature verification twice for non-restartable operations

Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
Andrzej Kurek 2020-08-09 14:53:10 -04:00
parent 2544cd3582
commit 6c30be8e4b
No known key found for this signature in database
GPG Key ID: 89A90840DC388527
2 changed files with 10 additions and 2 deletions

View File

@ -3100,6 +3100,11 @@ static int ssl_in_server_key_exchange_parse( mbedtls_ssl_context *ssl,
{ {
mbedtls_platform_random_delay(); mbedtls_platform_random_delay();
if( rs_ctx == NULL )
{
ret = mbedtls_pk_verify_restartable( peer_pk,
md_alg, hash, hashlen, p, sig_len, rs_ctx );
}
if( ret == 0 ) if( ret == 0 )
{ {
#if !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) #if !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE)

View File

@ -4650,6 +4650,9 @@ static int ssl_parse_certificate_verify( mbedtls_ssl_context *ssl )
{ {
mbedtls_platform_random_delay(); mbedtls_platform_random_delay();
ret = mbedtls_pk_verify( peer_pk,
md_alg, hash_start, hashlen,
ssl->in_msg + i, sig_len );
if( ret == 0 ) if( ret == 0 )
{ {
mbedtls_ssl_update_handshake_status( ssl ); mbedtls_ssl_update_handshake_status( ssl );