Skip to content

Commit b92c841

Browse files
alexreaperhulkdependabot[bot]
authored
[44.0.x] backports for libressl 4.1.0 support release (#12848)
* FIPS fixes (#12839) * attempt to fix wycheproof in CI on centos stream9 skip RSA PSS with SHA224 * Update test_rsa.py * Update backend.py * fix * make OpenSSL 3.5 FIPS work This replaces the rsa_pss_cert.pem with a new one that uses a salt length matching the digest length (previously it was max length) * simplify * comment * fix * update with new wycheproof --------- Co-authored-by: Alex Gaynor <[email protected]> * chore(deps): bump openssl-sys from 0.9.107 to 0.9.108 (#12832) Bumps [openssl-sys](https://github.com/sfackler/rust-openssl) from 0.9.107 to 0.9.108. - [Release notes](https://github.com/sfackler/rust-openssl/releases) - [Commits](rust-openssl/rust-openssl@openssl-sys-v0.9.107...openssl-sys-v0.9.108) --- updated-dependencies: - dependency-name: openssl-sys dependency-version: 0.9.108 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * test on libressl 4.1.0 (#12845) * 44.0.3 release * Make wycheproof x25519 and x448 tests more flexible (#12676) * Update test_x448.py * Update test_x25519.py * Update test_x25519.py * Update test_x448.py * fix mitmproxy downstream tests (#12776) * clippy nightly fixes --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Paul Kehrer <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 387ca00 commit b92c841

File tree

57 files changed

+244
-227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+244
-227
lines changed

.github/actions/fetch-vectors/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ runs:
99
with:
1010
repository: "C2SP/wycheproof"
1111
path: "wycheproof"
12-
# Latest commit on the wycheproof master branch, as of Apr 09, 2024.
13-
ref: "cd27d6419bedd83cbd24611ec54b6d4bfdb0cdca" # wycheproof-ref
12+
# Latest commit on the wycheproof master branch, as of May 02, 2025.
13+
ref: "df4e933efef449fc88af0c06e028d425d84a9495" # wycheproof-ref
1414

1515
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1616
with:

.github/downstream.d/mitmproxy.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
case "${1}" in
44
install)
5+
pip install uv
56
git clone --depth=1 https://github.com/mitmproxy/mitmproxy
67
cd mitmproxy
78
git rev-parse HEAD
8-
pip install -e ".[dev]"
9+
uv pip install --system --group dev -e .
910
;;
1011
run)
1112
cd mitmproxy

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ jobs:
4242
- {VERSION: "3.12", NOXSESSION: "tests", OPENSSL: {TYPE: "openssl", VERSION: "3.2.3", CONFIG_FLAGS: "no-legacy", NO_LEGACY: "1"}}
4343
- {VERSION: "3.12", NOXSESSION: "tests", NOXARGS: "--enable-fips=1", OPENSSL: {TYPE: "openssl", CONFIG_FLAGS: "enable-fips", VERSION: "3.1.7"}}
4444
- {VERSION: "3.12", NOXSESSION: "tests", NOXARGS: "--enable-fips=1", OPENSSL: {TYPE: "openssl", CONFIG_FLAGS: "enable-fips", VERSION: "3.2.3"}}
45+
- {VERSION: "3.12", NOXSESSION: "tests", NOXARGS: "--enable-fips=1", OPENSSL: {TYPE: "openssl", CONFIG_FLAGS: "enable-fips", VERSION: "3.5.0"}}
4546
- {VERSION: "3.12", NOXSESSION: "tests", OPENSSL: {TYPE: "openssl", VERSION: "3.4.0"}}
4647
- {VERSION: "3.12", NOXSESSION: "rust,tests", OPENSSL: {TYPE: "libressl", VERSION: "3.9.2"}}
4748
- {VERSION: "3.12", NOXSESSION: "rust,tests", OPENSSL: {TYPE: "libressl", VERSION: "4.0.0"}}
49+
- {VERSION: "3.12", NOXSESSION: "rust,tests", OPENSSL: {TYPE: "libressl", VERSION: "4.1.0"}}
4850
- {VERSION: "3.12", NOXSESSION: "tests-randomorder"}
4951
# Latest commit on the BoringSSL master branch, as of Nov 27, 2024.
5052
- {VERSION: "3.12", NOXSESSION: "rust,tests", OPENSSL: {TYPE: "boringssl", VERSION: "fcef13a49852397a0d39c00be8d7bc2ba1ab6fb9"}}

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
.. _v44-0-3:
5+
6+
44.0.3 - 2025-05-02
7+
~~~~~~~~~~~~~~~~~~~
8+
9+
* Fixed compilation when using LibreSSL 4.1.0.
10+
411
.. _v44-0-2:
512

