mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-22 12:51:03 +00:00
Read constant names from crypto_extra.h as well as crypto_values.h
test_psa_constant_names.py was originally written before the split of crypto.h into crypto_values.h and more, so it now needs to read crypto_values.h as well. In both generate_psa_constants.py and test_psa_constant_names.py, read crypto_extra.h as well. We don't currently define any value there, but it's plausible that we will one day.
This commit is contained in:
parent
6a78573088
commit
6d194bd92b
|
@ -276,10 +276,11 @@ class MacroCollector:
|
|||
data['key_usage_code'] = self.make_key_usage_code()
|
||||
output_file.write(output_template % data)
|
||||
|
||||
def generate_psa_constants(header_file_name, output_file_name):
|
||||
def generate_psa_constants(header_file_names, output_file_name):
|
||||
collector = MacroCollector()
|
||||
with open(header_file_name) as header_file:
|
||||
collector.read_file(header_file)
|
||||
for header_file_name in header_file_names:
|
||||
with open(header_file_name) as header_file:
|
||||
collector.read_file(header_file)
|
||||
temp_file_name = output_file_name + '.tmp'
|
||||
with open(temp_file_name, 'w') as output_file:
|
||||
collector.write_file(output_file)
|
||||
|
@ -288,5 +289,6 @@ def generate_psa_constants(header_file_name, output_file_name):
|
|||
if __name__ == '__main__':
|
||||
if not os.path.isdir('programs') and os.path.isdir('../programs'):
|
||||
os.chdir('..')
|
||||
generate_psa_constants('include/psa/crypto_values.h',
|
||||
generate_psa_constants(['include/psa/crypto_values.h',
|
||||
'include/psa/crypto_extra.h'],
|
||||
'programs/psa/psa_constant_names_generated.c')
|
||||
|
|
|
@ -294,7 +294,8 @@ if __name__ == '__main__':
|
|||
action='store_false', dest='keep_c',
|
||||
help='Don\'t keep the intermediate C file (default)')
|
||||
options = parser.parse_args()
|
||||
headers = [os.path.join(options.include[0], 'psa/crypto.h')]
|
||||
headers = [os.path.join(options.include[0], 'psa', h)
|
||||
for h in ['crypto.h', 'crypto_extra.h', 'crypto_values.h']]
|
||||
test_suites = ['tests/suites/test_suite_psa_crypto_metadata.data']
|
||||
inputs = gather_inputs(headers, test_suites)
|
||||
count, errors = run_tests(options, inputs)
|
||||
|
|
Loading…
Reference in a new issue