Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3-m2crypto: Upgrade to 0.37.1 #352

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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.29.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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.29.2

Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ Upstream-status: Unknown
setup.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Index: M2Crypto-0.30.1/setup.py
===================================================================
--- M2Crypto-0.30.1.orig/setup.py
+++ M2Crypto-0.30.1/setup.py
@@ -130,6 +130,7 @@ class _M2CryptoBuildExt(build_ext.build_
--- a/setup.py
+++ b/setup.py
@@ -135,6 +135,7 @@ class _M2CryptoBuildExt(build_ext.build_
self.set_undefined_options('build', ('bundledlls', 'bundledlls'))

self.libraries = ['ssl', 'crypto']
+ self.openssl = os.environ.get( "STAGING_DIR" )
if sys.platform == 'win32':
self.libraries = ['ssleay32', 'libeay32']
if self.openssl and openssl_version(self.openssl, 0x10100000, True):
@@ -150,8 +151,8 @@ class _M2CryptoBuildExt(build_ext.build_
if self.openssl and openssl_version(self.openssl,
@@ -159,8 +160,8 @@ class _M2CryptoBuildExt(build_ext.build_

if self.openssl is not None:
log.debug('self.openssl = %s', self.openssl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ since it pokes at the system for getting architecture values
Upstream-Status: Inappropriate
Signed-off-by: Khem Raj <raj.khem@gmail.com>

Index: M2Crypto-0.30.1/setup.py
===================================================================
--- M2Crypto-0.30.1.orig/setup.py
+++ M2Crypto-0.30.1/setup.py
@@ -160,22 +160,6 @@ class _M2CryptoBuildExt(build_ext.build_
--- a/setup.py
+++ b/setup.py
@@ -169,22 +169,6 @@ class _M2CryptoBuildExt(build_ext.build_
log.debug('self.include_dirs = %s', self.include_dirs)
log.debug('self.library_dirs = %s', self.library_dirs)

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/python-m2crypto:"

SRC_URI += "file://0001-setup.py-link-in-sysroot-not-in-host-directories.patch \
file://cross-compile-platform.patch \
file://m2crypto-0.26.4-gcc_macros.patch \
file://0001-Allow-verify_cb_-to-be-called-with-ok-True.patch \
file://0001-Use-of-RSA_SSLV23_PADDING-has-been-deprecated.patch \
"
SRC_URI[md5sum] = "7fce3cbf85eb84a669682892b935746b"
SRC_URI[sha256sum] = "a1b2751cdadc6afac3df8a5799676b7b7c67a6ad144bb62d38563062e7cd3fc6"
SRC_URI[sha256sum] = "e4e42f068b78ccbf113e5d0a72ae5f480f6c3ace4940b91e4fff5598cfff6fb3"

PYPI_PACKAGE = "M2Crypto"
inherit pypi siteinfo
inherit pypi siteinfo setuptools3

DEPENDS += "openssl swig-native"
RDEPENDS_${PN} += "\
Expand Down