1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-10-24 13:32:59 +03:00

Merge pull request #4996 from mprse/mbedtls_cipher_setup_psa_ECB

Fix test gap: mbedtls_cipher_setup_psa() with ECB
This commit is contained in:
Gilles Peskine
2021-10-01 14:49:10 +02:00
committed by GitHub
4 changed files with 107 additions and 3 deletions

View File

@@ -1266,9 +1266,12 @@ int mbedtls_cipher_crypt( mbedtls_cipher_context_t *ctx,
if( status != PSA_SUCCESS )
return( MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED );
status = psa_cipher_set_iv( &cipher_op, iv, iv_len );
if( status != PSA_SUCCESS )
return( MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED );
if( ctx->cipher_info->mode != MBEDTLS_MODE_ECB )
{
status = psa_cipher_set_iv( &cipher_op, iv, iv_len );
if( status != PSA_SUCCESS )
return( MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED );
}
status = psa_cipher_update( &cipher_op,
input, ilen,