mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-03 19:20:18 +00:00
Remove unnecessary test cases
It is enough only one test case for a key type, algorithm pair when testing the implicit usage flags. Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
parent
8f40510a92
commit
d9050a53ac
@ -537,29 +537,29 @@ class StorageFormatV0(StorageFormat):
|
|||||||
"""
|
"""
|
||||||
keys = [] #type: List[StorageKey]
|
keys = [] #type: List[StorageKey]
|
||||||
kt = crypto_knowledge.KeyType(key_type, params)
|
kt = crypto_knowledge.KeyType(key_type, params)
|
||||||
for bits in kt.sizes_to_test():
|
bits = kt.sizes_to_test()[0]
|
||||||
implicit = StorageKey.IMPLICIT_USAGE_FLAGS[implyer_usage]
|
implicit = StorageKey.IMPLICIT_USAGE_FLAGS[implyer_usage]
|
||||||
usage_flags = 'PSA_KEY_USAGE_EXPORT'
|
usage_flags = 'PSA_KEY_USAGE_EXPORT'
|
||||||
material_usage_flags = usage_flags + ' | ' + implyer_usage.string
|
material_usage_flags = usage_flags + ' | ' + implyer_usage.string
|
||||||
expected_usage_flags = material_usage_flags + ' | ' + implicit.string
|
expected_usage_flags = material_usage_flags + ' | ' + implicit.string
|
||||||
alg2 = 0
|
alg2 = 0
|
||||||
key_material = kt.key_material(bits)
|
key_material = kt.key_material(bits)
|
||||||
usage_expression = re.sub(r'PSA_KEY_USAGE_', r'', implyer_usage.string)
|
usage_expression = re.sub(r'PSA_KEY_USAGE_', r'', implyer_usage.string)
|
||||||
alg_expression = re.sub(r'PSA_ALG_', r'', alg)
|
alg_expression = re.sub(r'PSA_ALG_', r'', alg)
|
||||||
alg_expression = re.sub(r',', r', ', re.sub(r' +', r'', alg_expression))
|
alg_expression = re.sub(r',', r', ', re.sub(r' +', r'', alg_expression))
|
||||||
key_type_expression = re.sub(r'\bPSA_(?:KEY_TYPE|ECC_FAMILY)_',
|
key_type_expression = re.sub(r'\bPSA_(?:KEY_TYPE|ECC_FAMILY)_',
|
||||||
r'',
|
r'',
|
||||||
kt.expression)
|
kt.expression)
|
||||||
description = 'extend {}: {} {} {}-bit'.format(
|
description = 'extend {}: {} {} {}-bit'.format(
|
||||||
usage_expression, alg_expression, key_type_expression, bits)
|
usage_expression, alg_expression, key_type_expression, bits)
|
||||||
keys.append(self.key_builder.build(version=self.version,
|
keys.append(self.key_builder.build(version=self.version,
|
||||||
id=1, lifetime=0x00000001,
|
id=1, lifetime=0x00000001,
|
||||||
type=kt.expression, bits=bits,
|
type=kt.expression, bits=bits,
|
||||||
usage=material_usage_flags,
|
usage=material_usage_flags,
|
||||||
expected_usage=expected_usage_flags,
|
expected_usage=expected_usage_flags,
|
||||||
alg=alg, alg2=alg2,
|
alg=alg, alg2=alg2,
|
||||||
material=key_material,
|
material=key_material,
|
||||||
description=description))
|
description=description))
|
||||||
return keys
|
return keys
|
||||||
|
|
||||||
def gather_key_types_for_sign_alg(self) -> Dict[str, List[str]]:
|
def gather_key_types_for_sign_alg(self) -> Dict[str, List[str]]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user