mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Add test case generation for usage extensions when loading keys
Add test cases validating that if a stored key only had the hash policy, then after loading it psa_get_key_attributes reports that it also has the message policy, and the key can be used with message functions. Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
@ -107,6 +107,14 @@ class Key:
|
||||
} #type: Dict[Expr, Expr]
|
||||
"""The extendable usage flags with the corresponding extension flags."""
|
||||
|
||||
EXTENDABLE_USAGE_FLAGS_KEY_RESTRICTION = {
|
||||
'PSA_KEY_USAGE_SIGN_HASH': '.*KEY_PAIR',
|
||||
'PSA_KEY_USAGE_VERIFY_HASH': '.*KEY.*'
|
||||
} #type: Dict[str, str]
|
||||
"""The key type filter for the extendable usage flags.
|
||||
The filter is a regexp.
|
||||
"""
|
||||
|
||||
def __init__(self, *,
|
||||
version: Optional[int] = None,
|
||||
id: Optional[int] = None, #pylint: disable=redefined-builtin
|
||||
|
Reference in New Issue
Block a user