Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch "crypto" implementation to Python #457

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,10 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install OpenSSL and disable firewall
- name: Disable firewall
if: matrix.os == 'macos-latest'
run: |
brew install openssl
echo "AIOQUIC_SKIP_TESTS=chacha20" >> $GITHUB_ENV
echo "CFLAGS=-I$(brew --prefix openssl)/include" >> $GITHUB_ENV
echo "LDFLAGS=-L$(brew --prefix openssl)/lib" >> $GITHUB_ENV
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
- name: Install OpenSSL
if: matrix.os == 'windows-latest'
run: |
choco install openssl --no-progress
echo "INCLUDE=C:\Progra~1\OpenSSL\include" >> $GITHUB_ENV
echo "LIB=C:\Progra~1\OpenSSL\lib" >> $GITHUB_ENV
shell: bash
- name: Run tests
run: |
python -m pip install -U pip setuptools wheel
Expand Down Expand Up @@ -138,10 +127,7 @@ jobs:
- name: Build wheels
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BEFORE_BUILD: python scripts/fetch-vendor.py /tmp/vendor
CIBW_BEFORE_BUILD_WINDOWS: python scripts\fetch-vendor.py C:\cibw\vendor
CIBW_ENVIRONMENT: AIOQUIC_SKIP_TESTS=ipv6,loss CFLAGS=-I/tmp/vendor/include LDFLAGS=-L/tmp/vendor/lib
CIBW_ENVIRONMENT_WINDOWS: AIOQUIC_SKIP_TESTS=ipv6,loss INCLUDE=C:\\cibw\\vendor\\include LIB=C:\\cibw\\vendor\\lib
CIBW_ENVIRONMENT: AIOQUIC_SKIP_TESTS=ipv6,loss
CIBW_SKIP: cp37-* pp37-* *-musllinux*
CIBW_TEST_COMMAND: python -m unittest discover -t {project} -s {project}/tests
# there are no wheels for cryptography on these platforms
Expand Down
3 changes: 0 additions & 3 deletions scripts/fetch-vendor.json

This file was deleted.

64 changes: 0 additions & 64 deletions scripts/fetch-vendor.py

This file was deleted.

10 changes: 0 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@

if sys.platform == "win32":
extra_compile_args = []
libraries = ["libcrypto", "advapi32", "crypt32", "gdi32", "user32", "ws2_32"]
else:
extra_compile_args = ["-std=c99"]
libraries = ["crypto"]


class bdist_wheel_abi3(bdist_wheel):
Expand All @@ -30,14 +28,6 @@ def get_tag(self):
define_macros=[("Py_LIMITED_API", "0x03080000")],
py_limited_api=True,
),
setuptools.Extension(
"aioquic._crypto",
extra_compile_args=extra_compile_args,
libraries=libraries,
sources=["src/aioquic/_crypto.c"],
define_macros=[("Py_LIMITED_API", "0x03080000")],
py_limited_api=True,
),
],
cmdclass={"bdist_wheel": bdist_wheel_abi3},
)
Loading
Loading