Skip to content

Commit 75a3a4c

Browse files
committed
Address Feedback
1 parent ab69205 commit 75a3a4c

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

tests/integrationv2/test_pq_handshake.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,32 @@
2626
]
2727

2828
EXPECTED_RESULTS = {
29-
# The tuple keys have the form (client_{cipher, kem_group}, server_{cipher, kem_group})
3029
(Ciphers.PQ_TLS_1_0_2023_01, Ciphers.PQ_TLS_1_0_2023_01):
3130
{"cipher": "TLS_AES_256_GCM_SHA384",
32-
"kem": None, "kem_group": "_kyber-512-r3"},
31+
"kem_group": "_kyber-512-r3"},
3332
(KemGroups.P384_KYBER768R3, Ciphers.PQ_TLS_1_3_2023_06_01):
34-
{"cipher": "AES256_GCM_SHA384", "kem": None,
35-
"kem_group": "secp384r1_kyber-768-r3"},
33+
{"cipher": "AES256_GCM_SHA384",
34+
"kem_group": "secp384r1_kyber-768-r3"},
3635
(KemGroups.P521_KYBER1024R3, Ciphers.PQ_TLS_1_3_2023_06_01):
37-
{"cipher": "AES256_GCM_SHA384", "kem": None,
38-
"kem_group": "secp521r1_kyber-1024-r3"},
36+
{"cipher": "AES256_GCM_SHA384",
37+
"kem_group": "secp521r1_kyber-1024-r3"},
3938
(Ciphers.PQ_TLS_1_3_2023_06_01, KemGroups.X25519Kyber768Draft00):
4039
{"cipher": "TLS_AES_256_GCM_SHA384",
41-
"kem": None,
4240
"kem_group": "X25519Kyber768Draft00"},
4341
(Ciphers.PQ_TLS_1_3_2023_06_01, KemGroups.SecP256r1Kyber768Draft00):
4442
{"cipher": "TLS_AES_256_GCM_SHA384",
45-
"kem": None,
4643
"kem_group": "SecP256r1Kyber768Draft00"},
4744
(Ciphers.PQ_TLS_1_3_2023_06_01, Ciphers.PQ_TLS_1_3_2023_06_01):
4845
{"cipher": "TLS_AES_256_GCM_SHA384",
49-
"kem": None,
5046
"kem_group": "SecP256r1Kyber768Draft00"},
5147
(Ciphers.PQ_TLS_1_3_2023_06_01, Ciphers.KMS_TLS_1_0_2018_10):
5248
{"cipher": "ECDHE-RSA-AES256-GCM-SHA384",
53-
"kem": None,
5449
"kem_group": None},
5550
(Ciphers.KMS_TLS_1_0_2018_10, Ciphers.PQ_TLS_1_3_2023_06_01):
5651
{"cipher": "ECDHE-RSA-AES128-GCM-SHA256",
57-
"kem": None,
5852
"kem_group": None},
5953
(Ciphers.KMS_TLS_1_0_2018_10, Ciphers.KMS_TLS_1_0_2018_10):
6054
{"cipher": "ECDHE-RSA-AES256-GCM-SHA384",
61-
"kem": None,
6255
"kem_group": None},
6356
}
6457

@@ -95,16 +88,12 @@ def assert_s2n_negotiation_parameters(s2n_results, expected_result):
9588
if expected_result is not None:
9689
assert to_bytes(
9790
("Cipher negotiated: " + expected_result['cipher'])) in s2n_results.stdout
98-
if expected_result['kem']:
99-
assert to_bytes(
100-
("KEM: " + expected_result['kem'])) in s2n_results.stdout
101-
assert to_bytes(PQ_ENABLED_FLAG) in s2n_results.stdout
10291
if expected_result['kem_group']:
10392
# Purposefully leave off the "KEM Group: " prefix in order to perform partial matches
10493
# without specifying the curve.
10594
assert to_bytes(expected_result['kem_group']) in s2n_results.stdout
10695
assert to_bytes(PQ_ENABLED_FLAG) in s2n_results.stdout
107-
if not expected_result['kem'] and not expected_result['kem_group']:
96+
if not expected_result['kem_group']:
10897
assert to_bytes(PQ_ENABLED_FLAG) not in s2n_results.stdout
10998
assert to_bytes("Curve:") in s2n_results.stdout
11099

@@ -161,7 +150,7 @@ def test_s2nc_to_s2nd_pq_handshake(managed_process, protocol, certificate, clien
161150
# If PQ is not enabled in s2n, we expect classic handshakes to be negotiated.
162151
# Leave the expected cipher blank, as there are multiple possibilities - the
163152
# important thing is that kem and kem_group are NONE.
164-
expected_result = {"cipher": "", "kem": None, "kem_group": None}
153+
expected_result = {"cipher": "", "kem_group": None}
165154

166155
# Client and server are both s2n; can make meaningful assertions about negotiation for both
167156
for results in client.get_results():

0 commit comments

Comments
 (0)