Skip to content

Commit 5458c1b

Browse files
committed
cross_compatibility should test more sanity policies
1 parent 6467e09 commit 5458c1b

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

tests/integrationv2/common.py

+8
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,14 @@ class Ciphers(object):
511511
"PQ-TLS-1-3-2023-06-01", Protocols.TLS12, False, False, s2n=True, pq=True
512512
)
513513

514+
515+
SECURITY_POLICY_DEFAULT = Cipher(
516+
"default", Protocols.TLS12, False, False, s2n=True, pq=False
517+
)
518+
SECURITY_POLICY_DEFAULT_TLS13 = Cipher(
519+
"default_tls13", Protocols.TLS12, False, False, s2n=True, pq=False
520+
)
521+
514522
SECURITY_POLICY_20210816 = Cipher(
515523
"20210816", Protocols.TLS12, False, False, s2n=True, pq=False
516524
)

tests/integrationv2/providers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def supports_protocol(cls, protocol):
177177
# SSLv3 cannot be negotiated in FIPS mode with libcryptos other than AWS-LC.
178178
if all(
179179
[
180-
protocol == Protocols.SSLv3,
180+
protocol and protocol == Protocols.SSLv3,
181181
get_flag(S2N_FIPS_MODE),
182182
"awslc" not in get_flag(S2N_PROVIDER_VERSION),
183183
]

tests/integrationv2/test_cross_compatibility.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
1010
ALL_TEST_CURVES,
1111
ALL_TEST_CERTS,
1212
)
13-
from common import ProviderOptions, Protocols, data_bytes
13+
from common import Ciphers, ProviderOptions, Protocols, data_bytes
1414
from fixtures import managed_process # lgtm [py/unused-import]
1515
from providers import Provider, S2N, OpenSSL
1616
from utils import invalid_test_parameters, get_parameter_name, to_bytes
1717

18+
S2N_TEST_POLICIES = [
19+
Ciphers.SECURITY_POLICY_DEFAULT,
20+
Ciphers.SECURITY_POLICY_DEFAULT_TLS13,
21+
]
22+
1823
S2N_RESUMPTION_MARKER = to_bytes("Resumed session")
1924
CLOSE_MARKER_BYTES = data_bytes(10)
2025

@@ -177,10 +182,8 @@ def test_s2n_new_server_old_ticket(
177182

178183

179184
@pytest.mark.uncollect_if(func=invalid_test_parameters)
180-
@pytest.mark.parametrize("cipher", ALL_TEST_CIPHERS, ids=get_parameter_name)
181-
@pytest.mark.parametrize("curve", ALL_TEST_CURVES, ids=get_parameter_name)
185+
@pytest.mark.parametrize("cipher", S2N_TEST_POLICIES, ids=get_parameter_name)
182186
@pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
183-
@pytest.mark.parametrize("protocol", RESUMPTION_PROTOCOLS, ids=get_parameter_name)
184187
@pytest.mark.parametrize("provider", [S2N], ids=get_parameter_name)
185188
@pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
186189
def test_s2n_old_client_new_ticket(
@@ -246,10 +249,8 @@ def test_s2n_old_client_new_ticket(
246249

247250

248251
@pytest.mark.uncollect_if(func=invalid_test_parameters)
249-
@pytest.mark.parametrize("cipher", ALL_TEST_CIPHERS, ids=get_parameter_name)
250-
@pytest.mark.parametrize("curve", ALL_TEST_CURVES, ids=get_parameter_name)
252+
@pytest.mark.parametrize("cipher", S2N_TEST_POLICIES, ids=get_parameter_name)
251253
@pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
252-
@pytest.mark.parametrize("protocol", RESUMPTION_PROTOCOLS, ids=get_parameter_name)
253254
@pytest.mark.parametrize("provider", [S2N], ids=get_parameter_name)
254255
@pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
255256
def test_s2n_new_client_old_ticket(

0 commit comments

Comments
 (0)