Skip to content

Fix memory leak in OpenSSL.crypto.dump_privatekey#496

Merged
alex merged 3 commits into
pyca:masterfrom
hynek:fix-dump-leak
Jul 3, 2016
Merged

Fix memory leak in OpenSSL.crypto.dump_privatekey#496
alex merged 3 commits into
pyca:masterfrom
hynek:fix-dump-leak

Conversation

@hynek

@hynek hynek commented Jul 3, 2016

Copy link
Copy Markdown
Contributor

Fixes #494

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

codecov-io commented Jul 3, 2016

Copy link
Copy Markdown

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

Comment thread src/OpenSSL/crypto.py Outdated
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
Copy Markdown
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