diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2023-03-24 21:09:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-25 09:09:42 +0800 |
commit | 9dd0b26c48f567d5a7c4a0bc9f45ef2176a2d4a4 (patch) | |
tree | ea56241628a144f25ffb3d202c7b64b5774f42d1 /src | |
parent | 45e37718098edca2c5ac2135394bcf17fd7982f0 (diff) | |
download | cryptography-40.0.1.tar.gz |
Backport fix for 40.0.1 (#8603)40.0.1
* Fix handling very large pointer values (32-bit) (#8602)
* Changelog and backport fo 40.0.1
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/__about__.py | 4 | ||||
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/backend.py | 4 | ||||
-rw-r--r-- | src/cryptography/utils.py | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/cryptography/__about__.py b/src/cryptography/__about__.py index 20d197b6b..de686bbc6 100644 --- a/src/cryptography/__about__.py +++ b/src/cryptography/__about__.py @@ -9,7 +9,7 @@ __all__ = [ "__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__}" diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py index 53e3486c0..a3fe1bce4 100644 --- a/src/cryptography/hazmat/backends/openssl/backend.py +++ b/src/cryptography/hazmat/backends/openssl/backend.py @@ -712,7 +712,7 @@ class Backend: 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 @@ -771,7 +771,7 @@ class Backend: 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 diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py index a84069f1c..1a2d490a2 100644 --- a/src/cryptography/utils.py +++ b/src/cryptography/utils.py @@ -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): |