From afa5a66ffc219e5176fd316abfe989500d749f9b Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 10 Mar 2016 10:29:28 -0400 Subject: gc the DSA key a different way --- src/OpenSSL/crypto.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py index a6cd263..86752d3 100644 --- a/src/OpenSSL/crypto.py +++ b/src/OpenSSL/crypto.py @@ -221,6 +221,8 @@ class PKey(object): if dsa == _ffi.NULL: # TODO: This is untested. _raise_current_error() + + dsa = _ffi.gc(dsa, _lib.DSA_free) res = _lib.DSA_generate_parameters_ex( dsa, bits, _ffi.NULL, 0, _ffi.NULL, _ffi.NULL, _ffi.NULL ) @@ -230,7 +232,7 @@ class PKey(object): if not _lib.DSA_generate_key(dsa): # TODO: This is untested. _raise_current_error() - if not _lib.EVP_PKEY_assign_DSA(self._pkey, dsa): + if not _lib.EVP_PKEY_set1_DSA(self._pkey, dsa): # TODO: This is untested. _raise_current_error() else: -- cgit v1.2.1