psa: Add backwards compatible error codes

Add deprecated error codes to help transition between the previous
version of the PSA Crypto specification and the current one.
This commit is contained in:
Jaeden Amero 2019-02-21 10:41:29 +00:00
parent 1ac5e6a34c
commit 5e6d24c5e1
3 changed files with 40 additions and 2 deletions

View file

@ -167,6 +167,16 @@ class MacroCollector:
return
elif (name.startswith('PSA_ERROR_') or name == 'PSA_SUCCESS') \
and not parameter:
if name in [
'PSA_ERROR_UNKNOWN_ERROR',
'PSA_ERROR_OCCUPIED_SLOT',
'PSA_ERROR_EMPTY_SLOT',
'PSA_ERROR_INSUFFICIENT_CAPACITY',
]:
# Ad hoc skipping of deprecated error codes, which share
# numerical values with non-deprecated error codes
return
self.statuses.add(name)
elif name.startswith('PSA_KEY_TYPE_') and not parameter:
self.key_types.add(name)