summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2020-01-29 22:32:28 +0100
committerMatěj Cepl <mcepl@cepl.eu>2020-01-29 22:32:28 +0100
commita63ce2f5b98c21a2763c9d96105793a6aa3c4ce3 (patch)
tree891753a2089873defe39a81162c7ce6e6c887b93
parentf6bb4413466aa2588bcb7d22b9e6bf97885f16d7 (diff)
downloadm2crypto-a63ce2f5b98c21a2763c9d96105793a6aa3c4ce3.tar.gz
Add correct generated files
-rw-r--r--SWIG/_m2crypto_wrap.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/SWIG/_m2crypto_wrap.c b/SWIG/_m2crypto_wrap.c
index 837ce6c..ff75af5 100644
--- a/SWIG/_m2crypto_wrap.c
+++ b/SWIG/_m2crypto_wrap.c
@@ -6085,8 +6085,17 @@ PyObject *cipher_init(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
const void *kbuf, *ibuf;
Py_ssize_t klen, ilen;
- if ((PyObject_AsReadBuffer(key, &kbuf, &klen) == -1)
- || (PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1))
+ if (cipher == Py_None)
+ cipher = NULL;
+
+ if (key == Py_None)
+ kbuf = NULL;
+ else if (PyObject_AsReadBuffer(key, &kbuf, &klen) == -1)
+ return NULL;
+
+ if (iv == Py_None)
+ ibuf = NULL;
+ else if (PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1)
return NULL;
if (!EVP_CipherInit(ctx, cipher, (unsigned char *)kbuf,