Special handling for some always-on or alias symbols
Some symbols don't require a dependency symbol: * Modifiers such as truncated MAC * Always-on features such as the raw data key type * Aliases or special values such as RSA PKCS#1v1.5 raw I'm not convinced that all of these warrant special handling in the script, rather than having the expected symbol defined somewhere. But for now I prefer to minimize changes to the header files. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
81dec0047f
commit
f032fa9d94
1 changed files with 15 additions and 0 deletions
|
@ -108,6 +108,14 @@ def is_systematic_dependency(dep):
|
||||||
return dep.startswith('PSA_WANT_')
|
return dep.startswith('PSA_WANT_')
|
||||||
|
|
||||||
OMITTED_SYSTEMATIC_DEPENDENCIES = frozenset([
|
OMITTED_SYSTEMATIC_DEPENDENCIES = frozenset([
|
||||||
|
'PSA_ALG_AEAD_WITH_TAG_LENGTH', # only a modifier
|
||||||
|
'PSA_ALG_ANY_HASH', # only meaningful in policies
|
||||||
|
'PSA_ALG_KEY_AGREEMENT', # only a way to combine algorithms
|
||||||
|
'PSA_ALG_TRUNCATED_MAC', # only a modifier
|
||||||
|
'PSA_KEY_TYPE_NONE', # always supported
|
||||||
|
'PSA_KEY_TYPE_DERIVE', # always supported
|
||||||
|
'PSA_KEY_TYPE_RAW_DATA', # always supported
|
||||||
|
|
||||||
# Not implemented yet: cipher-related key types and algorithms.
|
# Not implemented yet: cipher-related key types and algorithms.
|
||||||
# Manually extracted from crypto_values.h.
|
# Manually extracted from crypto_values.h.
|
||||||
'PSA_KEY_TYPE_AES',
|
'PSA_KEY_TYPE_AES',
|
||||||
|
@ -130,10 +138,17 @@ OMITTED_SYSTEMATIC_DEPENDENCIES = frozenset([
|
||||||
'PSA_ALG_CHACHA20_POLY1305',
|
'PSA_ALG_CHACHA20_POLY1305',
|
||||||
])
|
])
|
||||||
|
|
||||||
|
SPECIAL_SYSTEMATIC_DEPENDENCIES = {
|
||||||
|
'PSA_ALG_ECDSA_ANY': frozenset(['PSA_WANT_ALG_ECDSA']),
|
||||||
|
'PSA_ALG_RSA_PKCS1V15_SIGN_RAW': frozenset(['PSA_WANT_ALG_RSA_PKCS1V15_SIGN']),
|
||||||
|
}
|
||||||
|
|
||||||
def dependencies_of_symbol(symbol):
|
def dependencies_of_symbol(symbol):
|
||||||
"""Return the dependencies for a symbol that designates a cryptographic mechanism."""
|
"""Return the dependencies for a symbol that designates a cryptographic mechanism."""
|
||||||
if symbol in OMITTED_SYSTEMATIC_DEPENDENCIES:
|
if symbol in OMITTED_SYSTEMATIC_DEPENDENCIES:
|
||||||
return frozenset()
|
return frozenset()
|
||||||
|
if symbol in SPECIAL_SYSTEMATIC_DEPENDENCIES:
|
||||||
|
return SPECIAL_SYSTEMATIC_DEPENDENCIES[symbol]
|
||||||
return {symbol.replace('_', '_WANT_', 1)}
|
return {symbol.replace('_', '_WANT_', 1)}
|
||||||
|
|
||||||
def systematic_dependencies(file_name, function_name, arguments):
|
def systematic_dependencies(file_name, function_name, arguments):
|
||||||
|
|
Loading…
Reference in a new issue