613
44.0.2 - 2025-03-01

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ rust-version = "1.65.0"
2121
[workspace.dependencies]
2222
asn1 = { version = "0.20.0", default-features = false }
2323
pyo3 = { version = "0.23.5", features = ["abi3"] }
24+
openssl = "0.10.72"
25+
openssl-sys = "0.9.108"
2426

2527
[profile.release]
2628
overflow-checks = true

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build-backend = "maturin"
1414

1515
[project]
1616
name = "cryptography"
17-
version = "44.0.2"
17+
version = "44.0.3"
1818
authors = [
1919
{name = "The Python Cryptographic Authority and individual contributors", email = "[email protected]"}
2020
]
@@ -65,7 +65,7 @@ ssh = ["bcrypt >=3.1.5"]
6565
# All the following are used for our own testing.
6666
nox = ["nox >=2024.04.15", "nox[uv] >=2024.03.02; python_version >= '3.8'"]
6767
test = [
68-
"cryptography_vectors==44.0.2",
68+
"cryptography_vectors==44.0.3",
6969
"pytest >=7.4.0",
7070
"pytest-benchmark >=4.0",
7171
"pytest-cov >=2.10.1",

src/cryptography/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"__version__",
1111
]
1212

13-
__version__ = "44.0.2"
13+
__version__ = "44.0.3"
1414

1515

1616
__author__ = "The Python Cryptographic Authority and individual contributors"

src/cryptography/hazmat/backends/openssl/backend.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,17 @@ def rsa_padding_supported(self, padding: AsymmetricPadding) -> bool:
169169
if isinstance(padding, PKCS1v15):
170170
return True
171171
elif isinstance(padding, PSS) and isinstance(padding._mgf, MGF1):
172-
# SHA1 is permissible in MGF1 in FIPS even when SHA1 is blocked
173-
# as signature algorithm.
174-
if self._fips_enabled and isinstance(
175-
padding._mgf._algorithm, hashes.SHA1
172+
# FIPS 186-4 only allows salt length == digest length for PSS
173+
# It is technically acceptable to set an explicit salt length
174+
# equal to the digest length and this will incorrectly fail, but
175+
# since we don't do that in the tests and this method is
176+
# private, we'll ignore that until we need to do otherwise.
177+
if (
178+
self._fips_enabled
179+
and padding._salt_length != PSS.DIGEST_LENGTH
176180
):
177-
return True
178-
else:
179-
return self.hash_supported(padding._mgf._algorithm)
181+
return False
182+
return self.hash_supported(padding._mgf._algorithm)
180183
elif isinstance(padding, OAEP) and isinstance(padding._mgf, MGF1):
181184
return self._oaep_hash_supported(
182185
padding._mgf._algorithm

src/rust/cryptography-cffi/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn main() {
7171
// This is because we don't want a potentially random build path to end up in the binary because
7272
// CFFI generated code uses the __FILE__ macro in its debug messages.
7373
if let Some(out_dir_str) = Path::new(&out_dir).to_str() {
74-
build.flag_if_supported(format!("-fmacro-prefix-map={}=.", out_dir_str).as_str());
74+
build.flag_if_supported(format!("-fmacro-prefix-map={out_dir_str}").as_str());
7575
}
7676

7777
for python_include in env::split_paths(&python_includes) {

0 commit comments

Comments
 (0)