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

Backport fix for 40.0.1 #8603

Merged
merged 3 commits into from
Mar 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
Changelog
=========

.. _v40-0-1:

40.0.1 - 2023-03-24
~~~~~~~~~~~~~~~~~~~

* Fixed a bug where certain operations would fail if an object happened to be
in the top-half of the memory-space. This only impacted 32-bit systems.

.. _v40-0-0:

40.0.0 - 2023-03-24
~~~~~~~~~~~~~~~~~~~


* **BACKWARDS INCOMPATIBLE:** As announced in the 39.0.0 changelog, the way
``cryptography`` links OpenSSL has changed. This only impacts users who
build ``cryptography`` from source (i.e., not from a ``wheel``), and
Expand Down
4 changes: 2 additions & 2 deletions src/cryptography/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"__copyright__",
]

__version__ = "40.0.0"
__version__ = "40.0.1"

__author__ = "The Python Cryptographic Authority and individual contributors"
__copyright__ = f"Copyright 2013-2022 {__author__}"
__copyright__ = f"Copyright 2013-2023 {__author__}"
4 changes: 2 additions & 2 deletions src/cryptography/hazmat/backends/openssl/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ def _evp_pkey_to_private_key(
return _X448PrivateKey(self, evp_pkey)
elif key_type == self._lib.EVP_PKEY_X25519:
return rust_openssl.x25519.private_key_from_ptr(
int(self._ffi.cast("intptr_t", evp_pkey))
int(self._ffi.cast("uintptr_t", evp_pkey))
)
elif key_type == getattr(self._lib, "EVP_PKEY_ED448", None):
# EVP_PKEY_ED448 is not present in CRYPTOGRAPHY_IS_LIBRESSL
Expand Down Expand Up @@ -771,7 +771,7 @@ def _evp_pkey_to_public_key(self, evp_pkey) -> PublicKeyTypes:
return _X448PublicKey(self, evp_pkey)
elif key_type == self._lib.EVP_PKEY_X25519:
return rust_openssl.x25519.public_key_from_ptr(
int(self._ffi.cast("intptr_t", evp_pkey))
int(self._ffi.cast("uintptr_t", evp_pkey))
)
elif key_type == getattr(self._lib, "EVP_PKEY_ED448", None):
# EVP_PKEY_ED448 is not present in CRYPTOGRAPHY_IS_LIBRESSL
Expand Down
2 changes: 1 addition & 1 deletion src/cryptography/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _extract_buffer_length(obj: typing.Any) -> typing.Tuple[int, int]:
from cryptography.hazmat.bindings._rust import _openssl

buf = _openssl.ffi.from_buffer(obj)
return int(_openssl.ffi.cast("intptr_t", buf)), len(buf)
return int(_openssl.ffi.cast("uintptr_t", buf)), len(buf)


class InterfaceNotImplemented(Exception):
Expand Down
2 changes: 1 addition & 1 deletion vectors/cryptography_vectors/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"__version__",
]

__version__ = "40.0.0"
__version__ = "40.0.1"