diff options
author | INADA Naoki <songofacandy@gmail.com> | 2011-08-26 01:17:51 +0900 |
---|---|---|
committer | INADA Naoki <songofacandy@gmail.com> | 2011-08-26 01:17:51 +0900 |
commit | e4582b0bba49f8958d0f39621427361a2e0121f7 (patch) | |
tree | 795fd4e0780e38b9338b4b8163e150d4ce9c020a | |
parent | 43e6654784f092370247e6d0510c5b5d71fecf41 (diff) | |
download | pyopenssl-e4582b0bba49f8958d0f39621427361a2e0121f7.tar.gz |
Fix didn't release while DSA key generation.
-rw-r--r-- | OpenSSL/crypto/pkey.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/OpenSSL/crypto/pkey.c b/OpenSSL/crypto/pkey.c index debc043..cb60211 100644 --- a/OpenSSL/crypto/pkey.c +++ b/OpenSSL/crypto/pkey.c @@ -64,11 +64,15 @@ crypto_PKey_generate_key(crypto_PKeyObj *self, PyObject *args) case crypto_TYPE_DSA: Py_BEGIN_ALLOW_THREADS; dsa = DSA_generate_parameters(bits, NULL, 0, NULL, NULL, NULL, NULL); - Py_END_ALLOW_THREADS; - if (dsa == NULL) + if (dsa == NULL) { + Py_END_ALLOW_THREADS; FAIL(); - if (!DSA_generate_key(dsa)) + } + if (!DSA_generate_key(dsa)) { + Py_END_ALLOW_THREADS; FAIL(); + } + Py_END_ALLOW_THREADS; if (!EVP_PKEY_assign_DSA(self->pkey, dsa)) FAIL(); break; |