diff options
-rw-r--r-- | cryptography/bindings/openssl/api.py | 3 | ||||
-rw-r--r-- | cryptography/primitives/block/base.py | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/cryptography/bindings/openssl/api.py b/cryptography/bindings/openssl/api.py index ec6b923a..ba6fbb83 100644 --- a/cryptography/bindings/openssl/api.py +++ b/cryptography/bindings/openssl/api.py @@ -65,7 +65,8 @@ class API(object): evp_cipher = self._lib.EVP_get_cipherbyname(ciphername) if evp_cipher == self._ffi.NULL: raise OpenSSLError(self) - # TODO: only use the key and initialization_vector as needed + # TODO: only use the key and initialization_vector as needed. Sometimes + # this needs to be a DecryptInit, when? res = self._lib.EVP_EncryptInit_ex(ctx, evp_cipher, self._ffi.NULL, cipher.key, mode.initialization_vector) if res == 0: raise OpenSSLError(self) diff --git a/cryptography/primitives/block/base.py b/cryptography/primitives/block/base.py index ed37685d..8faafadd 100644 --- a/cryptography/primitives/block/base.py +++ b/cryptography/primitives/block/base.py @@ -14,6 +14,7 @@ class BlockCipher(object): return api.update_encrypt_context(self._ctx, plaintext) def finalize(self): + # TODO: this might be a decrypt context result = api.finalize_encrypt_context(self._ctx) self._ctx = None return result |