summaryrefslogtreecommitdiff
path: root/dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
commitd18bf1e01b65ee4bf0c804e2843b282d3d4e5d7c (patch)
tree4a95cbc6ffdf13bad6ecbc7f8d5af99631984123 /dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch
parente748ba9741f6540f4675c23e3e37b73e822c13a4 (diff)
gentoo resync : 15.06.2021
Diffstat (limited to 'dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch')
-rw-r--r--dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch119
1 files changed, 119 insertions, 0 deletions
diff --git a/dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch b/dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch
new file mode 100644
index 000000000000..f9be349fc3db
--- /dev/null
+++ b/dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch
@@ -0,0 +1,119 @@
+diff --git a/SWIG/_bio.i b/SWIG/_bio.i
+index 84b76b3..6c090a4 100644
+--- a/SWIG/_bio.i
++++ b/SWIG/_bio.i
+@@ -246,8 +246,8 @@ PyObject *bio_set_cipher(BIO *b, EVP_CIPHER *c, PyObject *key, PyObject *iv, int
+ const void *kbuf, *ibuf;
+ Py_ssize_t klen, ilen;
+
+- if ((PyObject_AsReadBuffer(key, &kbuf, &klen) == -1)
+- || (PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1))
++ if ((m2_PyObject_AsReadBuffer(key, &kbuf, &klen) == -1)
++ || (m2_PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1))
+ return NULL;
+
+ BIO_set_cipher(b, (const EVP_CIPHER *)c,
+diff --git a/SWIG/_ec.i b/SWIG/_ec.i
+index f47d593..a492f6f 100644
+--- a/SWIG/_ec.i
++++ b/SWIG/_ec.i
+@@ -466,7 +466,7 @@ EC_KEY* ec_key_from_pubkey_der(PyObject *pubkey) {
+ const unsigned char *tempBuf;
+ EC_KEY *keypair;
+
+- if (PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
++ if (m2_PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
+ {
+ return NULL;
+ }
+@@ -486,7 +486,7 @@ EC_KEY* ec_key_from_pubkey_params(int nid, PyObject *pubkey) {
+ const unsigned char *tempBuf;
+ EC_KEY *keypair;
+
+- if (PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
++ if (m2_PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
+ {
+ return NULL;
+ }
+diff --git a/SWIG/_lib.i b/SWIG/_lib.i
+index 954e99b..351134b 100644
+--- a/SWIG/_lib.i
++++ b/SWIG/_lib.i
+@@ -137,8 +137,8 @@ m2_PyObject_AsReadBuffer(PyObject * obj, const void **buffer,
+ len = view.len;
+ }
+ } else {
+- if ((ret = PyObject_AsReadBuffer(obj, buffer, &len)) != 0)
+- return ret;
++ PyErr_SetString(PyExc_TypeError, "expected a readable buffer object");
++ return -1;
+ }
+ if (len > INT_MAX) {
+ m2_PyBuffer_Release(obj, &view);
+@@ -171,11 +171,8 @@ static int m2_PyObject_GetBufferInt(PyObject *obj, Py_buffer *view, int flags)
+ if (PyObject_CheckBuffer(obj))
+ ret = PyObject_GetBuffer(obj, view, flags);
+ else {
+- const void *buf;
+-
+- ret = PyObject_AsReadBuffer(obj, &buf, &view->len);
+- if (ret == 0)
+- view->buf = (void *)buf;
++ PyErr_SetString(PyExc_TypeError, "expected a readable buffer object");
++ return -1;
+ }
+ if (ret)
+ return ret;
+@@ -633,7 +630,7 @@ BIGNUM *hex_to_bn(PyObject *value) {
+ }
+ }
+ else {
+- if (PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
++ if (m2_PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
+ return NULL;
+ }
+
+@@ -665,7 +662,7 @@ BIGNUM *dec_to_bn(PyObject *value) {
+ }
+ }
+ else {
+- if (PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
++ if (m2_PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
+ return NULL;
+ }
+
+diff --git a/SWIG/_rc4.i b/SWIG/_rc4.i
+index eb4747e..6af2dc6 100644
+--- a/SWIG/_rc4.i
++++ b/SWIG/_rc4.i
+@@ -46,7 +46,7 @@ PyObject *rc4_update(RC4_KEY *key, PyObject *in) {
+ Py_ssize_t len;
+ void *out;
+
+- if (PyObject_AsReadBuffer(in, &buf, &len) == -1)
++ if (m2_PyObject_AsReadBuffer(in, &buf, &len) == -1)
+ return NULL;
+
+ if (!(out = PyMem_Malloc(len))) {
+diff --git a/SWIG/_util.i b/SWIG/_util.i
+index bc2ee61..18e446a 100644
+--- a/SWIG/_util.i
++++ b/SWIG/_util.i
+@@ -22,7 +22,7 @@ PyObject *util_hex_to_string(PyObject *blob) {
+ char *ret;
+ Py_ssize_t len;
+
+- if (PyObject_AsReadBuffer(blob, &buf, &len) == -1)
++ if (m2_PyObject_AsReadBuffer(blob, &buf, &len) == -1)
+ return NULL;
+
+ ret = hex_to_string((unsigned char *)buf, len);
+@@ -44,7 +44,7 @@ PyObject *util_string_to_hex(PyObject *blob) {
+ Py_ssize_t len0;
+ long len;
+
+- if (PyObject_AsReadBuffer(blob, &buf, &len0) == -1)
++ if (m2_PyObject_AsReadBuffer(blob, &buf, &len0) == -1)
+ return NULL;
+
+ len = len0;