Package: python3-m2crypto
Version: 0.31.0-9+b1
Severity: grave
Justification: renders package unusable

Dear maintainer,

>From https://gitlab.com/m2crypto/m2crypto/-/merge_requests/242:
        In python3.8 the fp is wrapped in a Buffer.
        SSL.Connection.makefile returns a socketIO which is no buffer.
        SocketIO in 'r' mode:
        use io.BufferedReader
        SocketIO in 'rw' mode:
        use io.BufferedRWPair
At the moment, m2crypto breaks down when chunked reads are done.
See but report https://github.com/openSUSE/osc/issues/783
for more discussion.

I attach a debdiff against the current package. I can confirm that the
upstream fix applies cleanly to the version in Debian and fixes the
problem.

Thanks

Norbert

PS: m2crypto could need an update, too, latest version is 0.35.2


-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.6.5 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python3-m2crypto depends on:
ii  libc6      2.30-4
ii  libssl1.1  1.1.1g-1
ii  python3    3.8.2-3

python3-m2crypto recommends no packages.

Versions of packages python3-m2crypto suggests:
pn  m2crypto-doc  <none>

-- no debconf information
diff -Nru m2crypto-0.31.0/debian/changelog m2crypto-0.31.0/debian/changelog
--- m2crypto-0.31.0/debian/changelog    2020-01-31 14:17:53.000000000 +0900
+++ m2crypto-0.31.0/debian/changelog    2020-04-23 07:21:19.000000000 +0900
@@ -1,3 +1,13 @@
+m2crypto (0.31.0-9.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix incompatibility with Python 3.8
+    python3.8 http.client module expects that m2crypto handles short read
+    (See https://github.com/openSUSE/osc/issues/783 and
+    https://github.com/openSUSE/osc/issues/783)
+
+ -- Norbert Preining <norb...@preining.info>  Thu, 23 Apr 2020 07:21:19 +0900
+
 m2crypto (0.31.0-9) unstable; urgency=medium
 
   [ Debian Janitor ]
diff -Nru 
m2crypto-0.31.0/debian/patches/d3a43ffe1bfe4c128d6ab7c390419dee68f4ca5a.patch 
m2crypto-0.31.0/debian/patches/d3a43ffe1bfe4c128d6ab7c390419dee68f4ca5a.patch
--- 
m2crypto-0.31.0/debian/patches/d3a43ffe1bfe4c128d6ab7c390419dee68f4ca5a.patch   
    1970-01-01 09:00:00.000000000 +0900
+++ 
m2crypto-0.31.0/debian/patches/d3a43ffe1bfe4c128d6ab7c390419dee68f4ca5a.patch   
    2020-04-23 07:15:49.000000000 +0900
@@ -0,0 +1,47 @@
+From d3a43ffe1bfe4c128d6ab7c390419dee68f4ca5a Mon Sep 17 00:00:00 2001
+From: lethliel <mstr...@suse.de>
+Date: Wed, 19 Feb 2020 11:53:05 +0100
+Subject: [PATCH] wrap SocketIO in io.Buffered* for makefile
+
+In python3.8 the fp is wrapped in a Buffer.
+SSL.Connection.makefile returns a socketIO which is no buffer.
+
+SocketIO in 'r' mode:
+use io.BufferedReader
+
+SocketIO in 'rw' mode:
+use io.BufferedRWPair
+---
+ M2Crypto/SSL/Connection.py | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/M2Crypto/SSL/Connection.py b/M2Crypto/SSL/Connection.py
+index 7053aa6b..01bb61c5 100644
+--- a/M2Crypto/SSL/Connection.py
++++ b/M2Crypto/SSL/Connection.py
+@@ -12,6 +12,7 @@ Copyright 2008 Heikki Toivonen. All rights reserved.
+ 
+ import logging
+ import socket
++import io
+ 
+ from M2Crypto import BIO, Err, X509, m2, py27plus, six, util  # noqa
+ from M2Crypto.SSL import Checker, Context, timeout  # noqa
+@@ -582,9 +583,12 @@ class Connection(object):
+         return m2.ssl_set_cipher_list(self.ssl, cipher_list)
+ 
+     def makefile(self, mode='rb', bufsize=-1):
+-        # type: (AnyStr, int) -> socket._fileobject
++        # type: (AnyStr, int) -> Union[io.BufferedRWPair,io.BufferedReader]
+         if six.PY3:
+-            return socket.SocketIO(self, mode)
++            raw = socket.SocketIO(self, mode)
++            if 'rw' in mode:
++                return io.BufferedRWPair(raw, raw)
++            return io.BufferedReader(raw, io.DEFAULT_BUFFER_SIZE)
+         else:
+             return socket._fileobject(self, mode, bufsize)
+ 
+-- 
+2.26.2
+
diff -Nru m2crypto-0.31.0/debian/patches/series 
m2crypto-0.31.0/debian/patches/series
--- m2crypto-0.31.0/debian/patches/series       2020-01-31 14:17:53.000000000 
+0900
+++ m2crypto-0.31.0/debian/patches/series       2020-04-23 07:18:47.000000000 
+0900
@@ -4,3 +4,4 @@
 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-error-hap.patch
+d3a43ffe1bfe4c128d6ab7c390419dee68f4ca5a.patch

Reply via email to