summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2016-03-10 10:29:28 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2016-03-10 10:29:28 -0400
commitafa5a66ffc219e5176fd316abfe989500d749f9b (patch)
treeadb17bc49f89f26ccff13596caa9a81d66b1eeee
parenta0860b900f671f389921c6fe311dc7a3ab576f2c (diff)
downloadpyopenssl-git-afa5a66ffc219e5176fd316abfe989500d749f9b.tar.gz
gc the DSA key a different way
-rw-r--r--src/OpenSSL/crypto.py4
1 files changed, 3 insertions, 1 deletions
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: