1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-06-15 06:41:43 +03:00

Fix KeyType with parameters passed in the name argument

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2021-04-12 13:41:52 +02:00
parent d6d2d6a7d7
commit 0ba69a462e

View File

@ -33,7 +33,7 @@ class KeyType:
`name` is a string 'PSA_KEY_TYPE_xxx' which is the name of a PSA key `name` is a string 'PSA_KEY_TYPE_xxx' which is the name of a PSA key
type macro. For key types that take arguments, the arguments can type macro. For key types that take arguments, the arguments can
be passed either through the optional argument `params` or by be passed either through the optional argument `params` or by
passing an expression of the form 'PSA_KEY_TYPE_xxx(param1, param2)' passing an expression of the form 'PSA_KEY_TYPE_xxx(param1, ...)'
in `name` as a string. in `name` as a string.
""" """
@ -48,7 +48,7 @@ class KeyType:
m = re.match(r'(\w+)\s*\((.*)\)\Z', self.name) m = re.match(r'(\w+)\s*\((.*)\)\Z', self.name)
assert m is not None assert m is not None
self.name = m.group(1) self.name = m.group(1)
params = ','.split(m.group(2)) params = m.group(2).split(',')
self.params = (None if params is None else self.params = (None if params is None else
[param.strip() for param in params]) [param.strip() for param in params])
"""The parameters of the key type, if there are any. """The parameters of the key type, if there are any.