From 8a06e864608189954c752cfabbbb6e54d3c6431f Mon Sep 17 00:00:00 2001 From: "Kirill A. Korinsky" Date: Mon, 8 Jul 2024 14:48:58 +0100 Subject: [PATCH 1/2] LibreSSL loads all cipher by default, and doesn't support add_cipher --- src/aioquic/_crypto.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/aioquic/_crypto.c b/src/aioquic/_crypto.c index b03c38db3..768ff9292 100644 --- a/src/aioquic/_crypto.c +++ b/src/aioquic/_crypto.c @@ -407,10 +407,13 @@ PyInit__crypto(void) PyModule_AddObject(m, "HeaderProtection", HeaderProtectionType); // ensure required ciphers are initialised + // LibreSSL loads all cipher by default, and doesn't support add_cipher +#ifndef LIBRESSL_VERSION_NUMBER EVP_add_cipher(EVP_aes_128_ecb()); EVP_add_cipher(EVP_aes_128_gcm()); EVP_add_cipher(EVP_aes_256_ecb()); EVP_add_cipher(EVP_aes_256_gcm()); +#endif return m; } From dee67d20aebf4f0343cb724c970fbf20d33e03b9 Mon Sep 17 00:00:00 2001 From: "Kirill A. Korinsky" Date: Mon, 8 Jul 2024 15:15:57 +0100 Subject: [PATCH 2/2] Allow to skip ED448 tests --- tests/test_asyncio.py | 1 + tests/test_tls.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_asyncio.py b/tests/test_asyncio.py index 989b16455..3a52b1dfd 100644 --- a/tests/test_asyncio.py +++ b/tests/test_asyncio.py @@ -196,6 +196,7 @@ async def test_connect_and_serve_with_ed25519_certificate(self): ) ) + @skipIf("ed448" in SKIP_TESTS, "Skipping ed448 tests") @asynctest async def test_connect_and_serve_with_ed448_certificate(self): await self._test_connect_and_serve_with_certificate( diff --git a/tests/test_tls.py b/tests/test_tls.py index 0ed911ba7..af0f9052f 100644 --- a/tests/test_tls.py +++ b/tests/test_tls.py @@ -2,7 +2,7 @@ import datetime import ssl from functools import partial -from unittest import TestCase +from unittest import TestCase, skipIf from unittest.mock import patch from aioquic import tls @@ -49,6 +49,7 @@ SERVER_CACERTFILE, SERVER_CERTFILE, SERVER_KEYFILE, + SKIP_TESTS, generate_ec_certificate, generate_ed448_certificate, generate_ed25519_certificate, @@ -583,6 +584,7 @@ def test_handshake_with_ed25519_certificate(self): *generate_ed25519_certificate(common_name="example.com") ) + @skipIf("ed448" in SKIP_TESTS, "Skipping ed448 tests") def test_handshake_with_ed448_certificate(self): self._test_handshake_with_certificate( *generate_ed448_certificate(common_name="example.com")