Skip to content

Commit d7f4077

Browse files
committed
drop support for openssl < 1.1.1d
This removes the OS random engine, which contained the only CPython PSF licensed code in the repository. Accordingly, that license has now been removed.
1 parent df5893f commit d7f4077

File tree

16 files changed

+8
-1114
lines changed

16 files changed

+8
-1114
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ jobs:
132132
- {IMAGE: "bullseye", TOXENV: "py39", RUNNER: "ubuntu-latest"}
133133
- {IMAGE: "bookworm", TOXENV: "py311", RUNNER: "ubuntu-latest"}
134134
- {IMAGE: "sid", TOXENV: "py311", RUNNER: "ubuntu-latest"}
135-
- {IMAGE: "ubuntu-bionic", TOXENV: "py36", RUNNER: "ubuntu-latest"}
136135
- {IMAGE: "ubuntu-focal", TOXENV: "py38", RUNNER: "ubuntu-latest"}
137136
- {IMAGE: "ubuntu-jammy", TOXENV: "py310", RUNNER: "ubuntu-latest"}
138137
- {IMAGE: "ubuntu-rolling", TOXENV: "py310", RUNNER: "ubuntu-latest"}
@@ -178,7 +177,6 @@ jobs:
178177
run: mkdir -p "${HOME}/.cache/pip"
179178
- run: |
180179
echo "OPENSSL_FORCE_FIPS_MODE=1" >> $GITHUB_ENV
181-
echo "CFLAGS=-DUSE_OSRANDOM_RNG_FOR_TESTING" >> $GITHUB_ENV
182180
if: matrix.IMAGE.FIPS
183181
- run: /venv/bin/python -m pip install -c ci-constraints-requirements.txt 'tox>3' coverage
184182
- run: '/venv/bin/tox -vvv --notest'
@@ -351,7 +349,7 @@ jobs:
351349
- {OS: [self-hosted, macos, ARM64, tart], ARCH: 'arm64'}
352350
PYTHON:
353351
- {VERSION: "3.6", TOXENV: "py36-nocoverage", EXTRA_CFLAGS: ""}
354-
- {VERSION: "3.11", TOXENV: "py311", EXTRA_CFLAGS: "-DUSE_OSRANDOM_RNG_FOR_TESTING"}
352+
- {VERSION: "3.11", TOXENV: "py311", EXTRA_CFLAGS: ""}
355353
exclude:
356354
# We only test latest Python on arm64. The py36 won't work since there's no universal2 binary
357355
- PYTHON: {VERSION: "3.6", TOXENV: "py36-nocoverage", EXTRA_CFLAGS: ""}
@@ -416,7 +414,7 @@ jobs:
416414
- {ARCH: 'x64', WINDOWS: 'win64'}
417415
PYTHON:
418416
- {VERSION: "3.6", TOXENV: "py36-nocoverage", CL_FLAGS: ""}
419-
- {VERSION: "3.11", TOXENV: "py311", CL_FLAGS: "/D USE_OSRANDOM_RNG_FOR_TESTING"}
417+
- {VERSION: "3.11", TOXENV: "py311", CL_FLAGS: ""}
420418
JOB_NUMBER: [0, 1]
421419
name: "${{ matrix.PYTHON.TOXENV }} on ${{ matrix.WINDOWS.WINDOWS }} (part ${{ matrix.JOB_NUMBER }})"
422420
timeout-minutes: 15

LICENSE

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
This software is made available under the terms of *either* of the licenses
22
found in LICENSE.APACHE or LICENSE.BSD. Contributions to cryptography are made
33
under the terms of *both* these licenses.
4-
5-
The code used in the OS random engine is derived from CPython, and is licensed
6-
under the terms of the PSF License Agreement.

LICENSE.PSF

Lines changed: 0 additions & 41 deletions
This file was deleted.

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ include CONTRIBUTING.rst
33
include LICENSE
44
include LICENSE.APACHE
55
include LICENSE.BSD
6-
include LICENSE.PSF
76
include README.rst
87
include tox.ini
98

docs/openssl.rst

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,6 @@ control.
2929
typically shown in hexadecimal (e.g. ``0x1010003f``). This is
3030
not necessarily the same version as it was compiled against.
3131

32-
.. method:: activate_osrandom_engine()
33-
34-
Activates the OS random engine. This will effectively disable OpenSSL's
35-
default CSPRNG.
36-
37-
.. method:: osrandom_engine_implementation()
38-
39-
.. versionadded:: 1.7
40-
41-
Returns the implementation of OS random engine.
42-
43-
.. method:: activate_builtin_random()
44-
45-
This will activate the default OpenSSL CSPRNG.
46-
4732
.. _legacy-provider:
4833

4934
Legacy provider in OpenSSL 3.x

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = attr: cryptography.__version__
44
description = cryptography is a package which provides cryptographic recipes and primitives to Python developers.
55
long_description = file: README.rst
66
long_description_content_type = text/x-rst
7-
license = (Apache-2.0 OR BSD-3-Clause) AND PSF-2.0
7+
license = Apache-2.0 OR BSD-3-Clause
88
url = https://github.com/pyca/cryptography
99
author = The Python Cryptographic Authority and individual contributors
1010
author_email = [email protected]

src/_cffi_src/build_openssl.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ def _extra_compile_args(platform):
9494
"nid",
9595
"objects",
9696
"opensslv",
97-
"osrandom_engine",
9897
"pem",
9998
"pkcs12",
10099
"rand",

src/_cffi_src/openssl/cryptography.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,40 +50,30 @@
5050
#define CRYPTOGRAPHY_LIBRESSL_LESS_THAN_370 (0)
5151
#endif
5252
53-
#if OPENSSL_VERSION_NUMBER < 0x10101000
54-
#error "pyca/cryptography MUST be linked with Openssl 1.1.1 or later"
53+
#if OPENSSL_VERSION_NUMBER < 0x10101040
54+
#error "pyca/cryptography MUST be linked with Openssl 1.1.1d or later"
5555
#endif
5656
5757
#define CRYPTOGRAPHY_OPENSSL_111D_OR_GREATER \
5858
(OPENSSL_VERSION_NUMBER >= 0x10101040 && !CRYPTOGRAPHY_IS_LIBRESSL)
5959
#define CRYPTOGRAPHY_OPENSSL_300_OR_GREATER \
6060
(OPENSSL_VERSION_NUMBER >= 0x30000000 && !CRYPTOGRAPHY_IS_LIBRESSL)
6161
62-
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_111B \
63-
(OPENSSL_VERSION_NUMBER < 0x10101020 || CRYPTOGRAPHY_IS_LIBRESSL)
6462
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_111D \
6563
(OPENSSL_VERSION_NUMBER < 0x10101040 || CRYPTOGRAPHY_IS_LIBRESSL)
6664
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_111E \
6765
(OPENSSL_VERSION_NUMBER < 0x10101050 || CRYPTOGRAPHY_IS_LIBRESSL)
68-
#if (CRYPTOGRAPHY_OPENSSL_LESS_THAN_111D && !CRYPTOGRAPHY_IS_LIBRESSL && \
69-
!defined(OPENSSL_NO_ENGINE)) || defined(USE_OSRANDOM_RNG_FOR_TESTING)
70-
#define CRYPTOGRAPHY_NEEDS_OSRANDOM_ENGINE 1
71-
#else
72-
#define CRYPTOGRAPHY_NEEDS_OSRANDOM_ENGINE 0
73-
#endif
74-
/* Ed25519 support is available from OpenSSL 1.1.1b and LibreSSL 3.7.0. */
66+
/* Ed25519 support is in all supported OpenSSLs as well as LibreSSL 3.7.0. */
7567
#define CRYPTOGRAPHY_HAS_WORKING_ED25519 \
76-
(!CRYPTOGRAPHY_OPENSSL_LESS_THAN_111B || \
68+
(CRYPTOGRAPHY_OPENSSL_111D_OR_GREATER || \
7769
(CRYPTOGRAPHY_IS_LIBRESSL && !CRYPTOGRAPHY_LIBRESSL_LESS_THAN_370))
7870
"""
7971

8072
TYPES = """
8173
static const int CRYPTOGRAPHY_OPENSSL_111D_OR_GREATER;
8274
static const int CRYPTOGRAPHY_OPENSSL_300_OR_GREATER;
8375
84-
static const int CRYPTOGRAPHY_OPENSSL_LESS_THAN_111B;
8576
static const int CRYPTOGRAPHY_OPENSSL_LESS_THAN_111E;
86-
static const int CRYPTOGRAPHY_NEEDS_OSRANDOM_ENGINE;
8777
static const int CRYPTOGRAPHY_HAS_WORKING_ED25519;
8878
8979
static const int CRYPTOGRAPHY_LIBRESSL_LESS_THAN_370;

src/_cffi_src/openssl/osrandom_engine.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)