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.
This commit is contained in:
Gilles Peskine 2018-10-19 11:31:52 +02:00 committed by Darryl Green
parent 434899fccd
commit c68ce9637a

View file

@ -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: