From df598abbd3908d4ec7b1fec2a1b0c2aff290ca1c Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Wed, 8 Jun 2022 17:17:08 +0200 Subject: [PATCH] Fix key usage test in psa_pake_set_password_key() Signed-off-by: Neil Armstrong --- library/psa_crypto_pake.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/library/psa_crypto_pake.c b/library/psa_crypto_pake.c index 05d585405..7288cacf6 100644 --- a/library/psa_crypto_pake.c +++ b/library/psa_crypto_pake.c @@ -188,11 +188,8 @@ psa_status_t psa_pake_set_password_key( psa_pake_operation_t *operation, return PSA_ERROR_INVALID_ARGUMENT; } - if( usage == 0 || - ( usage & PSA_KEY_USAGE_DERIVE ) == 0 ) - { + if( ( usage & PSA_KEY_USAGE_DERIVE ) == 0 ) return PSA_ERROR_NOT_PERMITTED; - } operation->password = password;