Commit Graph

24966 Commits

Author SHA1 Message Date
Tom Most fc70c0cf81
Merge branch 'trunk' into 9655-twisted-web-tempfile-parameter 2019-07-21 18:47:15 -07:00
Tom Most 6e3c05cf00
Merge branch 'trunk' into 8267-circular-reporter 2019-07-21 13:17:18 -07:00
Amber H. Brown 17084eab78 towncrier for 19.7.0rc1 2019-07-22 00:23:39 +10:00
Amber H. Brown 6e8cb44fb0 incremental to 19.7.0 2019-07-22 00:21:55 +10:00
Tom Most de4e26d43a
Merge branch 'trunk' into 9646-http-header-wsp-colon 2019-07-20 22:57:55 -07:00
Mark Williams ab6156fa76
Merge pull request #1143 from twisted/9628-trial3-importerror
[9628] Fix trial3 not knowing the difference between ImportErrors and modules not existing

Author: hawkowl

Reviewers: markrwilliams

Fixes: ticket:9628
2019-07-20 13:43:42 -07:00
Amber Brown e0b696f172
Merge branch 'trunk' into 9628-trial3-importerror 2019-07-21 05:21:29 +10:00
Amber Brown 82379a6501
Merge branch 'trunk' into 9655-twisted-web-tempfile-parameter 2019-07-21 05:03:44 +10:00
Amber Brown 511d0d98d7
Merge branch 'trunk' into 9646-http-header-wsp-colon 2019-07-21 03:34:45 +10:00
Ryan Van Gilder 5b203b267f Merge ryban:8258-ryban-hmac-sha2-512-fix: Fix SSH not generating correct keys when using hmac-sha2-512 with SHA1 based KEX algorithms
Author: ryban, jamohamm
Reviewer: hawkowl
Fixes: ticket:8258
2019-07-21 03:32:32 +10:00
Amber Brown 892e9828dd
Merge branch 'trunk' into 9646-http-header-wsp-colon 2019-07-21 03:10:06 +10:00
Heather White 4cade8bb1e Merge eevelweezel:move-proto_helpers-6435: Move t.test.proto_helpers to t.internet.testing
Author: eevelweezel
Reviewers: glyph, twm, hawkowl
Fixes: ticket:6435
2019-07-21 03:06:10 +10:00
Jeremy Cline c0ce0d77be Merge jeremycline:9668-jeremycline-stdlog-findCaller-38-compat: Add the stackLevel kwarg to STDLibLogObserver._findCaller
Author: jeremycline
Reviewer: hawkowl
Fixes: ticket:9668

