ssl-opt: add a check for PSA computation of digest of ServerKeyExchange

This commit is contained in:
Andrzej Kurek 2019-01-15 05:23:59 -05:00
parent 814feffd15
commit e85414edd0
2 changed files with 5 additions and 4 deletions

View File

@ -9988,8 +9988,8 @@ int mbedtls_ssl_get_key_exchange_md_tls1_2( mbedtls_ssl_context *ssl,
psa_hash_operation_t hash_operation; psa_hash_operation_t hash_operation;
psa_algorithm_t hash_alg = mbedtls_psa_translate_md( md_alg ); psa_algorithm_t hash_alg = mbedtls_psa_translate_md( md_alg );
MBEDTLS_SSL_DEBUG_MSG( 2, ( "Perform PSA-based computation of digest \ MBEDTLS_SSL_DEBUG_MSG( 1, ( "Perform PSA-based computation of digest "
of ServerKeyExchange" ) ); "of ServerKeyExchange" ) );
if( ( status = psa_hash_setup( &hash_operation, if( ( status = psa_hash_setup( &hash_operation,
hash_alg ) ) != PSA_SUCCESS ) hash_alg ) ) != PSA_SUCCESS )
@ -10052,8 +10052,8 @@ int mbedtls_ssl_get_key_exchange_md_tls1_2( mbedtls_ssl_context *ssl,
const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type( md_alg ); const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type( md_alg );
*hashlen = mbedtls_md_get_size( md_info ); *hashlen = mbedtls_md_get_size( md_info );
MBEDTLS_SSL_DEBUG_MSG( 2, ( "Perform mbedtls-based computation of digest \ MBEDTLS_SSL_DEBUG_MSG( 1, ( "Perform mbedtls-based computation of digest "
of ServerKeyExchange" ) ); "of ServerKeyExchange" ) );
mbedtls_md_init( &ctx ); mbedtls_md_init( &ctx );

View File

@ -765,6 +765,7 @@ run_test_psa() {
-C "Failed to setup PSA-based cipher context"\ -C "Failed to setup PSA-based cipher context"\
-S "Failed to setup PSA-based cipher context"\ -S "Failed to setup PSA-based cipher context"\
-s "Protocol is TLSv1.2" \ -s "Protocol is TLSv1.2" \
-c "Perform PSA-based computation of digest of ServerKeyExchange" \
-S "error" \ -S "error" \
-C "error" -C "error"
} }