mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-26 02:37:08 +00:00
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
@ -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…
x
Reference in New Issue
Block a user