diff options
author | Michał Górny <mgorny@gentoo.org> | 2021-02-10 00:34:56 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2021-02-10 00:38:41 +0100 |
commit | ba21d61bf2fd7912252e10ecff3e03f735a78855 (patch) | |
tree | efd781ace81ad80e7f068b43cc1f93819636b13f /dev-python/pypy3 | |
parent | sys-fs/mergerfs: 2.32.3 bump (diff) | |
download | gentoo-ba21d61bf2fd7912252e10ecff3e03f735a78855.tar.gz gentoo-ba21d61bf2fd7912252e10ecff3e03f735a78855.tar.bz2 gentoo-ba21d61bf2fd7912252e10ecff3e03f735a78855.zip |
dev-python/pypy3: Backport servername_callback fix
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/pypy3')
-rw-r--r-- | dev-python/pypy3/files/7.3.3_p37-sni-handle.patch | 38 | ||||
-rw-r--r-- | dev-python/pypy3/pypy3-7.3.3_p37-r1.ebuild (renamed from dev-python/pypy3/pypy3-7.3.3_p37.ebuild) | 4 |
2 files changed, 41 insertions, 1 deletions
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 new file mode 100644 index 000000000000..c4e377c3d8d8 --- /dev/null +++ b/dev-python/pypy3/files/7.3.3_p37-sni-handle.patch @@ -0,0 +1,38 @@ +diff -dupr a/lib_pypy/_cffi_ssl/_stdssl/__init__.py b/lib_pypy/_cffi_ssl/_stdssl/__init__.py +--- a/lib_pypy/_cffi_ssl/_stdssl/__init__.py 2021-02-10 00:15:40.815208732 +0100 ++++ b/lib_pypy/_cffi_ssl/_stdssl/__init__.py 2021-02-10 00:19:27.963109365 +0100 +@@ -1008,10 +1008,10 @@ for name in SSL_CTX_STATS_NAMES: + SSL_CTX_STATS.append((name, getattr(lib, attr))) + + class _SSLContext(object): +- __slots__ = ('ctx', '_check_hostname', 'servername_callback', ++ __slots__ = ('ctx', '_check_hostname', + 'alpn_protocols', '_alpn_protocols_handle', '_protocol' + 'npn_protocols', 'set_hostname', '_post_handshake_auth', +- '_sni_cb', '_npn_protocols_handle') ++ '_sni_cb', '_sni_cb_handle', '_npn_protocols_handle') + def __new__(cls, protocol): + self = object.__new__(cls) + self.ctx = ffi.NULL +@@ -1451,15 +1451,17 @@ class _SSLContext(object): + "is not in the current OpenSSL library.") + if cb is None: + lib.SSL_CTX_set_tlsext_servername_callback(self.ctx, ffi.NULL) +- self._sni_cb= None ++ self._sni_cb = None ++ lib.SSL_CTX_set_tlsext_servername_arg(self.ctx, ffi.NULL) ++ self._sni_cb_handle = None + return + if not callable(cb): + lib.SSL_CTX_set_tlsext_servername_callback(self.ctx, ffi.NULL) + raise TypeError("not a callable object") +- self.scb = ServernameCallback(cb, self) +- sni_cb = ffi.new_handle(self.scb) ++ self._sni_cb = ServernameCallback(cb, self) ++ self._sni_cb_handle = ffi.new_handle(self._sni_cb) + lib.SSL_CTX_set_tlsext_servername_callback(self.ctx, _servername_callback) +- lib.SSL_CTX_set_tlsext_servername_arg(self.ctx, sni_cb) ++ lib.SSL_CTX_set_tlsext_servername_arg(self.ctx, self._sni_cb_handle) + + def cert_store_stats(self): + store = lib.SSL_CTX_get_cert_store(self.ctx) diff --git a/dev-python/pypy3/pypy3-7.3.3_p37.ebuild b/dev-python/pypy3/pypy3-7.3.3_p37-r1.ebuild index 9c1fc7d860ba..a5d9d3cf0aa9 100644 --- a/dev-python/pypy3/pypy3-7.3.3_p37.ebuild +++ b/dev-python/pypy3/pypy3-7.3.3_p37-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -50,6 +50,8 @@ src_prepare() { eapply "${FILESDIR}/7.3.1-gentoo-path.patch" eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" eapply "${FILESDIR}/7.3.2-py37-distutils-cxx.patch" + # https://foss.heptapod.net/pypy/pypy/-/issues/3396 + eapply "${FILESDIR}/7.3.3_p37-sni-handle.patch" sed -e "s^@EPREFIX@^${EPREFIX}^" \ -i lib-python/3/distutils/command/install.py || die |