Check when usage == 0 in mbedtls_pk_can_do_ext()
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
This commit is contained in:
parent
b80785f1a4
commit
81d391f773
1 changed files with 2 additions and 1 deletions
|
@ -256,7 +256,8 @@ int mbedtls_pk_can_do_ext( const mbedtls_pk_context *ctx, psa_algorithm_t alg,
|
||||||
return( 0 );
|
return( 0 );
|
||||||
|
|
||||||
/* Filter out non allowed usage flags */
|
/* Filter out non allowed usage flags */
|
||||||
if( ( usage & ~( PSA_KEY_USAGE_SIGN_HASH |
|
if( usage == 0 ||
|
||||||
|
( usage & ~( PSA_KEY_USAGE_SIGN_HASH |
|
||||||
PSA_KEY_USAGE_DECRYPT |
|
PSA_KEY_USAGE_DECRYPT |
|
||||||
PSA_KEY_USAGE_DERIVE ) ) != 0 )
|
PSA_KEY_USAGE_DERIVE ) ) != 0 )
|
||||||
return( 0 );
|
return( 0 );
|
||||||
|
|
Loading…
Reference in a new issue