diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-03-05 14:29:28 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-03-05 16:02:15 -0600 |
commit | 791afc0d63f6985227ea18752ccb12fa0987c420 (patch) | |
tree | 700cc063dd7c47458a3a31da142d0555374d5d9d | |
parent | 7bfa22ed44332a430cfb13fd864759ec17ae6bf4 (diff) | |
download | cryptography-791afc0d63f6985227ea18752ccb12fa0987c420.tar.gz cryptography-791afc0d63f6985227ea18752ccb12fa0987c420.tar.bz2 cryptography-791afc0d63f6985227ea18752ccb12fa0987c420.zip |
fix a memory leak pointed out by @aftbit and improve changelog phrasing
-rw-r--r-- | CHANGELOG.rst | 2 | ||||
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/backend.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ce2d3f0b..70fd7a53 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -81,7 +81,7 @@ Changelog * Updated Windows wheels to be compiled against OpenSSL 1.0.2. * :func:`~cryptography.hazmat.primitives.serialization.load_pem_public_key` and :func:`~cryptography.hazmat.primitives.serialization.load_der_public_key` - now support PKCS1 RSA public keys (previously these functions supported + now support PKCS1 RSA public keys (in addition to the previous support for SubjectPublicKeyInfo format for RSA, EC, and DSA). * Added :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKeyWithSerialization` diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py index 613931f7..65c26ba8 100644 --- a/src/cryptography/hazmat/backends/openssl/backend.py +++ b/src/cryptography/hazmat/backends/openssl/backend.py @@ -708,6 +708,7 @@ class Backend(object): mem_bio.bio, self._ffi.NULL, self._ffi.NULL, self._ffi.NULL ) if rsa_cdata != self._ffi.NULL: + rsa_cdata = self._ffi.gc(rsa_cdata, self._lib.RSA_free) return _RSAPublicKey(self, rsa_cdata) else: self._handle_key_loading_error() @@ -789,6 +790,7 @@ class Backend(object): mem_bio.bio, self._ffi.NULL ) if rsa_cdata != self._ffi.NULL: + rsa_cdata = self._ffi.gc(rsa_cdata, self._lib.RSA_free) return _RSAPublicKey(self, rsa_cdata) else: self._handle_key_loading_error() |