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

Fix memory leak in OpenSSL.crypto.dump_privatekey #496

Merged
merged 3 commits into from
Jul 3, 2016
Merged

Fix memory leak in OpenSSL.crypto.dump_privatekey #496

merged 3 commits into from
Jul 3, 2016

Conversation

hynek
Copy link
Contributor

@hynek hynek commented Jul 3, 2016

Fixes #494

@hynek hynek added this to the 16.1.0 milestone Jul 3, 2016
@codecov-io
Copy link

codecov-io commented Jul 3, 2016

Current coverage is 90.51%

Merging #496 into master will increase coverage by 0.09%

@@             master       #496   diff @@
==========================================
  Files             7          7          
  Lines          2067       2066     -1   
  Methods           0          0          
  Messages          0          0          
  Branches        343        342     -1   
==========================================
+ Hits           1869       1870     +1   
+ Misses          107        106     -1   
+ Partials         91         90     -1   

Powered by Codecov. Last updated by add5b07...a1273c0

@@ -1735,14 +1736,13 @@ def dump_privatekey(type, pkey, cipher=None, passphrase=None):
elif type == FILETYPE_TEXT:
rsa = _lib.EVP_PKEY_get1_RSA(pkey._pkey)
result_code = _lib.RSA_print(bio, rsa, 0)
# TODO RSA_free(rsa)?
_ffi.gc(rsa, _lib.RSA_free)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be rsa = _ffi.gc(rsa, _lib.RSA_free) and it should be on the line right below rsa = _lib.EVP_PKEY...

@alex alex merged commit 11e43ad into pyca:master Jul 3, 2016
@hynek hynek deleted the fix-dump-leak branch July 3, 2016 12:42
jsonn referenced this pull request in jsonn/pkgsrc Jan 28, 2017
Add patch that makes tests on NetBSD progress further.
But then there's a segfault. See
pyca/pyopenssl#596

16.2.0 (2016-10-15)
-------------------

Changes:
^^^^^^^^

- Fixed compatibility errors with OpenSSL 1.1.0.
- Fixed an issue that caused failures with subinterpreters and embedded Pythons.
  `#552 <https://github.com/pyca/pyopenssl/pull/552>`_


16.1.0 (2016-08-26)
-------------------

Deprecations:
^^^^^^^^^^^^^

- Dropped support for OpenSSL 0.9.8.


Changes:
^^^^^^^^

- Fix memory leak in ``OpenSSL.crypto.dump_privatekey()`` with ``FILETYPE_TEXT``.
  `#496 <https://github.com/pyca/pyopenssl/pull/496>`_
- Enable use of CRL (and more) in verify context.
  `#483 <https://github.com/pyca/pyopenssl/pull/483>`_
- ``OpenSSL.crypto.PKey`` can now be constructed from ``cryptography`` objects and also exported as such.
  `#439 <https://github.com/pyca/pyopenssl/pull/439>`_
- Support newer versions of ``cryptography`` which use opaque structs for OpenSSL 1.1.0 compatibility.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak in OpenSSL.crypto.dump_privatekey with FILETYPE_TEXT
3 participants