Skip to content

Commit

Permalink
auto formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
johubertj committed Mar 1, 2025
1 parent dda8ca6 commit d1e8c39
Show file tree
Hide file tree
Showing 17 changed files with 226 additions and 37 deletions.
7 changes: 6 additions & 1 deletion tests/integrationv2/test_client_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,12 @@ def test_client_auth_with_s2n_server_using_nonmatching_certs(
@pytest.mark.parametrize("cipher", ALL_TEST_CIPHERS, ids=get_parameter_name)
@pytest.mark.parametrize("certificate", CERTS_TO_TEST, ids=get_parameter_name)
def test_client_auth_with_s2n_client_no_cert(
managed_process, provider, other_provider, protocol, cipher, certificate # noqa: F811
managed_process,
provider,
other_provider,
protocol,
cipher,
certificate, # noqa: F811
):
port = next(available_ports)

Expand Down
5 changes: 4 additions & 1 deletion tests/integrationv2/test_dynamic_record_sizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
PROTOCOLS,
)
from common import ProviderOptions, data_bytes
from fixtures import custom_mtu, managed_process # lgtm [py/unused-import] # noqa: F401
from fixtures import (
custom_mtu,
managed_process,
) # lgtm [py/unused-import] # noqa: F401
from providers import Provider, S2N, OpenSSL, Tcpdump
from utils import (
invalid_test_parameters,
Expand Down
8 changes: 7 additions & 1 deletion tests/integrationv2/test_early_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,13 @@ def test_s2n_client_with_early_data(
@pytest.mark.parametrize("provider", SERVER_PROVIDERS, ids=get_parameter_name)
@pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
def test_s2n_client_without_early_data(
managed_process, tmp_path, cipher, certificate, protocol, provider, other_provider # noqa: F811
managed_process,
tmp_path,
cipher,
certificate,
protocol,
provider,
other_provider, # noqa: F811
):
early_data_file = str(tmp_path / EARLY_DATA_FILE)
early_data = get_early_data_bytes(early_data_file, MAX_EARLY_DATA)
Expand Down
8 changes: 7 additions & 1 deletion tests/integrationv2/test_external_psk.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,13 @@ def test_s2n_client_multiple_psks(
@pytest.mark.parametrize("psk_identity", PSK_IDENTITY_LIST, ids=get_parameter_name)
@pytest.mark.parametrize("psk_secret", PSK_SECRET_LIST, ids=get_parameter_name)
def test_s2n_client_psk_handshake_failure(
managed_process, cipher, curve, protocol, provider, psk_identity, psk_secret # noqa: F811
managed_process,
cipher,
curve,
protocol,
provider,
psk_identity,
psk_secret, # noqa: F811
):
port = next(available_ports)
random_bytes = data_bytes(10)
Expand Down
15 changes: 13 additions & 2 deletions tests/integrationv2/test_fragmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@
@pytest.mark.parametrize("protocol", PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("certificate", CERTIFICATES_TO_TEST, ids=get_parameter_name)
def test_s2n_server_low_latency(
managed_process, cipher, provider, other_provider, protocol, certificate # noqa: F811
managed_process,
cipher,
provider,
other_provider,
protocol,
certificate, # noqa: F811
):
if provider is OpenSSL and "openssl-1.0.2" in provider.get_version():
pytest.skip(
Expand Down Expand Up @@ -97,7 +102,13 @@ def invalid_test_parameters_frag_len(*args, **kwargs):
"frag_len", [512, 2048, 8192, 12345, 16384], ids=get_parameter_name
)
def test_s2n_server_framented_data(
managed_process, cipher, provider, other_provider, protocol, certificate, frag_len # noqa: F811
managed_process,
cipher,
provider,
other_provider,
protocol,
certificate,
frag_len, # noqa: F811
):
if provider is OpenSSL and "openssl-1.0.2" in provider.get_version():
pytest.skip(
Expand Down
14 changes: 12 additions & 2 deletions tests/integrationv2/test_happy_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@
@pytest.mark.parametrize("protocol", PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
def test_s2n_server_happy_path(
managed_process, cipher, provider, curve, protocol, certificate # noqa: F811
managed_process,
cipher,
provider,
curve,
protocol,
certificate, # noqa: F811
):
port = next(available_ports)

Expand Down Expand Up @@ -94,7 +99,12 @@ def test_s2n_server_happy_path(
@pytest.mark.parametrize("protocol", PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
def test_s2n_client_happy_path(
managed_process, cipher, provider, curve, protocol, certificate # noqa: F811
managed_process,
cipher,
provider,
curve,
protocol,
certificate, # noqa: F811
):
port = next(available_ports)

Expand Down
24 changes: 21 additions & 3 deletions tests/integrationv2/test_hello_retry_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ def test_nothing():
@pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
@pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
def test_hrr_with_s2n_as_client(
managed_process, cipher, provider, other_provider, curve, protocol, certificate # noqa: F811
managed_process,
cipher,
provider,
other_provider,
curve,
protocol,
certificate, # noqa: F811
):
if curve == S2N_DEFAULT_CURVE:
pytest.skip("No retry if server curve matches client curve")
Expand Down Expand Up @@ -109,7 +115,13 @@ def test_hrr_with_s2n_as_client(
@pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
@pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
def test_hrr_with_s2n_as_server(
managed_process, cipher, provider, other_provider, curve, protocol, certificate # noqa: F811
managed_process,
cipher,
provider,
other_provider,
curve,
protocol,
certificate, # noqa: F811
):
port = next(available_ports)

Expand Down Expand Up @@ -175,7 +187,13 @@ def test_hrr_with_s2n_as_server(
@pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
@pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
def test_hrr_with_default_keyshare(
managed_process, cipher, provider, other_provider, curve, protocol, certificate # noqa: F811
managed_process,
cipher,
provider,
other_provider,
curve,
protocol,
certificate, # noqa: F811
):
port = next(available_ports)

Expand Down
12 changes: 10 additions & 2 deletions tests/integrationv2/test_key_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ def test_nothing():
@pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
@pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
def test_s2n_server_key_update(
managed_process, cipher, provider, other_provider, protocol # noqa: F811
managed_process,
cipher,
provider,
other_provider,
protocol, # noqa: F811
):
host = "localhost"
port = next(available_ports)
Expand Down Expand Up @@ -83,7 +87,11 @@ def test_s2n_server_key_update(
@pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
@pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
def test_s2n_client_key_update(
managed_process, cipher, provider, other_provider, protocol # noqa: F811
managed_process,
cipher,
provider,
other_provider,
protocol, # noqa: F811
):
host = "localhost"
port = next(available_ports)
Expand Down
51 changes: 44 additions & 7 deletions tests/integrationv2/test_npn.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@


def s2n_client_npn_handshake(
managed_process, cipher, curve, certificate, protocol, provider, server_list # noqa: F811
managed_process,
cipher,
curve,
certificate,
protocol,
provider,
server_list, # noqa: F811
):
options = ProviderOptions(
port=next(available_ports),
Expand Down Expand Up @@ -76,7 +82,12 @@ def s2n_client_npn_handshake(
@pytest.mark.parametrize("protocol", TLS_PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
def test_s2n_client_npn(
managed_process, cipher, curve, certificate, protocol, provider # noqa: F811
managed_process,
cipher,
curve,
certificate,
protocol,
provider, # noqa: F811
):
s2n_client, server = s2n_client_npn_handshake(
managed_process,
Expand Down Expand Up @@ -112,7 +123,12 @@ def test_s2n_client_npn(
@pytest.mark.parametrize("protocol", TLS_PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
def test_s2n_client_npn_server_preference(
managed_process, cipher, curve, certificate, protocol, provider # noqa: F811
managed_process,
cipher,
curve,
certificate,
protocol,
provider, # noqa: F811
):
s2n_client, server = s2n_client_npn_handshake(
managed_process,
Expand Down Expand Up @@ -148,7 +164,12 @@ def test_s2n_client_npn_server_preference(
@pytest.mark.parametrize("protocol", TLS_PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
def test_s2n_client_npn_no_overlap(
managed_process, cipher, curve, certificate, protocol, provider # noqa: F811
managed_process,
cipher,
curve,
certificate,
protocol,
provider, # noqa: F811
):
s2n_client, server = s2n_client_npn_handshake(
managed_process,
Expand All @@ -173,7 +194,13 @@ def test_s2n_client_npn_no_overlap(


def s2n_server_npn_handshake(
managed_process, cipher, curve, certificate, protocol, provider, server_list # noqa: F811
managed_process,
cipher,
curve,
certificate,
protocol,
provider,
server_list, # noqa: F811
):
options = ProviderOptions(
port=next(available_ports),
Expand Down Expand Up @@ -213,7 +240,12 @@ def s2n_server_npn_handshake(
@pytest.mark.parametrize("protocol", TLS_PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
def test_s2n_server_npn(
managed_process, cipher, curve, certificate, protocol, provider # noqa: F811
managed_process,
cipher,
curve,
certificate,
protocol,
provider, # noqa: F811
):
# We only send one protocol on the s2n server
# due to the fact that it re-purposes the alpn list(which only sends one protocol)
Expand Down Expand Up @@ -253,7 +285,12 @@ def test_s2n_server_npn(
@pytest.mark.parametrize("protocol", TLS_PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
def test_s2n_server_npn_no_overlap(
managed_process, cipher, curve, certificate, protocol, provider # noqa: F811
managed_process,
cipher,
curve,
certificate,
protocol,
provider, # noqa: F811
):
client, s2n_server = s2n_server_npn_handshake(
managed_process,
Expand Down
16 changes: 14 additions & 2 deletions tests/integrationv2/test_ocsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
@pytest.mark.parametrize("protocol", PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("certificate", OCSP_CERTS, ids=get_parameter_name)
def test_s2n_client_ocsp_response(
managed_process, cipher, provider, other_provider, curve, protocol, certificate # noqa: F811
managed_process,
cipher,
provider,
other_provider,
curve,
protocol,
certificate, # noqa: F811
):
if "boringssl" in get_flag(S2N_PROVIDER_VERSION):
pytest.skip("s2n-tls client with boringssl does not support ocsp")
Expand Down Expand Up @@ -86,7 +92,13 @@ def test_s2n_client_ocsp_response(
@pytest.mark.parametrize("protocol", PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("certificate", OCSP_CERTS, ids=get_parameter_name)
def test_s2n_server_ocsp_response(
managed_process, cipher, provider, other_provider, curve, protocol, certificate # noqa: F811
managed_process,
cipher,
provider,
other_provider,
curve,
protocol,
certificate, # noqa: F811
):
port = next(available_ports)

Expand Down
8 changes: 6 additions & 2 deletions tests/integrationv2/test_pq_handshake.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ def test_s2nc_to_s2nd_pq_handshake(
ids=get_parameter_name,
)
def test_s2nc_to_awslc_pq_handshake(
managed_process, s2n_client_policy, awslc_server_group # noqa: F811
managed_process,
s2n_client_policy,
awslc_server_group, # noqa: F811
):
if not pq_enabled():
pytest.skip("PQ not enabled")
Expand Down Expand Up @@ -260,7 +262,9 @@ def test_s2nc_to_awslc_pq_handshake(
ids=get_parameter_name,
)
def test_s2nd_to_awslc_pq_handshake(
managed_process, s2n_server_policy, awslc_client_group # noqa: F811
managed_process,
s2n_server_policy,
awslc_client_group, # noqa: F811
):
if not pq_enabled():
pytest.skip("PQ not enabled")
Expand Down
16 changes: 14 additions & 2 deletions tests/integrationv2/test_record_padding.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ def test_nothing():
@pytest.mark.parametrize("certificate", MINIMAL_TEST_CERTS, ids=get_parameter_name)
@pytest.mark.parametrize("padding_size", PADDING_SIZES, ids=get_parameter_name)
def test_s2n_server_handles_padded_records(
managed_process, cipher, provider, curve, protocol, certificate, padding_size # noqa: F811
managed_process,
cipher,
provider,
curve,
protocol,
certificate,
padding_size, # noqa: F811
):
port = next(available_ports)

Expand Down Expand Up @@ -148,7 +154,13 @@ def test_s2n_server_handles_padded_records(
@pytest.mark.parametrize("certificate", MINIMAL_TEST_CERTS, ids=get_parameter_name)
@pytest.mark.parametrize("padding_size", PADDING_SIZES, ids=get_parameter_name)
def test_s2n_client_handles_padded_records(
managed_process, cipher, provider, curve, protocol, certificate, padding_size # noqa: F811
managed_process,
cipher,
provider,
curve,
protocol,
certificate,
padding_size, # noqa: F811
):
port = next(available_ports)

Expand Down
Loading

0 comments on commit d1e8c39

Please sign in to comment.