diff --git a/scripts/generate_psa_constants.py b/scripts/generate_psa_constants.py index bcda282ce..f32339fa5 100755 --- a/scripts/generate_psa_constants.py +++ b/scripts/generate_psa_constants.py @@ -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') diff --git a/tests/scripts/test_psa_constant_names.py b/tests/scripts/test_psa_constant_names.py index 0201755df..d8f00050f 100755 --- a/tests/scripts/test_psa_constant_names.py +++ b/tests/scripts/test_psa_constant_names.py @@ -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)