aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-10-20 09:33:44 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2013-10-20 09:33:44 -0700
commit56ac648704e5515f44ffc3607faa36fb6f7fd2e5 (patch)
treedaf035475bc211cc7a3a75bae0798791ea26cfff
parent7abcb9c0e87787d58f4754c079a3296aaedae657 (diff)
downloadcryptography-56ac648704e5515f44ffc3607faa36fb6f7fd2e5.tar.gz
cryptography-56ac648704e5515f44ffc3607faa36fb6f7fd2e5.tar.bz2
cryptography-56ac648704e5515f44ffc3607faa36fb6f7fd2e5.zip
Cleanup hash ctxs when we're done with them
-rw-r--r--cryptography/bindings/openssl/api.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/cryptography/bindings/openssl/api.py b/cryptography/bindings/openssl/api.py
index 3c2cf2e2..f6b6677f 100644
--- a/cryptography/bindings/openssl/api.py
+++ b/cryptography/bindings/openssl/api.py
@@ -168,6 +168,8 @@ class API(object):
buf = self.ffi.new("unsigned char[]", digest_size)
res = self.lib.EVP_DigestFinal_ex(ctx, buf, self.ffi.NULL)
assert res != 0
+ res = self.lib.EVP_MD_CTX_cleanup(ctx)
+ assert res != 0
return self.ffi.buffer(buf)[:digest_size]
def copy_hash_context(self, ctx):