mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Add storage tests for lifetimes
Test keys with various persistence levels, enumerated from the metadata tests. For read-only keys, do not attempt to create or destroy the key through the API, only to read a key that has been injected into storage directly through filesystem access. Do not test keys with a non-default location, since they require a driver and we do not yet have a dependency mechanism to require the presence of a driver for a specific location value. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@ -164,6 +164,10 @@ class Key:
|
||||
"""
|
||||
return self.bytes().hex()
|
||||
|
||||
def location_value(self) -> int:
|
||||
"""The numerical value of the location encoded in the key's lifetime."""
|
||||
return self.lifetime.value() >> 8
|
||||
|
||||
|
||||
class TestKey(unittest.TestCase):
|
||||
# pylint: disable=line-too-long
|
||||
|
Reference in New Issue
Block a user