mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-05 06:26:52 +00:00
Merge pull request #4741 from gabor-mezei-arm/3267_fp30_sign_verify_key_policies
Key policy extension for PSA_KEY_USAGE_SIGN/VERIFY_HASH
This commit is contained in:
commit
0a7ff4a4e2
11 changed files with 542 additions and 175 deletions
|
|
@ -392,9 +392,19 @@ static inline psa_key_lifetime_t psa_get_key_lifetime(
|
|||
return( attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(lifetime) );
|
||||
}
|
||||
|
||||
static inline void psa_set_key_usage_flags( psa_key_attributes_t *attributes,
|
||||
psa_key_usage_t usage_flags )
|
||||
static inline void psa_extend_key_usage_flags( 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;
|
||||
}
|
||||
|
||||
static inline void psa_set_key_usage_flags(psa_key_attributes_t *attributes,
|
||||
psa_key_usage_t usage_flags)
|
||||
{
|
||||
psa_extend_key_usage_flags( &usage_flags );
|
||||
attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(usage) = usage_flags;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue