Skip to content

Commit f6e2b1a

Browse files
committed
Drop support for OpenSSL 1.1.x
1 parent 9974eaa commit f6e2b1a

File tree

21 files changed

+114
-108
lines changed

21 files changed

+114
-108
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ jobs:
157157
fail-fast: false
158158
matrix:
159159
IMAGE:
160-
- {IMAGE: "rhel8", NOXSESSION: "tests", RUNNER: "ubuntu-latest"}
161-
- {IMAGE: "rhel8-fips", NOXSESSION: "tests", RUNNER: "ubuntu-latest", FIPS: true}
162-
- {IMAGE: "bullseye", NOXSESSION: "tests", RUNNER: "ubuntu-latest"}
163160
- {IMAGE: "bookworm", NOXSESSION: "tests", RUNNER: "ubuntu-latest"}
164161
- {IMAGE: "trixie", NOXSESSION: "tests", RUNNER: "ubuntu-latest"}
165162
- {IMAGE: "sid", NOXSESSION: "tests", RUNNER: "ubuntu-latest"}

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Changelog
99
.. note:: This version is not yet released and is under active development.
1010

1111
* **BACKWARDS INCOMPATIBLE:** Support for Python 3.7 has been removed.
12+
* **BACKWARDS INCOMPATIBLE:** Support for OpenSSL 1.1.x has been removed.
13+
OpenSSL 3.0.0 or later is now required. LibreSSL, BoringSSL, and AWS-LC
14+
continue to be supported.
1215
* Removed the deprecated ``get_attribute_for_oid`` method on
1316
:class:`~cryptography.x509.CertificateSigningRequest`. Users should use
1417
:meth:`~cryptography.x509.Attributes.get_attribute_for_oid` instead.

docs/development/c-bindings.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ Caveats
189189
Sometimes, a set of loosely related features are added in the same
190190
version, and it's impractical to create ``#ifdef`` statements for each
191191
one. In that case, it may make sense to either check for a particular
192-
version. For example, to check for OpenSSL 1.1.1 or newer::
192+
version. For example, to check for OpenSSL 3.2.0 or newer::
193193

194-
#if CRYPTOGRAPHY_OPENSSL_111_OR_GREATER
194+
#if CRYPTOGRAPHY_OPENSSL_320_OR_GREATER
195195

196196
Sometimes, the version of a library on a particular platform will have
197197
features that you thought it wouldn't, based on its version.

docs/faq.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ If you have no other libraries using OpenSSL in your process, or they do not
107107
appear to be at fault, it's possible that this is a bug in ``cryptography``.
108108
Please file an `issue`_ with instructions on how to reproduce it.
109109

110-
Installing cryptography with OpenSSL 0.9.8, 1.0.0, 1.0.1, 1.0.2, 1.1.0 fails
111-
----------------------------------------------------------------------------
110+
Installing cryptography with OpenSSL older than 3.0.0 fails
111+
------------------------------------------------------------
112112

113113
The OpenSSL project has dropped support for the 0.9.8, 1.0.0, 1.0.1, 1.0.2,
114-
and 1.1.0 release series. Since they are no longer receiving security patches
114+
1.1.0, and 1.1.1 release series. Since they are no longer receiving security patches
115115
from upstream, ``cryptography`` is also dropping support for them. To fix this
116-
issue you should upgrade to a newer version of OpenSSL (1.1.1 or later). This
117-
may require you to upgrade to a newer operating system.
116+
issue you should upgrade to OpenSSL 3.0.0 or later. This may require you to
117+
upgrade to a newer operating system.
118118

119119
Installing ``cryptography`` fails with ``error: Can not find Rust compiler``
120120
----------------------------------------------------------------------------

docs/installation.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@ Supported platforms
2424
Currently we test ``cryptography`` on Python 3.8+ and PyPy3 7.3.11+ on these
2525
operating systems.
2626

27-
* x86-64 RHEL 8.x
2827
* x86-64 CentOS Stream 9, 10
2928
* x86-64 Fedora (latest)
3029
* x86-64 macOS 13 Ventura and ARM64 macOS 14 Sonoma
3130
* x86-64 Ubuntu 22.04, 24.04, rolling
3231
* ARM64 Ubuntu rolling
3332
* ARMv7l Ubuntu rolling
34-
* x86-64 Debian Bullseye (11.x), Bookworm (12.x), Trixie (13.x), and
35-
Sid (unstable)
33+
* x86-64 Debian Bookworm (12.x), Trixie (13.x), and Sid (unstable)
3634
* x86-64 and ARM64 Alpine (latest)
3735
* 32-bit and 64-bit Python on 64-bit Windows Server 2022
3836

@@ -206,7 +204,7 @@ available from your system package manager.
206204
Then, paste the following into a shell script. You'll need to populate the
207205
``OPENSSL_VERSION`` variable. To do that, visit `openssl.org`_ and find the
208206
latest non-FIPS release version number, then set the string appropriately. For
209-
example, for OpenSSL 1.1.1k, use ``OPENSSL_VERSION="1.1.1k"``.
207+
example, for OpenSSL 3.0.9, use ``OPENSSL_VERSION="3.0.9"``.
210208

211209
When this shell script is complete, you'll find a collection of wheel files in
212210
a directory called ``wheelhouse``. These wheels can be installed by a

src/_cffi_src/openssl/cryptography.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from __future__ import annotations
66

77
INCLUDES = r"""
8-
/* define our OpenSSL API compatibility level to 1.1.0. Any symbols older than
8+
/* define our OpenSSL API compatibility level to 3.0.0. Any symbols older than
99
that will raise an error during compilation. */
10-
#define OPENSSL_API_COMPAT 0x10100000L
10+
#define OPENSSL_API_COMPAT 0x30000000L
1111
1212
#if defined(_WIN32)
1313
#ifndef WIN32_LEAN_AND_MEAN
@@ -49,8 +49,11 @@
4949
#endif
5050
5151
52-
#if OPENSSL_VERSION_NUMBER < 0x10101050
53-
#error "pyca/cryptography MUST be linked with Openssl 1.1.1e or later"
52+
#if !CRYPTOGRAPHY_IS_LIBRESSL && !CRYPTOGRAPHY_IS_BORINGSSL && \
53+
!CRYPTOGRAPHY_IS_AWSLC
54+
#if OPENSSL_VERSION_NUMBER < 0x30000000
55+
#error "pyca/cryptography MUST be linked with OpenSSL 3.0.0 or later"
56+
#endif
5457
#endif
5558
"""
5659

src/_cffi_src/openssl/ssl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,8 @@
476476
static const long Cryptography_HAS_GET_EXTMS_SUPPORT = 1;
477477
#endif
478478
479-
/* in OpenSSL 1.1.0 the SSL_ST values were renamed to TLS_ST and several were
480-
removed */
479+
/* The SSL_ST values were renamed to TLS_ST in OpenSSL and several were
480+
removed, but are still available in LibreSSL, BoringSSL, and AWS-LC */
481481
#if CRYPTOGRAPHY_IS_LIBRESSL || CRYPTOGRAPHY_IS_BORINGSSL \
482482
|| CRYPTOGRAPHY_IS_AWSLC
483483
static const long Cryptography_HAS_SSL_ST = 1;

src/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ __all__ = [
4848
CRYPTOGRAPHY_IS_LIBRESSL: bool
4949
CRYPTOGRAPHY_IS_BORINGSSL: bool
5050
CRYPTOGRAPHY_IS_AWSLC: bool
51-
CRYPTOGRAPHY_OPENSSL_300_OR_GREATER: bool
5251
CRYPTOGRAPHY_OPENSSL_309_OR_GREATER: bool
5352
CRYPTOGRAPHY_OPENSSL_320_OR_GREATER: bool
5453
CRYPTOGRAPHY_OPENSSL_330_OR_GREATER: bool

src/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ name = "cryptography_rust"
3838
crate-type = ["cdylib"]
3939

4040
[lints.rust]
41-
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(CRYPTOGRAPHY_OPENSSL_300_OR_GREATER)', 'cfg(CRYPTOGRAPHY_OPENSSL_309_OR_GREATER)', 'cfg(CRYPTOGRAPHY_OPENSSL_320_OR_GREATER)', 'cfg(CRYPTOGRAPHY_OPENSSL_330_OR_GREATER)', 'cfg(CRYPTOGRAPHY_OPENSSL_350_OR_GREATER)', 'cfg(CRYPTOGRAPHY_IS_LIBRESSL)', 'cfg(CRYPTOGRAPHY_IS_BORINGSSL)', 'cfg(CRYPTOGRAPHY_IS_AWSLC)', 'cfg(CRYPTOGRAPHY_BUILD_OPENSSL_NO_LEGACY)', 'cfg(CRYPTOGRAPHY_OSSLCONF, values("OPENSSL_NO_IDEA", "OPENSSL_NO_CAST", "OPENSSL_NO_BF", "OPENSSL_NO_CAMELLIA", "OPENSSL_NO_SEED", "OPENSSL_NO_SM4", "OPENSSL_NO_RC4"))'] }
41+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(CRYPTOGRAPHY_OPENSSL_309_OR_GREATER)', 'cfg(CRYPTOGRAPHY_OPENSSL_320_OR_GREATER)', 'cfg(CRYPTOGRAPHY_OPENSSL_330_OR_GREATER)', 'cfg(CRYPTOGRAPHY_OPENSSL_350_OR_GREATER)', 'cfg(CRYPTOGRAPHY_IS_LIBRESSL)', 'cfg(CRYPTOGRAPHY_IS_BORINGSSL)', 'cfg(CRYPTOGRAPHY_IS_AWSLC)', 'cfg(CRYPTOGRAPHY_BUILD_OPENSSL_NO_LEGACY)', 'cfg(CRYPTOGRAPHY_OSSLCONF, values("OPENSSL_NO_IDEA", "OPENSSL_NO_CAST", "OPENSSL_NO_BF", "OPENSSL_NO_CAMELLIA", "OPENSSL_NO_SEED", "OPENSSL_NO_SM4", "OPENSSL_NO_RC4"))'] }

src/rust/build.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ fn main() {
1111
if let Ok(version) = env::var("DEP_OPENSSL_VERSION_NUMBER") {
1212
let version = u64::from_str_radix(&version, 16).unwrap();
1313

14-
if version >= 0x3_00_00_00_0 {
15-
println!("cargo:rustc-cfg=CRYPTOGRAPHY_OPENSSL_300_OR_GREATER");
16-
}
1714
if version >= 0x3_00_09_00_0 {
1815
println!("cargo:rustc-cfg=CRYPTOGRAPHY_OPENSSL_309_OR_GREATER");
1916
}

0 commit comments

Comments
 (0)