fix conditions in psa_cipher_finish function
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index ee45a15..3cf63a9 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -1489,11 +1489,11 @@
{
if( operation->ctx.cipher.unprocessed_len > operation->block_size )
return( PSA_ERROR_INVALID_ARGUMENT );
- if( ( ( ( operation->alg ) & PSA_ALG_BLOCK_CIPHER_PAD_NONE ) == PSA_ALG_BLOCK_CIPHER_PAD_NONE )
+ if( ( ( operation->alg & PSA_ALG_BLOCK_CIPHER_PADDING_MASK ) == PSA_ALG_BLOCK_CIPHER_PAD_NONE )
&& ( operation->ctx.cipher.unprocessed_len != 0 ) )
return( PSA_ERROR_INVALID_ARGUMENT );
- if( ( ( ( operation->alg) & PSA_ALG_BLOCK_CIPHER_PAD_PKCS7 ) == PSA_ALG_BLOCK_CIPHER_PAD_PKCS7 )
- && ( output_size != operation->block_size ) )
+ if( ( ( operation->alg & PSA_ALG_BLOCK_CIPHER_PADDING_MASK ) == PSA_ALG_BLOCK_CIPHER_PAD_PKCS7 )
+ && ( *output_length != operation->block_size ) )
return( PSA_ERROR_INVALID_ARGUMENT );
}