summaryrefslogtreecommitdiff
path: root/dns/message.py
Commit message (Collapse)AuthorAgeFilesLines
* use methods with appropriate rcode/opcode typecasting in Message.to_text()Bob Halley2021-01-041-4/+2
|
* Cast flags and ednsflags to int when calling dns.rcode.from_flags() andBob Halley2021-01-041-2/+2
| | | | | dns.opcode.from_flags(). This avoids subsequent to_text issues and other type confusion if the values were allowed to remain IntFlags.
* _WireReader.read() should make flags a dns.flags.Flag [Issue #606]Bob Halley2021-01-041-1/+1
|
* Change ChainingResult "rrset" to "answer"; fix typo.resolve_chainingBob Halley2020-12-211-10/+10
|
* resolve_chaining() now returns a ChainingResult object.Bob Halley2020-12-211-7/+30
|
* resolve_chaining() should not go into an infinite loop if the qtype isBob Halley2020-12-211-0/+3
| | | | CNAME and there is no answer [Issue #610].
* fix rrset match signature problemsfull_matchBob Halley2020-09-031-1/+2
|
* do not call the OPT constructor with rdclass == NoneBob Halley2020-08-211-1/+1
|
* Fix dns.message.use_tsig().Brian Wellington2020-08-101-3/+4
| | | | | | | | Passing only a dns.tsig.Key to dns.message.use_tsig() didn't work, as the placeholder tsig rrset on the message object was created with None as its name, not the name associated with the key. Also do a bit of refactoring to make the code more clear.
* Support callable() TSIG keyrings for use-cases like GSSTSig.Nick Hall2020-08-081-3/+9
|
* Add a lightweight wrapper around the HMAC types and refactor the "is gss-api ↵Nick Hall2020-08-081-4/+4
| | | | or not" wrapper functions to just call the class methods
* fix case of enum namesconstants2Bob Halley2020-08-031-2/+2
|
* remove globals() enum updatingBob Halley2020-08-031-1/+0
|
* add constantsBob Halley2020-08-031-0/+9
|
* pylint lintingBob Halley2020-07-311-2/+8
|
* Raise NoPreviousName if a text message tries to refer to a previous name but ↵Bob Halley2020-07-281-0/+9
| | | | there is none.
* Return the message in question_only mode. [#556]Bob Halley2020-07-281-1/+1
|
* even on errors where we tolerate no question, check question if presentBob Halley2020-07-251-3/+5
|
* Make resolver use_edns() conform to its docstring; slightly improve ↵Bob Halley2020-07-221-1/+1
| | | | use_edns() logic.
* Use min() for min_ttl computations.Bob Halley2020-07-211-8/+3
|
* fix exception docstringsBob Halley2020-07-211-10/+13
|
* set min ttl to max_ttl instead of special case -1Bob Halley2020-07-211-4/+5
|
* unify chaining codeBob Halley2020-07-211-3/+107
|
* Set EDNS default payload to 1232.Bob Halley2020-07-201-3/+4
|
* Minor cleanups to EDNS code.Brian Wellington2020-07-171-18/+7
| | | | | | | When the Message object was changed to store an OPT record, the changes to use_edns() left a lot of cruft. Reduce some code duplication in make_query().
* Fix Message ednsflags propery setter.Brian Wellington2020-07-071-1/+1
| | | | Setting ednsflags to 0 shouldn't unconditionally enable EDNS.
* Fix Message.want_dnssec().Brian Wellington2020-07-071-1/+1
| | | | | It was incorrectly calling Message._make_opt() in the case where the message was not currently using EDNS.
* Remove too strong "no metaclasses" check in _parse_rr_header().Bob Halley2020-07-071-2/+0
|
* Rework wire format processing.Bob Halley2020-07-021-36/+20
| | | | | | Wire format data is now done via a dns.wire.Parser, which does all of the bookkeeping and also provides convenience routines (e.g. get_uint16() or get_name()).
* Add dns.tsig.Key class.Brian Wellington2020-07-011-30/+51
| | | | | | | | | | | | | | | | | | | | This creates a new class to represent a TSIG key, containing name, secret, and algorithm. The keyring format is changed to be {name : key}, and the methods in dns.tsigkeyring are updated to deal with old and new formats. The Message class is updated to use dns.tsig.Key, although (to avoid breaking existing code), it stores them in the keyring field. Message.use_tsig() can accept either explicit keys, or keyrings; it will extract and/or create a key. dns.message.from_wire() can accept either a key or a keyring in the keyring parameter. If passed a key, it will now raise if the TSIG record in the message was signed with a different key. If passed a keyring containing keys (as opposed to bare secrets), it will check that the TSIG record's algorithm matches that of the key.
* Remove dns.message.Message multi field.Brian Wellington2020-06-301-7/+6
| | | | | The only user of this is the internal _WireReader class, so just pass it the flag rather than store it on the message.
* Remove the concept from "first" from TSIG.Brian Wellington2020-06-301-10/+3
| | | | | | | | | The sign() and validate() routines took a "first" parameter, which indicated that this message was the first in a multi-message sequence. This isn't needed, as it's identical to "not (ctx and multi)". Remove the parameter from both, as well as the now-unneeded field in the message object and message.from_wire() parameter.
* Store a TSIG rrset on the message object.Brian Wellington2020-06-301-39/+68
|
* Change dns.tsig.validate() to take a TSIG record.Brian Wellington2020-06-301-2/+1
|
* Create TSIGRecord; use it in _WireReader.Brian Wellington2020-06-301-40/+41
|
* opcode is a function not an attributeBob Halley2020-06-291-1/+1
|
* Remove no longer needed code to activate EDNS if setting an extendedBob Halley2020-06-281-2/+0
| | | | | | rcode and EDNS has not previously been activated. The code is no longer needed as setting ednsflags to a nonzero value will automatically make an opt RR and enable EDNS.
* Refactor OPT handling code into OPT record class. (#520)Brian Wellington2020-06-261-54/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | * Create an OPT record class. * Move OPT logic to one place. * Store the OPT record on the message object. This also adds a Renderer.add_rdata() method. * Add Rdataset.rdata_to_wire() helper. * Fix conflicts; simplify. * Fix typo. * style * Add a trivial to_text so that repr() works. * Add _parse_special_rr_header * More OPT checking. Pass the name to _parse_rr_header and _parse_special_rr_header, and check that the OPT record has the root name.
* Simplify code.Brian Wellington2020-06-261-6/+5
| | | | | There's no need to attach an attribute to the _TextReader/_WireReader classes; the code has access to the message.
* eliminate hardcode sections lengthBob Halley2020-06-261-4/+3
|
* lintBob Halley2020-06-261-2/+2
|
* Attempt to refactor per-opcode validation.messageBrian Wellington2020-06-261-43/+28
| | | | | | | | Instead of validating rrsets and sections after parsing them, check the class/type for each record before parsing it. This is more generic, because it moves all of the update logic out of the common code. It's also more flexible, as it allows the update logic to specify that meta-records are empty.
* Remove hardcoded section names from TextReader.Brian Wellington2020-06-261-26/+36
|
* Minor _WireReader refactoring.Brian Wellington2020-06-261-47/+49
| | | | | | Instead of parsing the header to determine which Message subclass to create and passing that message to _WireReader, make _WireReader create the Message subclass itself.
* basic documentation updates for revised message hierarchyBob Halley2020-06-261-4/+11
|
* move rrset validation to the end-of-section processingBob Halley2020-06-261-11/+7
|
* lintBob Halley2020-06-261-2/+2
|
* fix cut-and-paste errorBob Halley2020-06-261-3/+0
|
* message.from_text() should have the same relativize options as other text APIs.Bob Halley2020-06-261-7/+32
|
* new message class hierarchy and conversion of wire and text readersBob Halley2020-06-251-77/+137
|