Use PSA error code

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2022-02-08 13:15:45 +01:00
parent 5d7d201b87
commit c5efb8e58b
No known key found for this signature in database
GPG Key ID: 106F5A41ECC305BD
3 changed files with 5 additions and 5 deletions

View File

@ -46,7 +46,7 @@
* pseudorandom key in \p prk.
*
* \return 0 on success.
* \return #MBEDTLS_ERR_HKDF_BAD_INPUT_DATA when the parameters are invalid.
* \return #PSA_ERROR_INVALID_ARGUMENT when the parameters are invalid.
* \return An PSA_ERROR_* error for errors returned from the underlying
* PSA layer.
*/

View File

@ -148,7 +148,7 @@ psa_status_t mbedtls_psa_hkdf_extract( psa_algorithm_t alg,
unsigned char null_salt[PSA_MAC_MAX_SIZE] = { '\0' };
mbedtls_svc_key_id_t key = MBEDTLS_SVC_KEY_ID_INIT;
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
psa_status_t ret = MBEDTLS_ERR_SSL_INTERNAL_ERROR;
psa_status_t ret = PSA_ERROR_CORRUPTION_DETECTED;
if( salt == NULL || salt_len == 0 )
{
@ -156,14 +156,14 @@ psa_status_t mbedtls_psa_hkdf_extract( psa_algorithm_t alg,
if( salt_len != 0 )
{
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
return( PSA_ERROR_INVALID_ARGUMENT );
}
hash_len = PSA_HASH_LENGTH( alg );
if( hash_len == 0 )
{
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
return( PSA_ERROR_INVALID_ARGUMENT );
}
salt = null_salt;

View File

@ -4421,7 +4421,7 @@ depends_on:PSA_WANT_ALG_SHA_1
psa_hkdf_extract:PSA_ALG_HMAC(PSA_ALG_SHA_1):"0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c":"":"2adccada18779e7c2077ad2eb19d3f3e731385dd"
SSL TLS 1.3 Key schedule: HKDF extract fails with wrong hash alg
psa_hkdf_extract_ret:0:MBEDTLS_ERR_SSL_BAD_INPUT_DATA
psa_hkdf_extract_ret:0:PSA_ERROR_INVALID_ARGUMENT
SSL TLS 1.3 Key schedule: HKDF RFC5869 Test Vector #1 Expand
depends_on:PSA_WANT_ALG_SHA_256