diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-08-09 12:01:00 -0700 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-08-09 12:01:00 -0700 |
| commit | 0b26f787601acedf80d8fad5c71bf60c907b5201 (patch) | |
| tree | 2daeaed271885111ce755ecae66b638959d2e533 /cryptography | |
| parent | 6c4819dc06fb4db84c3f57ec69748a0fa13ef89f (diff) | |
| download | cryptography-0b26f787601acedf80d8fad5c71bf60c907b5201.tar.gz cryptography-0b26f787601acedf80d8fad5c71bf60c907b5201.tar.bz2 cryptography-0b26f787601acedf80d8fad5c71bf60c907b5201.zip | |
Address a review note
Diffstat (limited to 'cryptography')
| -rw-r--r-- | cryptography/bindings/openssl/api.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cryptography/bindings/openssl/api.py b/cryptography/bindings/openssl/api.py index 78cbcbc3..07079415 100644 --- a/cryptography/bindings/openssl/api.py +++ b/cryptography/bindings/openssl/api.py @@ -65,6 +65,7 @@ class API(object): def create_block_cipher_context(self, cipher, mode): ctx = self._ffi.new("EVP_CIPHER_CTX *") + ctx = self._ffi.gc(ctx, self._lib.EVP_CIPHER_CTX_cleanup) # TODO: compute name using a better algorithm ciphername = "{0}-{1}-{2}".format( cipher.name, len(cipher.key) * 8, mode.name @@ -101,7 +102,6 @@ class API(object): res = self._lib.EVP_EncryptFinal_ex(ctx, buf, outlen) if res == 0: raise OpenSSLError(self) - # TODO: this should also be called if the cipher isn't finalized. res = self._lib.EVP_CIPHER_CTX_cleanup(ctx) if res == 0: raise OpenSSLError(self) |
