1 |
commit: ba21d61bf2fd7912252e10ecff3e03f735a78855 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 9 23:34:56 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 9 23:38:41 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba21d61b |
7 |
|
8 |
dev-python/pypy3: Backport servername_callback fix |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-python/pypy3/files/7.3.3_p37-sni-handle.patch | 38 ++++++++++++++++++++++ |
13 |
...-7.3.3_p37.ebuild => pypy3-7.3.3_p37-r1.ebuild} | 4 ++- |
14 |
2 files changed, 41 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/dev-python/pypy3/files/7.3.3_p37-sni-handle.patch b/dev-python/pypy3/files/7.3.3_p37-sni-handle.patch |
17 |
new file mode 100644 |
18 |
index 00000000000..c4e377c3d8d |
19 |
--- /dev/null |
20 |
+++ b/dev-python/pypy3/files/7.3.3_p37-sni-handle.patch |
21 |
@@ -0,0 +1,38 @@ |
22 |
+diff -dupr a/lib_pypy/_cffi_ssl/_stdssl/__init__.py b/lib_pypy/_cffi_ssl/_stdssl/__init__.py |
23 |
+--- a/lib_pypy/_cffi_ssl/_stdssl/__init__.py 2021-02-10 00:15:40.815208732 +0100 |
24 |
++++ b/lib_pypy/_cffi_ssl/_stdssl/__init__.py 2021-02-10 00:19:27.963109365 +0100 |
25 |
+@@ -1008,10 +1008,10 @@ for name in SSL_CTX_STATS_NAMES: |
26 |
+ SSL_CTX_STATS.append((name, getattr(lib, attr))) |
27 |
+ |
28 |
+ class _SSLContext(object): |
29 |
+- __slots__ = ('ctx', '_check_hostname', 'servername_callback', |
30 |
++ __slots__ = ('ctx', '_check_hostname', |
31 |
+ 'alpn_protocols', '_alpn_protocols_handle', '_protocol' |
32 |
+ 'npn_protocols', 'set_hostname', '_post_handshake_auth', |
33 |
+- '_sni_cb', '_npn_protocols_handle') |
34 |
++ '_sni_cb', '_sni_cb_handle', '_npn_protocols_handle') |
35 |
+ def __new__(cls, protocol): |
36 |
+ self = object.__new__(cls) |
37 |
+ self.ctx = ffi.NULL |
38 |
+@@ -1451,15 +1451,17 @@ class _SSLContext(object): |
39 |
+ "is not in the current OpenSSL library.") |
40 |
+ if cb is None: |
41 |
+ lib.SSL_CTX_set_tlsext_servername_callback(self.ctx, ffi.NULL) |
42 |
+- self._sni_cb= None |
43 |
++ self._sni_cb = None |
44 |
++ lib.SSL_CTX_set_tlsext_servername_arg(self.ctx, ffi.NULL) |
45 |
++ self._sni_cb_handle = None |
46 |
+ return |
47 |
+ if not callable(cb): |
48 |
+ lib.SSL_CTX_set_tlsext_servername_callback(self.ctx, ffi.NULL) |
49 |
+ raise TypeError("not a callable object") |
50 |
+- self.scb = ServernameCallback(cb, self) |
51 |
+- sni_cb = ffi.new_handle(self.scb) |
52 |
++ self._sni_cb = ServernameCallback(cb, self) |
53 |
++ self._sni_cb_handle = ffi.new_handle(self._sni_cb) |
54 |
+ lib.SSL_CTX_set_tlsext_servername_callback(self.ctx, _servername_callback) |
55 |
+- lib.SSL_CTX_set_tlsext_servername_arg(self.ctx, sni_cb) |
56 |
++ lib.SSL_CTX_set_tlsext_servername_arg(self.ctx, self._sni_cb_handle) |
57 |
+ |
58 |
+ def cert_store_stats(self): |
59 |
+ store = lib.SSL_CTX_get_cert_store(self.ctx) |
60 |
|
61 |
diff --git a/dev-python/pypy3/pypy3-7.3.3_p37.ebuild b/dev-python/pypy3/pypy3-7.3.3_p37-r1.ebuild |
62 |
similarity index 97% |
63 |
rename from dev-python/pypy3/pypy3-7.3.3_p37.ebuild |
64 |
rename to dev-python/pypy3/pypy3-7.3.3_p37-r1.ebuild |
65 |
index 9c1fc7d860b..a5d9d3cf0aa 100644 |
66 |
--- a/dev-python/pypy3/pypy3-7.3.3_p37.ebuild |
67 |
+++ b/dev-python/pypy3/pypy3-7.3.3_p37-r1.ebuild |
68 |
@@ -1,4 +1,4 @@ |
69 |
-# Copyright 1999-2020 Gentoo Authors |
70 |
+# Copyright 1999-2021 Gentoo Authors |
71 |
# Distributed under the terms of the GNU General Public License v2 |
72 |
|
73 |
EAPI=7 |
74 |
@@ -50,6 +50,8 @@ src_prepare() { |
75 |
eapply "${FILESDIR}/7.3.1-gentoo-path.patch" |
76 |
eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" |
77 |
eapply "${FILESDIR}/7.3.2-py37-distutils-cxx.patch" |
78 |
+ # https://foss.heptapod.net/pypy/pypy/-/issues/3396 |
79 |
+ eapply "${FILESDIR}/7.3.3_p37-sni-handle.patch" |
80 |
|
81 |
sed -e "s^@EPREFIX@^${EPREFIX}^" \ |
82 |
-i lib-python/3/distutils/command/install.py || die |