diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-05-01 12:04:27 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-05-03 08:05:21 -0700 |
commit | b8bbcd4dea422be57123d75fbf77db6d33542b06 (patch) | |
tree | 17575e74c76687ac01ecdd69aed7a71614941326 /meta-python | |
parent | 57baca4bc1b681482bc014508d28f7def5949c33 (diff) | |
download | meta-openembedded-b8bbcd4dea422be57123d75fbf77db6d33542b06.tar.gz |
python3-m2crypto: Upgrade to 0.37.1
Unifiy .inc into .bb
Add patches to fix issues with openssl 1.1.x
Remove m2crypto-0.26.4-gcc_macros patch, its no longer needed
Refresh existing patches
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
Diffstat (limited to 'meta-python')
-rw-r--r-- | meta-python/recipes-devtools/python/python-m2crypto/m2crypto-0.26.4-gcc_macros.patch | 35 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-m2crypto/0001-Allow-verify_cb_-to-be-called-with-ok-True.patch | 47 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-m2crypto/0001-Use-of-RSA_SSLV23_PADDING-has-been-deprecated.patch | 29 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-link-in-sysroot-not-in-host-directories.patch (renamed from meta-python/recipes-devtools/python/python-m2crypto/0001-setup.py-link-in-sysroot-not-in-host-directories.patch) | 12 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-m2crypto/cross-compile-platform.patch (renamed from meta-python/recipes-devtools/python/python-m2crypto/cross-compile-platform.patch) | 8 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-m2crypto_0.30.1.bb | 2 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-m2crypto_0.37.1.bb (renamed from meta-python/recipes-devtools/python/python-m2crypto.inc) | 8 |
7 files changed, 88 insertions, 53 deletions
diff --git a/meta-python/recipes-devtools/python/python-m2crypto/m2crypto-0.26.4-gcc_macros.patch b/meta-python/recipes-devtools/python/python-m2crypto/m2crypto-0.26.4-gcc_macros.patch deleted file mode 100644 index 7f6dd29f8..000000000 --- a/meta-python/recipes-devtools/python/python-m2crypto/m2crypto-0.26.4-gcc_macros.patch +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | Imported from Fedora | ||
2 | |||
3 | Index: M2Crypto-0.30.1/SWIG/_m2crypto.i | ||
4 | =================================================================== | ||
5 | --- M2Crypto-0.30.1.orig/SWIG/_m2crypto.i | ||
6 | +++ M2Crypto-0.30.1/SWIG/_m2crypto.i | ||
7 | @@ -8,6 +8,11 @@ | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | +%import "gcc_macros.h" | ||
12 | + | ||
13 | +%ignore WCHAR_MAX; | ||
14 | +%ignore WCHAR_MIN; | ||
15 | + | ||
16 | %module(threads=1) m2crypto | ||
17 | /* We really don't need threadblock (PyGILState_Ensure() etc.) anywhere. | ||
18 | Disable threadallow as well, only enable it for operations likely to | ||
19 | @@ -15,11 +20,6 @@ | ||
20 | %nothreadblock; | ||
21 | %nothreadallow; | ||
22 | |||
23 | -#if SWIG_VERSION >= 0x030000 | ||
24 | -#define __WCHAR_MAX__ __WCHAR_MAX | ||
25 | -#define __WCHAR_MIN__ __WCHAR_MIN | ||
26 | -#endif | ||
27 | - | ||
28 | %{ | ||
29 | #ifdef _WIN32 | ||
30 | #define _WINSOCKAPI_ | ||
31 | @@ -95,4 +95,3 @@ static PyObject *x509_store_verify_cb_fu | ||
32 | %constant int encrypt = 1; | ||
33 | %constant int decrypt = 0; | ||
34 | #endif | ||
35 | - | ||
diff --git a/meta-python/recipes-devtools/python/python3-m2crypto/0001-Allow-verify_cb_-to-be-called-with-ok-True.patch b/meta-python/recipes-devtools/python/python3-m2crypto/0001-Allow-verify_cb_-to-be-called-with-ok-True.patch new file mode 100644 index 000000000..3c836635a --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-m2crypto/0001-Allow-verify_cb_-to-be-called-with-ok-True.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 73fbd1e646f6bbf202d4418bae80eb9941fbf552 Mon Sep 17 00:00:00 2001 | ||
2 | From: Casey Deccio <casey@deccio.net> | ||
3 | Date: Fri, 8 Jan 2021 12:43:09 -0700 | ||
4 | Subject: [PATCH] Allow verify_cb_* to be called with ok=True | ||
5 | |||
6 | With https://github.com/openssl/openssl/commit/2e06150e3928daa06d5ff70c32bffad8088ebe58 | ||
7 | OpenSSL allowed verificaton to continue on UNABLE_TO_VERIFY_LEAF_SIGNATURE | ||
8 | --- | ||
9 | tests/test_ssl.py | 14 ++++++++++++-- | ||
10 | 1 file changed, 12 insertions(+), 2 deletions(-) | ||
11 | |||
12 | diff --git a/tests/test_ssl.py b/tests/test_ssl.py | ||
13 | index 92b6942..7a3271a 100644 | ||
14 | --- a/tests/test_ssl.py | ||
15 | +++ b/tests/test_ssl.py | ||
16 | @@ -59,8 +59,13 @@ def allocate_srv_port(): | ||
17 | |||
18 | |||
19 | def verify_cb_new_function(ok, store): | ||
20 | - assert not ok | ||
21 | err = store.get_error() | ||
22 | + # If err is X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE, then instead of | ||
23 | + # aborting, this callback is called to retrieve additional error | ||
24 | + # information. In this case, ok might not be False. | ||
25 | + # See https://github.com/openssl/openssl/commit/2e06150e3928daa06d5ff70c32bffad8088ebe58 | ||
26 | + if err != m2.X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: | ||
27 | + assert not ok | ||
28 | assert err in [m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT, | ||
29 | m2.X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY, | ||
30 | m2.X509_V_ERR_CERT_UNTRUSTED, | ||
31 | @@ -618,7 +623,12 @@ class MiscSSLClientTestCase(BaseSSLClientTestCase): | ||
32 | |||
33 | def verify_cb_old(self, ctx_ptr, x509_ptr, err, depth, ok): | ||
34 | try: | ||
35 | - self.assertFalse(ok) | ||
36 | + # If err is X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE, then instead of | ||
37 | + # aborting, this callback is called to retrieve additional error | ||
38 | + # information. In this case, ok might not be False. | ||
39 | + # See https://github.com/openssl/openssl/commit/2e06150e3928daa06d5ff70c32bffad8088ebe58 | ||
40 | + if err != m2.X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: | ||
41 | + self.assertFalse(ok) | ||
42 | self.assertIn(err, | ||
43 | [m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT, | ||
44 | m2.X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY, | ||
45 | -- | ||
46 | 2.29.2 | ||
47 | |||
diff --git a/meta-python/recipes-devtools/python/python3-m2crypto/0001-Use-of-RSA_SSLV23_PADDING-has-been-deprecated.patch b/meta-python/recipes-devtools/python/python3-m2crypto/0001-Use-of-RSA_SSLV23_PADDING-has-been-deprecated.patch new file mode 100644 index 000000000..2313a324a --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-m2crypto/0001-Use-of-RSA_SSLV23_PADDING-has-been-deprecated.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From d06eaa88a5f491827733f32027c46de3557fbd05 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu> | ||
3 | Date: Fri, 19 Feb 2021 15:53:02 +0100 | ||
4 | Subject: [PATCH] Use of RSA_SSLV23_PADDING has been deprecated. | ||
5 | |||
6 | Fixes #293. | ||
7 | --- | ||
8 | tests/test_rsa.py | 5 ----- | ||
9 | 1 file changed, 5 deletions(-) | ||
10 | |||
11 | diff --git a/tests/test_rsa.py b/tests/test_rsa.py | ||
12 | index 3de5016..7299785 100644 | ||
13 | --- a/tests/test_rsa.py | ||
14 | +++ b/tests/test_rsa.py | ||
15 | @@ -124,11 +124,6 @@ class RSATestCase(unittest.TestCase): | ||
16 | ptxt = priv.private_decrypt(ctxt, p) | ||
17 | self.assertEqual(ptxt, self.data) | ||
18 | |||
19 | - # sslv23_padding | ||
20 | - ctxt = priv.public_encrypt(self.data, RSA.sslv23_padding) | ||
21 | - res = priv.private_decrypt(ctxt, RSA.sslv23_padding) | ||
22 | - self.assertEqual(res, self.data) | ||
23 | - | ||
24 | # no_padding | ||
25 | with six.assertRaisesRegex(self, RSA.RSAError, 'data too small'): | ||
26 | priv.public_encrypt(self.data, RSA.no_padding) | ||
27 | -- | ||
28 | 2.29.2 | ||
29 | |||
diff --git a/meta-python/recipes-devtools/python/python-m2crypto/0001-setup.py-link-in-sysroot-not-in-host-directories.patch b/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-link-in-sysroot-not-in-host-directories.patch index b339d93f7..f4c74384f 100644 --- a/meta-python/recipes-devtools/python/python-m2crypto/0001-setup.py-link-in-sysroot-not-in-host-directories.patch +++ b/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-link-in-sysroot-not-in-host-directories.patch | |||
@@ -10,19 +10,17 @@ Upstream-status: Unknown | |||
10 | setup.py | 6 +++--- | 10 | setup.py | 6 +++--- |
11 | 1 file changed, 3 insertions(+), 3 deletions(-) | 11 | 1 file changed, 3 insertions(+), 3 deletions(-) |
12 | 12 | ||
13 | Index: M2Crypto-0.30.1/setup.py | 13 | --- a/setup.py |
14 | =================================================================== | 14 | +++ b/setup.py |
15 | --- M2Crypto-0.30.1.orig/setup.py | 15 | @@ -135,6 +135,7 @@ class _M2CryptoBuildExt(build_ext.build_ |
16 | +++ M2Crypto-0.30.1/setup.py | ||
17 | @@ -130,6 +130,7 @@ class _M2CryptoBuildExt(build_ext.build_ | ||
18 | self.set_undefined_options('build', ('bundledlls', 'bundledlls')) | 16 | self.set_undefined_options('build', ('bundledlls', 'bundledlls')) |
19 | 17 | ||
20 | self.libraries = ['ssl', 'crypto'] | 18 | self.libraries = ['ssl', 'crypto'] |
21 | + self.openssl = os.environ.get( "STAGING_DIR" ) | 19 | + self.openssl = os.environ.get( "STAGING_DIR" ) |
22 | if sys.platform == 'win32': | 20 | if sys.platform == 'win32': |
23 | self.libraries = ['ssleay32', 'libeay32'] | 21 | self.libraries = ['ssleay32', 'libeay32'] |
24 | if self.openssl and openssl_version(self.openssl, 0x10100000, True): | 22 | if self.openssl and openssl_version(self.openssl, |
25 | @@ -150,8 +151,8 @@ class _M2CryptoBuildExt(build_ext.build_ | 23 | @@ -159,8 +160,8 @@ class _M2CryptoBuildExt(build_ext.build_ |
26 | 24 | ||
27 | if self.openssl is not None: | 25 | if self.openssl is not None: |
28 | log.debug('self.openssl = %s', self.openssl) | 26 | log.debug('self.openssl = %s', self.openssl) |
diff --git a/meta-python/recipes-devtools/python/python-m2crypto/cross-compile-platform.patch b/meta-python/recipes-devtools/python/python3-m2crypto/cross-compile-platform.patch index 4b64f4613..f039ae866 100644 --- a/meta-python/recipes-devtools/python/python-m2crypto/cross-compile-platform.patch +++ b/meta-python/recipes-devtools/python/python3-m2crypto/cross-compile-platform.patch | |||
@@ -4,11 +4,9 @@ since it pokes at the system for getting architecture values | |||
4 | Upstream-Status: Inappropriate | 4 | Upstream-Status: Inappropriate |
5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
6 | 6 | ||
7 | Index: M2Crypto-0.30.1/setup.py | 7 | --- a/setup.py |
8 | =================================================================== | 8 | +++ b/setup.py |
9 | --- M2Crypto-0.30.1.orig/setup.py | 9 | @@ -169,22 +169,6 @@ class _M2CryptoBuildExt(build_ext.build_ |
10 | +++ M2Crypto-0.30.1/setup.py | ||
11 | @@ -160,22 +160,6 @@ class _M2CryptoBuildExt(build_ext.build_ | ||
12 | log.debug('self.include_dirs = %s', self.include_dirs) | 10 | log.debug('self.include_dirs = %s', self.include_dirs) |
13 | log.debug('self.library_dirs = %s', self.library_dirs) | 11 | log.debug('self.library_dirs = %s', self.library_dirs) |
14 | 12 | ||
diff --git a/meta-python/recipes-devtools/python/python3-m2crypto_0.30.1.bb b/meta-python/recipes-devtools/python/python3-m2crypto_0.30.1.bb deleted file mode 100644 index 4d63d4bd3..000000000 --- a/meta-python/recipes-devtools/python/python3-m2crypto_0.30.1.bb +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | inherit setuptools3 | ||
2 | require python-m2crypto.inc | ||
diff --git a/meta-python/recipes-devtools/python/python-m2crypto.inc b/meta-python/recipes-devtools/python/python3-m2crypto_0.37.1.bb index 797a0354b..896d9d2cc 100644 --- a/meta-python/recipes-devtools/python/python-m2crypto.inc +++ b/meta-python/recipes-devtools/python/python3-m2crypto_0.37.1.bb | |||
@@ -8,13 +8,13 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/python-m2crypto:" | |||
8 | 8 | ||
9 | SRC_URI += "file://0001-setup.py-link-in-sysroot-not-in-host-directories.patch \ | 9 | SRC_URI += "file://0001-setup.py-link-in-sysroot-not-in-host-directories.patch \ |
10 | file://cross-compile-platform.patch \ | 10 | file://cross-compile-platform.patch \ |
11 | file://m2crypto-0.26.4-gcc_macros.patch \ | 11 | file://0001-Allow-verify_cb_-to-be-called-with-ok-True.patch \ |
12 | file://0001-Use-of-RSA_SSLV23_PADDING-has-been-deprecated.patch \ | ||
12 | " | 13 | " |
13 | SRC_URI[md5sum] = "7fce3cbf85eb84a669682892b935746b" | 14 | SRC_URI[sha256sum] = "e4e42f068b78ccbf113e5d0a72ae5f480f6c3ace4940b91e4fff5598cfff6fb3" |
14 | SRC_URI[sha256sum] = "a1b2751cdadc6afac3df8a5799676b7b7c67a6ad144bb62d38563062e7cd3fc6" | ||
15 | 15 | ||
16 | PYPI_PACKAGE = "M2Crypto" | 16 | PYPI_PACKAGE = "M2Crypto" |
17 | inherit pypi siteinfo | 17 | inherit pypi siteinfo setuptools3 |
18 | 18 | ||
19 | DEPENDS += "openssl swig-native" | 19 | DEPENDS += "openssl swig-native" |
20 | RDEPENDS_${PN} += "\ | 20 | RDEPENDS_${PN} += "\ |