Return 'Feature unavailable' error for ciphers unsupported by PSA
This commit is contained in:
parent
9de97d7773
commit
7b05629641
1 changed files with 1 additions and 1 deletions
|
@ -333,7 +333,7 @@ int mbedtls_cipher_setkey( mbedtls_cipher_context_t *ctx,
|
||||||
key_type = mbedtls_psa_translate_cipher_type(
|
key_type = mbedtls_psa_translate_cipher_type(
|
||||||
ctx->cipher_info->type );
|
ctx->cipher_info->type );
|
||||||
if( key_type == 0 )
|
if( key_type == 0 )
|
||||||
return( MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED );
|
return( MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE );
|
||||||
status = psa_import_key( cipher_psa->slot,
|
status = psa_import_key( cipher_psa->slot,
|
||||||
key_type, key, key_bytelen );
|
key_type, key, key_bytelen );
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
|
|
Loading…
Reference in a new issue