[Python-modules-commits] [dnspython] 02/17: Import dnspython_1.13.0.orig.tar.gz
Scott Kitterman
kitterman at moszumanska.debian.org
Wed May 25 06:39:48 UTC 2016
This is an automated email from the git hooks/post-receive script.
kitterman pushed a commit to branch master
in repository dnspython.
commit 8d7a975dc0c58a57c155726305be922a7b5cb134
Author: Scott Kitterman <scott at kitterman.com>
Date: Wed May 25 01:31:35 2016 -0400
Import dnspython_1.13.0.orig.tar.gz
---
ChangeLog | 42 ++
MANIFEST.in | 3 +
PKG-INFO | 11 +-
README | 557 --------------------------
dns/_compat.py | 21 +
dns/dnssec.py | 157 +++++---
dns/e164.py | 13 +-
dns/edns.py | 30 +-
dns/entropy.py | 34 +-
dns/exception.py | 104 ++++-
dns/flags.py | 30 +-
dns/grange.py | 2 +-
dns/hash.py | 53 +--
dns/inet.py | 11 +-
dns/ipv4.py | 11 +-
dns/ipv6.py | 54 +--
dns/message.py | 210 +++++-----
dns/name.py | 269 ++++++++-----
dns/namedict.py | 59 ++-
dns/node.py | 15 +-
dns/opcode.py | 31 +-
dns/query.py | 93 +++--
dns/rcode.py | 36 +-
dns/rdata.py | 172 ++++----
dns/rdataclass.py | 46 ++-
dns/rdataset.py | 51 ++-
dns/rdatatype.py | 171 ++++----
dns/rdtypes/ANY/AFSDB.py | 2 +
dns/rdtypes/ANY/CAA.py | 74 ++++
dns/rdtypes/ANY/{SPF.py => CDNSKEY.py} | 15 +-
dns/rdtypes/ANY/{DS.py => CDS.py} | 7 +-
dns/rdtypes/ANY/CERT.py | 67 ++--
dns/rdtypes/ANY/CNAME.py | 3 +-
dns/rdtypes/ANY/DLV.py | 3 +-
dns/rdtypes/ANY/DNAME.py | 5 +-
dns/rdtypes/ANY/DNSKEY.py | 127 +-----
dns/rdtypes/ANY/DS.py | 3 +-
dns/rdtypes/ANY/{SPF.py => EUI48.py} | 21 +-
dns/rdtypes/ANY/{SPF.py => EUI64.py} | 21 +-
dns/rdtypes/ANY/GPOS.py | 70 ++--
dns/rdtypes/ANY/HINFO.py | 46 ++-
dns/rdtypes/ANY/HIP.py | 71 +---
dns/rdtypes/ANY/ISDN.py | 46 ++-
dns/rdtypes/ANY/LOC.py | 96 +++--
dns/rdtypes/ANY/MX.py | 3 +-
dns/rdtypes/ANY/NS.py | 3 +-
dns/rdtypes/ANY/NSEC.py | 48 ++-
dns/rdtypes/ANY/NSEC3.py | 106 ++---
dns/rdtypes/ANY/NSEC3PARAM.py | 44 +-
dns/rdtypes/ANY/PTR.py | 3 +-
dns/rdtypes/ANY/RP.py | 26 +-
dns/rdtypes/ANY/RRSIG.py | 41 +-
dns/rdtypes/ANY/RT.py | 3 +-
dns/rdtypes/ANY/SOA.py | 39 +-
dns/rdtypes/ANY/SPF.py | 3 +-
dns/rdtypes/ANY/SSHFP.py | 32 +-
dns/rdtypes/ANY/TLSA.py | 34 +-
dns/rdtypes/ANY/TXT.py | 3 +-
dns/rdtypes/ANY/URI.py | 81 ++++
dns/rdtypes/ANY/X25.py | 31 +-
dns/rdtypes/ANY/__init__.py | 4 +
dns/rdtypes/IN/A.py | 22 +-
dns/rdtypes/IN/AAAA.py | 22 +-
dns/rdtypes/IN/APL.py | 38 +-
dns/rdtypes/IN/DHCID.py | 26 +-
dns/rdtypes/IN/IPSECKEY.py | 50 +--
dns/rdtypes/IN/KX.py | 3 +-
dns/rdtypes/IN/NAPTR.py | 57 ++-
dns/rdtypes/IN/NSAP.py | 26 +-
dns/rdtypes/IN/NSAP_PTR.py | 3 +-
dns/rdtypes/IN/PX.py | 34 +-
dns/rdtypes/IN/SRV.py | 28 +-
dns/rdtypes/IN/WKS.py | 45 +--
dns/rdtypes/__init__.py | 1 +
dns/rdtypes/{ANY/DNSKEY.py => dnskeybase.py} | 46 +--
dns/rdtypes/dsbase.py | 34 +-
dns/rdtypes/euibase.py | 71 ++++
dns/rdtypes/mxbase.py | 42 +-
dns/rdtypes/nsbase.py | 31 +-
dns/rdtypes/txtbase.py | 34 +-
dns/renderer.py | 19 +-
dns/resolver.py | 339 ++++++++++------
dns/reversename.py | 21 +-
dns/rrset.py | 18 +-
dns/set.py | 14 +-
dns/tokenizer.py | 65 +--
dns/tsig.py | 82 ++--
dns/tsigkeyring.py | 6 +-
dns/ttl.py | 20 +-
dns/update.py | 78 ++--
dns/version.py | 4 +-
dns/wiredata.py | 27 +-
dns/zone.py | 178 ++++----
PKG-INFO => dnspython.egg-info/PKG-INFO | 11 +-
dnspython.egg-info/SOURCES.txt | 135 +++++++
dnspython.egg-info/dependency_links.txt | 1 +
dnspython.egg-info/top_level.txt | 1 +
examples/ddns.py | 14 +-
examples/reverse.py | 6 +-
setup.cfg | 5 +
setup.py | 17 +-
tests/__init__.py | 0
tests/example | 14 +
tests/example1.good | 9 +
tests/example2.good | 9 +
tests/example3.good | 9 +
tests/test_bugs.py | 26 +-
tests/test_dnssec.py | 7 +-
tests/test_exceptions.py | 65 +++
tests/test_flags.py | 5 +-
tests/test_generate.py | 155 +++----
tests/test_grange.py | 6 +-
tests/test_message.py | 28 +-
tests/test_name.py | 164 ++++----
tests/test_namedict.py | 5 +-
tests/test_ntoaaton.py | 91 +++--
dns/rdtypes/ANY/SPF.py => tests/test_rdata.py | 24 +-
tests/test_rdtypeandclass.py | 5 +-
tests/test_rdtypeanydnskey.py | 5 +-
tests/test_rdtypeanyeui.py | 224 +++++++++++
tests/test_rdtypeanyloc.py | 5 +-
tests/test_resolver.py | 12 +-
tests/test_rrset.py | 5 +-
tests/test_set.py | 5 +-
tests/test_tokenizer.py | 14 +
tests/test_update.py | 8 +-
tests/test_zone.py | 79 ++--
tests/utest.py | 8 +-
128 files changed, 3363 insertions(+), 2765 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 39792fe..177a34c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,45 @@
+2016-05-10 Bob Halley <halley at dnspython.org>
+
+ * (Version 1.13.0 released)
+
+2016-05-10 Bob Halley <halley at dnspython.org>
+
+ * Dropped support for Python 2.4 and 2.5.
+
+ * Zone origin can be specified as a string.
+
+ * Support string representation for all DNSExceptions.
+
+ * Use setuptools not distutils
+
+ * A number of Unicode name bug fixes.
+
+ * Added support for CAA, CDS, CDNSKEY, EUI48, EUI64, and URI RR
+ types.
+
+ * Names now support the pickle protocol.
+
+ * NameDicts now keep the max-depth value correct, and update
+ properly.
+
+ * resolv.conf processing rejects lines with too few tokens.
+
+ * Ports can be specified per-nameserver in the stub resolver.
+
+2016-05-03 Arthur Gautier
+
+ * Single source support for python 2.6+ and 3.3+
+
+2014-09-04 Bob Halley <halley at dnspython.org>
+
+ * Comparing two rdata is now always done by comparing the binary
+ data of the DNSSEC digestable forms. This corrects a number of
+ errors where dnspython's rdata comparsion order was not the
+ DNSSEC order.
+
+ * Add CAA implementation. Thanks to Brian Wellington for the
+ patch.
+
2014-09-01 Bob Halley <halley at dnspython.org>
* (Version 1.12.0 released)
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..d58fb8b
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,3 @@
+include LICENSE ChangeLog TODO
+recursive-include examples *.txt *.py
+recursive-include tests *.txt *.py Makefile *.good example
diff --git a/PKG-INFO b/PKG-INFO
index 603db66..5cae73a 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: dnspython
-Version: 1.12.0
+Version: 1.13.0
Summary: DNS toolkit
Home-page: http://www.dnspython.org
Author: Bob Halley
Author-email: halley at dnspython.org
License: BSD-like
-Download-URL: http://www.dnspython.org/kits/1.12.0/dnspython-1.12.0.tar.gz
+Download-URL: http://www.dnspython.org/kits/1.13.0/dnspython-1.13.0.tar.gz
Description: dnspython is a DNS toolkit for Python. It supports almost all
record types. It can be used for queries, zone transfers, and dynamic
updates. It supports TSIG authenticated messages and EDNS0.
@@ -25,4 +25,11 @@ Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: Name Service (DNS)
Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
Provides: dns
diff --git a/README b/README
deleted file mode 100644
index 932e552..0000000
--- a/README
+++ /dev/null
@@ -1,557 +0,0 @@
-dnspython
-
-INTRODUCTION
-
-dnspython is a DNS toolkit for Python. It supports almost all record
-types. It can be used for queries, zone transfers, and dynamic
-updates. It supports TSIG authenticated messages and EDNS0.
-
-dnspython provides both high and low level access to DNS. The high
-level classes perform queries for data of a given name, type, and
-class, and return an answer set. The low level classes allow direct
-manipulation of DNS zones, messages, names, and records.
-
-To see a few of the ways dnspython can be used, look in the examples/
-directory.
-
-dnspython originated at Nominum where it was developed to facilitate
-the testing of DNS software. Nominum has generously allowed it to be
-open sourced under a BSD-style license, and helps support its future
-development by continuing to employ the author :).
-
-
-ABOUT THIS RELEASE
-
-This is dnspython 1.12.0
-
-New since 1.11.1:
-
- Added dns.zone.to_text().
-
- Added support for "options rotate" in /etc/resolv.conf.
-
- dns.rdtypes.ANY.DNSKEY now has helpers functions to convert
- between the numeric form of the flags and a set of
- human-friendly strings
-
- The reverse name of an IPv6 mapped IPv4 address is now in the
- IPv4 reverse namespace.
-
- The test system can now run the tests without requiring
- dnspython to be installed.
-
- Preliminary Elliptic Curve DNSSEC Validation (requires ecdsa module)
-
-Bugs fixed since 1.11.1:
-
- dnspython raised an exception when reading a masterfile starting
- with leading whitespace
-
- dnspython was affected by a python slicing API bug present on
- 64-bit windows.
-
- Unicode escaping was applied at the wrong time.
-
- RRSIG to_text() did not respect the relativize setting.
-
- APL RRs with zero rdlength were rejected.
-
- The tokenizer could put back an unescaped token.
-
- Making a response to a message signed with TSIG was broken.
-
- The IXFR state machine didn't handle long IXFR diffs.
-
-New since 1.11.0:
-
- Nothing
-
-Bugs fixed since 1.11.0:
-
- dns.resolver.Resolver erroneously referred to 'retry_servfail'
- instead of 'self.retry_servfail'.
-
- dns.tsigkeyring.to_text() would fail trying to convert the
- keyname to text.
-
- Multi-message TSIGs were broken for algorithms other than
- HMAC-MD5 because we weren't passing the right digest module to
- the HMAC code.
-
- dns.dnssec._find_candidate_keys() tried to extract the key
- from the wrong variable name.
-
- $GENERATE tests were not backward compatible with python 2.4.
-
-New since 1.10.0:
-
- $GENERATE support
-
- TLSA RR support
-
- Added set_flags() method to dns.resolver.Resolver
-
-Bugs fixed since 1.10.0:
-
- Names with offsets >= 2^14 are no longer added to the compression
- table.
-
- The "::" syntax is not used to shorten a single 16-bit section of
- the text form an IPv6 address.
-
- Caches are now locked.
-
- YXDOMAIN is raised if seen by the resolver.
-
- Empty rdatasets are not printed.
-
- DNSKEY key tags are no longer assumed to be unique.
-
-New since 1.9.4:
-
- Added dns.resolver.LRUCache. In this cache implementation,
- the cache size is limited to a user-specified number of nodes,
- and when adding a new node to a full cache the least-recently
- used node is removed. If you're crawling the web or otherwise
- doing lots of resolutions and you are using a cache, switching
- to the LRUCache is recommended.
-
- dns.resolver.query() will try TCP if a UDP response is
- truncated.
-
- The python socket module's DNS methods can be now be overriden
- with implementations that use dnspython's resolver.
-
- Old DNSSEC types KEY, NXT, and SIG have been removed.
-
- Whitespace is allowed in SSHFP fingerprints.
-
- Origin checking in dns.zone.from_xfr() can be disabled.
-
- Trailing junk checking can be disabled.
-
- A source port can be specified when creating a resolver query.
-
- All EDNS values may now be specified to dns.message.make_query().
-
-Bugs fixed since 1.9.4:
-
- IPv4 and IPv6 address processing is now stricter.
-
- Bounds checking of slices in rdata wire processing is now more
- strict, and bounds errors (e.g. we got less data than was
- expected) now raise dns.exception.FormError rather than
- IndexError.
-
- Specifying a source port without specifying source used to
- have no effect, but now uses the wildcard address and the
- specified port.
-
-New since 1.9.3:
-
- Nothing.
-
-Bugs fixed since 1.9.3:
-
- The rdata _wire_cmp() routine now handles relative names.
-
- The SIG RR implementation was missing 'import struct'.
-
-New since 1.9.2:
-
- A boolean parameter, 'raise_on_no_answer', has been added to
- the query() methods. In no-error, no-data situations, this
- parameter determines whether NoAnswer should be raised or not.
- If True, NoAnswer is raised. If False, then an Answer()
- object with a None rrset will be returned.
-
- Resolver Answer() objects now have a canonical_name field.
-
- Rdata now have a __hash__ method.
-
-Bugs fixed since 1.9.2:
-
- Dnspython was erroneously doing case-insensitive comparisons
- of the names in NSEC and RRSIG RRs.
-
- We now use "is" and not "==" when testing what section an RR
- is in.
-
- The resolver now disallows metaqueries.
-
-New since 1.9.1:
-
- Nothing.
-
-Bugs fixed since 1.9.1:
-
- The dns.dnssec module didn't work at all due to missing
- imports that escaped detection in testing because the test
- suite also did the imports. The third time is the charm!
-
-New since 1.9.0:
-
- Nothing.
-
-Bugs fixed since 1.9.0:
-
- The dns.dnssec module didn't work with DSA due to namespace
- contamination from a "from"-style import.
-
-New since 1.8.0:
-
- dnspython now uses poll() instead of select() when available.
-
- Basic DNSSEC validation can be done using dns.dnsec.validate()
- and dns.dnssec.validate_rrsig() if you have PyCrypto 2.3 or
- later installed. Complete secure resolution is not yet
- available.
-
- Added key_id() to the DNSSEC module, which computes the DNSSEC
- key id of a DNSKEY rdata.
-
- Added make_ds() to the DNSSEC module, which returns the DS RR
- for a given DNSKEY rdata.
-
- dnspython now raises an exception if HMAC-SHA284 or
- HMAC-SHA512 are used with a Python older than 2.5.2. (Older
- Pythons do not compute the correct value.)
-
- Symbolic constants are now available for TSIG algorithm names.
-
-Bugs fixed since 1.8.0
-
- dns.resolver.zone_for_name() didn't handle a query response
- with a CNAME or DNAME correctly in some cases.
-
- When specifying rdata types and classes as text, Unicode
- strings may now be used.
-
- Hashlib compatibility issues have been fixed.
-
- dns.message now imports dns.edns.
-
- The TSIG algorithm value was passed incorrectly to use_tsig()
- in some cases.
-
-New since 1.7.1:
-
- Support for hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384
- and hmac-sha512 has been contributed by Kevin Chen.
-
- The tokenizer's tokens are now Token objects instead of (type,
- value) tuples.
-
-Bugs fixed since 1.7.1:
-
- Escapes in masterfiles now work correctly. Previously they
- were only working correctly when the text involved was part of
- a domain name.
-
- When constructing a DDNS update, if the present() method was
- used with a single rdata, a zero TTL was not added.
-
- The entropy pool needed locking to be thread safe.
-
- The entropy pool's reading of /dev/random could cause
- dnspython to block.
-
- The entropy pool did buffered reads, potentially consuming more
- randomness than we needed.
-
- The entropy pool did not seed with high quality randomness on
- Windows.
-
- SRV records were compared incorrectly.
-
- In the e164 query function, the resolver parameter was not
- used.
-
-New since 1.7.0:
-
- Nothing
-
-Bugs fixed since 1.7.0:
-
- The 1.7.0 kitting process inadventently omitted the code for the
- DLV RR.
-
- Negative DDNS prerequisites are now handled correctly.
-
-New since 1.6.0:
-
- Rdatas now have a to_digestable() method, which returns the
- DNSSEC canonical form of the rdata, suitable for use in
- signature computations.
-
- The NSEC3, NSEC3PARAM, DLV, and HIP RR types are now supported.
-
- An entropy module has been added and is used to randomize query ids.
-
- EDNS0 options are now supported.
-
- UDP IXFR is now supported.
-
- The wire format parser now has a 'one_rr_per_rrset' mode, which
- suppresses the usual coalescing of all RRs of a given type into a
- single RRset.
-
- Various helpful DNSSEC-related constants are now defined.
-
- The resolver's query() method now has an optional 'source' parameter,
- allowing the source IP address to be specified.
-
-Bugs fixed since 1.6.0:
-
- On Windows, the resolver set the domain incorrectly.
-
- DS RR parsing only allowed one Base64 chunk.
-
- TSIG validation didn't always use absolute names.
-
- NSEC.to_text() only printed the last window.
-
- We did not canonicalize IPv6 addresses before comparing them; we
- would thus treat equivalent but different textual forms, e.g.
- "1:00::1" and "1::1" as being non-equivalent.
-
- If the peer set a TSIG error, we didn't raise an exception.
-
- Some EDNS bugs in the message code have been fixed (see the ChangeLog
- for details).
-
-New since 1.5.0:
- Added dns.inet.is_multicast().
-
-Bugs fixed since 1.5.0:
-
- If select() raises an exception due to EINTR, we should just
- select() again.
-
- If the queried address is a multicast address, then don't
- check that the address of the response is the same as the
- address queried.
-
- NAPTR comparisons didn't compare the preference field due to a
- typo.
-
- Testing of whether a Windows NIC is enabled now works on Vista
- thanks to code contributed by Paul Marks.
-
-New since 1.4.0:
-
- Answer objects now support more of the python sequence
- protocol, forwarding the requests to the answer rrset.
- E.g. "for a in answer" is equivalent to "for a in
- answer.rrset", "answer[i]" is equivalent to "answer.rrset[i]",
- and "answer[i:j]" is equivalent to "answer.rrset[i:j]".
-
- Making requests using EDNS, including indicating DNSSEC awareness,
- is now easier. For example, you can now say:
-
- q = dns.message.make_query('www.dnspython.org', 'MX',
- want_dnssec=True)
-
- dns.query.xfr() can now be used for IXFR.
-
- Support has been added for the DHCID, IPSECKEY, and SPF RR types.
-
- UDP messages from unexpected sources can now be ignored by
- setting ignore_unexpected to True when calling dns.query.udp.
-
-Bugs fixed since 1.4.0:
-
- If /etc/resolv.conf didn't exist, we raised an exception
- instead of simply using the default resolver configuration.
-
- In dns.resolver.Resolver._config_win32_fromkey(), we were
- passing the wrong variable to self._config_win32_search().
-
-New since 1.3.5:
-
- You can now convert E.164 numbers to/from their ENUM name
- forms:
-
- >>> import dns.e164
- >>> n = dns.e164.from_e164("+1 555 1212")
- >>> n
- <DNS name 2.1.2.1.5.5.5.1.e164.arpa.>
- >>> dns.e164.to_e164(n)
- '+15551212'
-
- You can now convert IPv4 and IPv6 address to/from their
- corresponding DNS reverse map names:
-
- >>> import dns.reversename
- >>> n = dns.reversename.from_address("127.0.0.1")
- >>> n
- <DNS name 1.0.0.127.in-addr.arpa.>
- >>> dns.reversename.to_address(n)
- '127.0.0.1'
-
- You can now convert between Unicode strings and their IDN ACE
- form:
-
- >>> n = dns.name.from_text(u'les-\u00e9l\u00e8ves.example.')
- >>> n
- <DNS name xn--les-lves-50ai.example.>
- >>> n.to_unicode()
- u'les-\xe9l\xe8ves.example.'
-
- The origin parameter to dns.zone.from_text() and dns.zone.to_text()
- is now optional. If not specified, the origin will be taken from
- the first $ORIGIN statement in the master file.
-
- Sanity checking of a zone can be disabled; this is useful when
- working with files which are zone fragments.
-
-Bugs fixed since 1.3.5:
-
- The correct delimiter was not used when retrieving the
- list of nameservers from the registry in certain versions of
- windows.
-
- The floating-point version of latitude and longitude in LOC RRs
- (float_latitude and float_longitude) had incorrect signs for
- south latitudes and west longitudes.
-
- BIND 8 TTL syntax is now accepted in all TTL-like places (i.e.
- SOA fields refresh, retry, expire, and minimum; SIG/RRSIG
- field original_ttl).
-
- TTLs are now bounds checked when their text form is parsed,
- and their values must be in the closed interval [0, 2^31 - 1].
-
-New since 1.3.4:
-
- In the resolver, if time goes backward a little bit, ignore
- it.
-
- zone_for_name() has been added to the resolver module. It
- returns the zone which is authoritative for the specified
- name, which is handy for dynamic update. E.g.
-
- import dns.resolver
- print dns.resolver.zone_for_name('www.dnspython.org')
-
- will output "dnspython.org." and
-
- print dns.resolver.zone_for_name('a.b.c.d.e.f.example.')
-
- will output ".".
-
- The default resolver can be fetched with the
- get_default_resolver() method.
-
- You can now get the parent (immediate superdomain) of a name
- by using the parent() method.
-
- Zone.iterate_rdatasets() and Zone.iterate_rdatas() now have
- a default rdtype of dns.rdatatype.ANY like the documentation
- says.
-
- A Dynamic DNS example, ddns.py, has been added.
-
-New since 1.3.3:
-
- The source address and port may now be specified when calling
- dns.query.{udp,tcp,xfr}.
-
- The resolver now does exponential backoff each time it runs
- through all of the nameservers.
-
- Rcodes which indicate a nameserver is likely to be a
- "permanent failure" for a query cause the nameserver to be removed
- from the mix for that query.
-
-New since 1.3.2:
-
- dns.message.Message.find_rrset() now uses an index, vastly
- improving the from_wire() performance of large messages such
- as zone transfers.
-
- Added dns.message.make_response(), which creates a skeletal
- response for the specified query.
-
- Added opcode() and set_opcode() convenience methods to the
- dns.message.Message class. Added the request_payload
- attribute to the Message class.
-
- The 'file' parameter of dns.name.Name.to_wire() is now
- optional; if omitted, the wire form will be returned as the
- value of the function.
-
- dns.zone.from_xfr() in relativization mode incorrectly set
- zone.origin to the empty name.
-
- The masterfile parser incorrectly rejected TXT records where a
- value was not quoted.
-
-New since 1.3.1:
-
- The NSEC format doesn't allow specifying types by number, so
- we shouldn't either. (Using the unknown type format is still
- OK though.)
-
- The resolver wasn't catching dns.exception.Timeout, so a timeout
- erroneously caused the whole resolution to fail instead of just
- going on to the next server.
-
- The renderer module didn't import random, causing an exception
- to be raised if a query id wasn't provided when a Renderer was
- created.
-
- The conversion of LOC milliseconds values from text to binary was
- incorrect if the length of the milliseconds string was not 3.
-
-New since 1.3.0:
-
- Added support for the SSHFP type.
-
-New since 1.2.0:
-
- Added support for new DNSSEC types RRSIG, NSEC, and DNSKEY.
-
-This release fixes all known bugs.
-
-See the ChangeLog file for more detailed information on changes since
-the prior release.
-
-
-REQUIREMENTS
-
-Python 2.4 or later.
-
-
-INSTALLATION
-
-To build and install dnspython, type
-
- python setup.py install
-
-
-HOME PAGE
-
-For the latest in releases, documentation, and information, visit the
-dnspython home page at
-
- http://www.dnspython.org/
-
-
-
-DOCUMENTATION
-
-Documentation is sparse at the moment. Use pydoc, or read the HTML
-documentation at the dnspython home page, or download the HTML
-documentation.
-
-
-BUG REPORTS
-
-Bug reports may be sent to bugs at dnspython.org
-
-
-MAILING LISTS
-
-A number of mailing lists are available. Visit the dnspython home
-page to subscribe or unsubscribe.
diff --git a/dns/_compat.py b/dns/_compat.py
new file mode 100644
index 0000000..cffe4bb
--- /dev/null
+++ b/dns/_compat.py
@@ -0,0 +1,21 @@
+import sys
+
+
+if sys.version_info > (3,):
+ long = int
+ xrange = range
+else:
+ long = long
+ xrange = xrange
+
+# unicode / binary types
+if sys.version_info > (3,):
+ text_type = str
+ binary_type = bytes
+ string_types = (str,)
+ unichr = chr
+else:
+ text_type = unicode
+ binary_type = str
+ string_types = (basestring,)
+ unichr = unichr
diff --git a/dns/dnssec.py b/dns/dnssec.py
index f1d70ce..fec1208 100644
--- a/dns/dnssec.py
+++ b/dns/dnssec.py
@@ -15,7 +15,7 @@
"""Common DNSSEC-related functions and constants."""
-import cStringIO
+from io import BytesIO
import struct
import time
@@ -27,14 +27,17 @@ import dns.rdataset
import dns.rdata
import dns.rdatatype
import dns.rdataclass
+from ._compat import string_types
+
class UnsupportedAlgorithm(dns.exception.DNSException):
- """Raised if an algorithm is not supported."""
- pass
+
+ """The DNSSEC algorithm is not supported."""
+
class ValidationFailure(dns.exception.DNSException):
+
"""The DNSSEC signature is invalid."""
- pass
RSAMD5 = 1
DH = 2
@@ -52,27 +55,28 @@ PRIVATEDNS = 253
PRIVATEOID = 254
_algorithm_by_text = {
- 'RSAMD5' : RSAMD5,
- 'DH' : DH,
- 'DSA' : DSA,
- 'ECC' : ECC,
- 'RSASHA1' : RSASHA1,
- 'DSANSEC3SHA1' : DSANSEC3SHA1,
- 'RSASHA1NSEC3SHA1' : RSASHA1NSEC3SHA1,
- 'RSASHA256' : RSASHA256,
- 'RSASHA512' : RSASHA512,
- 'INDIRECT' : INDIRECT,
- 'ECDSAP256SHA256' : ECDSAP256SHA256,
- 'ECDSAP384SHA384' : ECDSAP384SHA384,
- 'PRIVATEDNS' : PRIVATEDNS,
- 'PRIVATEOID' : PRIVATEOID,
- }
+ 'RSAMD5': RSAMD5,
+ 'DH': DH,
+ 'DSA': DSA,
+ 'ECC': ECC,
+ 'RSASHA1': RSASHA1,
+ 'DSANSEC3SHA1': DSANSEC3SHA1,
+ 'RSASHA1NSEC3SHA1': RSASHA1NSEC3SHA1,
+ 'RSASHA256': RSASHA256,
+ 'RSASHA512': RSASHA512,
+ 'INDIRECT': INDIRECT,
+ 'ECDSAP256SHA256': ECDSAP256SHA256,
+ 'ECDSAP384SHA384': ECDSAP384SHA384,
+ 'PRIVATEDNS': PRIVATEDNS,
+ 'PRIVATEOID': PRIVATEOID,
+}
# We construct the inverse mapping programmatically to ensure that we
# cannot make any mistakes (e.g. omissions, cut-and-paste errors) that
# would cause the mapping not to be true inverse.
-_algorithm_by_value = dict([(y, x) for x, y in _algorithm_by_text.iteritems()])
+_algorithm_by_value = dict((y, x) for x, y in _algorithm_by_text.items())
+
def algorithm_from_text(text):
"""Convert text into a DNSSEC algorithm value
@@ -83,6 +87,7 @@ def algorithm_from_text(text):
value = int(text)
return value
+
def algorithm_to_text(value):
"""Convert a DNSSEC algorithm value to text
@rtype: string"""
@@ -92,35 +97,40 @@ def algorithm_to_text(value):
text = str(value)
return text
+
def _to_rdata(record, origin):
- s = cStringIO.StringIO()
+ s = BytesIO()
record.to_wire(s, origin=origin)
return s.getvalue()
+
def key_id(key, origin=None):
rdata = _to_rdata(key, origin)
+ rdata = bytearray(rdata)
if key.algorithm == RSAMD5:
- return (ord(rdata[-3]) << 8) + ord(rdata[-2])
+ return (rdata[-3] << 8) + rdata[-2]
else:
total = 0
for i in range(len(rdata) // 2):
- total += (ord(rdata[2 * i]) << 8) + ord(rdata[2 * i + 1])
+ total += (rdata[2 * i] << 8) + \
+ rdata[2 * i + 1]
if len(rdata) % 2 != 0:
- total += ord(rdata[len(rdata) - 1]) << 8
- total += ((total >> 16) & 0xffff);
+ total += rdata[len(rdata) - 1] << 8
+ total += ((total >> 16) & 0xffff)
return total & 0xffff
+
def make_ds(name, key, algorithm, origin=None):
if algorithm.upper() == 'SHA1':
dsalg = 1
- hash = dns.hash.get('SHA1')()
+ hash = dns.hash.hashes['SHA1']()
elif algorithm.upper() == 'SHA256':
dsalg = 2
- hash = dns.hash.get('SHA256')()
+ hash = dns.hash.hashes['SHA256']()
else:
- raise UnsupportedAlgorithm, 'unsupported algorithm "%s"' % algorithm
+ raise UnsupportedAlgorithm('unsupported algorithm "%s"' % algorithm)
- if isinstance(name, (str, unicode)):
+ if isinstance(name, string_types):
name = dns.name.from_text(name, origin)
hash.update(name.canonicalize().to_wire())
hash.update(_to_rdata(key, origin))
@@ -130,8 +140,9 @@ def make_ds(name, key, algorithm, origin=None):
return dns.rdata.from_wire(dns.rdataclass.IN, dns.rdatatype.DS, dsrdata, 0,
len(dsrdata))
+
def _find_candidate_keys(keys, rrsig):
- candidate_keys=[]
+ candidate_keys = []
value = keys.get(rrsig.signer)
if value is None:
return None
@@ -145,49 +156,59 @@ def _find_candidate_keys(keys, rrsig):
rdataset = value
for rdata in rdataset:
if rdata.algorithm == rrsig.algorithm and \
- key_id(rdata) == rrsig.key_tag:
+ key_id(rdata) == rrsig.key_tag:
candidate_keys.append(rdata)
return candidate_keys
+
def _is_rsa(algorithm):
return algorithm in (RSAMD5, RSASHA1,
RSASHA1NSEC3SHA1, RSASHA256,
RSASHA512)
+
def _is_dsa(algorithm):
return algorithm in (DSA, DSANSEC3SHA1)
+
def _is_ecdsa(algorithm):
return _have_ecdsa and (algorithm in (ECDSAP256SHA256, ECDSAP384SHA384))
+
def _is_md5(algorithm):
return algorithm == RSAMD5
+
def _is_sha1(algorithm):
return algorithm in (DSA, RSASHA1,
DSANSEC3SHA1, RSASHA1NSEC3SHA1)
+
def _is_sha256(algorithm):
return algorithm in (RSASHA256, ECDSAP256SHA256)
... 11963 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/dnspython.git
More information about the Python-modules-commits
mailing list