Python 3.8 adds a new keyword argument, stacklevel, to its findCaller
function in commit dde9fdbe4539 ("bpo-33165: Added stacklevel parameter
to logging APIs. (GH-7424)"). As Twisted is replacing this method with
its own method, logging with STDLibLogObserver fails in Python 3.8. This
patch adds the argument, but does not use it as there is already a
stackDepth instance variable and the stackInfo on the method is also
ignored.

This patch fixes the logger tests that currently fail in Python 3.8.

Signed-off-by: Jeremy Cline <jcline@redhat.com>
2019-07-21 01:52:28 +10:00
Amber Brown b6955269d8
Merge 9674-raiser-c: Regenerate twisted/test/raiser.c for Python 3.8.0b2
Author: cython
Reviewer: hawkowl
Fixes: ticket:9674
2019-07-21 01:10:48 +10:00
Tom Most 0a6f84c421
Merge branch 'trunk' into 8267-circular-reporter 2019-07-12 21:46:13 -07:00
Tom Most 0935c925e3
Merge branch 'trunk' into 9655-twisted-web-tempfile-parameter 2019-07-12 21:44:00 -07:00
Tom Most 7d94ec0b78
Merge branch 'trunk' into 9646-http-header-wsp-colon 2019-07-12 21:43:02 -07:00
Ralph Meijer cf8ed69824
Merge pull request #1147 from twisted/9561-xmpp-tls-verify-cert
[#9561] Check remote certificates for XMPP TLS (CVE-2019-12855)

Author: ralphm
Reviewer: glyph, alex
Fixes: ticket:9561
2019-07-04 14:57:44 +02:00
Ralph Meijer d99ce020e0
Merge branch 'trunk' into 9561-xmpp-tls-verify-cert 2019-07-03 11:53:19 +02:00
Ralph Meijer abbf0fd52c Revert "Move check for configurationTLS being None to __init__"
This reverts commit 05556b6ca1.
2019-06-16 19:50:33 +02:00
Ralph Meijer a66878c15a Mention CVE-2019-12855 in news fragment 2019-06-16 19:14:04 +02:00
Ralph Meijer 7caf8ac879 Document configurationForTLS being None directly 2019-06-16 19:11:35 +02:00
Ralph Meijer 05556b6ca1 Move check for configurationTLS being None to __init__ 2019-06-16 19:02:52 +02:00
Ralph Meijer ea2d28f703 Rename contextFactory to configurationForTLS, make private vars 2019-06-16 18:41:49 +02:00
Amber H. Brown 289d596206 fixes 2019-06-16 18:32:37 +10:00
Amber H. Brown 1f6950b101 fix the test 2019-06-16 09:52:49 +10:00
Amber H. Brown 0114d8018e Make the transport properly carry over the timeout 2019-06-16 09:34:46 +10:00
Amber Brown 4bceaac105
Merge 9656-theyre-ugly-anyway: Disable traceback printing by default in Site and update twisted.web.tap to have an enable flag instead of a disable flag (#1156)
Author: hawkowl
Reviewer: twm
Fixes: ticket:9656
2019-06-16 07:02:09 +10:00
Jean-Paul Calderone f6c533e52d guessed wrong on that one 2019-06-13 15:50:04 -04:00
Jean-Paul Calderone 2fc69c437a an attempt to satisfy the linter 2019-06-13 15:38:32 -04:00
Jean-Paul Calderone 658e326c4b classic class upcall 2019-06-13 15:00:33 -04:00
Jean-Paul Calderone 0c6805d237 import cleanups 2019-06-13 11:37:03 -04:00
Jean-Paul Calderone a70450212c Minor refactoring for cleanliness 2019-06-13 11:36:53 -04:00
Jean-Paul Calderone e877fc04ac Teach server.Request.gotLength to call getContentFile 2019-06-13 11:36:41 -04:00
Jean-Paul Calderone 69277b8191 Factor this assertion helper out into something reusable 2019-06-13 11:35:39 -04:00
Jean-Paul Calderone f255c5f1f8 news fragment 2019-06-13 11:35:11 -04:00
Tom Most ba8357c50e
Merge branch 'trunk' into 9646-http-header-wsp-colon 2019-06-12 21:26:33 -07:00
Tom Most fd73587f3d
Merge pull request #1150 from twisted/9644-multiline-headers
Author: twm
Reviewer: glyph
Fixes: ticket:9644

Don't TypeError on multiline headers
2019-06-12 21:26:15 -07:00
Glyph 7ae2b10573
Merge branch 'trunk' into 9644-multiline-headers 2019-06-12 13:08:50 -07:00
Amber Brown fe6b661d92
Merge branch 'trunk' into 9628-trial3-importerror 2019-06-09 20:29:58 +10:00
Wilfredo Sánchez d54f66fa06 import some things so TiwstedChecker doesn't complain 2019-06-08 13:20:58 -07:00
Wilfredo Sánchez 9037091133 Move news fragment to where it goes now 2019-06-08 13:20:33 -07:00
Wilfredo Sánchez Vega f035a94d92
Merge branch 'trunk' into 9006-coro-result-assertions 2019-06-08 12:30:59 -07:00
Tom Most f8db37bc30
Merge branch 'trunk' into 9646-http-header-wsp-colon 2019-06-06 17:04:15 -07:00
Mark Williams 6c61fc4503
Prevent CRLF injections described in CVE-2019-12387
Author: markrwilliams

Reviewers: glyph

Fixes: ticket:9647

Twisted's HTTP client APIs were vulnerable to maliciously constructed
HTTP methods, hosts, and/or paths, URI components such as paths and
query parameters.  These vulnerabilities were beyond the header name
and value injection vulnerabilities addressed in:

https://twistedmatrix.com/trac/ticket/9420
https://github.com/twisted/twisted/pull/999/

The following client APIs will raise a ValueError if given a method,
host, or URI that includes newlines or other disallowed characters:

- twisted.web.client.Agent.request
- twisted.web.client.ProxyAgent.request
- twisted.web.client.Request.__init__
- twisted.web.client.Request.writeTo

ProxyAgent is patched separately from Agent because unlike other
agents (e.g. CookieAgent) it is not implemented as an Agent wrapper.

Request.__init__ checks its method and URI so that errors occur closer
to their originating input.  Request.method and Request.uri are both
public APIs, however, so Request.writeTo (via Request._writeHeaders)
also checks the validity of both before writing anything to the wire.

Additionally, the following deprecated client APIs have also been
patched:

- twisted.web.client.HTTPPageGetter.__init__
- twisted.web.client.HTTPPageDownloader.__init__
- twisted.web.client.HTTPClientFactory.__init__
- twisted.web.client.HTTPClientFactory.setURL
- twisted.web.client.HTTPDownloader.__init__
- twisted.web.client.HTTPDownloader.setURL
- twisted.web.client.getPage
- twisted.web.client.downloadPage

These have been patched prior to their removal so that they won't be
vulnerable in the last Twisted release that includes them.  They
represent a best effort, because testing every combination of these
public APIs would require more code than deprecated APIs warrant.

In all cases URI components, including hostnames, are restricted to
the characters allowed in path components.  This mirrors the CPython
patch (for bpo-30458) that addresses equivalent vulnerabilities:

bb8071a4ca

HTTP methods, however, are checked against the set of characters
described in RFC-7230.
2019-06-05 00:03:37 -07:00
Tom Most 268318f426 Wrap long lines 2019-06-04 21:36:48 -07:00
Tom Most 4f5a1274de Update newsfragment 2019-06-04 21:36:48 -07:00
Tom Most d2f6dd9b37 Refactor to reduce duplication 2019-06-04 21:36:48 -07:00
Tom Most 1e2d27966b Reject invalid header lines 2019-06-04 21:36:48 -07:00
Tom Most 7d907209aa Also test for an empty header name 2019-06-04 21:36:48 -07:00