From c68ce9637a1886a5dc7538c93c36c5d15325892d Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 19 Oct 2018 11:31:52 +0200 Subject: [PATCH] Exclude full-length-algorithm macros from testing Calls to PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH and PSA_ALG_FULL_LENGTH_MAC are not in canonical form, so exclude them from the list of constructor macros to test. --- tests/scripts/test_psa_constant_names.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/scripts/test_psa_constant_names.py b/tests/scripts/test_psa_constant_names.py index 15884f6fe..0201755df 100755 --- a/tests/scripts/test_psa_constant_names.py +++ b/tests/scripts/test_psa_constant_names.py @@ -127,6 +127,9 @@ where each argument takes each possible value at least once.''' r'(?:\(([^\n()]*)\))?') # Regex of macro names to exclude. excluded_name_re = re.compile('_(?:GET|IS|OF)_|_(?:BASE|FLAG|MASK)\Z') + # Additional excluded macros. + excluded_names = set(['PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH', + 'PSA_ALG_FULL_LENGTH_MAC']) argument_split_re = re.compile(r' *, *') def parse_header_line(self, line): '''Parse a C header line, looking for "#define PSA_xxx".''' @@ -134,7 +137,8 @@ where each argument takes each possible value at least once.''' if not m: return name = m.group(1) - if re.search(self.excluded_name_re, name): + if re.search(self.excluded_name_re, name) or \ + name in self.excluded_names: return dest = self.table_by_prefix.get(m.group(2)) if dest is None: