1
0
mirror of https://github.com/ARMmbed/mbedtls.git synced 2025-05-10 00:49:04 +08:00

Fixing PSA return status

Signed-off-by: pespacek <peter.spacek@silabs.com>
This commit is contained in:
pespacek 2022-06-07 13:07:21 +02:00
parent 670913f4dc
commit b06acd734b

View File

@ -922,7 +922,8 @@ static int ssl_tls13_write_certificate_verify_body( mbedtls_ssl_context *ssl,
size_t signature_len = 0; size_t signature_len = 0;
unsigned char verify_hash[ MBEDTLS_MD_MAX_SIZE ]; unsigned char verify_hash[ MBEDTLS_MD_MAX_SIZE ];
size_t verify_hash_len; size_t verify_hash_len;
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
*out_len = 0; *out_len = 0;
own_key = mbedtls_ssl_own_key( ssl ); own_key = mbedtls_ssl_own_key( ssl );
@ -984,11 +985,12 @@ static int ssl_tls13_write_certificate_verify_body( mbedtls_ssl_context *ssl,
/* Hash verify buffer with indicated hash function */ /* Hash verify buffer with indicated hash function */
psa_algorithm = mbedtls_psa_translate_md( md_alg ); psa_algorithm = mbedtls_psa_translate_md( md_alg );
if( psa_hash_compute( psa_algorithm, status = psa_hash_compute( psa_algorithm,
verify_buffer, verify_buffer,
verify_buffer_len, verify_buffer_len,
verify_hash,sizeof( verify_hash ), verify_hash,sizeof( verify_hash ),
&verify_hash_len ) != PSA_SUCCESS ) &verify_hash_len );
if( status != PSA_SUCCESS )
return( psa_ssl_status_to_mbedtls( status ) ); return( psa_ssl_status_to_mbedtls( status ) );
MBEDTLS_SSL_DEBUG_BUF( 3, "verify hash", verify_hash, verify_hash_len ); MBEDTLS_SSL_DEBUG_BUF( 3, "verify hash", verify_hash, verify_hash_len );