diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-09-30 18:48:10 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-09-30 18:48:10 -0700 |
commit | 6d0542f16801e055529ddf888755742ae252d926 (patch) | |
tree | 9b5795eae271e5dc01e303b62ff59d1369036138 | |
parent | e2ac563c990b204b96d4a560153f05e95804b3e9 (diff) | |
parent | 90cde04460e3b3c30eb58b95778c0208ff5c429e (diff) | |
download | cryptography-6d0542f16801e055529ddf888755742ae252d926.tar.gz cryptography-6d0542f16801e055529ddf888755742ae252d926.tar.bz2 cryptography-6d0542f16801e055529ddf888755742ae252d926.zip |
Merge pull request #79 from reaperhulk/init-cipher-ctx
Added a EVP_CIPHER_CTX_init() call
-rw-r--r-- | cryptography/bindings/openssl/api.py | 2 | ||||
-rw-r--r-- | cryptography/bindings/openssl/evp.py | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/cryptography/bindings/openssl/api.py b/cryptography/bindings/openssl/api.py index d648d491..28437576 100644 --- a/cryptography/bindings/openssl/api.py +++ b/cryptography/bindings/openssl/api.py @@ -56,6 +56,8 @@ class API(object): def create_block_cipher_context(self, cipher, mode): ctx = self.ffi.new("EVP_CIPHER_CTX *") + res = self.lib.EVP_CIPHER_CTX_init(ctx) + assert res != 0 ctx = self.ffi.gc(ctx, self.lib.EVP_CIPHER_CTX_cleanup) # TODO: compute name using a better algorithm ciphername = "{0}-{1}-{2}".format( diff --git a/cryptography/bindings/openssl/evp.py b/cryptography/bindings/openssl/evp.py index 8d2230fd..0bc5cffc 100644 --- a/cryptography/bindings/openssl/evp.py +++ b/cryptography/bindings/openssl/evp.py @@ -35,4 +35,5 @@ int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *, unsigned char *, int *); int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *); const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *); int EVP_CIPHER_block_size(const EVP_CIPHER *); +void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *); """ |