diff --git a/1521_delegate_parseqs_stdlib_bpo42967.patch b/1521_delegate_parseqs_stdlib_bpo42967.patch index e53eb9d..14db004 100644 --- a/1521_delegate_parseqs_stdlib_bpo42967.patch +++ b/1521_delegate_parseqs_stdlib_bpo42967.patch @@ -9,28 +9,22 @@ Subject: [PATCH 1/2] delegate to stdlib parse qs 2 files changed, 2 insertions(+), 26 deletions(-) create mode 100644 src/twisted/web/newsfragments/10096.bugfix ---- a/src/twisted/web/http.py -+++ b/src/twisted/web/http.py -@@ -70,12 +70,12 @@ from io import BytesIO as StringIO +Index: Twisted-21.2.0/src/twisted/web/http.py +=================================================================== +--- Twisted-21.2.0.orig/src/twisted/web/http.py ++++ Twisted-21.2.0/src/twisted/web/http.py +@@ -110,6 +110,7 @@ from urllib.parse import ( + ParseResultBytes, + urlparse as _urlparse, + unquote_to_bytes as unquote, ++ parse_qs, + ) - try: - from urlparse import ( -- ParseResult as ParseResultBytes, urlparse as _urlparse) -+ ParseResult as ParseResultBytes, urlparse as _urlparse, parse_qs) - from urllib import unquote - from cgi import parse_header as _parseHeader - except ImportError: - from urllib.parse import ( -- ParseResultBytes, urlparse as _urlparse, unquote_to_bytes as unquote) -+ ParseResultBytes, urlparse as _urlparse, parse_qs) - - def _parseHeader(line): - # cgi.parse_header requires a str -@@ -191,33 +191,6 @@ def urlparse(url): + from zope.interface import Attribute, Interface, implementer, provider +@@ -261,31 +262,6 @@ def urlparse(url): return ParseResultBytes(scheme, netloc, path, params, query, fragment) -- -def parse_qs(qs, keep_blank_values=0, strict_parsing=0): - """ - Like C{cgi.parse_qs}, but with support for parsing byte strings on Python 3. @@ -55,30 +49,30 @@ Subject: [PATCH 1/2] delegate to stdlib parse qs - d[k] = [v] - return d - -- - def datetimeToString(msSinceEpoch=None): """ Convert seconds since epoch to HTTP datetime string. +Index: Twisted-21.2.0/src/twisted/web/newsfragments/10096.bugfix +=================================================================== --- /dev/null -+++ b/src/twisted/web/newsfragments/10096.bugfix ++++ Twisted-21.2.0/src/twisted/web/newsfragments/10096.bugfix @@ -0,0 +1 @@ +delegate to urllib.parse:parse_qs in twisted.web.http:parse_qs to avoid CVE-2021-23336 and the associated CI failures ---- a/src/twisted/web/server.py -+++ b/src/twisted/web/server.py -@@ -19,9 +19,9 @@ import copy - import os +Index: Twisted-21.2.0/src/twisted/web/server.py +=================================================================== +--- Twisted-21.2.0.orig/src/twisted/web/server.py ++++ Twisted-21.2.0/src/twisted/web/server.py +@@ -19,7 +19,7 @@ import os import re - try: -- from urllib import quote -+ from urllib import quote, unquote_to_bytes as _unquote_to_bytes - except ImportError: -- from urllib.parse import quote as _quote -+ from urllib.parse import quote as _quote, unquote_to_bytes as _unquote_to_bytes + from html import escape + from typing import List, Optional +-from urllib.parse import quote as _quote ++from urllib.parse import quote as _quote, unquote_to_bytes as _unquote_to_bytes - def quote(string, *args, **kwargs): - return _quote( -@@ -37,7 +37,6 @@ from twisted.spread.pb import Copyable, + import zlib + from binascii import hexlify +@@ -31,7 +31,6 @@ from twisted.spread.pb import Copyable, from twisted.internet import address, interfaces from twisted.internet.error import AlreadyCalled, AlreadyCancelled from twisted.web import iweb, http, util @@ -86,12 +80,12 @@ Subject: [PATCH 1/2] delegate to stdlib parse qs from twisted.python import reflect, failure, components from twisted import copyright from twisted.web import resource -@@ -219,7 +218,7 @@ class Request(Copyable, http.Request, co +@@ -213,7 +212,7 @@ class Request(Copyable, http.Request, co # Resource Identification self.prepath = [] -- self.postpath = list(map(unquote, self.path[1:].split(b'/'))) +- self.postpath = list(map(unquote, self.path[1:].split(b"/"))) + self.postpath = [_unquote_to_bytes(v) for v in self.path[1:].split(b"/")] # Short-circuit for requests whose path is '*'. - if self.path == b'*': + if self.path == b"*": diff --git a/Twisted-20.3.0.tar.bz2 b/Twisted-20.3.0.tar.bz2 deleted file mode 100644 index 5e34dd3..0000000 --- a/Twisted-20.3.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d72c55b5d56e176563b91d11952d13b01af8725c623e498db5507b6614fc1e10 -size 3127793 diff --git a/Twisted-21.2.0.tar.gz b/Twisted-21.2.0.tar.gz new file mode 100644 index 0000000..93c2e2d --- /dev/null +++ b/Twisted-21.2.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77544a8945cf69b98d2946689bbe0c75de7d145cdf11f391dd487eae8fc95a12 +size 3727284 diff --git a/no-cython_test_exception_raiser.patch b/no-cython_test_exception_raiser.patch new file mode 100644 index 0000000..e6db368 --- /dev/null +++ b/no-cython_test_exception_raiser.patch @@ -0,0 +1,14 @@ +Index: Twisted-21.2.0/src/twisted/test/test_failure.py +=================================================================== +--- Twisted-21.2.0.orig/src/twisted/test/test_failure.py ++++ Twisted-21.2.0/src/twisted/test/test_failure.py +@@ -22,7 +22,8 @@ from twisted.python import failure + from twisted.trial.unittest import SynchronousTestCase + + +-from cython_test_exception_raiser import raiser ++#from cython_test_exception_raiser import raiser ++raiser = None + + + def getDivisionFailure(*args, **kwargs): diff --git a/no-pygtkcompat.patch b/no-pygtkcompat.patch deleted file mode 100644 index 9beb80c..0000000 --- a/no-pygtkcompat.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -ur Twisted-18.7.0.orig/src/twisted/internet/gireactor.py Twisted-18.7.0/src/twisted/internet/gireactor.py ---- Twisted-18.7.0.orig/src/twisted/internet/gireactor.py 2018-03-26 10:19:31.000000000 +0200 -+++ Twisted-18.7.0/src/twisted/internet/gireactor.py 2018-10-04 01:41:32.547220235 +0200 -@@ -75,8 +75,12 @@ - # Newer version of gi, so we can try to initialize compatibility layer; if - # real pygtk was already imported we'll get ImportError at this point - # rather than segfault, so unconditional import is fine. -- import gi.pygtkcompat -- gi.pygtkcompat.enable() -+ try: -+ import gi.pygtkcompat -+ except ImportError: -+ pass # This is probably Python 3, with pygtkcompat removed -+ else: -+ gi.pygtkcompat.enable() - # At this point importing gobject will get you gi version, and importing - # e.g. gtk will either fail in non-segfaulty way or use gi version if user - # does gi.pygtkcompat.enable_gtk(). So, no need to prevent imports of diff --git a/no-test_successResultOfWithFailureHasTraceback.patch b/no-test_successResultOfWithFailureHasTraceback.patch index b58d4c2..8dd09cc 100644 --- a/no-test_successResultOfWithFailureHasTraceback.patch +++ b/no-test_successResultOfWithFailureHasTraceback.patch @@ -2,21 +2,22 @@ src/twisted/conch/test/test_keys.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---- a/src/twisted/conch/test/test_keys.py -+++ b/src/twisted/conch/test/test_keys.py -@@ -6,6 +6,7 @@ Tests for L{twisted.conch.ssh.keys}. - """ - - from __future__ import absolute_import, division +Index: Twisted-21.2.0/src/twisted/conch/test/test_keys.py +=================================================================== +--- Twisted-21.2.0.orig/src/twisted/conch/test/test_keys.py ++++ Twisted-21.2.0/src/twisted/conch/test/test_keys.py +@@ -15,6 +15,7 @@ from twisted.python import randbytes + from twisted.python.filepath import FilePath + from twisted.python.reflect import requireModule + from twisted.trial import unittest +import unittest as pyunit - from twisted.python.reflect import requireModule -@@ -225,7 +226,8 @@ class KeyTests(unittest.TestCase): + cryptography = requireModule("cryptography") +@@ -253,6 +254,8 @@ class KeyTests(unittest.TestCase): for k, v in data.items(): self.assertEqual(privateKey.data()[k], v) -- + @pyunit.skip('Upstream ticket https://twistedmatrix.com/trac/ticket/9665' + + ' has still not been resolved.') def test_fromOpenSSH(self): diff --git a/python-38-hmac-digestmod.patch b/python-38-hmac-digestmod.patch deleted file mode 100644 index 746693f..0000000 --- a/python-38-hmac-digestmod.patch +++ /dev/null @@ -1,76 +0,0 @@ -Index: Twisted-19.10.0/src/twisted/cred/credentials.py -=================================================================== ---- Twisted-19.10.0.orig/src/twisted/cred/credentials.py -+++ Twisted-19.10.0/src/twisted/cred/credentials.py -@@ -439,7 +439,8 @@ class CramMD5Credentials(object): - - - def checkPassword(self, password): -- verify = hexlify(hmac.HMAC(password, self.challenge).digest()) -+ verify = hexlify( -+ hmac.HMAC(password, self.challenge, digestmod=md5).digest()) - return verify == self.response - - -Index: Twisted-19.10.0/src/twisted/cred/test/test_cramauth.py -=================================================================== ---- Twisted-19.10.0.orig/src/twisted/cred/test/test_cramauth.py -+++ Twisted-19.10.0/src/twisted/cred/test/test_cramauth.py -@@ -7,6 +7,7 @@ Tests for L{twisted.cred}'s implementati - - from __future__ import division, absolute_import - -+from hashlib import md5 - from hmac import HMAC - from binascii import hexlify - -@@ -39,7 +40,7 @@ class CramMD5CredentialsTests(TestCase): - """ - c = CramMD5Credentials() - chal = c.getChallenge() -- c.response = hexlify(HMAC(b'secret', chal).digest()) -+ c.response = hexlify(HMAC(b'secret', chal, digestmod=md5).digest()) - self.assertTrue(c.checkPassword(b'secret')) - - -@@ -61,7 +62,8 @@ class CramMD5CredentialsTests(TestCase): - """ - c = CramMD5Credentials() - chal = c.getChallenge() -- c.response = hexlify(HMAC(b'thewrongsecret', chal).digest()) -+ c.response = hexlify( -+ HMAC(b'thewrongsecret', chal, digestmod=md5).digest()) - self.assertFalse(c.checkPassword(b'secret')) - - -@@ -75,7 +77,7 @@ class CramMD5CredentialsTests(TestCase): - chal = c.getChallenge() - c.setResponse(b" ".join( - (b"squirrel", -- hexlify(HMAC(b'supersecret', chal).digest())))) -+ hexlify(HMAC(b'supersecret', chal, digestmod=md5).digest())))) - self.assertTrue(c.checkPassword(b'supersecret')) - self.assertEqual(c.username, b"squirrel") - -Index: Twisted-19.10.0/src/twisted/mail/test/test_pop3.py -=================================================================== ---- Twisted-19.10.0.orig/src/twisted/mail/test/test_pop3.py -+++ Twisted-19.10.0/src/twisted/mail/test/test_pop3.py -@@ -12,6 +12,7 @@ import base64 - import itertools - - from collections import OrderedDict -+from hashlib import md5 - from io import BytesIO - - from zope.interface import implementer -@@ -1097,7 +1098,8 @@ class SASLTests(unittest.TestCase): - p.lineReceived(b"AUTH CRAM-MD5") - chal = s.getvalue().splitlines()[-1][2:] - chal = base64.decodestring(chal) -- response = hmac.HMAC(b'testpassword', chal).hexdigest().encode("ascii") -+ response = hmac.HMAC( -+ b'testpassword', chal, digestmod=md5).hexdigest().encode("ascii") - - p.lineReceived( - base64.encodestring(b'testuser ' + response).rstrip(b'\n')) diff --git a/python-38-no-cgi-parseqs.patch b/python-38-no-cgi-parseqs.patch deleted file mode 100644 index e333cfe..0000000 --- a/python-38-no-cgi-parseqs.patch +++ /dev/null @@ -1,41 +0,0 @@ -Index: Twisted-19.10.0/src/twisted/web/test/test_http.py -=================================================================== ---- Twisted-19.10.0.orig/src/twisted/web/test/test_http.py -+++ Twisted-19.10.0/src/twisted/web/test/test_http.py -@@ -9,15 +9,14 @@ from __future__ import absolute_import, - - import base64 - import calendar --import cgi - import random - - import hamcrest - - try: -- from urlparse import urlparse, urlunsplit, clear_cache -+ from urlparse import urlparse, urlunsplit, clear_cache, parse_qs - except ImportError: -- from urllib.parse import urlparse, urlunsplit, clear_cache -+ from urllib.parse import urlparse, urlunsplit, clear_cache, parse_qs - - from io import BytesIO - from itertools import cycle -@@ -2156,15 +2155,15 @@ Hello, - class QueryArgumentsTests(unittest.TestCase): - def testParseqs(self): - self.assertEqual( -- cgi.parse_qs(b"a=b&d=c;+=f"), -+ parse_qs(b"a=b&d=c;+=f"), - http.parse_qs(b"a=b&d=c;+=f")) - self.assertRaises( - ValueError, http.parse_qs, b"blah", strict_parsing=True) - self.assertEqual( -- cgi.parse_qs(b"a=&b=c", keep_blank_values=1), -+ parse_qs(b"a=&b=c", keep_blank_values=1), - http.parse_qs(b"a=&b=c", keep_blank_values=1)) - self.assertEqual( -- cgi.parse_qs(b"a=&b=c"), -+ parse_qs(b"a=&b=c"), - http.parse_qs(b"a=&b=c")) - - diff --git a/python-Twisted.changes b/python-Twisted.changes index c9526d7..5f74386 100644 --- a/python-Twisted.changes +++ b/python-Twisted.changes @@ -1,3 +1,42 @@ +------------------------------------------------------------------- +Wed Mar 10 06:11:42 UTC 2021 - Steve Kowalik + +- Update to 21.2.0: + * Features + + The enableSessions argument to twisted.internet.ssl.CertificateOptions now + + actually enables/disables OpenSSL's session cache. Also, due to + + session-related bugs, it defaults to False. (#9583) + + twisted.internet.defer.inlineCallbacks and ensureDeferred will now associate a contextvars.Context with the coroutines they run, meaning that ContextVar objects will maintain their value within the same coroutine, similarly to asyncio Tasks. This functionality requires Python 3.7+, or the contextvars PyPI backport to be installed for Python 3.5-3.6. (#9719, #9826) + + twisted.internet.defer.Deferred.fromCoroutine has been added. This is similar to the existing ensureDeferred function, but is named more consistently inside Twisted and does not pass through Deferreds. (#9825) + + trial now allows the @unittest.skipIf decorator to specify that an entire test class should be skipped. (#9829) + + The twisted.python.deprecate.deprecatedKeywordParameter decorator can be used to mark a keyword paramater of a function or method as deprecated. (#9844) + + Projects using Twisted can now perform type checking against a Twisted + + installation, for example using mypy. (#9908) + + twisted.python.util.InsensitiveDict now fully implements MutableMapping. (#9919) + + Python 3.8 is now tested and supported. (#9955) + + Support a coroutine function in twisted.internet.task.react (#9974) + + PyPy 3.7 is now tested and supported. (#10093) + * Bugfixes + + twisted.web.twcgi.CGIProcessProtocol.processEnded(...) now handles an already-finished request, for example when request.connectionLost(...) was called previously. (#9468) + + Twisted's dependency on PyHamcrest has been moved from the base package to the new "test" extra. Consequently the test extra must be installed for Twisted's test suite to pass. (#9509) + + Fixed serialization of timedelta, date, and time objects in twisted.spread. (#9716) + + twisted.internet.asyncioreactor.AsyncioSelectorReactor now raises an exception if instantiated with an event loop which is not compatible with asyncio.SelectorEventLoop. This fixes the AsyncioSelectorReactor in Python 3.8+ on Windows, where in bp-34687 the default Windows asyncio event loop was changed to ProactorEventLoop. Applications that use AsyncioSelectorReactor on Windows with Python 3.8+ must call asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) before instantiating and running AsyncioSelectorReactor. (#9766) + + twisted.internet.process.registerReapProcessHandler and ._BaseProcess.reapProcess will no longer raise a TypeError when processing a None PID (#9775) + + INotify will close its file descriptor if a directory is automatically removed by twisted from the watchlist because it's deleted, avoiding orphaned filedescriptors. (#9777) + + DelayedCall.reset() is now working properly with asyncioreactor (#9780) + + AsyncioSelectorReactor.seconds() now correctly returns an epoch time. (#9787) + + The _connDone parameter has been removed from twisted.internet.abstract.FileDescriptor.loseConnection()'s signature in order to match the signature in the base class twisted.internet._newtls.ConnectionMixin loseConnection(). (#9849) + + The Gtk3 reactor now runs on Wayland-only sessions (#9904) + + Descriptive error messages from twisted.internet.error are now present when running with 'python -OO'. (#9918) + + Comparator methods such as eq() now always return NotImplemented for uncomparable types. (#9919) + + When installing Twisted it now requires a minimum Python 3.5.4 version to match the version used with automated testing. This is the minimum Python version that we know that Twisted works with. (#10098) +- Drop patches no-pygtkcompat.patch, python-38-hmac-digestmod.patch, + python-38-no-cgi-parseqs.patch, twisted-pr1369-remove-pyopenssl-npn.patch & + twisted-pr1487-increase-ffdh-keysize.patch, they have been merged. +- Refresh other patches. +- Add no-cython_test_exception_raiser.patch to avoid another dependency. +- Update URL and make use of sitelib, not sitearch macros + ------------------------------------------------------------------- Tue Feb 23 18:17:29 UTC 2021 - Matej Cepl diff --git a/python-Twisted.spec b/python-Twisted.spec index 9604984..14e3b71 100644 --- a/python-Twisted.spec +++ b/python-Twisted.spec @@ -20,30 +20,23 @@ %define modname Twisted %define skip_python2 1 Name: python-Twisted -Version: 20.3.0 +Version: 21.2.0 Release: 0 Summary: An asynchronous networking framework written in Python License: MIT -Group: Development/Languages/Python URL: https://twistedmatrix.com/ -Source: https://files.pythonhosted.org/packages/source/T/Twisted/%{modname}-%{version}.tar.bz2 -Patch1: skip_MultiCast.patch -Patch2: no-pygtkcompat.patch -Patch3: test-mktime-invalid-tm_isdst.patch -Patch5: python-38-hmac-digestmod.patch -Patch6: python-38-no-cgi-parseqs.patch -Patch7: true-binary.patch +Source: https://files.pythonhosted.org/packages/source/T/Twisted/%{modname}-%{version}.tar.gz +Patch0: skip_MultiCast.patch +Patch1: true-binary.patch # PATCH-FIX-UPSTREAM no-test_successResultOfWithFailureHasTraceback.patch https://twistedmatrix.com/trac/ticket/9665 mcepl@suse.com # skip over the test test_successResultOfWithFailureHasTraceback -Patch8: no-test_successResultOfWithFailureHasTraceback.patch -# PATCH-FIX-UPSTREAM gh#twisted/twisted#1369 https://twistedmatrix.com/trac/ticket/9928 -Patch9: twisted-pr1369-remove-pyopenssl-npn.patch -# PATCH-FIX-UPSTRAM gh#twisted/twisted#1487 https://twistedmatrix.com/trac/ticket/10061 -Patch10: twisted-pr1487-increase-ffdh-keysize.patch +Patch2: no-test_successResultOfWithFailureHasTraceback.patch # PATCH-FIX-UPSTREAM 1521_delegate_parseqs_stdlib_bpo42967.patch https://twistedmatrix.com/trac/ticket/10096 mcepl@suse.com # overcome incompatibility with the solution for bpo#42967. -Patch0: 1521_delegate_parseqs_stdlib_bpo42967.patch -BuildRequires: %{python_module Automat >= 0.3.0} +Patch3: 1521_delegate_parseqs_stdlib_bpo42967.patch +# We don't want to package yet another module, and it is easily skippable +Patch4: no-cython_test_exception_raiser.patch +BuildRequires: %{python_module Automat >= 0.8.0} BuildRequires: %{python_module PyHamcrest >= 1.9.0} BuildRequires: %{python_module appdirs >= 1.4.0} BuildRequires: %{python_module attrs >= 19.2.0} @@ -66,8 +59,9 @@ BuildRequires: %{python_module service_identity >= 18.1.0} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module zope.interface >= 4.4.2} BuildRequires: fdupes +BuildRequires: git-core BuildRequires: python-rpm-macros -Requires: python-Automat >= 0.3.0 +Requires: python-Automat >= 0.8.0 Requires: python-PyHamcrest >= 1.9.0 Requires: python-appdirs >= 1.4.0 Requires: python-attrs >= 19.2.0 @@ -93,7 +87,6 @@ on event-based network programming and multiprotocol integration. %package -n %{name}-doc Summary: An asynchronous networking framework written in Python - Documentation -Group: Development/Languages/Python %description -n %{name}-doc An extensible framework for Python programming, with special focus @@ -137,7 +130,7 @@ export PYTHONDONTWRITEBYTECODE=1 export OPENSSL_SYSTEM_CIPHERS_OVERRIDE=xyz_nonexistent_file export OPENSSL_CONF='' -%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -m twisted.trial twisted +%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python -m twisted.trial twisted %post # these were master alternatives until Dec 2020. Remove before the install as slave links @@ -171,7 +164,7 @@ done %python_alternative %{_mandir}/man1/pyhtmlizer.1%{?ext_man} %python_alternative %{_mandir}/man1/tkconch.1%{?ext_man} %python_alternative %{_mandir}/man1/trial.1%{?ext_man} -%{python_sitearch}/twisted -%{python_sitearch}/Twisted-%{version}*-info +%{python_sitelib}/twisted +%{python_sitelib}/Twisted-%{version}*-info %changelog diff --git a/skip_MultiCast.patch b/skip_MultiCast.patch index 438afe4..a817d99 100644 --- a/skip_MultiCast.patch +++ b/skip_MultiCast.patch @@ -1,12 +1,21 @@ -Index: Twisted-19.7.0/src/twisted/test/test_udp.py +Index: Twisted-21.2.0/src/twisted/test/test_udp.py =================================================================== ---- Twisted-19.7.0.orig/src/twisted/test/test_udp.py -+++ Twisted-19.7.0/src/twisted/test/test_udp.py -@@ -514,6 +514,7 @@ class MulticastTests(unittest.TestCase): - skip = "Does not work on Azure Pipelines" +--- Twisted-21.2.0.orig/src/twisted/test/test_udp.py ++++ Twisted-21.2.0/src/twisted/test/test_udp.py +@@ -9,7 +9,7 @@ Tests for implementations of L{IReactorU + + import os + +-from unittest import skipIf ++from unittest import skipIf, SkipTest + from twisted.trial.unittest import TestCase + + from twisted.internet.defer import Deferred, gatherResults, maybeDeferred +@@ -522,6 +522,7 @@ class MulticastTests(TestCase): + skip = "This reactor does not support multicast" def setUp(self): -+ raise unittest.SkipTest("Multicast networking doesn't work with OBS") ++ raise SkipTest("Multicast networking doesn't work with OBS") self.server = Server() self.client = Client() # multicast won't work if we listen over loopback, apparently diff --git a/true-binary.patch b/true-binary.patch index e940e3c..72c6c02 100644 --- a/true-binary.patch +++ b/true-binary.patch @@ -1,22 +1,22 @@ -Index: Twisted-20.3.0/src/twisted/conch/test/test_ckeygen.py +Index: Twisted-21.2.0/src/twisted/conch/test/test_ckeygen.py =================================================================== ---- Twisted-20.3.0.orig/src/twisted/conch/test/test_ckeygen.py -+++ Twisted-20.3.0/src/twisted/conch/test/test_ckeygen.py -@@ -66,7 +66,7 @@ class KeyGenTests(TestCase): +--- Twisted-21.2.0.orig/src/twisted/conch/test/test_ckeygen.py ++++ Twisted-21.2.0/src/twisted/conch/test/test_ckeygen.py +@@ -73,7 +73,7 @@ class KeyGenTests(TestCase): def _testrun(self, keyType, keySize=None, privateKeySubtype=None): filename = self.mktemp() -- args = ['ckeygen', '-t', keyType, '-f', filename, '--no-passphrase'] -+ args = ['ckeygen-' + sys.version[:3], '-t', keyType, '-f', filename, '--no-passphrase'] +- args = ["ckeygen", "-t", keyType, "-f", filename, "--no-passphrase"] ++ args = ["ckeygen-" + sys.version[:3], "-t", keyType, "-f", filename, "--no-passphrase"] if keySize is not None: - args.extend(['-b', keySize]) + args.extend(["-b", keySize]) if privateKeySubtype is not None: -@@ -100,7 +100,7 @@ class KeyGenTests(TestCase): +@@ -107,7 +107,7 @@ class KeyGenTests(TestCase): def test_runBadKeytype(self): filename = self.mktemp() with self.assertRaises(subprocess.CalledProcessError): -- subprocess.check_call(['ckeygen', '-t', 'foo', '-f', filename]) -+ subprocess.check_call(['ckeygen-' + sys.version[:3], '-t', 'foo', '-f', filename]) - - +- subprocess.check_call(["ckeygen", "-t", "foo", "-f", filename]) ++ subprocess.check_call(["ckeygen-" + sys.version[:3], "-t", "foo", "-f", filename]) + def test_enumrepresentation(self): + """ diff --git a/twisted-pr1369-remove-pyopenssl-npn.patch b/twisted-pr1369-remove-pyopenssl-npn.patch deleted file mode 100644 index 331791b..0000000 --- a/twisted-pr1369-remove-pyopenssl-npn.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 895a9a0c7141646847a8c798f695c92e543af035 Mon Sep 17 00:00:00 2001 -From: Alex Gaynor -Date: Mon, 3 Aug 2020 21:00:25 -0400 -Subject: [PATCH] Make the twisted tests work when pyOpenSSL deletes NPN - ---- - src/twisted/newsfragments/9928.misc | 0 - src/twisted/test/test_sslverify.py | 7 +++++-- - 2 files changed, 5 insertions(+), 2 deletions(-) - create mode 100644 src/twisted/newsfragments/9928.misc - -diff --git a/src/twisted/newsfragments/9928.misc b/src/twisted/newsfragments/9928.misc -new file mode 100644 -index 00000000000..e69de29bb2d -diff --git a/src/twisted/test/test_sslverify.py b/src/twisted/test/test_sslverify.py -index 4a1e082737f..a8992741d55 100644 ---- a/src/twisted/test/test_sslverify.py -+++ b/src/twisted/test/test_sslverify.py -@@ -62,8 +62,11 @@ - try: - ctx = SSL.Context(SSL.SSLv23_METHOD) - ctx.set_npn_advertise_callback(lambda c: None) -- except NotImplementedError: -- skipNPN = "OpenSSL 1.0.1 or greater required for NPN support" -+ except (NotImplementedError, AttributeError): -+ skipNPN = ( -+ "NPN is deprecated (and OpenSSL 1.0.1 or greater required for NPN" -+ " support)" -+ ) - - try: - ctx = SSL.Context(SSL.SSLv23_METHOD) diff --git a/twisted-pr1487-increase-ffdh-keysize.patch b/twisted-pr1487-increase-ffdh-keysize.patch deleted file mode 100644 index ec3f7cd..0000000 --- a/twisted-pr1487-increase-ffdh-keysize.patch +++ /dev/null @@ -1,67 +0,0 @@ -From d3a97b7f9e536af0103940afe670817fd2ff1393 Mon Sep 17 00:00:00 2001 -From: Paul Kehrer -Date: Sat, 28 Nov 2020 22:56:28 -0600 -Subject: [PATCH] increase size of FFDH keys for conch testing - ---- - src/twisted/conch/test/test_transport.py | 29 ++++++++++++++++++------ - src/twisted/newsfragments/10061.misc | 0 - 2 files changed, 22 insertions(+), 7 deletions(-) - create mode 100644 src/twisted/newsfragments/10061.misc - -Index: Twisted-20.3.0/src/twisted/conch/test/test_transport.py -=================================================================== ---- Twisted-20.3.0.orig/src/twisted/conch/test/test_transport.py -+++ Twisted-20.3.0/src/twisted/conch/test/test_transport.py -@@ -2267,6 +2267,21 @@ class ClientSSHTransportDHGroupExchangeB - Diffie-Hellman group exchange tests for SSHClientTransport. - """ - -+ """ -+ 1536-bit modulus from RFC 3526 -+ """ -+ P1536 = int( -+ "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" -+ "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" -+ "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" -+ "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" -+ "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" -+ "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" -+ "83655D23DCA3AD961C62F356208552BB9ED529077096966D" -+ "670C354E4ABC9804F1746C08CA237327FFFFFFFFFFFFFFFF", -+ 16, -+ ) -+ - def test_KEXINIT_groupexchange(self): - """ - KEXINIT packet with a group-exchange key exchange results -@@ -2286,14 +2301,14 @@ class ClientSSHTransportDHGroupExchangeB - KEX_DH_GEX_INIT message with the client's Diffie-Hellman public key. - """ - self.test_KEXINIT_groupexchange() -- self.proto.ssh_KEX_DH_GEX_GROUP( -- b'\x00\x00\x00\x03\x00\xfe\xf3\x00\x00\x00\x01\x02') -- self.assertEqual(self.proto.p, 65267) -+ self.proto.ssh_KEX_DH_GEX_GROUP(common.MP(self.P1536) + common.MP(2)) -+ self.assertEqual(self.proto.p, self.P1536) - self.assertEqual(self.proto.g, 2) - x = self.proto.dhSecretKey.private_numbers().x -- self.assertEqual(common.MP(x)[5:], b'\x99' * 2) -- self.assertEqual(self.proto.dhSecretKeyPublicMP, -- common.MP(pow(2, x, 65267))) -+ self.assertEqual(common.MP(x)[5:], b"\x99" * 192) -+ self.assertEqual( -+ self.proto.dhSecretKeyPublicMP, common.MP(pow(2, x, self.P1536)) -+ ) - self.assertEqual(self.packets[1:], [(transport.MSG_KEX_DH_GEX_INIT, - self.proto.dhSecretKeyPublicMP)]) - -@@ -2322,7 +2337,7 @@ class ClientSSHTransportDHGroupExchangeB - # Here is the wire format for advertised min, pref and max DH sizes. - h.update(b'\x00\x00\x04\x00\x00\x00\x08\x00\x00\x00\x20\x00') - # And the selected group parameters. -- h.update(b'\x00\x00\x00\x03\x00\xfe\xf3\x00\x00\x00\x01\x02') -+ h.update(common.MP(self.P1536) + common.MP(2)) - h.update(self.proto.dhSecretKeyPublicMP) - h.update(fMP) - h.update(sharedSecret)