summaryrefslogtreecommitdiff
path: root/dev-python/m2crypto
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-04-28 20:21:43 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-04-28 20:21:43 +0100
commit40aaaa64e86ba6710bbeb31c4615a6ce80e75e11 (patch)
tree758c221bad35c9288d0bd6df9c7dfc226728e52c /dev-python/m2crypto
parent8d5dbd847cbc704a6a06405856e94b461011afe3 (diff)
gentoo resync : 28.04.2021
Diffstat (limited to 'dev-python/m2crypto')
-rw-r--r--dev-python/m2crypto/Manifest4
-rw-r--r--dev-python/m2crypto/files/m2crypto-0.37.1-openssl-fixes.patch76
-rw-r--r--dev-python/m2crypto/m2crypto-0.35.2-r1.ebuild2
-rw-r--r--dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild69
4 files changed, 149 insertions, 2 deletions
diff --git a/dev-python/m2crypto/Manifest b/dev-python/m2crypto/Manifest
index 1acdba5f6cb0..0d054027bdab 100644
--- a/dev-python/m2crypto/Manifest
+++ b/dev-python/m2crypto/Manifest
@@ -1,8 +1,10 @@
+AUX m2crypto-0.37.1-openssl-fixes.patch 3074 BLAKE2B 3daa583d4f7e04840a9c2f15fc583dcf8e4ee996aee93d9c180ccc4920f36cd2f90e2f2591732597b0108f3944cb3b22d0eb202c8dfd500fccb8e805aa74666d SHA512 fd73a98592026b39341200fc378042b71272dad4c43c63e4da3aafabae4f5a8aadeb41738ca99cca87ebeecb5455abadfe96d0c6640702b14f138f8122dc57ee
AUX m2crypto-libressl-0.31.0.patch 8211 BLAKE2B dc36c1e77f6fa9f260d465c0e61168a9ddd82f382c46f31c06a3ef5972cbbe225f665eac17999f7c8a0b74e1702f82451fed5a39691577b050f477bbf7a2ee2e SHA512 ea100feabae82cf1c1237f55354847935a9c49e05c780e01d8fef959d2a10abc4b9f14c56ea50cba68ff59eb67c3cf5136ff92e9dc456960327e0c582b55720d
DIST M2Crypto-0.35.2.tar.gz 1117706 BLAKE2B efa15e023be7755b94c642bb23eade912edcbbb76bcdfed3414d27937cd705ec4c83069ca620fe20e58e126549ba7f98e84f6f8330b78133a8a8b953d18f467b SHA512 3608b29a8e7d0732a2359e35fcaae191447aa7c0211ca3d057eed6cee7f0819f5c1121e7d41caca8cdea3c7911f8c447ee475b1b3d125e8dc3adde2718a59f36
DIST M2Crypto-0.36.0.tar.gz 1127584 BLAKE2B 5cdbbb11ff67d4ddffb2853a72383f3c7f1e1aa53ab84166aeda4fbea1b0d7f506761bb07bf8cb5b36f94bdbeb2ea2b46e0693da8355f81b4bf5c4c1c1cc18b1 SHA512 5b7d6d10c943ff0e09e0e9748d5578e7e0f7659a73de4ba49481152bca05871aef2bfbb869e1636a7cebcf2dd8b9f67fb0d299a833d1d4ebd538031c35d7bca1
DIST M2Crypto-0.37.1.tar.gz 1247031 BLAKE2B 3628150b8da15d7356298b6e52e0d8fa7875921a184a0eba3a97eff0588c9e0fee340c92fd486919057d900d6e3b2b711174dde9761fe247848f92ac6434df0a SHA512 9a5e0220704b4897a9ca7efa4b3b57447b9175c52e8039a85bff7bb1a43b709c69f3c8b5903df461f8de39d3f8a20f9bf494df6f5882771846adfe2c03fbea9e
-EBUILD m2crypto-0.35.2-r1.ebuild 1411 BLAKE2B 0505ee70f03d9a037a282ee58b50dc7d8a954ad148ac449d492bc9b8827a43b361b112e9b7805f3cbeb58ab9409790996972bab707225da47feb11cdcc863e57 SHA512 71d04c3efb88e0871724b8fcd846b81314f29052354e6052fe690957c094305fbce17cf966612c82c4e8020fbec20ea022f59670011c18bb81cefbc8fe4faf69
+EBUILD m2crypto-0.35.2-r1.ebuild 1412 BLAKE2B 3ebc7eacf9a3c1856baa7b6840eaf8350c9a8282fc07469b6bfd85425d3cd50c4112d178d22ad793992d860bd8712b276e2ae4700fdc4bb90f9dc573ec623d2a SHA512 1b77d2436aad5efea0e2b8afe7b501f86347dba601e32fdc2b09e88a64a378ce59737b5fdf4893f3a1494d85fa5ad05066454910129e9f7d5f65e3116409c008
EBUILD m2crypto-0.36.0-r1.ebuild 1543 BLAKE2B eaa6cfa13143cdc26b0bd42d01742a5b51213419c5de03bcd2d9cef04ec01c5d77da6325ae8452b6ccb0682ad2520f98b75eb60c0e53fe6f5b3bbd05605b7865 SHA512 464263a00453564f4a729b3e3d403b555ca6d19835d7727d775fedcd2179b0f7ff781cccd1ae5e61af5c9930117c854232c34990735f510334dd1859a349f37d
+EBUILD m2crypto-0.37.1-r1.ebuild 1518 BLAKE2B 6a5f677520198c38d4f461c1c88852264c33890e458367378d535e503773e629aa06ed867f1ae67efdfee4cda1a0d542f214a9c6d4845b32bf4089a9c743c9bc SHA512 b40fe56c621a730baf3186cb3e5bb3ad69e401e5caa8d7ef721e1a2c33a95170e6c4db71acdde610b69003fed3d9caacb24e6094f3d548c6867c808a7cfa5546
EBUILD m2crypto-0.37.1.ebuild 1524 BLAKE2B 054203de4f7b81f9083440bd2e02bcae9fb713d1c1d498f69728b2a0ca1a53d94898d5a08673ac78785d78242311d5ac384d38819852fed0aaf1b60599a6706e SHA512 ccdcee7b053971725b71392cc854c984f524b0db06263c4ff0a6e21b77e3dc8106ee9cb3fa0fe3b623eae8f4c233b9d7328f8df96b86eaa0642f33242de16eeb
MISC metadata.xml 380 BLAKE2B 99a1c8e8202bed7c6d0ff8cdff3f17b664791405b082be2b7d72b3fe2b77bf89c886666d9bdce6a96c540b9518042b9d49b9af926ca10ab4c5b3b416182de01c SHA512 f2e3b4228c45471f0132b3bb412f017f4006eb82bd63e187db3efdfd3f412c1db19bdb79d37630bb059f75ef69f110687b8924d22c2aef0101cb40eb3486f1e6
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
new file mode 100644
index 000000000000..c249f7adbb80
--- /dev/null
+++ b/dev-python/m2crypto/files/m2crypto-0.37.1-openssl-fixes.patch
@@ -0,0 +1,76 @@
+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/m2crypto-0.35.2-r1.ebuild b/dev-python/m2crypto/m2crypto-0.35.2-r1.ebuild
index 06d5f2cdc7bd..a96e594465a2 100644
--- a/dev-python/m2crypto/m2crypto-0.35.2-r1.ebuild
+++ b/dev-python/m2crypto/m2crypto-0.35.2-r1.ebuild
@@ -15,7 +15,7 @@ SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
LICENSE="MIT"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
IUSE="libressl"
RDEPEND="
diff --git a/dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild b/dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild
new file mode 100644
index 000000000000..b536accf6bbd
--- /dev/null
+++ b/dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 2018-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1 toolchain-funcs
+
+MY_PN="M2Crypto"
+DESCRIPTION="A Python crypto and SSL toolkit"
+HOMEPAGE="https://gitlab.com/m2crypto/m2crypto https://pypi.org/project/M2Crypto/"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+IUSE="libressl test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ >=dev-lang/swig-2.0.9
+ test? ( dev-python/parameterized[${PYTHON_USEDEP}] )
+"
+RDEPEND="
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-openssl-fixes.patch"
+)
+
+swig_define() {
+ local x
+ for x; do
+ if tc-cpp-is-true "defined(${x})"; then
+ SWIG_FEATURES+=" -D${x}"
+ fi
+ done
+}
+
+src_prepare() {
+ # TODO
+ sed -e 's:test_server_simple_timeouts:_&:' \
+ -i tests/test_ssl.py || die
+ distutils-r1_src_prepare
+}
+
+python_compile() {
+ # setup.py looks at platform.machine() to determine swig options.
+ # For exotic ABIs, we need to give swig a hint.
+ local -x SWIG_FEATURES=
+
+ # https://bugs.gentoo.org/617946
+ swig_define __ILP32__
+
+ # https://bugs.gentoo.org/674112
+ swig_define __ARM_PCS_VFP
+
+ distutils-r1_python_compile --openssl="${ESYSROOT}"/usr
+}
+
+python_test() {
+ esetup.py test
+}