This update includes a few backwards-incompatible changes. Aside from a
few simple renames, the other incompatibilities are correctness-related.
* **BACKWARDS INCOMPATIBLE:** Removed the deprecated
``PUBLIC_KEY_TYPES``, ``PRIVATE_KEY_TYPES``,
``CERTIFICATE_PRIVATE_KEY_TYPES``, ``CERTIFICATE_ISSUER_PUBLIC_KEY_TYPES``,
and ``CERTIFICATE_PUBLIC_KEY_TYPES`` type aliases. Use
``PublicKeyTypes``, ``PrivateKeyTypes``, ``CertificateIssuerPrivateKeyTypes``,
``CertificateIssuerPublicKeyTypes``, and ``CertificatePublicKeyTypes``
instead. These were deprecated in version 40.0.
* **BACKWARDS INCOMPATIBLE:** :class:`~cryptography.hazmat.primitives.ciphers.algorithms.ChaCha20`
now treats the first 4 bytes of the ``nonce`` as a 32-bit little-endian block
counter (as defined in :rfc:`7539`) and tracks the number of bytes processed.
Attempting to encrypt or decrypt more data than the counter allows before it
would overflow now raises a :class:`ValueError` rather than silently diverging
from RFC 7539. Setting the counter portion of the ``nonce`` to zero allows
encrypting up to 256 GiB with a given nonce.
* **BACKWARDS INCOMPATIBLE:** Loading an X.509 certificate whose ECDSA or DSA
signature ``AlgorithmIdentifier`` contains encoded NULL parameters now raises
a :class:`ValueError`. Such certificates are invalid, but older versions of
Java emitted them; previously they loaded with a deprecation warning.
Complete changelog: https://github.com/pyca/cryptography/blob/49.0.0/CHANGELOG.rst
Full changelog: https://cryptography.io/en/latest/changelog/#v48-0-0
This contains one backwards-incompatible change, but which is in a
failure path where the previous behavior was unexpected.
- BACKWARDS INCOMPATIBLE: Loading an X.509 CRL whose inner
TBSCertList.signature algorithm does not match the outer
signatureAlgorithm now raises ValueError. Previously, such CRLs were
parsed successfully and only rejected during signature validation.
- Added support for ML-KEM key encapsulation and ML-DSA signing when
using OpenSSL 3.5.0 or later
Signed-off-by: Jeremy Cline <jeremycline@microsoft.com>
Full changelog: https://cryptography.io/en/latest/changelog/#v47-0-0
This release includes a number of backwards-incompatible changes:
- Support for binary elliptic curves (SECT* classes) has been removed.
These curves are rarely used and have additional security
considerations that make them undesirable.
- Loading keys with unsupported algorithms or keys with unsupported
explicit curve encodings now raises UnsupportedAlgorithm instead of
ValueError. This change affects load_pem_private_key(),
load_der_private_key(), load_pem_public_key(), load_der_public_key(),
and public_key() when called on certificates with unsupported public
key algorithms.
- When parsing elliptic curve private keys, we now reject keys that
incorrectly encode a private key of the wrong length because such
keys are impossible to process in a constant-time manner. We do not
believe keys with this problem are in wide use, however we may revert
this change based on the feedback we receive.
- SECURITY ISSUE: Fixed an issue where non-contiguous buffers could be
passed to APIs that accept Python buffers, which could lead to buffer
overflow. CVE-2026-39892
This includes a single fix for security issue:
* **SECURITY ISSUE**: Fixed a bug where name constraints were not applied
to peer names during verification when the leaf certificate contains a
wildcard DNS SAN. Ordinary X.509 topologies are not affected by this bug,
including those used by the Web PKI. Credit to **Oleh Konko (1seal)** for
reporting the issue. **CVE-2026-34073**
Changelog (https://cryptography.io/en/latest/changelog/#v46-0-5)
- An attacker could create a malicious public key that reveals portions
of your private key when using certain uncommon elliptic curves
(binary curves). This version now includes additional security checks
to prevent this attack. This issue only affects binary elliptic
curves, which are rarely used in real-world applications. Credit to
**XlabAI Team of Tencent Xuanwu Lab and Atuin Automated Vulnerability
Discovery Engine** for reporting the issue. **CVE-2026-26007**
- Support for SECT binary elliptic curves is deprecated and will be
removed in the next release.
- Removed the deprecated get_attribute_for_oid method on
CertificateSigningRequest. Users should use get_attribute_for_oid()
instead.
- Removed the deprecated CAST5, SEED, IDEA, and Blowfish classes from
the cipher module. These are still available in Decrepit cryptography.
- In X.509, when performing a PSS signature with a SHA-3 hash, it is now
encoded with the official NIST SHA3 OID.
- Added support for free-threaded Python 3.14.
The upstream release fixes a single issue:
- Fixed decrypting PKCS#8 files encrypted with SHA1-RC4. (This is not
considered secure, and is supported only for backwards compatibility.)
Fixes rhbz #2371350
This fixes two issues from v45:
- Fixed decrypting PKCS#8 files encrypted with long salts (this impacts keys encrypted by Bouncy Castle).
- Fixed decrypting PKCS#8 files encrypted with DES-CBC-MD5. While wildly insecure, this remains prevalent.
This update includes two backwards-incompatible changes with v44:
- Made SSH private key loading more consistent with other private key
loading:
:func:`~cryptography.hazmat.primitives.serialization.load_ssh_private_key`
now raises a TypeError if the key is unencrypted but a password is
provided (previously no exception was raised), and raises a
TypeError if the key is encrypted but no password is provided
(previously a ValueError was raised).
- The :meth:`VerifiedClient.subject
<cryptography.x509.verification.VerifiedClient.subjects>` property
can now be None since a custom extension policy may allow
certificates without a Subject Alternative Name extension.
Full changelog: https://github.com/pyca/cryptography/blob/45.0.2/CHANGELOG.rst
This release is largely adding new features. One behavioral which might
cause issues is:
- Enforce the RFC 5280 requirement that extended key usage extensions must not be empty.
Complete changelog: https://github.com/pyca/cryptography/blob/44.0.0/CHANGELOG.rst
Upstream switched to maturin in v43[0]. Since we fiddle with the
lockfile maturin wants to update it since upstream configures `lock =
true`. Turn that off.
This fixes the v43 build in rawhide.
[0] https://github.com/pyca/cryptography/pull/8815
[skip changelog]
Additionally, this builds the package with OPENSSL_NO_ENGINE=1
This drops the skip-overflow-tests-32bit.patch as its included in
v43.0.0. It picks up the patch in
https://github.com/pyca/cryptography/pull/11328 to allow building with
OPENSSL_NO_ENGINE=1.
Commit 7b18e1445d ("Update to 41.0.3") introduces a patch that was
applied behind a conditional. This is no longer the case, so revert back
to letting autosetup apply all patches.
[skip changelog]
PyO3 doesn't support Python 3.13 until 0.22, but cryptography 0.42 is
using 0.20 at the moment. Use ABI3 forward compatibility for ELN builds
until cryptography updates.
The Rawhide build is using crates from the distro which must be setting
this in some way, but I'm not familiar enough with PyO3 or Fedora's Rust
packaging to find it quickly.
Fixes rhbz#2295602
There is no additional dependency generated by it, other than tox and tox-current-env.
There is no tox configuration in the source tarball.
If desired, there is a [test] extra, so we could use -x test instead,
but that would break the %if 0%{?fedora} tests dependencies separation.
This reverts commit 2220bc3f08 and bumps
the version up from 42.0.5 to 42.0.8.
Additionally, a dependency on the openssl-devel-engine is necessary.
Longer-term this should be dropped[0].
[0] https://fedoraproject.org/wiki/Changes/OpensslDeprecateEngine
Co-authored-by: Christian Heimes <cheimes@redhat.com>