dependabot[bot] [Fri, 3 Nov 2023 19:30:23 +0000 (12:30 -0700)]
Update trio requirement from >=0.14,<0.23 to >=0.14,<0.24 (#1003)
Updates the requirements on [trio](https://github.com/python-trio/trio) to permit the latest version.
- [Release notes](https://github.com/python-trio/trio/releases)
- [Commits](https://github.com/python-trio/trio/compare/v0.14.0...v0.23.0)
If a caller passes prepend_length=True, the wire format will include the
2 byte encoded message length before the message itself. This is useful
for callers planning to send the message over TCP, DoT, and DoQ.
Bob Halley [Fri, 27 Oct 2023 15:55:10 +0000 (08:55 -0700)]
Fix a race condition in trio quic shutdown.
It was possible to have a "lost wakeup" situation where we had stuff to
send but the trio worker was blocked indefinitely in the receive.
There is no test for this as the race is very race-y and I can't reproduce it
reliably in the test suite, though I was able to do reliable replication a different
way when debugging.
I also reordered event processing to happen after timer handling but before sending
in the trio and sync quic code. The async code already worked this way due to its
different struture and needed no changes.
Bob Halley [Fri, 27 Oct 2023 01:41:36 +0000 (18:41 -0700)]
The "address" passed to QUIC receive_datagram() should be a low-level tuple.
Previously we sent just the address part, i.e. lltuple[0], but the
aioquic code intends for the value to be the whole tuple. This did
not break anything for dnspython as we were consistently wrong and
aioquic is flexible enough with its notion of NetworkAddress for our
purposes that dnspython's mistake had no effect.
Bob Halley [Sun, 22 Oct 2023 14:12:41 +0000 (07:12 -0700)]
Fix two QUIC issues:
1) We treated stream reset like connection terminated, which
is just wrong. We should send EOF to the stream but leave
the connection alone.
2) When we got an unexpected EOF on a stream, we raised the
exception in the wrong place, killing the QUIC connection
but leaving the stream blocked. Now we deliver the exception
to the stream and don't kill the connection.
Bob Halley [Sat, 21 Oct 2023 13:38:54 +0000 (06:38 -0700)]
Check that a relative name plus the zone's origin is not too long. (#997)
Previously it was possible to add very long relative names to a
relative zone which could never be rendered due to being too long for
wire format. Now we check this as part of _validate_name().
This code also removes duplicated name validation code from Zone and
Version, consolidating it into one helper function.
Finally, we fix a few comments in get methods that have cut-and-paste
typos from the find variant indicating they can raise KeyError when
they cannot.
Brian Wellington [Tue, 10 Oct 2023 18:29:27 +0000 (11:29 -0700)]
Fix enum inversion.
A change in Python 3.11's enum module caused IntEnum inversion to only
invert the bits associated with the (inferred) range of the flag,
meaning that ~dns.flags.DO only inverted 16 bits. This meant that
calling want_dnssec(False) on a message would unconditionally set the
EDNS version field to 0.
Bob Halley [Sat, 5 Aug 2023 20:35:29 +0000 (13:35 -0700)]
Fix unintended "wait forever" behavior with zero timeouts [#976].
In a few places we did "if timeout:" or "if expiration:" when we
really meant "if timeout is not None:". This meant that in the zero
timeout case we fell into the "wait forever" path instead of
immediately timing out. In the case of UDP queries, we'd be waiting
on recvfrom() and if a packet was lost, then the code would never wake
up.
Update wheel requirement from ^0.40.0 to ^0.41.0 (#965)
Updates the requirements on [wheel](https://github.com/pypa/wheel) to permit the latest version.
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](https://github.com/pypa/wheel/compare/0.40.0...0.41.0)
Use `Sequence` instead of `List` for nameservers, as List is invariant (#961)
without this, resolver.nameservers = string.split() produces mypy error, see
https://mypy.readthedocs.io/en/stable/common_issues.html#invariance-vs-covariance
Scott Kitterman [Sat, 8 Jul 2023 20:02:31 +0000 (16:02 -0400)]
Clarify skip test message in test_doq.py (#952)
While the current message is technically correct, nanoquic isn't actually what's missing, so it would be clearer to point to the fact that aioquic isn't found, since that's the issue someone can actually do something about.
Bob Halley [Fri, 7 Jul 2023 14:29:08 +0000 (07:29 -0700)]
In async TLS do not ignore a ssl_context given as an argument [#951].
The async TLS code would always fail if given an ssl_context instead
of making one, as it set the passed paramter to None and then called
into the async socket backend, which would make a regular TCP socket
(i.e. no TLS), which would be rejected by the server as it wasn't
using TLS.
Scott Kitterman [Fri, 7 Jul 2023 13:29:39 +0000 (09:29 -0400)]
Add shebang for ecs.py (#950)
I know this is trivial, but the Debian QA tools get slightly grumpy when there's no shebang for an executable script, so it would make things slightly easier for me if you would add this.
Bob Halley [Sat, 24 Jun 2023 14:27:25 +0000 (07:27 -0700)]
Fix three problems with DNSSEC: (#946)
* Fix three problems with DNSSEC:
1) Signing a relative zone didn't quite work.
2) The signer generated the wrong RRSIG labels length for a wild name.
3) The validator failed to detect 2).
dependabot[bot] [Fri, 9 Jun 2023 21:58:10 +0000 (14:58 -0700)]
Bump sphinx-rtd-theme from 1.2.1 to 1.2.2 (#941)
Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 1.2.1 to 1.2.2.
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/1.2.1...1.2.2)
dependabot[bot] [Wed, 31 May 2023 17:06:47 +0000 (10:06 -0700)]
Update cryptography requirement from >=2.6,<41.0 to >=2.6,<42.0 (#937)
Updates the requirements on [cryptography](https://github.com/pyca/cryptography) to permit the latest version.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.6...41.0.0)
dependabot[bot] [Sun, 28 May 2023 21:00:32 +0000 (14:00 -0700)]
Bump sphinx-rtd-theme from 1.2.0 to 1.2.1 (#933)
Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 1.2.0 to 1.2.1.
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/1.2.0...1.2.1)
Bob Halley [Sun, 28 May 2023 20:58:27 +0000 (13:58 -0700)]
Httpx now has a socket_options parameter in its NetworkBackends.
We accept this parameter if it is given, but do not actually do
anything with it. In theory this shouldn't be a problem as we're
never passing it either in the cases where we use our backends.
Bob Halley [Sat, 6 May 2023 18:21:36 +0000 (11:21 -0700)]
Deal with "in" changes for enums in python 3.12
In python 3.12, "in" for enums tests values as well, so something
like "12345 in dns.rdatatype.RdataType" will now return True. This
broke some logic guarding against registering a known-but-unimplmemented
type code point with a class that didn't have the right name. We now
just give up on this test as it will never be a real problem. We change
a few related tests to be more sensible.
The NSEC3 next name field is defined as base32 with no padding, but the
code was doing base32 decoding with padding. This wouldn't have any
effect in the normal case, since the only defined NSEC3 hashing
algorithm is SHA1, and that generates a 160 bit hash that doesn't
require padding when encoded in base32.
This change removes generated padding after encode, rejects padded input
on decode, and adds necessary padding for decode.