mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-23 22:45:22 +00:00
Simplify code
Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
parent
6c18541a5e
commit
705c452fd0
|
@ -358,7 +358,7 @@ class StorageFormat:
|
||||||
usage = ' | '.join(usage_flags) if usage_flags else '0'
|
usage = ' | '.join(usage_flags) if usage_flags else '0'
|
||||||
if short is None:
|
if short is None:
|
||||||
short = re.sub(r'\bPSA_KEY_USAGE_', r'', usage)
|
short = re.sub(r'\bPSA_KEY_USAGE_', r'', usage)
|
||||||
extra_desc = ' ' + extra_desc if extra_desc is not None and len(extra_desc) > 0 else ''
|
extra_desc = ' ' + extra_desc if extra_desc else ''
|
||||||
description = 'usage' + extra_desc + ': ' + short
|
description = 'usage' + extra_desc + ': ' + short
|
||||||
return self.key_builder.build(version=self.version,
|
return self.key_builder.build(version=self.version,
|
||||||
id=1, lifetime=0x00000001,
|
id=1, lifetime=0x00000001,
|
||||||
|
@ -475,14 +475,12 @@ class StorageFormat:
|
||||||
# test cases. This allows all required information to be obtained in
|
# test cases. This allows all required information to be obtained in
|
||||||
# one go, which is a significant performance gain as the information
|
# one go, which is a significant performance gain as the information
|
||||||
# includes numerical values obtained by compiling a C program.
|
# includes numerical values obtained by compiling a C program.
|
||||||
generated_keys = self.generate_all_keys()
|
keys = self.generate_all_keys()
|
||||||
|
|
||||||
# Skip keys with a non-default location, because they
|
# Skip keys with a non-default location, because they
|
||||||
# require a driver and we currently have no mechanism to
|
# require a driver and we currently have no mechanism to
|
||||||
# determine whether a driver is available.
|
# determine whether a driver is available.
|
||||||
keys = filter(lambda key: key.location_value() == 0, generated_keys)
|
return [self.make_test_case(key) for key in keys if key.location_value() == 0]
|
||||||
|
|
||||||
return [self.make_test_case(key) for key in keys]
|
|
||||||
|
|
||||||
class StorageFormatForward(StorageFormat):
|
class StorageFormatForward(StorageFormat):
|
||||||
"""Storage format stability test cases for forward compatibility."""
|
"""Storage format stability test cases for forward compatibility."""
|
||||||
|
|
Loading…
Reference in a new issue