fix condition over key type
This commit is contained in:
parent
17638efc46
commit
e58e68458e
1 changed files with 5 additions and 7 deletions
|
@ -1508,9 +1508,8 @@ psa_status_t psa_aead_encrypt( psa_key_slot_t key,
|
||||||
|
|
||||||
//TODO: check key policy
|
//TODO: check key policy
|
||||||
|
|
||||||
|
if ( !( ( key_type & PSA_KEY_TYPE_CATEGORY_MASK ) == PSA_KEY_TYPE_CATEGORY_CIPHER
|
||||||
if ( ( key_type & PSA_KEY_TYPE_CATEGORY_MASK ) == PSA_KEY_TYPE_CATEGORY_CIPHER
|
&& PSA_BLOCK_CIPHER_BLOCK_SIZE( key_type ) == 16 ) )
|
||||||
&& PSA_BLOCK_CIPHER_BLOCK_SIZE( key_type ) == 16 )
|
|
||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||||
|
|
||||||
if( alg == PSA_ALG_GCM )
|
if( alg == PSA_ALG_GCM )
|
||||||
|
@ -1609,9 +1608,8 @@ psa_status_t psa_aead_decrypt( psa_key_slot_t key,
|
||||||
|
|
||||||
//TODO: check key policy
|
//TODO: check key policy
|
||||||
|
|
||||||
|
if ( !( ( key_type & PSA_KEY_TYPE_CATEGORY_MASK ) == PSA_KEY_TYPE_CATEGORY_CIPHER
|
||||||
if ( ( key_type & PSA_KEY_TYPE_CATEGORY_MASK ) == PSA_KEY_TYPE_CATEGORY_CIPHER
|
&& PSA_BLOCK_CIPHER_BLOCK_SIZE( key_type ) == 16 ) )
|
||||||
&& PSA_BLOCK_CIPHER_BLOCK_SIZE( key_type ) == 16 )
|
|
||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||||
|
|
||||||
if( alg == PSA_ALG_GCM )
|
if( alg == PSA_ALG_GCM )
|
||||||
|
|
Loading…
Reference in a new issue