diff options
Diffstat (limited to 'dev-python/m2crypto/files')
-rw-r--r-- | dev-python/m2crypto/files/m2crypto-0.37.1-openssl-fixes.patch | 76 | ||||
-rw-r--r-- | dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch | 119 |
2 files changed, 0 insertions, 195 deletions
diff --git a/dev-python/m2crypto/files/m2crypto-0.37.1-openssl-fixes.patch b/dev-python/m2crypto/files/m2crypto-0.37.1-openssl-fixes.patch deleted file mode 100644 index c249f7adbb80..000000000000 --- a/dev-python/m2crypto/files/m2crypto-0.37.1-openssl-fixes.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 73fbd1e646f6bbf202d4418bae80eb9941fbf552 Mon Sep 17 00:00:00 2001 -From: Casey Deccio <casey@deccio.net> -Date: Fri, 8 Jan 2021 12:43:09 -0700 -Subject: [PATCH] Allow verify_cb_* to be called with ok=True - -With https://github.com/openssl/openssl/commit/2e06150e3928daa06d5ff70c32bffad8088ebe58 -OpenSSL allowed verificaton to continue on UNABLE_TO_VERIFY_LEAF_SIGNATURE ---- - tests/test_ssl.py | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/tests/test_ssl.py b/tests/test_ssl.py -index 92b6942..7a3271a 100644 ---- a/tests/test_ssl.py -+++ b/tests/test_ssl.py -@@ -59,8 +59,13 @@ def allocate_srv_port(): - - - def verify_cb_new_function(ok, store): -- assert not ok - err = store.get_error() -+ # If err is X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE, then instead of -+ # aborting, this callback is called to retrieve additional error -+ # information. In this case, ok might not be False. -+ # See https://github.com/openssl/openssl/commit/2e06150e3928daa06d5ff70c32bffad8088ebe58 -+ if err != m2.X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: -+ assert not ok - assert err in [m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT, - m2.X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY, - m2.X509_V_ERR_CERT_UNTRUSTED, -@@ -618,7 +623,12 @@ class MiscSSLClientTestCase(BaseSSLClientTestCase): - - def verify_cb_old(self, ctx_ptr, x509_ptr, err, depth, ok): - try: -- self.assertFalse(ok) -+ # If err is X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE, then instead of -+ # aborting, this callback is called to retrieve additional error -+ # information. In this case, ok might not be False. -+ # See https://github.com/openssl/openssl/commit/2e06150e3928daa06d5ff70c32bffad8088ebe58 -+ if err != m2.X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: -+ self.assertFalse(ok) - self.assertIn(err, - [m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT, - m2.X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY, --- -2.31.1 - -From d06eaa88a5f491827733f32027c46de3557fbd05 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu> -Date: Fri, 19 Feb 2021 15:53:02 +0100 -Subject: [PATCH] Use of RSA_SSLV23_PADDING has been deprecated. - -Fixes #293. ---- - tests/test_rsa.py | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/tests/test_rsa.py b/tests/test_rsa.py -index 3de5016..7299785 100644 ---- a/tests/test_rsa.py -+++ b/tests/test_rsa.py -@@ -124,11 +124,6 @@ class RSATestCase(unittest.TestCase): - ptxt = priv.private_decrypt(ctxt, p) - self.assertEqual(ptxt, self.data) - -- # sslv23_padding -- ctxt = priv.public_encrypt(self.data, RSA.sslv23_padding) -- res = priv.private_decrypt(ctxt, RSA.sslv23_padding) -- self.assertEqual(res, self.data) -- - # no_padding - with six.assertRaisesRegex(self, RSA.RSAError, 'data too small'): - priv.public_encrypt(self.data, RSA.no_padding) --- -2.31.1 - diff --git a/dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch b/dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch deleted file mode 100644 index f9be349fc3db..000000000000 --- a/dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch +++ /dev/null @@ -1,119 +0,0 @@ -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; |