diff --git a/include/psa/crypto_struct.h b/include/psa/crypto_struct.h index 47012fdd00..aee4002e8e 100644 --- a/include/psa/crypto_struct.h +++ b/include/psa/crypto_struct.h @@ -394,6 +394,12 @@ static inline psa_key_lifetime_t psa_get_key_lifetime( static inline void psa_set_key_usage_flags(psa_key_attributes_t *attributes, psa_key_usage_t usage_flags) { + if( usage_flags & PSA_KEY_USAGE_SIGN_HASH ) + usage_flags |= PSA_KEY_USAGE_SIGN_MESSAGE; + + if( usage_flags & PSA_KEY_USAGE_VERIFY_HASH ) + usage_flags |= PSA_KEY_USAGE_VERIFY_MESSAGE; + attributes->core.policy.usage = usage_flags; }