1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

Indicate if we know that a nonce length is invalid

This restores the behaviour found in the previously released versions
and development_2.x.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
This commit is contained in:
Bence Szépkúti
2021-11-09 13:17:17 +01:00
parent b78618e9a3
commit 357b78e42c
3 changed files with 9 additions and 14 deletions

View File

@@ -3658,13 +3658,13 @@ static psa_status_t psa_aead_check_nonce_length( psa_algorithm_t alg,
case PSA_ALG_CHACHA20_POLY1305:
if( nonce_length == 12 )
return( PSA_SUCCESS );
break;
return( PSA_ERROR_NOT_SUPPORTED );
#endif /* PSA_WANT_ALG_CHACHA20_POLY1305 */
default:
break;
return( PSA_ERROR_NOT_SUPPORTED );
}
return( PSA_ERROR_NOT_SUPPORTED );
return( PSA_ERROR_INVALID_ARGUMENT );
}
psa_status_t psa_aead_encrypt( mbedtls_svc_key_id_t key,