Skip to content

Commit 157e70c

Browse files
committed
Switch "crypto" implementation to Python
This simplifies the build process and avoids needing to ship a vendor'd OpenSSL.
1 parent a6d91fb commit 157e70c

File tree

7 files changed

+128
-524
lines changed

7 files changed

+128
-524
lines changed

.github/workflows/tests.yml

+1-14
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,6 @@ jobs:
6565
if: matrix.os == 'macos-latest'
6666
run: |
6767
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
68-
echo "AIOQUIC_SKIP_TESTS=chacha20" >> $GITHUB_ENV
69-
echo "CFLAGS=-I/usr/local/opt/openssl/include" >> $GITHUB_ENV
70-
echo "LDFLAGS=-L/usr/local/opt/openssl/lib" >> $GITHUB_ENV
71-
- name: Install OpenSSL
72-
if: matrix.os == 'windows-latest'
73-
run: |
74-
choco install openssl --no-progress
75-
echo "INCLUDE=C:\Progra~1\OpenSSL\include" >> $GITHUB_ENV
76-
echo "LIB=C:\Progra~1\OpenSSL\lib" >> $GITHUB_ENV
77-
shell: bash
7868
- name: Run tests
7969
run: |
8070
python -m pip install -U pip setuptools wheel
@@ -136,10 +126,7 @@ jobs:
136126
- name: Build wheels
137127
env:
138128
CIBW_ARCHS: ${{ matrix.arch }}
139-
CIBW_BEFORE_BUILD: python scripts/fetch-vendor.py /tmp/vendor
140-
CIBW_BEFORE_BUILD_WINDOWS: python scripts\fetch-vendor.py C:\cibw\vendor
141-
CIBW_ENVIRONMENT: AIOQUIC_SKIP_TESTS=ipv6,loss CFLAGS=-I/tmp/vendor/include LDFLAGS=-L/tmp/vendor/lib
142-
CIBW_ENVIRONMENT_WINDOWS: AIOQUIC_SKIP_TESTS=ipv6,loss INCLUDE=C:\\cibw\\vendor\\include LIB=C:\\cibw\\vendor\\lib
129+
CIBW_ENVIRONMENT: AIOQUIC_SKIP_TESTS=ipv6,loss
143130
CIBW_SKIP: cp37-* pp37-* *-musllinux*
144131
CIBW_TEST_COMMAND: python -m unittest discover -t {project} -s {project}/tests
145132
# 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)