Skip to content

Commit 7fffb5a

Browse files
committed
Switch "crypto" implementation to Python
This simplifies the build process and avoids needing to ship a vendor'd OpenSSL.
1 parent 9bc1e43 commit 7fffb5a

File tree

7 files changed

+129
-526
lines changed

7 files changed

+129
-526
lines changed

.github/workflows/tests.yml

+2-16
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,10 @@ jobs:
6262
- uses: actions/setup-python@v5
6363
with:
6464
python-version: ${{ matrix.python }}
65-
- name: Install OpenSSL and disable firewall
65+
- name: Disable firewall
6666
if: matrix.os == 'macos-latest'
6767
run: |
68-
brew install openssl
69-
echo "AIOQUIC_SKIP_TESTS=chacha20" >> $GITHUB_ENV
70-
echo "CFLAGS=-I$(brew --prefix openssl)/include" >> $GITHUB_ENV
71-
echo "LDFLAGS=-L$(brew --prefix openssl)/lib" >> $GITHUB_ENV
7268
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
73-
- name: Install OpenSSL
74-
if: matrix.os == 'windows-latest'
75-
run: |
76-
choco install openssl --no-progress
77-
echo "INCLUDE=C:\Progra~1\OpenSSL\include" >> $GITHUB_ENV
78-
echo "LIB=C:\Progra~1\OpenSSL\lib" >> $GITHUB_ENV
79-
shell: bash
8069
- name: Run tests
8170
run: |
8271
python -m pip install -U pip setuptools wheel
@@ -138,10 +127,7 @@ jobs:
138127
- name: Build wheels
139128
env:
140129
CIBW_ARCHS: ${{ matrix.arch }}
141-
CIBW_BEFORE_BUILD: python scripts/fetch-vendor.py /tmp/vendor
142-
CIBW_BEFORE_BUILD_WINDOWS: python scripts\fetch-vendor.py C:\cibw\vendor
143-
CIBW_ENVIRONMENT: AIOQUIC_SKIP_TESTS=ipv6,loss CFLAGS=-I/tmp/vendor/include LDFLAGS=-L/tmp/vendor/lib
144-
CIBW_ENVIRONMENT_WINDOWS: AIOQUIC_SKIP_TESTS=ipv6,loss INCLUDE=C:\\cibw\\vendor\\include LIB=C:\\cibw\\vendor\\lib
130+
CIBW_ENVIRONMENT: AIOQUIC_SKIP_TESTS=ipv6,loss
145131
CIBW_SKIP: cp37-* pp37-* *-musllinux*
146132
CIBW_TEST_COMMAND: python -m unittest discover -t {project} -s {project}/tests
147133
# there are no wheels for cryptography on these platforms

scripts/fetch-vendor.json

-3
This file was deleted.

scripts/fetch-vendor.py

-64
This file was deleted.

setup.py

-10
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55

66
if sys.platform == "win32":
77
extra_compile_args = []
8-
libraries = ["libcrypto", "advapi32", "crypt32", "gdi32", "user32", "ws2_32"]
98
else:
109
extra_compile_args = ["-std=c99"]
11-
libraries = ["crypto"]
1210

1311

1412
class bdist_wheel_abi3(bdist_wheel):
@@ -30,14 +28,6 @@ def get_tag(self):
3028
define_macros=[("Py_LIMITED_API", "0x03080000")],
3129
py_limited_api=True,
3230
),
33-
setuptools.Extension(
34-
"aioquic._crypto",
35-
extra_compile_args=extra_compile_args,
36-
libraries=libraries,
37-
sources=["src/aioquic/_crypto.c"],
38-
define_macros=[("Py_LIMITED_API", "0x03080000")],
39-
py_limited_api=True,
40-
),
4131
],
4232
cmdclass={"bdist_wheel": bdist_wheel_abi3},
4333
)

0 commit comments

Comments
 (0)