diff options
author | tb <> | 2021-04-14 13:06:53 +0000 |
---|---|---|
committer | tb <> | 2021-04-14 13:06:53 +0000 |
commit | 48831817beec073951d117178729d9f9543bdd30 (patch) | |
tree | b96fdff8ac91f0ace36592d4baf43b6c206493f1 /src | |
parent | 7f6713ddb38478403f8d8ae9ce0ee731b41ae393 (diff) | |
download | openbsd-48831817beec073951d117178729d9f9543bdd30.tar.gz openbsd-48831817beec073951d117178729d9f9543bdd30.tar.bz2 openbsd-48831817beec073951d117178729d9f9543bdd30.zip |
factor argument to catch an alert mismatch into a helper function
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libssl/tlsfuzzer/tlsfuzzer.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/regress/lib/libssl/tlsfuzzer/tlsfuzzer.py b/src/regress/lib/libssl/tlsfuzzer/tlsfuzzer.py index 5db361c1f7..ef1e24e508 100644 --- a/src/regress/lib/libssl/tlsfuzzer/tlsfuzzer.py +++ b/src/regress/lib/libssl/tlsfuzzer/tlsfuzzer.py | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: tlsfuzzer.py,v 1.33 2021/04/13 16:16:06 tb Exp $ | 1 | # $OpenBSD: tlsfuzzer.py,v 1.34 2021/04/14 13:06:53 tb Exp $ |
2 | # | 2 | # |
3 | # Copyright (c) 2020 Theo Buehler <tb@openbsd.org> | 3 | # Copyright (c) 2020 Theo Buehler <tb@openbsd.org> |
4 | # | 4 | # |
@@ -68,13 +68,16 @@ tls13_unsupported_ciphers = [ | |||
68 | "-e", "TLS 1.3 with x448", | 68 | "-e", "TLS 1.3 with x448", |
69 | ] | 69 | ] |
70 | 70 | ||
71 | def substitute_alert(want, got): | ||
72 | return f"Expected alert description \"{want}\" " \ | ||
73 | + f"does not match received \"{got}\"" | ||
74 | |||
71 | # test-tls13-finished.py has 70 failing tests that expect a "decode_error" | 75 | # test-tls13-finished.py has 70 failing tests that expect a "decode_error" |
72 | # instead of the "decrypt_error" sent by tls13_server_finished_recv(). | 76 | # instead of the "decrypt_error" sent by tls13_server_finished_recv(). |
73 | # Both alerts appear to be reasonable in this context, so work around this | 77 | # Both alerts appear to be reasonable in this context, so work around this |
74 | # in the test instead of the library. | 78 | # in the test instead of the library. |
75 | def generate_test_tls13_finished_args(): | 79 | def generate_test_tls13_finished_args(): |
76 | assertion = "Expected alert description \"decode_error\"" | 80 | assertion = substitute_alert("decode_error", "decrypt_error"); |
77 | assertion += " does not match received \"decrypt_error\"" | ||
78 | paddings = [ | 81 | paddings = [ |
79 | ("TLS_AES_128_GCM_SHA256", 0, 1), | 82 | ("TLS_AES_128_GCM_SHA256", 0, 1), |
80 | ("TLS_AES_128_GCM_SHA256", 0, 2), | 83 | ("TLS_AES_128_GCM_SHA256", 0, 2), |
@@ -379,11 +382,9 @@ tls12_tests = TestGroup("TLSv1.2 tests", [ | |||
379 | 382 | ||
380 | Test("test-invalid-compression-methods.py", [ | 383 | Test("test-invalid-compression-methods.py", [ |
381 | "-x", "invalid compression methods", | 384 | "-x", "invalid compression methods", |
382 | "-X", 'Expected alert description "illegal_parameter" ' | 385 | "-X", substitute_alert("illegal_parameter", "decode_error"), |
383 | 'does not match received "decode_error"', | ||
384 | "-x", "only deflate compression method", | 386 | "-x", "only deflate compression method", |
385 | "-X", 'Expected alert description "illegal_parameter" ' | 387 | "-X", substitute_alert("illegal_parameter", "decode_error"), |
386 | 'does not match received "decode_error"', | ||
387 | ]), | 388 | ]), |
388 | 389 | ||
389 | # Without --sig-algs-drop-ok, two tests fail since we do not currently | 390 | # Without --sig-algs-drop-ok, two tests fail since we do not currently |