Skip to content

Commit 18e4b3f

Browse files
Merge pull request Mbed-TLS#9857 from gilles-peskine-arm/psa-storage-test-cases-never-supported-negative-3.6
Backport 3.6: Switch generate_psa_test.py to automatic dependencies for negative test cases
2 parents c1b1aa3 + a6c1f56 commit 18e4b3f

File tree

2 files changed

+7
-48
lines changed

2 files changed

+7
-48
lines changed

tests/scripts/analyze_outcomes.py

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -33,41 +33,6 @@ def _has_word_re(words: typing.Iterable[str],
3333
r'.*\b(?:' + r'|'.join(words) + r')\b.*',
3434
re.DOTALL)
3535

36-
# generate_psa_tests.py generates test cases involving cryptographic
37-
# mechanisms (key types, families, algorithms) that are declared but
38-
# not implemented. Until we improve the Python scripts, ignore those
39-
# test cases in the analysis.
40-
# https://github.com/Mbed-TLS/mbedtls/issues/9572
41-
_PSA_MECHANISMS_NOT_IMPLEMENTED = [
42-
r'CBC_MAC',
43-
r'DETERMINISTIC_DSA',
44-
r'DET_DSA',
45-
r'DSA',
46-
r'ECC_KEY_PAIR\(BRAINPOOL_P_R1\) (?:160|192|224|320)-bit',
47-
r'ECC_KEY_PAIR\(SECP_K1\) 225-bit',
48-
r'ECC_PAIR\(BP_R1\) (?:160|192|224|320)-bit',
49-
r'ECC_PAIR\(SECP_K1\) 225-bit',
50-
r'ECC_PUBLIC_KEY\(BRAINPOOL_P_R1\) (?:160|192|224|320)-bit',
51-
r'ECC_PUBLIC_KEY\(SECP_K1\) 225-bit',
52-
r'ECC_PUB\(BP_R1\) (?:160|192|224|320)-bit',
53-
r'ECC_PUB\(SECP_K1\) 225-bit',
54-
r'ED25519PH',
55-
r'ED448PH',
56-
r'PEPPER',
57-
r'PURE_EDDSA',
58-
r'SECP_R2',
59-
r'SECT_K1',
60-
r'SECT_R1',
61-
r'SECT_R2',
62-
r'SHAKE256_512',
63-
r'SHA_512_224',
64-
r'SHA_512_256',
65-
r'TWISTED_EDWARDS',
66-
r'XTS',
67-
]
68-
PSA_MECHANISM_NOT_IMPLEMENTED_SEARCH_RE = \
69-
_has_word_re(_PSA_MECHANISMS_NOT_IMPLEMENTED)
70-
7136
IGNORED_TESTS = {
7237
'ssl-opt': [
7338
# We don't run ssl-opt.sh with Valgrind on the CI because
@@ -237,18 +202,6 @@ def _has_word_re(words: typing.Iterable[str],
237202
'PSA import DH_PUBLIC_KEY(RFC7919) 2048-bit group not supported',
238203
],
239204
'test_suite_psa_crypto_op_fail.generated': [
240-
# Ignore mechanisms that are not implemented, except
241-
# for test cases that assume the mechanism is not supported.
242-
_has_word_re(_PSA_MECHANISMS_NOT_IMPLEMENTED,
243-
exclude=(r'.*: !(?:' +
244-
r'|'.join(_PSA_MECHANISMS_NOT_IMPLEMENTED) +
245-
r')\b')),
246-
# Incorrect dependency generation. To be fixed as part of the
247-
# resolution of https://github.com/Mbed-TLS/mbedtls/issues/9167
248-
# by forward-porting the commit
249-
# "PSA test case generation: dependency inference class: operation fail"
250-
# from https://github.com/Mbed-TLS/mbedtls/pull/9025 .
251-
re.compile(r'.* with (?:DH|ECC)_(?:KEY_PAIR|PUBLIC_KEY)\(.*'),
252205
# We don't test this unusual, but sensible configuration.
253206
# https://github.com/Mbed-TLS/mbedtls/issues/9592
254207
re.compile(r'.*: !ECDSA but DETERMINISTIC_ECDSA with ECC_.*'),
@@ -265,6 +218,12 @@ def _has_word_re(words: typing.Iterable[str],
265218
# differing from PSA_WANT_ALG_RSA_PSS.
266219
# https://github.com/Mbed-TLS/mbedtls/issues/9578
267220
re.compile(r'PSA sign RSA_PSS_ANY_SALT.*!(?:MD|RIPEMD|SHA).*'),
221+
# We don't test with ECDH disabled but the key type enabled.
222+
# https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/161
223+
re.compile(r'PSA key_agreement.* !ECDH with ECC_KEY_PAIR\(.*'),
224+
# We don't test with FFDH disabled but the key type enabled.
225+
# https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/160
226+
re.compile(r'PSA key_agreement.* !FFDH with DH_KEY_PAIR\(.*'),
268227
],
269228
'test_suite_psa_crypto_op_fail.misc': [
270229
# We don't test this unusual, but sensible configuration.

0 commit comments

Comments
 (0)