[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#930221: marked as done (unblock: m2crypto/0.31.0-4)



Your message dated Tue, 11 Jun 2019 20:41:13 +0200
with message-id <f6c0e62b-da87-9b02-204d-913be2da4b58@debian.org>
and subject line Re: Bug#930221: unblock: m2crypto/ 0.31.0-3.1
has caused the Debian Bug report #930221,
regarding unblock: m2crypto/0.31.0-4
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
930221: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930221
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
User: release.debian.org@packages.debian.org
Usertags: unblock
Severity: normal

This is a proposal for m2crypto which could be uploaded to unstable and
unblocked for Buster unless someone objects.
The testsuite in m2crypto fails because it tests for a bug in openssl
which was fixed in 1.1.1c which is currently in unstable (and is
friendly asking for the Buster gates to open in #930194). The m2crypto
bug is tracked in #929903.

I backported three patches from upstream and made one additional myself
(which has been forwarded) to get this sorted out.

I don't mind if the maintainer of m2crypto takes over, I just wanted to
make everything ready so nobody blaims openssl for stalling the Buster
release :)

unblock m2crypto/ 0.31.0-3.1

Sebastian
diff -Nru m2crypto-0.31.0/debian/changelog m2crypto-0.31.0/debian/changelog
--- m2crypto-0.31.0/debian/changelog	2019-03-11 19:44:01.000000000 +0100
+++ m2crypto-0.31.0/debian/changelog	2019-06-08 12:35:11.000000000 +0200
@@ -1,3 +1,11 @@
+m2crypto (0.31.0-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Add a few patches from upstream to avoid a testsuite regression while
+    testing for bug which was fixed in OpenSSL 1.1.1c (Closes: #929903).
+
+ -- Sebastian Andrzej Siewior <sebastian@breakpoint.cc>  Sat, 08 Jun 2019 12:35:11 +0200
+
 m2crypto (0.31.0-3) unstable; urgency=medium
 
   * add 0002-tests-test_ssl-use-ciphercuites-for-TLS1.3-cipher-in.patch
diff -Nru m2crypto-0.31.0/debian/patches/0003-Remove-duplicate-call-of-the-error-code.patch m2crypto-0.31.0/debian/patches/0003-Remove-duplicate-call-of-the-error-code.patch
--- m2crypto-0.31.0/debian/patches/0003-Remove-duplicate-call-of-the-error-code.patch	1970-01-01 01:00:00.000000000 +0100
+++ m2crypto-0.31.0/debian/patches/0003-Remove-duplicate-call-of-the-error-code.patch	2019-06-08 12:34:05.000000000 +0200
@@ -0,0 +1,25 @@
+From 83d4d9bc3aa4466e540fa00f8cc6891c0301ec82 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
+Date: Fri, 31 May 2019 17:00:14 +0200
+Subject: [PATCH] Remove duplicate call of the error code.
+
+---
+ tests/test_rsa.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/tests/test_rsa.py b/tests/test_rsa.py
+index 308b1b180445d..875b59c6844b5 100644
+--- a/tests/test_rsa.py
++++ b/tests/test_rsa.py
+@@ -126,8 +126,6 @@ log = logging.getLogger('test_RSA')
+         ctxt = priv.public_encrypt(self.data, RSA.sslv23_padding)
+         with self.assertRaises(RSA.RSAError):
+             priv.private_decrypt(ctxt, RSA.sslv23_padding)
+-        with self.assertRaises(RSA.RSAError):
+-            priv.private_decrypt(ctxt, RSA.sslv23_padding)
+ 
+         # no_padding
+         with self.assertRaises(RSA.RSAError):
+-- 
+2.20.1
+
diff -Nru m2crypto-0.31.0/debian/patches/0004-Limit-tests.test_rsa.RSATestCase.test_public_encrypt.patch m2crypto-0.31.0/debian/patches/0004-Limit-tests.test_rsa.RSATestCase.test_public_encrypt.patch
--- m2crypto-0.31.0/debian/patches/0004-Limit-tests.test_rsa.RSATestCase.test_public_encrypt.patch	1970-01-01 01:00:00.000000000 +0100
+++ m2crypto-0.31.0/debian/patches/0004-Limit-tests.test_rsa.RSATestCase.test_public_encrypt.patch	2019-06-08 12:33:53.000000000 +0200
@@ -0,0 +1,42 @@
+From 0b22d79082afd7c564b2ac07fb0ef5d76d692586 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
+Date: Fri, 7 Jun 2019 11:43:03 +0200
+Subject: [PATCH] Limit tests.test_rsa.RSATestCase.test_public_encrypt just
+ to OpenSSL which sustains it.
+
+Fixes #258
+---
+ tests/test_rsa.py | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/tests/test_rsa.py b/tests/test_rsa.py
+index 875b59c6844b5..7028b6085788e 100644
+--- a/tests/test_rsa.py
++++ b/tests/test_rsa.py
+@@ -113,6 +113,8 @@ log = logging.getLogger('test_RSA')
+         with self.assertRaises(TypeError):
+             priv.private_encrypt(self.gen_callback, RSA.pkcs1_padding)
+ 
++    @unittest.skipIf(m2.OPENSSL_VERSION_NUMBER < 0x1010103f,
++                     'Relies on fix which happened only in OpenSSL 1.1.1c')
+     def test_public_encrypt(self):
+         priv = RSA.load_key(self.privkey)
+         # pkcs1_padding, pkcs1_oaep_padding
+@@ -124,11 +126,11 @@ log = logging.getLogger('test_RSA')
+ 
+         # sslv23_padding
+         ctxt = priv.public_encrypt(self.data, RSA.sslv23_padding)
+-        with self.assertRaises(RSA.RSAError):
+-            priv.private_decrypt(ctxt, RSA.sslv23_padding)
++        res = priv.private_decrypt(ctxt, RSA.sslv23_padding)
++        self.assertEqual(res, self.data)
+ 
+         # no_padding
+-        with self.assertRaises(RSA.RSAError):
++        with six.assertRaisesRegex(self, TypeError, 'data too small'):
+             priv.public_encrypt(self.data, RSA.no_padding)
+ 
+         # Type-check the data to be encrypted.
+-- 
+2.20.1
+
diff -Nru m2crypto-0.31.0/debian/patches/0005-tests.test_rsa-Fix-typo-to-match-for-proper-exceptio.patch m2crypto-0.31.0/debian/patches/0005-tests.test_rsa-Fix-typo-to-match-for-proper-exceptio.patch
--- m2crypto-0.31.0/debian/patches/0005-tests.test_rsa-Fix-typo-to-match-for-proper-exceptio.patch	1970-01-01 01:00:00.000000000 +0100
+++ m2crypto-0.31.0/debian/patches/0005-tests.test_rsa-Fix-typo-to-match-for-proper-exceptio.patch	2019-06-08 12:35:11.000000000 +0200
@@ -0,0 +1,25 @@
+From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+Date: Sat, 8 Jun 2019 14:13:59 +0000
+Subject: [PATCH] tests.test_rsa: Fix typo to match for proper exception
+
+Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+---
+ tests/test_rsa.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_rsa.py b/tests/test_rsa.py
+index 7028b6085788e..a1d0805fc04e4 100644
+--- a/tests/test_rsa.py
++++ b/tests/test_rsa.py
+@@ -130,7 +130,7 @@ log = logging.getLogger('test_RSA')
+         self.assertEqual(res, self.data)
+ 
+         # no_padding
+-        with six.assertRaisesRegex(self, TypeError, 'data too small'):
++        with six.assertRaisesRegex(self, RSA.RSAError, 'data too small'):
+             priv.public_encrypt(self.data, RSA.no_padding)
+ 
+         # Type-check the data to be encrypted.
+-- 
+2.20.1
+
diff -Nru m2crypto-0.31.0/debian/patches/0006-Be-resilient-against-the-situation-when-no-erorr-hap.patch m2crypto-0.31.0/debian/patches/0006-Be-resilient-against-the-situation-when-no-erorr-hap.patch
--- m2crypto-0.31.0/debian/patches/0006-Be-resilient-against-the-situation-when-no-erorr-hap.patch	1970-01-01 01:00:00.000000000 +0100
+++ m2crypto-0.31.0/debian/patches/0006-Be-resilient-against-the-situation-when-no-erorr-hap.patch	2019-06-08 12:35:11.000000000 +0200
@@ -0,0 +1,106 @@
+From f287d7145b5fd28f630f2b823ad45a44cf635b35 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
+Date: Thu, 30 May 2019 16:01:36 +0200
+Subject: [PATCH] Be resilient against the situation when no erorr happened.
+
+Fixes #258.
+---
+ M2Crypto/Err.py   | 20 ++++++++++++--------
+ tests/alltests.py |  1 +
+ tests/test_err.py | 28 ++++++++++++++++++++++++++++
+ 3 files changed, 41 insertions(+), 8 deletions(-)
+ create mode 100644 tests/test_err.py
+
+diff --git a/M2Crypto/Err.py b/M2Crypto/Err.py
+index dcee587712200..70974c94ac1e2 100644
+--- a/M2Crypto/Err.py
++++ b/M2Crypto/Err.py
+@@ -29,18 +29,21 @@ from M2Crypto import BIO, m2, py27plus, util, six  # noqa
+ 
+ 
+ def get_error_lib(err):
+-    # type: (int) -> str
+-    return six.ensure_text(m2.err_lib_error_string(err))
++    # type: (Optional[int]) -> str
++    err_str = m2.err_lib_error_string(err)
++    return six.ensure_text(err_str) if err_str else ''
+ 
+ 
+ def get_error_func(err):
+-    # type: (int) -> str
+-    return six.ensure_text(m2.err_func_error_string(err))
++    # type: (Optional[int]) -> str
++    err_str = m2.err_func_error_string(err)
++    return six.ensure_text(err_str) if err_str else ''
+ 
+ 
+ def get_error_reason(err):
+-    # type: (int) -> str
+-    return six.ensure_text(m2.err_reason_error_string(err))
++    # type: (Optional[int]) -> str
++    err_str = m2.err_reason_error_string(err)
++    return six.ensure_text(err_str) if err_str else ''
+ 
+ 
+ def get_error_message():
+@@ -49,8 +52,9 @@ from M2Crypto import BIO, m2, py27plus, util, six  # noqa
+ 
+ 
+ def get_x509_verify_error(err):
+-    # type: (int) -> str
+-    return six.ensure_text(m2.x509_get_verify_error(err))
++    # type: (Optional[int]) -> str
++    err_str = m2.x509_get_verify_error(err)
++    return six.ensure_text(err_str) if err_str else ''
+ 
+ 
+ class SSLError(Exception):
+diff --git a/tests/alltests.py b/tests/alltests.py
+index a0e773933ee93..141cd8882b0c4 100644
+--- a/tests/alltests.py
++++ b/tests/alltests.py
+@@ -32,6 +32,7 @@ from __future__ import absolute_import, print_function
+         'tests.test_dh',
+         'tests.test_dsa',
+         'tests.test_engine',
++        'tests.test_err',
+         'tests.test_evp',
+         'tests.test_obj',
+         'tests.test_rand',
+diff --git a/tests/test_err.py b/tests/test_err.py
+new file mode 100644
+index 0000000000000..05fe425e73c91
+--- /dev/null
++++ b/tests/test_err.py
+@@ -0,0 +1,28 @@
++#!/usr/bin/env python
++# -*- coding: utf-8 -*-
++"""Unit tests for M2Crypto.Err.
++
++Copyright (C) 2019 Matěj Cepl
++Released under the terms of MIT/X11 License,
++see the file LICENCE for more.
++"""
++from M2Crypto import Err
++from tests import unittest
++
++
++class ErrTestCase(unittest.TestCase):
++
++    def test_no_error(self):
++        # Protection against gl#m2crypto/m2crypto#258
++        self.assertEqual(Err.get_error_reason(0), '')
++
++
++
++def suite():
++    suite = unittest.TestSuite()
++    suite.addTest(unittest.makeSuite(ErrTestCase))
++    return suite
++
++
++if __name__ == '__main__':
++    unittest.TextTestRunner().run(suite())
+-- 
+2.20.1
+
diff -Nru m2crypto-0.31.0/debian/patches/series m2crypto-0.31.0/debian/patches/series
--- m2crypto-0.31.0/debian/patches/series	2019-03-11 19:43:58.000000000 +0100
+++ m2crypto-0.31.0/debian/patches/series	2019-06-08 12:35:11.000000000 +0200
@@ -1,2 +1,6 @@
 0001-import-inspect-in-urllib-2.patch
 0002-tests-test_ssl-use-ciphercuites-for-TLS1.3-cipher-in.patch
+0003-Remove-duplicate-call-of-the-error-code.patch
+0004-Limit-tests.test_rsa.RSATestCase.test_public_encrypt.patch
+0005-tests.test_rsa-Fix-typo-to-match-for-proper-exceptio.patch
+0006-Be-resilient-against-the-situation-when-no-erorr-hap.patch

--- End Message ---
--- Begin Message ---
Hi

On 09-06-2019 20:45, Paul Gevers wrote:
> I'll trigger a test with openssl 1.1.1c to verify, but the test passed
> in unstable already. If that passes, I'll unblock this.

Unblocked, thanks.

Paul

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

Reply to: