Merge pull request #5076 from mstarzyk-mobica/psa_ccm_no_tag

PSA CCM*-no-tag
This commit is contained in:
Manuel Pégourié-Gonnard 2021-11-10 10:18:55 +01:00 committed by GitHub
commit 087f04783d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 1366 additions and 11 deletions

View file

@ -3595,7 +3595,12 @@ psa_status_t psa_cipher_decrypt( mbedtls_svc_key_id_t key,
.core = slot->attr
};
if( input_length < PSA_CIPHER_IV_LENGTH( slot->attr.type, alg ) )
if( alg == PSA_ALG_CCM_STAR_NO_TAG && input_length < PSA_BLOCK_CIPHER_BLOCK_LENGTH( slot->attr.type ) )
{
status = PSA_ERROR_INVALID_ARGUMENT;
goto exit;
}
else if ( input_length < PSA_CIPHER_IV_LENGTH( slot->attr.type, alg ) )
{
status = PSA_ERROR_INVALID_ARGUMENT;
goto exit;