Valerio Setti | 8d178be | 2023-10-17 12:23:55 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 2 | |
| 3 | """Analyze the test outcomes from a full CI run. |
| 4 | |
| 5 | This script can also run on outcomes from a partial run, but the results are |
| 6 | less likely to be useful. |
| 7 | """ |
| 8 | |
| 9 | import argparse |
| 10 | import sys |
| 11 | import traceback |
Przemek Stekiel | 85c54ea | 2022-11-17 11:50:23 +0100 | [diff] [blame] | 12 | import re |
Valerio Setti | a266332 | 2023-03-24 08:20:18 +0100 | [diff] [blame] | 13 | import subprocess |
| 14 | import os |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 15 | |
Gilles Peskine | 8d3c70a | 2020-06-25 18:37:43 +0200 | [diff] [blame] | 16 | import check_test_cases |
| 17 | |
Valerio Setti | f075e47 | 2023-10-17 11:03:16 +0200 | [diff] [blame] | 18 | class Results: |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 19 | """Process analysis results.""" |
| 20 | |
| 21 | def __init__(self): |
| 22 | self.error_count = 0 |
| 23 | self.warning_count = 0 |
Valerio Setti | aaef0bc | 2023-10-10 09:42:13 +0200 | [diff] [blame] | 24 | |
Valerio Setti | 2cff820 | 2023-10-18 14:36:47 +0200 | [diff] [blame] | 25 | def new_section(self, fmt, *args, **kwargs): |
| 26 | self._print_line('\n*** ' + fmt + ' ***\n', *args, **kwargs) |
| 27 | |
Valerio Setti | aaef0bc | 2023-10-10 09:42:13 +0200 | [diff] [blame] | 28 | def info(self, fmt, *args, **kwargs): |
Valerio Setti | 8070dbe | 2023-10-17 12:29:30 +0200 | [diff] [blame] | 29 | self._print_line('Info: ' + fmt, *args, **kwargs) |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 30 | |
| 31 | def error(self, fmt, *args, **kwargs): |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 32 | self.error_count += 1 |
Valerio Setti | 8070dbe | 2023-10-17 12:29:30 +0200 | [diff] [blame] | 33 | self._print_line('Error: ' + fmt, *args, **kwargs) |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 34 | |
| 35 | def warning(self, fmt, *args, **kwargs): |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 36 | self.warning_count += 1 |
Valerio Setti | 8070dbe | 2023-10-17 12:29:30 +0200 | [diff] [blame] | 37 | self._print_line('Warning: ' + fmt, *args, **kwargs) |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 38 | |
Valerio Setti | 3f33989 | 2023-10-17 10:42:11 +0200 | [diff] [blame] | 39 | @staticmethod |
Valerio Setti | 8070dbe | 2023-10-17 12:29:30 +0200 | [diff] [blame] | 40 | def _print_line(fmt, *args, **kwargs): |
Valerio Setti | 735794c | 2023-10-18 08:05:15 +0200 | [diff] [blame] | 41 | sys.stderr.write((fmt + '\n').format(*args, **kwargs)) |
Valerio Setti | aaef0bc | 2023-10-10 09:42:13 +0200 | [diff] [blame] | 42 | |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 43 | class TestCaseOutcomes: |
| 44 | """The outcomes of one test case across many configurations.""" |
| 45 | # pylint: disable=too-few-public-methods |
| 46 | |
| 47 | def __init__(self): |
Gilles Peskine | 3d863f2 | 2020-06-26 13:02:30 +0200 | [diff] [blame] | 48 | # Collect a list of witnesses of the test case succeeding or failing. |
| 49 | # Currently we don't do anything with witnesses except count them. |
| 50 | # The format of a witness is determined by the read_outcome_file |
| 51 | # function; it's the platform and configuration joined by ';'. |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 52 | self.successes = [] |
| 53 | self.failures = [] |
| 54 | |
| 55 | def hits(self): |
| 56 | """Return the number of times a test case has been run. |
| 57 | |
| 58 | This includes passes and failures, but not skips. |
| 59 | """ |
| 60 | return len(self.successes) + len(self.failures) |
| 61 | |
Valerio Setti | f075e47 | 2023-10-17 11:03:16 +0200 | [diff] [blame] | 62 | def execute_reference_driver_tests(results: Results, ref_component, driver_component, \ |
Valerio Setti | 781c234 | 2023-10-17 12:47:35 +0200 | [diff] [blame] | 63 | outcome_file): |
Valerio Setti | 22992a0 | 2023-03-29 11:15:28 +0200 | [diff] [blame] | 64 | """Run the tests specified in ref_component and driver_component. Results |
| 65 | are stored in the output_file and they will be used for the following |
Valerio Setti | a266332 | 2023-03-24 08:20:18 +0100 | [diff] [blame] | 66 | coverage analysis""" |
| 67 | # If the outcome file already exists, we assume that the user wants to |
| 68 | # perform the comparison analysis again without repeating the tests. |
| 69 | if os.path.exists(outcome_file): |
Valerio Setti | 39d4b9d | 2023-10-18 14:30:03 +0200 | [diff] [blame] | 70 | results.info("Outcome file ({}) already exists. Tests will be skipped.", outcome_file) |
Valerio Setti | 781c234 | 2023-10-17 12:47:35 +0200 | [diff] [blame] | 71 | return |
Valerio Setti | a266332 | 2023-03-24 08:20:18 +0100 | [diff] [blame] | 72 | |
| 73 | shell_command = "tests/scripts/all.sh --outcome-file " + outcome_file + \ |
| 74 | " " + ref_component + " " + driver_component |
Valerio Setti | 39d4b9d | 2023-10-18 14:30:03 +0200 | [diff] [blame] | 75 | results.info("Running: {}", shell_command) |
Valerio Setti | a266332 | 2023-03-24 08:20:18 +0100 | [diff] [blame] | 76 | ret_val = subprocess.run(shell_command.split(), check=False).returncode |
| 77 | |
| 78 | if ret_val != 0: |
Valerio Setti | f075e47 | 2023-10-17 11:03:16 +0200 | [diff] [blame] | 79 | results.error("failed to run reference/driver components") |
Valerio Setti | aaef0bc | 2023-10-10 09:42:13 +0200 | [diff] [blame] | 80 | |
Tomás González | b401e11 | 2023-08-11 15:22:04 +0100 | [diff] [blame] | 81 | def analyze_coverage(results, outcomes, allow_list, full_coverage): |
Gilles Peskine | 8d3c70a | 2020-06-25 18:37:43 +0200 | [diff] [blame] | 82 | """Check that all available test cases are executed at least once.""" |
Gilles Peskine | 686c292 | 2022-01-07 15:58:38 +0100 | [diff] [blame] | 83 | available = check_test_cases.collect_available_test_cases() |
Gilles Peskine | 8d3c70a | 2020-06-25 18:37:43 +0200 | [diff] [blame] | 84 | for key in available: |
| 85 | hits = outcomes[key].hits() if key in outcomes else 0 |
Tomás González | 07bdcc2 | 2023-08-11 14:59:03 +0100 | [diff] [blame] | 86 | if hits == 0 and key not in allow_list: |
Tomás González | b401e11 | 2023-08-11 15:22:04 +0100 | [diff] [blame] | 87 | if full_coverage: |
| 88 | results.error('Test case not executed: {}', key) |
| 89 | else: |
| 90 | results.warning('Test case not executed: {}', key) |
Tomás González | 07bdcc2 | 2023-08-11 14:59:03 +0100 | [diff] [blame] | 91 | elif hits != 0 and key in allow_list: |
| 92 | # Test Case should be removed from the allow list. |
Tomás González | 7ebb18f | 2023-08-22 09:40:23 +0100 | [diff] [blame] | 93 | if full_coverage: |
Tomás González | a063144 | 2023-08-22 12:17:57 +0100 | [diff] [blame] | 94 | results.error('Allow listed test case was executed: {}', key) |
Tomás González | 7ebb18f | 2023-08-22 09:40:23 +0100 | [diff] [blame] | 95 | else: |
| 96 | results.warning('Allow listed test case was executed: {}', key) |
Gilles Peskine | 8d3c70a | 2020-06-25 18:37:43 +0200 | [diff] [blame] | 97 | |
Manuel Pégourié-Gonnard | 881ce01 | 2023-10-18 10:22:07 +0200 | [diff] [blame] | 98 | def name_matches_pattern(name, str_or_re): |
| 99 | """Check if name matches a pattern, that may be a string or regex. |
| 100 | - If the pattern is a string, name must be equal to match. |
| 101 | - If the pattern is a regex, name must fully match. |
| 102 | """ |
| 103 | if isinstance(str_or_re, re.Pattern): |
| 104 | if str_or_re.fullmatch(name): |
| 105 | return True |
| 106 | else: |
| 107 | if str_or_re == name: |
| 108 | return True |
| 109 | return False |
| 110 | |
Valerio Setti | f075e47 | 2023-10-17 11:03:16 +0200 | [diff] [blame] | 111 | def analyze_driver_vs_reference(results: Results, outcomes, |
Valerio Setti | aaef0bc | 2023-10-10 09:42:13 +0200 | [diff] [blame] | 112 | component_ref, component_driver, |
Manuel Pégourié-Gonnard | 881ce01 | 2023-10-18 10:22:07 +0200 | [diff] [blame] | 113 | ignored_suites, ignored_tests=None): |
Przemek Stekiel | 4e95590 | 2022-10-21 13:42:08 +0200 | [diff] [blame] | 114 | """Check that all tests executed in the reference component are also |
| 115 | executed in the corresponding driver component. |
Valerio Setti | 3002c99 | 2023-01-18 17:28:36 +0100 | [diff] [blame] | 116 | Skip: |
| 117 | - full test suites provided in ignored_suites list |
| 118 | - only some specific test inside a test suite, for which the corresponding |
| 119 | output string is provided |
Przemek Stekiel | 4e95590 | 2022-10-21 13:42:08 +0200 | [diff] [blame] | 120 | """ |
Manuel Pégourié-Gonnard | 371165a | 2023-10-18 12:44:54 +0200 | [diff] [blame^] | 121 | seen_reference_passing = False |
| 122 | for key in outcomes: |
Manuel Pégourié-Gonnard | 4da369f | 2023-10-18 09:40:32 +0200 | [diff] [blame] | 123 | # key is like "test_suite_foo.bar;Description of test case" |
| 124 | (full_test_suite, test_string) = key.split(';') |
Valerio Setti | 00c1ccb | 2023-02-02 11:33:31 +0100 | [diff] [blame] | 125 | test_suite = full_test_suite.split('.')[0] # retrieve main part of test suite name |
Manuel Pégourié-Gonnard | 371165a | 2023-10-18 12:44:54 +0200 | [diff] [blame^] | 126 | |
| 127 | # Immediately skip fully-ignored test suites |
Manuel Pégourié-Gonnard | 7d381f5 | 2023-03-17 15:13:08 +0100 | [diff] [blame] | 128 | if test_suite in ignored_suites or full_test_suite in ignored_suites: |
Valerio Setti | 00c1ccb | 2023-02-02 11:33:31 +0100 | [diff] [blame] | 129 | continue |
Manuel Pégourié-Gonnard | 371165a | 2023-10-18 12:44:54 +0200 | [diff] [blame^] | 130 | |
| 131 | # For ignored test cases inside test suites, just remember and: |
| 132 | # don't issue an error if they're skipped with drivers, |
| 133 | # but issue an error if they're not (means we have a bad entry). |
| 134 | ignored = False |
Manuel Pégourié-Gonnard | 881ce01 | 2023-10-18 10:22:07 +0200 | [diff] [blame] | 135 | if full_test_suite in ignored_tests: |
| 136 | for str_or_re in ignored_tests[full_test_suite]: |
| 137 | if name_matches_pattern(test_string, str_or_re): |
Manuel Pégourié-Gonnard | 371165a | 2023-10-18 12:44:54 +0200 | [diff] [blame^] | 138 | ignored = True |
Manuel Pégourié-Gonnard | 4da369f | 2023-10-18 09:40:32 +0200 | [diff] [blame] | 139 | |
Przemek Stekiel | 4e95590 | 2022-10-21 13:42:08 +0200 | [diff] [blame] | 140 | # Search for tests that run in reference component and not in driver component |
| 141 | driver_test_passed = False |
| 142 | reference_test_passed = False |
| 143 | for entry in outcomes[key].successes: |
Przemek Stekiel | 51f30ff | 2022-11-09 12:07:29 +0100 | [diff] [blame] | 144 | if component_driver in entry: |
Przemek Stekiel | 4e95590 | 2022-10-21 13:42:08 +0200 | [diff] [blame] | 145 | driver_test_passed = True |
Przemek Stekiel | 51f30ff | 2022-11-09 12:07:29 +0100 | [diff] [blame] | 146 | if component_ref in entry: |
Przemek Stekiel | 4e95590 | 2022-10-21 13:42:08 +0200 | [diff] [blame] | 147 | reference_test_passed = True |
Manuel Pégourié-Gonnard | 371165a | 2023-10-18 12:44:54 +0200 | [diff] [blame^] | 148 | seen_reference_passing = True |
Manuel Pégourié-Gonnard | c6967d2 | 2022-12-30 13:40:34 +0100 | [diff] [blame] | 149 | if(reference_test_passed and not driver_test_passed): |
Manuel Pégourié-Gonnard | 371165a | 2023-10-18 12:44:54 +0200 | [diff] [blame^] | 150 | if not ignored: |
| 151 | results.error("PASS -> SKIP/FAIL: {}", key) |
| 152 | else: |
| 153 | if ignored: |
| 154 | results.error("uselessly ignored: {}", key) |
| 155 | |
| 156 | if not seen_reference_passing: |
| 157 | results.error("no passing test in reference component: bad outcome file?") |
Przemek Stekiel | 4e95590 | 2022-10-21 13:42:08 +0200 | [diff] [blame] | 158 | |
Valerio Setti | 781c234 | 2023-10-17 12:47:35 +0200 | [diff] [blame] | 159 | def analyze_outcomes(results: Results, outcomes, args): |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 160 | """Run all analyses on the given outcome collection.""" |
Valerio Setti | f075e47 | 2023-10-17 11:03:16 +0200 | [diff] [blame] | 161 | analyze_coverage(results, outcomes, args['allow_list'], |
Tomás González | b401e11 | 2023-08-11 15:22:04 +0100 | [diff] [blame] | 162 | args['full_coverage']) |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 163 | |
| 164 | def read_outcome_file(outcome_file): |
| 165 | """Parse an outcome file and return an outcome collection. |
| 166 | |
| 167 | An outcome collection is a dictionary mapping keys to TestCaseOutcomes objects. |
| 168 | The keys are the test suite name and the test case description, separated |
| 169 | by a semicolon. |
| 170 | """ |
| 171 | outcomes = {} |
| 172 | with open(outcome_file, 'r', encoding='utf-8') as input_file: |
| 173 | for line in input_file: |
| 174 | (platform, config, suite, case, result, _cause) = line.split(';') |
| 175 | key = ';'.join([suite, case]) |
| 176 | setup = ';'.join([platform, config]) |
| 177 | if key not in outcomes: |
| 178 | outcomes[key] = TestCaseOutcomes() |
| 179 | if result == 'PASS': |
| 180 | outcomes[key].successes.append(setup) |
| 181 | elif result == 'FAIL': |
| 182 | outcomes[key].failures.append(setup) |
| 183 | return outcomes |
| 184 | |
Valerio Setti | 781c234 | 2023-10-17 12:47:35 +0200 | [diff] [blame] | 185 | def do_analyze_coverage(results: Results, outcome_file, args): |
Przemek Stekiel | 6856f4c | 2022-11-09 10:50:29 +0100 | [diff] [blame] | 186 | """Perform coverage analysis.""" |
Valerio Setti | 2cff820 | 2023-10-18 14:36:47 +0200 | [diff] [blame] | 187 | results.new_section("Analyze coverage") |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 188 | outcomes = read_outcome_file(outcome_file) |
Valerio Setti | 781c234 | 2023-10-17 12:47:35 +0200 | [diff] [blame] | 189 | analyze_outcomes(results, outcomes, args) |
Przemek Stekiel | 4e95590 | 2022-10-21 13:42:08 +0200 | [diff] [blame] | 190 | |
Valerio Setti | 781c234 | 2023-10-17 12:47:35 +0200 | [diff] [blame] | 191 | def do_analyze_driver_vs_reference(results: Results, outcome_file, args): |
Przemek Stekiel | 4e95590 | 2022-10-21 13:42:08 +0200 | [diff] [blame] | 192 | """Perform driver vs reference analyze.""" |
Valerio Setti | 2cff820 | 2023-10-18 14:36:47 +0200 | [diff] [blame] | 193 | results.new_section("Analyze driver {} vs reference {}", |
| 194 | args['component_driver'], args['component_ref']) |
Valerio Setti | b0c618e | 2023-10-16 14:19:49 +0200 | [diff] [blame] | 195 | |
Valerio Setti | 781c234 | 2023-10-17 12:47:35 +0200 | [diff] [blame] | 196 | execute_reference_driver_tests(results, args['component_ref'], \ |
| 197 | args['component_driver'], outcome_file) |
Valerio Setti | a266332 | 2023-03-24 08:20:18 +0100 | [diff] [blame] | 198 | |
Valerio Setti | 3002c99 | 2023-01-18 17:28:36 +0100 | [diff] [blame] | 199 | ignored_suites = ['test_suite_' + x for x in args['ignored_suites']] |
Przemek Stekiel | 51f30ff | 2022-11-09 12:07:29 +0100 | [diff] [blame] | 200 | |
Przemek Stekiel | 4e95590 | 2022-10-21 13:42:08 +0200 | [diff] [blame] | 201 | outcomes = read_outcome_file(outcome_file) |
Valerio Setti | aaef0bc | 2023-10-10 09:42:13 +0200 | [diff] [blame] | 202 | |
Valerio Setti | 781c234 | 2023-10-17 12:47:35 +0200 | [diff] [blame] | 203 | analyze_driver_vs_reference(results, outcomes, |
| 204 | args['component_ref'], args['component_driver'], |
| 205 | ignored_suites, args['ignored_tests']) |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 206 | |
Przemek Stekiel | 6856f4c | 2022-11-09 10:50:29 +0100 | [diff] [blame] | 207 | # List of tasks with a function that can handle this task and additional arguments if required |
Valerio Setti | dfd7ca6 | 2023-10-09 16:30:11 +0200 | [diff] [blame] | 208 | KNOWN_TASKS = { |
Przemek Stekiel | 4d13c83 | 2022-10-26 16:11:26 +0200 | [diff] [blame] | 209 | 'analyze_coverage': { |
| 210 | 'test_function': do_analyze_coverage, |
Tomás González | 07bdcc2 | 2023-08-11 14:59:03 +0100 | [diff] [blame] | 211 | 'args': { |
Tomás González | 358c6c6 | 2023-08-14 15:43:46 +0100 | [diff] [blame] | 212 | 'allow_list': [ |
Tomás González | 5022311 | 2023-08-22 09:52:06 +0100 | [diff] [blame] | 213 | # Algorithm not supported yet |
| 214 | 'test_suite_psa_crypto_metadata;Asymmetric signature: pure EdDSA', |
| 215 | # Algorithm not supported yet |
| 216 | 'test_suite_psa_crypto_metadata;Cipher: XTS', |
Tomás González | d43cab3 | 2023-08-24 09:12:40 +0100 | [diff] [blame] | 217 | ], |
Tomás González | b401e11 | 2023-08-11 15:22:04 +0100 | [diff] [blame] | 218 | 'full_coverage': False, |
Tomás González | 07bdcc2 | 2023-08-11 14:59:03 +0100 | [diff] [blame] | 219 | } |
Tomás González | d43cab3 | 2023-08-24 09:12:40 +0100 | [diff] [blame] | 220 | }, |
Valerio Setti | a266332 | 2023-03-24 08:20:18 +0100 | [diff] [blame] | 221 | # There are 2 options to use analyze_driver_vs_reference_xxx locally: |
| 222 | # 1. Run tests and then analysis: |
| 223 | # - tests/scripts/all.sh --outcome-file "$PWD/out.csv" <component_ref> <component_driver> |
| 224 | # - tests/scripts/analyze_outcomes.py out.csv analyze_driver_vs_reference_xxx |
| 225 | # 2. Let this script run both automatically: |
| 226 | # - tests/scripts/analyze_outcomes.py out.csv analyze_driver_vs_reference_xxx |
Przemek Stekiel | 4d13c83 | 2022-10-26 16:11:26 +0200 | [diff] [blame] | 227 | 'analyze_driver_vs_reference_hash': { |
| 228 | 'test_function': do_analyze_driver_vs_reference, |
| 229 | 'args': { |
Przemek Stekiel | 51f30ff | 2022-11-09 12:07:29 +0100 | [diff] [blame] | 230 | 'component_ref': 'test_psa_crypto_config_reference_hash_use_psa', |
| 231 | 'component_driver': 'test_psa_crypto_config_accel_hash_use_psa', |
Manuel Pégourié-Gonnard | 10e3963 | 2022-12-29 12:29:09 +0100 | [diff] [blame] | 232 | 'ignored_suites': [ |
| 233 | 'shax', 'mdx', # the software implementations that are being excluded |
Manuel Pégourié-Gonnard | 7d381f5 | 2023-03-17 15:13:08 +0100 | [diff] [blame] | 234 | 'md.psa', # purposefully depends on whether drivers are present |
Gilles Peskine | 35b49c4 | 2023-10-04 12:28:41 +0200 | [diff] [blame] | 235 | 'psa_crypto_low_hash.generated', # testing the builtins |
Valerio Setti | 3002c99 | 2023-01-18 17:28:36 +0100 | [diff] [blame] | 236 | ], |
| 237 | 'ignored_tests': { |
| 238 | } |
| 239 | } |
| 240 | }, |
Valerio Setti | b6b301f | 2023-10-04 12:05:05 +0200 | [diff] [blame] | 241 | 'analyze_driver_vs_reference_cipher_aead': { |
| 242 | 'test_function': do_analyze_driver_vs_reference, |
| 243 | 'args': { |
| 244 | 'component_ref': 'test_psa_crypto_config_reference_cipher_aead', |
| 245 | 'component_driver': 'test_psa_crypto_config_accel_cipher_aead', |
Valerio Setti | 507e08f | 2023-10-26 09:44:06 +0200 | [diff] [blame] | 246 | # Modules replaced by drivers. |
Valerio Setti | b6b301f | 2023-10-04 12:05:05 +0200 | [diff] [blame] | 247 | 'ignored_suites': [ |
Valerio Setti | 507e08f | 2023-10-26 09:44:06 +0200 | [diff] [blame] | 248 | # low-level (block/stream) cipher modules |
| 249 | 'aes', 'aria', 'camellia', 'des', 'chacha20', |
| 250 | # AEAD modes |
| 251 | 'ccm', 'chachapoly', 'cmac', 'gcm', |
| 252 | # The Cipher abstraction layer |
| 253 | 'cipher', |
Valerio Setti | b6b301f | 2023-10-04 12:05:05 +0200 | [diff] [blame] | 254 | ], |
| 255 | 'ignored_tests': { |
Valerio Setti | 507e08f | 2023-10-26 09:44:06 +0200 | [diff] [blame] | 256 | # PEM decryption is not supported so far. |
| 257 | # The rest of PEM (write, unencrypted read) works though. |
Valerio Setti | 7448cee | 2023-10-04 15:46:42 +0200 | [diff] [blame] | 258 | 'test_suite_pem': [ |
| 259 | 'PEM read (AES-128-CBC + invalid iv)' |
| 260 | 'PEM read (DES-CBC + invalid iv)', |
| 261 | 'PEM read (DES-EDE3-CBC + invalid iv)', |
| 262 | 'PEM read (malformed PEM AES-128-CBC)', |
| 263 | 'PEM read (malformed PEM DES-CBC)', |
| 264 | 'PEM read (malformed PEM DES-EDE3-CBC)', |
| 265 | 'PEM read (unknown encryption algorithm)', |
| 266 | 'PEM read (AES-128-CBC + invalid iv)', |
| 267 | 'PEM read (DES-CBC + invalid iv)', |
| 268 | ], |
Valerio Setti | 507e08f | 2023-10-26 09:44:06 +0200 | [diff] [blame] | 269 | # Following tests depend on AES_C/DES_C but are not about |
| 270 | # them really, just need to know some error code is there. |
Valerio Setti | 7448cee | 2023-10-04 15:46:42 +0200 | [diff] [blame] | 271 | 'test_suite_error': [ |
| 272 | 'Low and high error', |
| 273 | 'Single low error' |
| 274 | ], |
Valerio Setti | 507e08f | 2023-10-26 09:44:06 +0200 | [diff] [blame] | 275 | # Similar to test_suite_error above. |
Valerio Setti | 7448cee | 2023-10-04 15:46:42 +0200 | [diff] [blame] | 276 | 'test_suite_version': [ |
| 277 | 'Check for MBEDTLS_AES_C when already present', |
Valerio Setti | 9394144 | 2023-10-13 09:19:52 +0200 | [diff] [blame] | 278 | ], |
Valerio Setti | 507e08f | 2023-10-26 09:44:06 +0200 | [diff] [blame] | 279 | # The en/decryption part of PKCS#12 is not supported so far. |
| 280 | # The rest of PKCS#12 (key derivation) works though. |
Valerio Setti | 9394144 | 2023-10-13 09:19:52 +0200 | [diff] [blame] | 281 | 'test_suite_pkcs12': [ |
| 282 | 'PBE Decrypt, (Invalid padding & PKCS7 padding enabled)', |
| 283 | 'PBE Decrypt, pad = 7 (OK)', |
| 284 | 'PBE Decrypt, pad = 8 (Invalid output size)', |
| 285 | 'PBE Decrypt, pad = 8 (OK)', |
| 286 | 'PBE Encrypt, pad = 7 (OK)', |
| 287 | 'PBE Encrypt, pad = 8 (Invalid output size)', |
| 288 | 'PBE Encrypt, pad = 8 (OK)', |
| 289 | ], |
Valerio Setti | 507e08f | 2023-10-26 09:44:06 +0200 | [diff] [blame] | 290 | # The en/decryption part of PKCS#5 is not supported so far. |
| 291 | # The rest of PKCS#5 (PBKDF2) works though. |
Valerio Setti | 9394144 | 2023-10-13 09:19:52 +0200 | [diff] [blame] | 292 | 'test_suite_pkcs5': [ |
| 293 | 'PBES2 Decrypt (Invalid output size)', |
| 294 | 'PBES2 Decrypt (Invalid padding & PKCS7 padding enabled)', |
| 295 | 'PBES2 Decrypt (KDF != PBKDF2)', |
| 296 | 'PBES2 Decrypt (OK)', |
| 297 | 'PBES2 Decrypt (OK, PBKDF2 params explicit keylen)', |
| 298 | 'PBES2 Decrypt (OK, PBKDF2 params explicit prf_alg)', |
| 299 | 'PBES2 Decrypt (bad KDF AlgId: not a sequence)', |
| 300 | 'PBES2 Decrypt (bad KDF AlgId: overlong)', |
| 301 | 'PBES2 Decrypt (bad PBKDF2 params explicit keylen: overlong)', |
| 302 | 'PBES2 Decrypt (bad PBKDF2 params iter: not an int)', |
| 303 | 'PBES2 Decrypt (bad PBKDF2 params iter: overlong)', |
| 304 | 'PBES2 Decrypt (bad PBKDF2 params salt: not an octet string)', |
| 305 | 'PBES2 Decrypt (bad PBKDF2 params salt: overlong)', |
| 306 | 'PBES2 Decrypt (bad PBKDF2 params: not a sequence)', |
| 307 | 'PBES2 Decrypt (bad PBKDF2 params: overlong)', |
| 308 | 'PBES2 Decrypt (bad enc_scheme_alg params: len != iv_len)', |
| 309 | 'PBES2 Decrypt (bad enc_scheme_alg params: not an octet string)', |
| 310 | 'PBES2 Decrypt (bad enc_scheme_alg params: overlong)', |
| 311 | 'PBES2 Decrypt (bad enc_scheme_alg: not a sequence)', |
| 312 | 'PBES2 Decrypt (bad enc_scheme_alg: overlong)', |
| 313 | 'PBES2 Decrypt (bad enc_scheme_alg: unknown oid)', |
| 314 | 'PBES2 Decrypt (bad iter value)', |
| 315 | 'PBES2 Decrypt (bad params tag)', |
| 316 | 'PBES2 Decrypt (bad password)', |
| 317 | 'PBES2 Decrypt (bad, PBKDF2 params explicit prf_alg != HMAC-SHA*)', |
| 318 | 'PBES2 Decrypt (bad, PBKDF2 params explicit prf_alg not a sequence)', |
| 319 | 'PBES2 Decrypt (bad, PBKDF2 params explicit prf_alg overlong)', |
| 320 | 'PBES2 Decrypt (bad, PBKDF2 params extra data)', |
| 321 | 'PBES2 Encrypt, pad=6 (OK)', |
| 322 | 'PBES2 Encrypt, pad=8 (Invalid output size)', |
| 323 | 'PBES2 Encrypt, pad=8 (OK)', |
| 324 | ], |
Valerio Setti | 507e08f | 2023-10-26 09:44:06 +0200 | [diff] [blame] | 325 | # Encrypted keys are not supported so far. |
Valerio Setti | 5cd18f9 | 2023-10-13 15:14:07 +0200 | [diff] [blame] | 326 | # pylint: disable=line-too-long |
Valerio Setti | 9394144 | 2023-10-13 09:19:52 +0200 | [diff] [blame] | 327 | 'test_suite_pkparse': [ |
| 328 | 'Key ASN1 (Encrypted key PKCS12, trailing garbage data)', |
| 329 | 'Key ASN1 (Encrypted key PKCS5, trailing garbage data)', |
| 330 | 'Parse RSA Key #20 (PKCS#8 encrypted SHA1-3DES)', |
| 331 | 'Parse RSA Key #20.1 (PKCS#8 encrypted SHA1-3DES, wrong PW)', |
| 332 | 'Parse RSA Key #20.2 (PKCS#8 encrypted SHA1-3DES, no PW)', |
| 333 | 'Parse RSA Key #21 (PKCS#8 encrypted SHA1-3DES, 2048-bit)', |
| 334 | 'Parse RSA Key #21.1 (PKCS#8 encrypted SHA1-3DES, 2048-bit, wrong PW)', |
| 335 | 'Parse RSA Key #21.2 (PKCS#8 encrypted SHA1-3DES, 2048-bit, no PW)', |
| 336 | 'Parse RSA Key #22 (PKCS#8 encrypted SHA1-3DES, 4096-bit)', |
| 337 | 'Parse RSA Key #22.1 (PKCS#8 encrypted SHA1-3DES, 4096-bit, wrong PW)', |
| 338 | 'Parse RSA Key #22.2 (PKCS#8 encrypted SHA1-3DES, 4096-bit, no PW)', |
| 339 | 'Parse RSA Key #23 (PKCS#8 encrypted SHA1-3DES DER)', |
| 340 | 'Parse RSA Key #24 (PKCS#8 encrypted SHA1-3DES DER, 2048-bit)', |
| 341 | 'Parse RSA Key #25 (PKCS#8 encrypted SHA1-3DES DER, 4096-bit)', |
| 342 | 'Parse RSA Key #26 (PKCS#8 encrypted SHA1-2DES)', |
| 343 | 'Parse RSA Key #26.1 (PKCS#8 encrypted SHA1-2DES, wrong PW)', |
| 344 | 'Parse RSA Key #26.2 (PKCS#8 encrypted SHA1-2DES, no PW)', |
| 345 | 'Parse RSA Key #27 (PKCS#8 encrypted SHA1-2DES, 2048-bit)', |
| 346 | 'Parse RSA Key #27.1 (PKCS#8 encrypted SHA1-2DES, 2048-bit, wrong PW)', |
| 347 | 'Parse RSA Key #27.2 (PKCS#8 encrypted SHA1-2DES, 2048-bit no PW)', |
| 348 | 'Parse RSA Key #28 (PKCS#8 encrypted SHA1-2DES, 4096-bit)', |
| 349 | 'Parse RSA Key #28.1 (PKCS#8 encrypted SHA1-2DES, 4096-bit, wrong PW)', |
| 350 | 'Parse RSA Key #28.2 (PKCS#8 encrypted SHA1-2DES, 4096-bit, no PW)', |
| 351 | 'Parse RSA Key #29 (PKCS#8 encrypted SHA1-2DES DER)', |
| 352 | 'Parse RSA Key #30 (PKCS#8 encrypted SHA1-2DES DER, 2048-bit)', |
| 353 | 'Parse RSA Key #31 (PKCS#8 encrypted SHA1-2DES DER, 4096-bit)', |
| 354 | 'Parse RSA Key #38 (PKCS#8 encrypted v2 PBKDF2 3DES)', |
| 355 | 'Parse RSA Key #38.1 (PKCS#8 encrypted v2 PBKDF2 3DES, wrong PW)', |
| 356 | 'Parse RSA Key #38.2 (PKCS#8 encrypted v2 PBKDF2 3DES, no PW)', |
| 357 | 'Parse RSA Key #39 (PKCS#8 encrypted v2 PBKDF2 3DES, 2048-bit)', |
| 358 | 'Parse RSA Key #39.1 (PKCS#8 encrypted v2 PBKDF2 3DES, 2048-bit, wrong PW)', |
| 359 | 'Parse RSA Key #39.2 (PKCS#8 encrypted v2 PBKDF2 3DES, 2048-bit, no PW)', |
| 360 | 'Parse RSA Key #40 (PKCS#8 encrypted v2 PBKDF2 3DES, 4096-bit)', |
| 361 | 'Parse RSA Key #40.1 (PKCS#8 encrypted v2 PBKDF2 3DES, 4096-bit, wrong PW)', |
| 362 | 'Parse RSA Key #40.2 (PKCS#8 encrypted v2 PBKDF2 3DES, 4096-bit, no PW)', |
| 363 | 'Parse RSA Key #41 (PKCS#8 encrypted v2 PBKDF2 3DES DER)', |
| 364 | 'Parse RSA Key #41.1 (PKCS#8 encrypted v2 PBKDF2 3DES DER, wrong PW)', |
| 365 | 'Parse RSA Key #41.2 (PKCS#8 encrypted v2 PBKDF2 3DES DER, no PW)', |
| 366 | 'Parse RSA Key #42 (PKCS#8 encrypted v2 PBKDF2 3DES DER, 2048-bit)', |
| 367 | 'Parse RSA Key #42.1 (PKCS#8 encrypted v2 PBKDF2 3DES DER, 2048-bit, wrong PW)', |
| 368 | 'Parse RSA Key #42.2 (PKCS#8 encrypted v2 PBKDF2 3DES DER, 2048-bit, no PW)', |
| 369 | 'Parse RSA Key #43 (PKCS#8 encrypted v2 PBKDF2 3DES DER, 4096-bit)', |
| 370 | 'Parse RSA Key #43.1 (PKCS#8 encrypted v2 PBKDF2 3DES DER, 4096-bit, wrong PW)', |
| 371 | 'Parse RSA Key #43.2 (PKCS#8 encrypted v2 PBKDF2 3DES DER, 4096-bit, no PW)', |
| 372 | 'Parse RSA Key #44 (PKCS#8 encrypted v2 PBKDF2 DES)', |
| 373 | 'Parse RSA Key #44.1 (PKCS#8 encrypted v2 PBKDF2 DES, wrong PW)', |
| 374 | 'Parse RSA Key #44.2 (PKCS#8 encrypted v2 PBKDF2 DES, no PW)', |
| 375 | 'Parse RSA Key #45 (PKCS#8 encrypted v2 PBKDF2 DES, 2048-bit)', |
| 376 | 'Parse RSA Key #45.1 (PKCS#8 encrypted v2 PBKDF2 DES, 2048-bit, wrong PW)', |
| 377 | 'Parse RSA Key #45.2 (PKCS#8 encrypted v2 PBKDF2 DES, 2048-bit, no PW)', |
| 378 | 'Parse RSA Key #46 (PKCS#8 encrypted v2 PBKDF2 DES, 4096-bit)', |
| 379 | 'Parse RSA Key #46.1 (PKCS#8 encrypted v2 PBKDF2 DES, 4096-bit, wrong PW)', |
| 380 | 'Parse RSA Key #46.2 (PKCS#8 encrypted v2 PBKDF2 DES, 4096-bit, no PW)', |
| 381 | 'Parse RSA Key #47 (PKCS#8 encrypted v2 PBKDF2 DES DER)', |
| 382 | 'Parse RSA Key #47.1 (PKCS#8 encrypted v2 PBKDF2 DES DER, wrong PW)', |
| 383 | 'Parse RSA Key #47.2 (PKCS#8 encrypted v2 PBKDF2 DES DER, no PW)', |
| 384 | 'Parse RSA Key #48 (PKCS#8 encrypted v2 PBKDF2 DES DER, 2048-bit)', |
| 385 | 'Parse RSA Key #48.1 (PKCS#8 encrypted v2 PBKDF2 DES DER, 2048-bit, wrong PW)', |
| 386 | 'Parse RSA Key #48.2 (PKCS#8 encrypted v2 PBKDF2 DES DER, 2048-bit, no PW)', |
| 387 | 'Parse RSA Key #49 (PKCS#8 encrypted v2 PBKDF2 DES DER, 4096-bit)', |
| 388 | 'Parse RSA Key #49.1 (PKCS#8 encrypted v2 PBKDF2 DES DER, 4096-bit, wrong PW)', |
| 389 | 'Parse RSA Key #49.2 (PKCS#8 encrypted v2 PBKDF2 DES DER, 4096-bit, no PW)', |
| 390 | 'Parse RSA Key #50 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224)', |
| 391 | 'Parse RSA Key #50.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224, wrong PW)', |
| 392 | 'Parse RSA Key #50.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224, no PW)', |
| 393 | 'Parse RSA Key #51 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224, 2048-bit)', |
| 394 | 'Parse RSA Key #51.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224, 2048-bit, wrong PW)', |
| 395 | 'Parse RSA Key #51.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224, 2048-bit, no PW)', |
| 396 | 'Parse RSA Key #52 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224, 4096-bit)', |
| 397 | 'Parse RSA Key #52.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224, 4096-bit, wrong PW)', |
| 398 | 'Parse RSA Key #52.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224, 4096-bit, no PW)', |
| 399 | 'Parse RSA Key #53 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224 DER)', |
| 400 | 'Parse RSA Key #53.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224 DER, wrong PW)', |
| 401 | 'Parse RSA Key #53.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224 DER, no PW)', |
| 402 | 'Parse RSA Key #54 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224 DER, 2048-bit)', |
| 403 | 'Parse RSA Key #54.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224 DER, 2048-bit, wrong PW)', |
| 404 | 'Parse RSA Key #54.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224 DER, 2048-bit, no PW)', |
| 405 | 'Parse RSA Key #55 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224 DER, 4096-bit)', |
| 406 | 'Parse RSA Key #55.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224 DER, 4096-bit, wrong PW)', |
| 407 | 'Parse RSA Key #55.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA224 DER, 4096-bit, no PW)', |
| 408 | 'Parse RSA Key #56 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224)', |
| 409 | 'Parse RSA Key #56.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224, wrong PW)', |
| 410 | 'Parse RSA Key #56.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224, no PW)', |
| 411 | 'Parse RSA Key #57 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224, 2048-bit)', |
| 412 | 'Parse RSA Key #57.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224, 2048-bit, wrong PW)', |
| 413 | 'Parse RSA Key #57.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224, 2048-bit, no PW)', |
| 414 | 'Parse RSA Key #58 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224, 4096-bit)', |
| 415 | 'Parse RSA Key #58.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224, 4096-bit, wrong PW)', |
| 416 | 'Parse RSA Key #58.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224, 4096-bit, no PW)', |
| 417 | 'Parse RSA Key #59 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224 DER)', |
| 418 | 'Parse RSA Key #59.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224 DER, wrong PW)', |
| 419 | 'Parse RSA Key #59.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224 DER, no PW)', |
| 420 | 'Parse RSA Key #60 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224 DER, 2048-bit)', |
| 421 | 'Parse RSA Key #60.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224 DER, 2048-bit, wrong PW)', |
| 422 | 'Parse RSA Key #60.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224 DER, 2048-bit, no PW)', |
| 423 | 'Parse RSA Key #61 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224 DER, 4096-bit)', |
| 424 | 'Parse RSA Key #61.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224 DER, 4096-bit, wrong PW)', |
| 425 | 'Parse RSA Key #61.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA224 DER, 4096-bit, no PW)', |
| 426 | 'Parse RSA Key #62 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256)', |
| 427 | 'Parse RSA Key #62.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256, wrong PW)', |
| 428 | 'Parse RSA Key #62.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256, no PW)', |
| 429 | 'Parse RSA Key #63 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256, 2048-bit)', |
| 430 | 'Parse RSA Key #63.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256, 2048-bit, wrong PW)', |
| 431 | 'Parse RSA Key #63.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256, 2048-bit, no PW)', |
| 432 | 'Parse RSA Key #64 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256, 4096-bit)', |
| 433 | 'Parse RSA Key #64.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256, 4096-bit, wrong PW)', |
| 434 | 'Parse RSA Key #64.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256, 4096-bit, no PW)', |
| 435 | 'Parse RSA Key #65 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256 DER)', |
| 436 | 'Parse RSA Key #65.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256 DER, wrong PW)', |
| 437 | 'Parse RSA Key #65.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256 DER, no PW)', |
| 438 | 'Parse RSA Key #66 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256 DER, 2048-bit)', |
| 439 | 'Parse RSA Key #66.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256 DER, 2048-bit, wrong PW)', |
| 440 | 'Parse RSA Key #66.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256 DER, 2048-bit, no PW)', |
| 441 | 'Parse RSA Key #67 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256 DER, 4096-bit)', |
| 442 | 'Parse RSA Key #68.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256 DER, 4096-bit, wrong PW)', |
| 443 | 'Parse RSA Key #68.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA256 DER, 4096-bit, no PW)', |
| 444 | 'Parse RSA Key #69 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256)', |
| 445 | 'Parse RSA Key #69.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256, wrong PW)', |
| 446 | 'Parse RSA Key #69.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256, no PW)', |
| 447 | 'Parse RSA Key #70 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256, 2048-bit)', |
| 448 | 'Parse RSA Key #70.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256, 2048-bit, wrong PW)', |
| 449 | 'Parse RSA Key #70.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256, 2048-bit, no PW)', |
| 450 | 'Parse RSA Key #71 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256, 4096-bit)', |
| 451 | 'Parse RSA Key #71.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256, 4096-bit, wrong PW)', |
| 452 | 'Parse RSA Key #71.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256, 4096-bit, no PW)', |
| 453 | 'Parse RSA Key #72 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256 DER)', |
| 454 | 'Parse RSA Key #72.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256 DER, wrong PW)', |
| 455 | 'Parse RSA Key #72.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256 DER, no PW)', |
| 456 | 'Parse RSA Key #73 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256 DER, 2048-bit)', |
| 457 | 'Parse RSA Key #73.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256 DER, 2048-bit, wrong PW)', |
| 458 | 'Parse RSA Key #73.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256 DER, 2048-bit, no PW)', |
| 459 | 'Parse RSA Key #74 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256 DER, 4096-bit)', |
| 460 | 'Parse RSA Key #74.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256 DER, 4096-bit, wrong PW)', |
| 461 | 'Parse RSA Key #74.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA256 DER, 4096-bit, no PW)', |
| 462 | 'Parse RSA Key #75 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384)', |
| 463 | 'Parse RSA Key #75.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384, wrong PW)', |
| 464 | 'Parse RSA Key #75.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384, no PW)', |
| 465 | 'Parse RSA Key #76 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384, 2048-bit)', |
| 466 | 'Parse RSA Key #76.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384, 2048-bit, wrong PW)', |
| 467 | 'Parse RSA Key #76.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384, 2048-bit, no PW)', |
| 468 | 'Parse RSA Key #77 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384, 4096-bit)', |
| 469 | 'Parse RSA Key #77.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384, 4096-bit, wrong PW)', |
| 470 | 'Parse RSA Key #77.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384, 4096-bit, no PW)', |
| 471 | 'Parse RSA Key #78 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384 DER)', |
| 472 | 'Parse RSA Key #78.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384 DER, wrong PW)', |
| 473 | 'Parse RSA Key #78.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384 DER, no PW)', |
| 474 | 'Parse RSA Key #79 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384 DER, 2048-bit)', |
| 475 | 'Parse RSA Key #79.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384 DER, 2048-bit, wrong PW)', |
| 476 | 'Parse RSA Key #79.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384 DER, 2048-bit, no PW)', |
| 477 | 'Parse RSA Key #80 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384 DER, 4096-bit)', |
| 478 | 'Parse RSA Key #80.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384 DER, 4096-bit, wrong PW)', |
| 479 | 'Parse RSA Key #80.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA384 DER, 4096-bit, no PW)', |
| 480 | 'Parse RSA Key #81 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384)', |
| 481 | 'Parse RSA Key #81.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384, wrong PW)', |
| 482 | 'Parse RSA Key #81.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384, no PW)', |
| 483 | 'Parse RSA Key #82 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384, 2048-bit)', |
| 484 | 'Parse RSA Key #82.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384, 2048-bit, wrong PW)', |
| 485 | 'Parse RSA Key #82.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384, 2048-bit, no PW)', |
| 486 | 'Parse RSA Key #83 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384, 4096-bit)', |
| 487 | 'Parse RSA Key #83.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384, 4096-bit, wrong PW)', |
| 488 | 'Parse RSA Key #83.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384, 4096-bit, no PW)', |
| 489 | 'Parse RSA Key #84 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384 DER)', |
| 490 | 'Parse RSA Key #84.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384 DER, wrong PW)', |
| 491 | 'Parse RSA Key #85.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384 DER, no PW)', |
| 492 | 'Parse RSA Key #86 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384 DER, 2048-bit)', |
| 493 | 'Parse RSA Key #86.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384 DER, 2048-bit, wrong PW)', |
| 494 | 'Parse RSA Key #86.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384 DER, 2048-bit, no PW)', |
| 495 | 'Parse RSA Key #87 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384 DER, 4096-bit)', |
| 496 | 'Parse RSA Key #87.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384 DER, 4096-bit, wrong PW)', |
| 497 | 'Parse RSA Key #87.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA384 DER, 4096-bit, no PW)', |
| 498 | 'Parse RSA Key #88 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512)', |
| 499 | 'Parse RSA Key #88.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512, wrong PW)', |
| 500 | 'Parse RSA Key #88.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512, no PW)', |
| 501 | 'Parse RSA Key #89 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512, 2048-bit)', |
| 502 | 'Parse RSA Key #89.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512, 2048-bit, wrong PW)', |
| 503 | 'Parse RSA Key #89.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512, 2048-bit, no PW)', |
| 504 | 'Parse RSA Key #90 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512, 4096-bit)', |
| 505 | 'Parse RSA Key #90.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512, 4096-bit, wrong PW)', |
| 506 | 'Parse RSA Key #90.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512, 4096-bit, no PW)', |
| 507 | 'Parse RSA Key #91 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512 DER)', |
| 508 | 'Parse RSA Key #91.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512 DER, wrong PW)', |
| 509 | 'Parse RSA Key #91.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512 DER, no PW)', |
| 510 | 'Parse RSA Key #92 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512 DER, 2048-bit)', |
| 511 | 'Parse RSA Key #92.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512 DER, 2048-bit, wrong PW)', |
| 512 | 'Parse RSA Key #92.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512 DER, 2048-bit, no PW)', |
| 513 | 'Parse RSA Key #93 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512 DER, 4096-bit)', |
| 514 | 'Parse RSA Key #93.1 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512 DER, 4096-bit, wrong PW)', |
| 515 | 'Parse RSA Key #93.2 (PKCS#8 encrypted v2 PBKDF2 3DES hmacWithSHA512 DER, 4096-bit, no PW)', |
| 516 | 'Parse RSA Key #94 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512)', |
| 517 | 'Parse RSA Key #94.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512, wrong PW)', |
| 518 | 'Parse RSA Key #94.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512, no PW)', |
| 519 | 'Parse RSA Key #95 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512, 2048-bit)', |
| 520 | 'Parse RSA Key #95.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512, 2048-bit, wrong PW)', |
| 521 | 'Parse RSA Key #95.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512, 2048-bit, no PW)', |
| 522 | 'Parse RSA Key #96 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512, 4096-bit)', |
| 523 | 'Parse RSA Key #96.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512, 4096-bit, wrong PW)', |
| 524 | 'Parse RSA Key #96.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512, 4096-bit, no PW)', |
| 525 | 'Parse RSA Key #97 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512 DER)', |
| 526 | 'Parse RSA Key #97.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512 DER, wrong PW)', |
| 527 | 'Parse RSA Key #97.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512 DER, no PW)', |
| 528 | 'Parse RSA Key #98 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512 DER, 2048-bit)', |
| 529 | 'Parse RSA Key #98.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512 DER, 2048-bit, wrong PW)', |
| 530 | 'Parse RSA Key #98.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512 DER, 2048-bit, no PW)', |
| 531 | 'Parse RSA Key #99 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512 DER, 4096-bit)', |
| 532 | 'Parse RSA Key #99.1 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512 DER, 4096-bit, wrong PW)', |
| 533 | 'Parse RSA Key #99.2 (PKCS#8 encrypted v2 PBKDF2 DES hmacWithSHA512 DER, 4096-bit, no PW)', |
| 534 | ], |
Valerio Setti | b6b301f | 2023-10-04 12:05:05 +0200 | [diff] [blame] | 535 | } |
| 536 | } |
| 537 | }, |
Valerio Setti | 4d25a8d | 2023-06-14 10:33:10 +0200 | [diff] [blame] | 538 | 'analyze_driver_vs_reference_ecp_light_only': { |
Valerio Setti | 42d5f19 | 2023-03-20 13:54:41 +0100 | [diff] [blame] | 539 | 'test_function': do_analyze_driver_vs_reference, |
| 540 | 'args': { |
Valerio Setti | 4d25a8d | 2023-06-14 10:33:10 +0200 | [diff] [blame] | 541 | 'component_ref': 'test_psa_crypto_config_reference_ecc_ecp_light_only', |
| 542 | 'component_driver': 'test_psa_crypto_config_accel_ecc_ecp_light_only', |
Valerio Setti | 42d5f19 | 2023-03-20 13:54:41 +0100 | [diff] [blame] | 543 | 'ignored_suites': [ |
| 544 | 'ecdsa', |
| 545 | 'ecdh', |
| 546 | 'ecjpake', |
| 547 | ], |
| 548 | 'ignored_tests': { |
| 549 | 'test_suite_random': [ |
| 550 | 'PSA classic wrapper: ECDSA signature (SECP256R1)', |
| 551 | ], |
Valerio Setti | 0c477d3 | 2023-04-07 15:54:20 +0200 | [diff] [blame] | 552 | # In the accelerated test ECP_C is not set (only ECP_LIGHT is) |
| 553 | # so we must ignore disparities in the tests for which ECP_C |
| 554 | # is required. |
| 555 | 'test_suite_ecp': [ |
| 556 | 'ECP check public-private #1 (OK)', |
| 557 | 'ECP check public-private #2 (group none)', |
| 558 | 'ECP check public-private #3 (group mismatch)', |
| 559 | 'ECP check public-private #4 (Qx mismatch)', |
| 560 | 'ECP check public-private #5 (Qy mismatch)', |
| 561 | 'ECP check public-private #6 (wrong Qx)', |
| 562 | 'ECP check public-private #7 (wrong Qy)', |
| 563 | 'ECP gen keypair [#1]', |
| 564 | 'ECP gen keypair [#2]', |
| 565 | 'ECP gen keypair [#3]', |
| 566 | 'ECP gen keypair wrapper', |
| 567 | 'ECP point muladd secp256r1 #1', |
| 568 | 'ECP point muladd secp256r1 #2', |
| 569 | 'ECP point multiplication Curve25519 (element of order 2: origin) #3', |
| 570 | 'ECP point multiplication Curve25519 (element of order 4: 1) #4', |
| 571 | 'ECP point multiplication Curve25519 (element of order 8) #5', |
| 572 | 'ECP point multiplication Curve25519 (normalized) #1', |
| 573 | 'ECP point multiplication Curve25519 (not normalized) #2', |
| 574 | 'ECP point multiplication rng fail Curve25519', |
| 575 | 'ECP point multiplication rng fail secp256r1', |
| 576 | 'ECP test vectors Curve25519', |
| 577 | 'ECP test vectors Curve448 (RFC 7748 6.2, after decodeUCoordinate)', |
| 578 | 'ECP test vectors brainpoolP256r1 rfc 7027', |
| 579 | 'ECP test vectors brainpoolP384r1 rfc 7027', |
| 580 | 'ECP test vectors brainpoolP512r1 rfc 7027', |
| 581 | 'ECP test vectors secp192k1', |
| 582 | 'ECP test vectors secp192r1 rfc 5114', |
| 583 | 'ECP test vectors secp224k1', |
| 584 | 'ECP test vectors secp224r1 rfc 5114', |
| 585 | 'ECP test vectors secp256k1', |
| 586 | 'ECP test vectors secp256r1 rfc 5114', |
| 587 | 'ECP test vectors secp384r1 rfc 5114', |
| 588 | 'ECP test vectors secp521r1 rfc 5114', |
Valerio Setti | e50a75f | 2023-05-19 17:43:06 +0200 | [diff] [blame] | 589 | ], |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 590 | 'test_suite_psa_crypto': [ |
| 591 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1', |
| 592 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1 (1 redraw)', |
| 593 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1, exercise ECDSA', |
| 594 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp384r1', |
| 595 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp521r1 #0', |
| 596 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp521r1 #1', |
| 597 | ], |
Manuel Pégourié-Gonnard | f07ce3b | 2023-09-22 11:53:41 +0200 | [diff] [blame] | 598 | 'test_suite_ssl': [ |
| 599 | 'Test configuration of groups for DHE through mbedtls_ssl_conf_curves()', |
| 600 | ], |
Valerio Setti | 5f54020 | 2023-06-30 17:20:49 +0200 | [diff] [blame] | 601 | } |
Valerio Setti | 42d5f19 | 2023-03-20 13:54:41 +0100 | [diff] [blame] | 602 | } |
| 603 | }, |
Valerio Setti | 4d25a8d | 2023-06-14 10:33:10 +0200 | [diff] [blame] | 604 | 'analyze_driver_vs_reference_no_ecp_at_all': { |
Valerio Setti | e618cb0 | 2023-04-12 14:59:16 +0200 | [diff] [blame] | 605 | 'test_function': do_analyze_driver_vs_reference, |
| 606 | 'args': { |
Valerio Setti | 4d25a8d | 2023-06-14 10:33:10 +0200 | [diff] [blame] | 607 | 'component_ref': 'test_psa_crypto_config_reference_ecc_no_ecp_at_all', |
| 608 | 'component_driver': 'test_psa_crypto_config_accel_ecc_no_ecp_at_all', |
Valerio Setti | e618cb0 | 2023-04-12 14:59:16 +0200 | [diff] [blame] | 609 | 'ignored_suites': [ |
| 610 | # Ignore test suites for the modules that are disabled in the |
| 611 | # accelerated test case. |
| 612 | 'ecp', |
| 613 | 'ecdsa', |
| 614 | 'ecdh', |
| 615 | 'ecjpake', |
| 616 | ], |
| 617 | 'ignored_tests': { |
| 618 | 'test_suite_random': [ |
| 619 | 'PSA classic wrapper: ECDSA signature (SECP256R1)', |
| 620 | ], |
| 621 | 'test_suite_psa_crypto': [ |
| 622 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1', |
| 623 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1 (1 redraw)', |
| 624 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1, exercise ECDSA', |
| 625 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp384r1', |
| 626 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp521r1 #0', |
| 627 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp521r1 #1', |
| 628 | 'PSA key derivation: bits=7 invalid for ECC BRAINPOOL_P_R1 (ECC enabled)', |
| 629 | 'PSA key derivation: bits=7 invalid for ECC SECP_K1 (ECC enabled)', |
| 630 | 'PSA key derivation: bits=7 invalid for ECC SECP_R1 (ECC enabled)', |
| 631 | 'PSA key derivation: bits=7 invalid for ECC SECP_R2 (ECC enabled)', |
| 632 | 'PSA key derivation: bits=7 invalid for ECC SECT_K1 (ECC enabled)', |
| 633 | 'PSA key derivation: bits=7 invalid for ECC SECT_R1 (ECC enabled)', |
| 634 | 'PSA key derivation: bits=7 invalid for ECC SECT_R2 (ECC enabled)', |
Valerio Setti | addeee4 | 2023-06-14 10:46:55 +0200 | [diff] [blame] | 635 | ], |
| 636 | 'test_suite_pkparse': [ |
Valerio Setti | 5bd2523 | 2023-06-19 19:32:14 +0200 | [diff] [blame] | 637 | # When PK_PARSE_C and ECP_C are defined then PK_PARSE_EC_COMPRESSED |
| 638 | # is automatically enabled in build_info.h (backward compatibility) |
| 639 | # even if it is disabled in config_psa_crypto_no_ecp_at_all(). As a |
| 640 | # consequence compressed points are supported in the reference |
| 641 | # component but not in the accelerated one, so they should be skipped |
| 642 | # while checking driver's coverage. |
| 643 | 'Parse EC Key #10a (SEC1 PEM, secp384r1, compressed)', |
| 644 | 'Parse EC Key #11a (SEC1 PEM, secp521r1, compressed)', |
| 645 | 'Parse EC Key #12a (SEC1 PEM, bp256r1, compressed)', |
| 646 | 'Parse EC Key #13a (SEC1 PEM, bp384r1, compressed)', |
| 647 | 'Parse EC Key #14a (SEC1 PEM, bp512r1, compressed)', |
| 648 | 'Parse EC Key #2a (SEC1 PEM, secp192r1, compressed)', |
| 649 | 'Parse EC Key #8a (SEC1 PEM, secp224r1, compressed)', |
| 650 | 'Parse EC Key #9a (SEC1 PEM, secp256r1, compressed)', |
| 651 | 'Parse Public EC Key #2a (RFC 5480, PEM, secp192r1, compressed)', |
| 652 | 'Parse Public EC Key #3a (RFC 5480, secp224r1, compressed)', |
| 653 | 'Parse Public EC Key #4a (RFC 5480, secp256r1, compressed)', |
| 654 | 'Parse Public EC Key #5a (RFC 5480, secp384r1, compressed)', |
| 655 | 'Parse Public EC Key #6a (RFC 5480, secp521r1, compressed)', |
| 656 | 'Parse Public EC Key #7a (RFC 5480, brainpoolP256r1, compressed)', |
| 657 | 'Parse Public EC Key #8a (RFC 5480, brainpoolP384r1, compressed)', |
| 658 | 'Parse Public EC Key #9a (RFC 5480, brainpoolP512r1, compressed)', |
Valerio Setti | addeee4 | 2023-06-14 10:46:55 +0200 | [diff] [blame] | 659 | ], |
Manuel Pégourié-Gonnard | f07ce3b | 2023-09-22 11:53:41 +0200 | [diff] [blame] | 660 | 'test_suite_ssl': [ |
| 661 | 'Test configuration of groups for DHE through mbedtls_ssl_conf_curves()', |
| 662 | ], |
Valerio Setti | e618cb0 | 2023-04-12 14:59:16 +0200 | [diff] [blame] | 663 | } |
| 664 | } |
| 665 | }, |
Valerio Setti | 307810b | 2023-08-15 10:12:25 +0200 | [diff] [blame] | 666 | 'analyze_driver_vs_reference_ecc_no_bignum': { |
Manuel Pégourié-Gonnard | abd00d0 | 2023-06-12 17:51:33 +0200 | [diff] [blame] | 667 | 'test_function': do_analyze_driver_vs_reference, |
| 668 | 'args': { |
| 669 | 'component_ref': 'test_psa_crypto_config_reference_ecc_no_bignum', |
| 670 | 'component_driver': 'test_psa_crypto_config_accel_ecc_no_bignum', |
| 671 | 'ignored_suites': [ |
| 672 | # Ignore test suites for the modules that are disabled in the |
| 673 | # accelerated test case. |
| 674 | 'ecp', |
| 675 | 'ecdsa', |
| 676 | 'ecdh', |
| 677 | 'ecjpake', |
Valerio Setti | 9b3dbcc | 2023-07-26 18:00:31 +0200 | [diff] [blame] | 678 | 'bignum_core', |
| 679 | 'bignum_random', |
| 680 | 'bignum_mod', |
| 681 | 'bignum_mod_raw', |
| 682 | 'bignum.generated', |
| 683 | 'bignum.misc', |
Manuel Pégourié-Gonnard | abd00d0 | 2023-06-12 17:51:33 +0200 | [diff] [blame] | 684 | ], |
| 685 | 'ignored_tests': { |
| 686 | 'test_suite_random': [ |
| 687 | 'PSA classic wrapper: ECDSA signature (SECP256R1)', |
| 688 | ], |
| 689 | 'test_suite_psa_crypto': [ |
| 690 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1', |
| 691 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1 (1 redraw)', |
| 692 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1, exercise ECDSA', |
| 693 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp384r1', |
| 694 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp521r1 #0', |
| 695 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp521r1 #1', |
| 696 | 'PSA key derivation: bits=7 invalid for ECC BRAINPOOL_P_R1 (ECC enabled)', |
| 697 | 'PSA key derivation: bits=7 invalid for ECC SECP_K1 (ECC enabled)', |
| 698 | 'PSA key derivation: bits=7 invalid for ECC SECP_R1 (ECC enabled)', |
| 699 | 'PSA key derivation: bits=7 invalid for ECC SECP_R2 (ECC enabled)', |
| 700 | 'PSA key derivation: bits=7 invalid for ECC SECT_K1 (ECC enabled)', |
| 701 | 'PSA key derivation: bits=7 invalid for ECC SECT_R1 (ECC enabled)', |
| 702 | 'PSA key derivation: bits=7 invalid for ECC SECT_R2 (ECC enabled)', |
| 703 | ], |
| 704 | 'test_suite_pkparse': [ |
| 705 | # See the description provided above in the |
| 706 | # analyze_driver_vs_reference_no_ecp_at_all component. |
| 707 | 'Parse EC Key #10a (SEC1 PEM, secp384r1, compressed)', |
| 708 | 'Parse EC Key #11a (SEC1 PEM, secp521r1, compressed)', |
| 709 | 'Parse EC Key #12a (SEC1 PEM, bp256r1, compressed)', |
| 710 | 'Parse EC Key #13a (SEC1 PEM, bp384r1, compressed)', |
| 711 | 'Parse EC Key #14a (SEC1 PEM, bp512r1, compressed)', |
| 712 | 'Parse EC Key #2a (SEC1 PEM, secp192r1, compressed)', |
| 713 | 'Parse EC Key #8a (SEC1 PEM, secp224r1, compressed)', |
| 714 | 'Parse EC Key #9a (SEC1 PEM, secp256r1, compressed)', |
| 715 | 'Parse Public EC Key #2a (RFC 5480, PEM, secp192r1, compressed)', |
| 716 | 'Parse Public EC Key #3a (RFC 5480, secp224r1, compressed)', |
| 717 | 'Parse Public EC Key #4a (RFC 5480, secp256r1, compressed)', |
| 718 | 'Parse Public EC Key #5a (RFC 5480, secp384r1, compressed)', |
| 719 | 'Parse Public EC Key #6a (RFC 5480, secp521r1, compressed)', |
| 720 | 'Parse Public EC Key #7a (RFC 5480, brainpoolP256r1, compressed)', |
| 721 | 'Parse Public EC Key #8a (RFC 5480, brainpoolP384r1, compressed)', |
| 722 | 'Parse Public EC Key #9a (RFC 5480, brainpoolP512r1, compressed)', |
| 723 | ], |
Valerio Setti | 9b3dbcc | 2023-07-26 18:00:31 +0200 | [diff] [blame] | 724 | 'test_suite_asn1parse': [ |
| 725 | # This test depends on BIGNUM_C |
| 726 | 'INTEGER too large for mpi', |
| 727 | ], |
| 728 | 'test_suite_asn1write': [ |
| 729 | # Following tests depends on BIGNUM_C |
| 730 | 'ASN.1 Write mpi 0 (1 limb)', |
| 731 | 'ASN.1 Write mpi 0 (null)', |
| 732 | 'ASN.1 Write mpi 0x100', |
| 733 | 'ASN.1 Write mpi 0x7f', |
| 734 | 'ASN.1 Write mpi 0x7f with leading 0 limb', |
| 735 | 'ASN.1 Write mpi 0x80', |
| 736 | 'ASN.1 Write mpi 0x80 with leading 0 limb', |
| 737 | 'ASN.1 Write mpi 0xff', |
| 738 | 'ASN.1 Write mpi 1', |
| 739 | 'ASN.1 Write mpi, 127*8 bits', |
| 740 | 'ASN.1 Write mpi, 127*8+1 bits', |
| 741 | 'ASN.1 Write mpi, 127*8-1 bits', |
| 742 | 'ASN.1 Write mpi, 255*8 bits', |
| 743 | 'ASN.1 Write mpi, 255*8-1 bits', |
| 744 | 'ASN.1 Write mpi, 256*8-1 bits', |
| 745 | ], |
Valerio Setti | e0be95e | 2023-08-01 09:07:43 +0200 | [diff] [blame] | 746 | 'test_suite_debug': [ |
| 747 | # Following tests depends on BIGNUM_C |
| 748 | 'Debug print mbedtls_mpi #2: 3 bits', |
| 749 | 'Debug print mbedtls_mpi: 0 (empty representation)', |
| 750 | 'Debug print mbedtls_mpi: 0 (non-empty representation)', |
| 751 | 'Debug print mbedtls_mpi: 49 bits', |
| 752 | 'Debug print mbedtls_mpi: 759 bits', |
| 753 | 'Debug print mbedtls_mpi: 764 bits #1', |
| 754 | 'Debug print mbedtls_mpi: 764 bits #2', |
| 755 | ], |
Manuel Pégourié-Gonnard | f07ce3b | 2023-09-22 11:53:41 +0200 | [diff] [blame] | 756 | 'test_suite_ssl': [ |
| 757 | 'Test configuration of groups for DHE through mbedtls_ssl_conf_curves()', |
| 758 | ], |
Manuel Pégourié-Gonnard | abd00d0 | 2023-06-12 17:51:33 +0200 | [diff] [blame] | 759 | } |
| 760 | } |
| 761 | }, |
Valerio Setti | 307810b | 2023-08-15 10:12:25 +0200 | [diff] [blame] | 762 | 'analyze_driver_vs_reference_ecc_ffdh_no_bignum': { |
| 763 | 'test_function': do_analyze_driver_vs_reference, |
| 764 | 'args': { |
| 765 | 'component_ref': 'test_psa_crypto_config_reference_ecc_ffdh_no_bignum', |
| 766 | 'component_driver': 'test_psa_crypto_config_accel_ecc_ffdh_no_bignum', |
| 767 | 'ignored_suites': [ |
| 768 | # Ignore test suites for the modules that are disabled in the |
| 769 | # accelerated test case. |
| 770 | 'ecp', |
| 771 | 'ecdsa', |
| 772 | 'ecdh', |
| 773 | 'ecjpake', |
| 774 | 'bignum_core', |
| 775 | 'bignum_random', |
| 776 | 'bignum_mod', |
| 777 | 'bignum_mod_raw', |
| 778 | 'bignum.generated', |
| 779 | 'bignum.misc', |
| 780 | 'dhm', |
| 781 | ], |
| 782 | 'ignored_tests': { |
| 783 | 'test_suite_random': [ |
| 784 | 'PSA classic wrapper: ECDSA signature (SECP256R1)', |
| 785 | ], |
| 786 | 'test_suite_psa_crypto': [ |
| 787 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1', |
| 788 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1 (1 redraw)', |
| 789 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1, exercise ECDSA', |
| 790 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp384r1', |
| 791 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp521r1 #0', |
| 792 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp521r1 #1', |
| 793 | 'PSA key derivation: bits=7 invalid for ECC BRAINPOOL_P_R1 (ECC enabled)', |
| 794 | 'PSA key derivation: bits=7 invalid for ECC SECP_K1 (ECC enabled)', |
| 795 | 'PSA key derivation: bits=7 invalid for ECC SECP_R1 (ECC enabled)', |
| 796 | 'PSA key derivation: bits=7 invalid for ECC SECP_R2 (ECC enabled)', |
| 797 | 'PSA key derivation: bits=7 invalid for ECC SECT_K1 (ECC enabled)', |
| 798 | 'PSA key derivation: bits=7 invalid for ECC SECT_R1 (ECC enabled)', |
| 799 | 'PSA key derivation: bits=7 invalid for ECC SECT_R2 (ECC enabled)', |
| 800 | ], |
| 801 | 'test_suite_pkparse': [ |
| 802 | # See the description provided above in the |
| 803 | # analyze_driver_vs_reference_no_ecp_at_all component. |
| 804 | 'Parse EC Key #10a (SEC1 PEM, secp384r1, compressed)', |
| 805 | 'Parse EC Key #11a (SEC1 PEM, secp521r1, compressed)', |
| 806 | 'Parse EC Key #12a (SEC1 PEM, bp256r1, compressed)', |
| 807 | 'Parse EC Key #13a (SEC1 PEM, bp384r1, compressed)', |
| 808 | 'Parse EC Key #14a (SEC1 PEM, bp512r1, compressed)', |
| 809 | 'Parse EC Key #2a (SEC1 PEM, secp192r1, compressed)', |
| 810 | 'Parse EC Key #8a (SEC1 PEM, secp224r1, compressed)', |
| 811 | 'Parse EC Key #9a (SEC1 PEM, secp256r1, compressed)', |
| 812 | 'Parse Public EC Key #2a (RFC 5480, PEM, secp192r1, compressed)', |
| 813 | 'Parse Public EC Key #3a (RFC 5480, secp224r1, compressed)', |
| 814 | 'Parse Public EC Key #4a (RFC 5480, secp256r1, compressed)', |
| 815 | 'Parse Public EC Key #5a (RFC 5480, secp384r1, compressed)', |
| 816 | 'Parse Public EC Key #6a (RFC 5480, secp521r1, compressed)', |
| 817 | 'Parse Public EC Key #7a (RFC 5480, brainpoolP256r1, compressed)', |
| 818 | 'Parse Public EC Key #8a (RFC 5480, brainpoolP384r1, compressed)', |
| 819 | 'Parse Public EC Key #9a (RFC 5480, brainpoolP512r1, compressed)', |
| 820 | ], |
| 821 | 'test_suite_asn1parse': [ |
| 822 | # This test depends on BIGNUM_C |
| 823 | 'INTEGER too large for mpi', |
| 824 | ], |
| 825 | 'test_suite_asn1write': [ |
| 826 | # Following tests depends on BIGNUM_C |
| 827 | 'ASN.1 Write mpi 0 (1 limb)', |
| 828 | 'ASN.1 Write mpi 0 (null)', |
| 829 | 'ASN.1 Write mpi 0x100', |
| 830 | 'ASN.1 Write mpi 0x7f', |
| 831 | 'ASN.1 Write mpi 0x7f with leading 0 limb', |
| 832 | 'ASN.1 Write mpi 0x80', |
| 833 | 'ASN.1 Write mpi 0x80 with leading 0 limb', |
| 834 | 'ASN.1 Write mpi 0xff', |
| 835 | 'ASN.1 Write mpi 1', |
| 836 | 'ASN.1 Write mpi, 127*8 bits', |
| 837 | 'ASN.1 Write mpi, 127*8+1 bits', |
| 838 | 'ASN.1 Write mpi, 127*8-1 bits', |
| 839 | 'ASN.1 Write mpi, 255*8 bits', |
| 840 | 'ASN.1 Write mpi, 255*8-1 bits', |
| 841 | 'ASN.1 Write mpi, 256*8-1 bits', |
| 842 | ], |
| 843 | 'test_suite_debug': [ |
| 844 | # Following tests depends on BIGNUM_C |
| 845 | 'Debug print mbedtls_mpi #2: 3 bits', |
| 846 | 'Debug print mbedtls_mpi: 0 (empty representation)', |
| 847 | 'Debug print mbedtls_mpi: 0 (non-empty representation)', |
| 848 | 'Debug print mbedtls_mpi: 49 bits', |
| 849 | 'Debug print mbedtls_mpi: 759 bits', |
| 850 | 'Debug print mbedtls_mpi: 764 bits #1', |
| 851 | 'Debug print mbedtls_mpi: 764 bits #2', |
| 852 | ], |
Manuel Pégourié-Gonnard | f07ce3b | 2023-09-22 11:53:41 +0200 | [diff] [blame] | 853 | 'test_suite_ssl': [ |
| 854 | 'Test configuration of groups for DHE through mbedtls_ssl_conf_curves()', |
| 855 | ], |
Valerio Setti | 307810b | 2023-08-15 10:12:25 +0200 | [diff] [blame] | 856 | } |
| 857 | } |
| 858 | }, |
Przemek Stekiel | 85b6442 | 2023-05-26 09:55:23 +0200 | [diff] [blame] | 859 | 'analyze_driver_vs_reference_ffdh_alg': { |
| 860 | 'test_function': do_analyze_driver_vs_reference, |
| 861 | 'args': { |
| 862 | 'component_ref': 'test_psa_crypto_config_reference_ffdh', |
| 863 | 'component_driver': 'test_psa_crypto_config_accel_ffdh', |
Przemek Stekiel | 84f4ff1 | 2023-07-04 12:35:31 +0200 | [diff] [blame] | 864 | 'ignored_suites': ['dhm'], |
Przemek Stekiel | 565353e | 2023-07-05 11:07:07 +0200 | [diff] [blame] | 865 | 'ignored_tests': {} |
Przemek Stekiel | 85b6442 | 2023-05-26 09:55:23 +0200 | [diff] [blame] | 866 | } |
| 867 | }, |
Valerio Setti | f01d648 | 2023-08-04 13:51:18 +0200 | [diff] [blame] | 868 | 'analyze_driver_vs_reference_tfm_config': { |
| 869 | 'test_function': do_analyze_driver_vs_reference, |
| 870 | 'args': { |
| 871 | 'component_ref': 'test_tfm_config', |
| 872 | 'component_driver': 'test_tfm_config_p256m_driver_accel_ec', |
Manuel Pégourié-Gonnard | e9d9797 | 2023-08-08 18:34:47 +0200 | [diff] [blame] | 873 | 'ignored_suites': [ |
| 874 | # Ignore test suites for the modules that are disabled in the |
| 875 | # accelerated test case. |
| 876 | 'ecp', |
| 877 | 'ecdsa', |
| 878 | 'ecdh', |
| 879 | 'ecjpake', |
| 880 | 'bignum_core', |
| 881 | 'bignum_random', |
| 882 | 'bignum_mod', |
| 883 | 'bignum_mod_raw', |
| 884 | 'bignum.generated', |
| 885 | 'bignum.misc', |
| 886 | ], |
Valerio Setti | f01d648 | 2023-08-04 13:51:18 +0200 | [diff] [blame] | 887 | 'ignored_tests': { |
| 888 | # Ignore all tests that require DERIVE support which is disabled |
| 889 | # in the driver version |
| 890 | 'test_suite_psa_crypto': [ |
| 891 | 'PSA key agreement setup: ECDH + HKDF-SHA-256: good', |
| 892 | ('PSA key agreement setup: ECDH + HKDF-SHA-256: good, key algorithm broader ' |
| 893 | 'than required'), |
| 894 | 'PSA key agreement setup: ECDH + HKDF-SHA-256: public key not on curve', |
| 895 | 'PSA key agreement setup: KDF instead of a key agreement algorithm', |
| 896 | 'PSA key agreement setup: bad key agreement algorithm', |
| 897 | 'PSA key agreement: ECDH SECP256R1 (RFC 5903) + HKDF-SHA-256: capacity=8160', |
| 898 | 'PSA key agreement: ECDH SECP256R1 (RFC 5903) + HKDF-SHA-256: read 0+32', |
| 899 | 'PSA key agreement: ECDH SECP256R1 (RFC 5903) + HKDF-SHA-256: read 1+31', |
| 900 | 'PSA key agreement: ECDH SECP256R1 (RFC 5903) + HKDF-SHA-256: read 31+1', |
| 901 | 'PSA key agreement: ECDH SECP256R1 (RFC 5903) + HKDF-SHA-256: read 32+0', |
| 902 | 'PSA key agreement: ECDH SECP256R1 (RFC 5903) + HKDF-SHA-256: read 32+32', |
| 903 | 'PSA key agreement: ECDH SECP256R1 (RFC 5903) + HKDF-SHA-256: read 64+0', |
| 904 | 'PSA key derivation: ECDH on P256 with HKDF-SHA256, info first', |
| 905 | 'PSA key derivation: ECDH on P256 with HKDF-SHA256, key output', |
| 906 | 'PSA key derivation: ECDH on P256 with HKDF-SHA256, missing info', |
| 907 | 'PSA key derivation: ECDH on P256 with HKDF-SHA256, omitted salt', |
| 908 | 'PSA key derivation: ECDH on P256 with HKDF-SHA256, raw output', |
| 909 | 'PSA key derivation: ECDH on P256 with HKDF-SHA256, salt after secret', |
| 910 | 'PSA key derivation: ECDH with TLS 1.2 PRF SHA-256, good case', |
| 911 | 'PSA key derivation: ECDH with TLS 1.2 PRF SHA-256, missing label', |
| 912 | 'PSA key derivation: ECDH with TLS 1.2 PRF SHA-256, missing label and secret', |
| 913 | 'PSA key derivation: ECDH with TLS 1.2 PRF SHA-256, no inputs', |
| 914 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1', |
| 915 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1 (1 redraw)', |
| 916 | 'PSA key derivation: HKDF-SHA-256 -> ECC secp256r1, exercise ECDSA', |
| 917 | 'PSA key derivation: TLS 1.2 Mix-PSK-to-MS, SHA-256, 0+48, ka', |
| 918 | 'PSA key derivation: TLS 1.2 Mix-PSK-to-MS, SHA-256, 24+24, ka', |
| 919 | 'PSA key derivation: TLS 1.2 Mix-PSK-to-MS, SHA-256, 48+0, ka', |
| 920 | 'PSA key derivation: TLS 1.2 Mix-PSK-to-MS, bad state #1, ka', |
| 921 | 'PSA key derivation: TLS 1.2 Mix-PSK-to-MS, bad state #3, ka', |
| 922 | 'PSA key derivation: TLS 1.2 Mix-PSK-to-MS, bad state #4, ka', |
| 923 | 'PSA key derivation: bits=7 invalid for ECC BRAINPOOL_P_R1 (ECC enabled)', |
| 924 | 'PSA key derivation: bits=7 invalid for ECC MONTGOMERY (ECC enabled)', |
| 925 | 'PSA key derivation: bits=7 invalid for ECC SECP_K1 (ECC enabled)', |
| 926 | 'PSA key derivation: bits=7 invalid for ECC SECP_R1 (ECC enabled)', |
| 927 | 'PSA key derivation: bits=7 invalid for ECC SECP_R2 (ECC enabled)', |
| 928 | 'PSA key derivation: bits=7 invalid for ECC SECT_K1 (ECC enabled)', |
| 929 | 'PSA key derivation: bits=7 invalid for ECC SECT_R1 (ECC enabled)', |
| 930 | 'PSA key derivation: bits=7 invalid for ECC SECT_R2 (ECC enabled)', |
| 931 | 'PSA raw key agreement: ECDH SECP256R1 (RFC 5903)', |
| 932 | ], |
Manuel Pégourié-Gonnard | e9d9797 | 2023-08-08 18:34:47 +0200 | [diff] [blame] | 933 | 'test_suite_random': [ |
| 934 | 'PSA classic wrapper: ECDSA signature (SECP256R1)', |
| 935 | ], |
Valerio Setti | f01d648 | 2023-08-04 13:51:18 +0200 | [diff] [blame] | 936 | 'test_suite_psa_crypto_pake': [ |
| 937 | 'PSA PAKE: ecjpake size macros', |
Manuel Pégourié-Gonnard | e9d9797 | 2023-08-08 18:34:47 +0200 | [diff] [blame] | 938 | ], |
| 939 | 'test_suite_asn1parse': [ |
| 940 | # This test depends on BIGNUM_C |
| 941 | 'INTEGER too large for mpi', |
| 942 | ], |
| 943 | 'test_suite_asn1write': [ |
| 944 | # Following tests depends on BIGNUM_C |
Manuel Pégourié-Gonnard | 881ce01 | 2023-10-18 10:22:07 +0200 | [diff] [blame] | 945 | re.compile('ASN.1 Write mpi.*'), |
Manuel Pégourié-Gonnard | e9d9797 | 2023-08-08 18:34:47 +0200 | [diff] [blame] | 946 | ], |
Valerio Setti | f01d648 | 2023-08-04 13:51:18 +0200 | [diff] [blame] | 947 | } |
| 948 | } |
| 949 | } |
Przemek Stekiel | 4d13c83 | 2022-10-26 16:11:26 +0200 | [diff] [blame] | 950 | } |
Przemek Stekiel | 4d13c83 | 2022-10-26 16:11:26 +0200 | [diff] [blame] | 951 | |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 952 | def main(): |
Valerio Setti | f075e47 | 2023-10-17 11:03:16 +0200 | [diff] [blame] | 953 | main_results = Results() |
Valerio Setti | aaef0bc | 2023-10-10 09:42:13 +0200 | [diff] [blame] | 954 | |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 955 | try: |
| 956 | parser = argparse.ArgumentParser(description=__doc__) |
Przemek Stekiel | 58bbc23 | 2022-10-24 08:10:10 +0200 | [diff] [blame] | 957 | parser.add_argument('outcomes', metavar='OUTCOMES.CSV', |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 958 | help='Outcome file to analyze') |
Valerio Setti | dfd7ca6 | 2023-10-09 16:30:11 +0200 | [diff] [blame] | 959 | parser.add_argument('specified_tasks', default='all', nargs='?', |
Przemek Stekiel | 992de3c | 2022-11-09 13:54:49 +0100 | [diff] [blame] | 960 | help='Analysis to be done. By default, run all tasks. ' |
| 961 | 'With one or more TASK, run only those. ' |
| 962 | 'TASK can be the name of a single task or ' |
Przemek Stekiel | 85c54ea | 2022-11-17 11:50:23 +0100 | [diff] [blame] | 963 | 'comma/space-separated list of tasks. ') |
Przemek Stekiel | 992de3c | 2022-11-09 13:54:49 +0100 | [diff] [blame] | 964 | parser.add_argument('--list', action='store_true', |
| 965 | help='List all available tasks and exit.') |
Tomás González | b401e11 | 2023-08-11 15:22:04 +0100 | [diff] [blame] | 966 | parser.add_argument('--require-full-coverage', action='store_true', |
| 967 | dest='full_coverage', help="Require all available " |
| 968 | "test cases to be executed and issue an error " |
| 969 | "otherwise. This flag is ignored if 'task' is " |
| 970 | "neither 'all' nor 'analyze_coverage'") |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 971 | options = parser.parse_args() |
Przemek Stekiel | 4e95590 | 2022-10-21 13:42:08 +0200 | [diff] [blame] | 972 | |
Przemek Stekiel | 992de3c | 2022-11-09 13:54:49 +0100 | [diff] [blame] | 973 | if options.list: |
Valerio Setti | dfd7ca6 | 2023-10-09 16:30:11 +0200 | [diff] [blame] | 974 | for task in KNOWN_TASKS: |
Valerio Setti | 5329ff0 | 2023-10-17 09:44:36 +0200 | [diff] [blame] | 975 | print(task) |
Przemek Stekiel | 992de3c | 2022-11-09 13:54:49 +0100 | [diff] [blame] | 976 | sys.exit(0) |
| 977 | |
Valerio Setti | dfd7ca6 | 2023-10-09 16:30:11 +0200 | [diff] [blame] | 978 | if options.specified_tasks == 'all': |
| 979 | tasks_list = KNOWN_TASKS.keys() |
Przemek Stekiel | 992de3c | 2022-11-09 13:54:49 +0100 | [diff] [blame] | 980 | else: |
Valerio Setti | dfd7ca6 | 2023-10-09 16:30:11 +0200 | [diff] [blame] | 981 | tasks_list = re.split(r'[, ]+', options.specified_tasks) |
Valerio Setti | dfd7ca6 | 2023-10-09 16:30:11 +0200 | [diff] [blame] | 982 | for task in tasks_list: |
| 983 | if task not in KNOWN_TASKS: |
Valerio Setti | fb2750e | 2023-10-17 10:11:45 +0200 | [diff] [blame] | 984 | sys.stderr.write('invalid task: {}'.format(task)) |
| 985 | sys.exit(2) |
Przemek Stekiel | 992de3c | 2022-11-09 13:54:49 +0100 | [diff] [blame] | 986 | |
Valerio Setti | dfd7ca6 | 2023-10-09 16:30:11 +0200 | [diff] [blame] | 987 | KNOWN_TASKS['analyze_coverage']['args']['full_coverage'] = options.full_coverage |
Tomás González | b401e11 | 2023-08-11 15:22:04 +0100 | [diff] [blame] | 988 | |
Valerio Setti | fb2750e | 2023-10-17 10:11:45 +0200 | [diff] [blame] | 989 | for task in tasks_list: |
| 990 | test_function = KNOWN_TASKS[task]['test_function'] |
| 991 | test_args = KNOWN_TASKS[task]['args'] |
Valerio Setti | 781c234 | 2023-10-17 12:47:35 +0200 | [diff] [blame] | 992 | test_function(main_results, options.outcomes, test_args) |
Valerio Setti | dfd7ca6 | 2023-10-09 16:30:11 +0200 | [diff] [blame] | 993 | |
Valerio Setti | f6f64cf | 2023-10-17 12:28:26 +0200 | [diff] [blame] | 994 | main_results.info("Overall results: {} warnings and {} errors", |
| 995 | main_results.warning_count, main_results.error_count) |
Valerio Setti | f075e47 | 2023-10-17 11:03:16 +0200 | [diff] [blame] | 996 | |
Valerio Setti | 8d178be | 2023-10-17 12:23:55 +0200 | [diff] [blame] | 997 | sys.exit(0 if (main_results.error_count == 0) else 1) |
Valerio Setti | aaef0bc | 2023-10-10 09:42:13 +0200 | [diff] [blame] | 998 | |
Gilles Peskine | 15c2cbf | 2020-06-25 18:36:28 +0200 | [diff] [blame] | 999 | except Exception: # pylint: disable=broad-except |
| 1000 | # Print the backtrace and exit explicitly with our chosen status. |
| 1001 | traceback.print_exc() |
| 1002 | sys.exit(120) |
| 1003 | |
| 1004 | if __name__ == '__main__': |
| 1005 | main() |