mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-14 01:25:28 -04:00
Make nonce length check return error where it can
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
parent
12acb6bb4c
commit
eac6c757a2
@ -195,12 +195,10 @@ psa_status_t mbedtls_psa_aead_encrypt(
|
|||||||
}
|
}
|
||||||
tag = ciphertext + plaintext_length;
|
tag = ciphertext + plaintext_length;
|
||||||
|
|
||||||
if( mbedtls_aead_check_nonce_length( &operation, nonce_length )
|
status = mbedtls_aead_check_nonce_length( &operation, nonce_length );
|
||||||
!= PSA_SUCCESS )
|
|
||||||
{
|
if( status != PSA_SUCCESS )
|
||||||
status = PSA_ERROR_NOT_SUPPORTED;
|
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CCM)
|
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CCM)
|
||||||
if( operation.alg == PSA_ALG_CCM )
|
if( operation.alg == PSA_ALG_CCM )
|
||||||
@ -310,12 +308,10 @@ psa_status_t mbedtls_psa_aead_decrypt(
|
|||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
if( mbedtls_aead_check_nonce_length( &operation, nonce_length )
|
status = mbedtls_aead_check_nonce_length( &operation, nonce_length );
|
||||||
!= PSA_SUCCESS )
|
|
||||||
{
|
if( status != PSA_SUCCESS )
|
||||||
status = PSA_ERROR_NOT_SUPPORTED;
|
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CCM)
|
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CCM)
|
||||||
if( operation.alg == PSA_ALG_CCM )
|
if( operation.alg == PSA_ALG_CCM )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user