summaryrefslogtreecommitdiff
path: root/t
Commit message (Collapse)AuthorAge
* Merge pull request #136 from mattias-p/ignore-incomplete-rrMattias Päivärinta2023-12-04
|\ | | | | Ignore incomplete RRs
| * Add missing methods for Zonemaster::LDNS::RR::SIGMarc van der Wal2023-11-30
| | | | | | | | | | SIG resource records were missing methods defined in LDNS.xs because of a missing use statement in Zonemaster::LDNS::RR.
| * Ignore incomplete recordsMattias Päivärinta2023-11-30
| |
* | Zonemaster::LDNS::RR::NSEC3PARAM: rewrite salt()Marc van der Wal2023-11-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The salt() method in Zonemaster::LDNS::RR::NSEC3PARAM did not work as documented. Like two of those accessor methods in NSEC3 I’ve fixed previously, its return value is a byte string that starts with an extraneous length byte, which isn’t necessary. The unit test for this function compares base64-encoded strings. This hampers legibility because conversions between hexadecimal strings and base64 strings are not trivial and only a very astute reader would notice that the salt() method also had a similar problem. Also improve the documentation and the unit test coverage for that method.
* | Zonemaster::LDNS::RR::NSEC3: rewrite next_owner()Marc van der Wal2023-11-21
|/ | | | | | | | | | | | | | | | | | | The next_owner() method in Zonemaster::LDNS::RR::NSEC3 did not work as documented. Its return value was not the value of the next hashed owner name field, but the same value with the length byte prepended. This choice does not make the function as useful as one may hope. This commit ensures that the next_owner() method returns the next hashed owner name field, and only that. The unit test for this function compares base64-encoded strings. This hampers legibility because conversions between base32 and base64 are not trivial and only a very astute reader would notice that the next_owner() method had this kind of catch. As a bonus, add a useful tip in the method’s documentation.
* Remove newlines from base64-encoded dataMarc van der Wal2023-11-20
|
* Make Zonemaster::LDNS::RR::NSEC3::salt workMarc van der Wal2023-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The salt() method in the Zonemaster::LDNS::RR::NSEC3 module never worked and often caused the Perl interpreter to crash. This commit fixes many long-standing issues with the affected code. Firstly, the root cause of the crash is a double free resulting from the inappropriate use of ldns_rdf_deep_free() in the code. The ldns_nsec3_salt() function returns a pointer to a ldns_rdf structure which is just a window into the salt field, not a copy of the data. So calling ldns_rdf_deep_free() on that ldns_rdf object causes a part of the original resource record structure to be freed instead. This then results in a double free when the memory for the resource record object is deallocated. Calling ldns_rdf_free() instead fixes the crashing. Secondly, the method doesn’t quite return the salt: it actually returns a string containing the salt preceded by its length byte. This is surprising, not as documented and unlikely to be useful. This problem is fixed by rewriting the entire function so as to return the salt, all the salt and nothing but the salt. Thirdly, the method was also insufficiently covered by unit tests. Tests were added, first to help reproduce the crashes, but also to cover the case of an NSEC3 with non-empty salt. Finally, the method returns undef if the salt is empty. Not only is that documented nowhere, but the choice of doing so is questionable. This commit changes the behavior somewhat in this case: if the salt is empty, an empty string is returned instead; the method only returns undef if there was a problem accessing the salt field.
* Zonemaster::LDNS::RR::NSEC3::covers: check RRsMarc van der Wal2023-11-14
| | | | | | | | | | | | | | In Zonemaster::LDNS::RR::NSEC3::covers(), perform a simple sanity check on resource records before giving them to ldns_nsec_covers_name(). With ldns version 1.8.3, ldns_nsec_covers_name() crashes if the NSEC3 resource record has the root domain as owner name or has an empty next hashed owner name. Both are cases of invalid NSEC3 resource records that should be tested for before trying to do anything with them. While this is technically an ldns bug, we still need some kind of workaround, especially because Zonemaster::LDNS is linked by default against a bundled version of ldns.
* Zonemaster::LDNS::RR: NSEC3 RRs never cover rootMarc van der Wal2023-11-14
| | | | | | | | By definition, no NSEC3 resource record can ever prove the nonexistence of the root zone. However, calling the covers() method on an object representing an NSEC3 resource record, with "." as input, caused a crash. This commit changes the function to return undef in this case, which can be interpreted as a false value.
* Add (skipped) unit tests involving bad NSEC3 RRsMarc van der Wal2023-11-14
| | | | | Reproduce crashes witnessed in issues #174 and #175. The tests have to be skipped, however, because they both cause Perl to crash.
* Merge pull request #135 from mattias-p/110-empty-keyMattias Päivärinta2023-05-10
|\ | | | | Ignore DNSKEY RRs with incalculable key sizes
| * Make answer() filter out DNSKEY with incalculable key sizeMattias Päivärinta2022-03-16
| |
| * Make keysize() return -1 on insufficient dataMattias Päivärinta2022-03-16
| |
| * Interpret absence of pubkey field as empty pubkey fieldMattias Päivärinta2022-03-16
| |
| * Update DNS data used in testsAlexandre Pion2022-03-10
| | | | | | | | | | | | The `se` and `nic.se` zones have evolved a little. The tests made over the network using these zones have been slightly updated to fix errors and be aligned with current zone configuration.
* | Expand DNAME RR support - initial commit[Thomas Green]2023-03-07
| | | | | | | | | | - Allow access to DNAME RR - Add unitary test
* | Merge pull request #153 from marc-vanderwal/bugfix/#149Marc van der Wal2022-11-28
|\ \ | | | | | | Fix unsafe string manipulations in XS code
| * | Fix “bad CAA” unit tests on single-threaded PerlMarc van der Wal2022-09-05
| | | | | | | | | | | | | | | | | | | | | | | | Instantiation of a malformed CAA resource record is a guaranteed croak if and only if the Perl in use is compiled with support for interpreter threads (-DUSE_ITHREADS). If not, it won’t. So the unit test is modified to try to convert the bad CAA record back to presentation form, so that it does become a guaranteed croak.
| * | Add unit tests to reproduce issue on bad CAA RRsMarc van der Wal2022-09-01
| | | | | | | | | | | | | | | | | | | | | Add a unit test in packet.t and another one in rr.t to reproduce the segfaults I observed. See also issue #149.
* | | Merge pull request #151 from pnax/nsidAlexandre Pion2022-11-03
|\ \ \ | | | | | | | | | | | | Add support for NSID option + update internal LDNS to 1.8.3
| * | | Unit test for NSID supportAlexandre Pion2022-10-12
| |/ /
* | | Improve access to data in SPF recordsMarc van der Wal2022-10-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SPF resource records are, in essence, TXT resource records with a different type identifier. The only real difference between SPF and TXT resource records lies in their uses: TXT is more generic, where SPF was meant for publishing Sender Policy Framework policies before being deprecated. The Zonemaster::LDNS::RR::SPF module suffered from the same problem as its TXT counterpart, i.e. the spfdata() method only returns the first string, in presentation format. For parsing actual SPF policies, however, the behavior of the spfdata() method is both not very useful as well as incorrect: RFC 7208 states that the SPF policy is the concatenation of *all* strings in a single TXT (or SPF) resource record. So like with the txtdata() method in the TXT package, we entirely replace the spfdata() method with a correct and pure-Perl variant.
* | | Improve access to text data in TXT recordsMarc van der Wal2022-10-12
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, there has been no real elegant way of accessing the data in DNS TXT records. The only existing method, txtdata(), is implemented in XS code and has several issues. Firstly, it only returns the first string of the TXT record. Secondly, it returns that string in presentation format, that is, it returns a string which itself has surrounding quotes and contains decimal escapes for non-printable characters. This incorrect implementation is replaced with one in pure Perl. Normally, the only correct abstraction for TXT resource records is a list of strings. But for some use cases, such as SPF, DKIM and DMARC, the TXT record data ought to be treated as a single long string, which is the concatenation of all the strings in the TXT resource record data, without adding any spaces between consecutive strings. To my knowledge, there is no need to access the actual list of strings in the resource record data. This function could easily be made context-sensitive (e.g. by returning the list of strings in list context) if need be. This commit is also an excellent opportunity to rewrite the unit test for TXT resource records. The previous version needed Internet connectivity, but this new version can be run offline.
* | Replace references to "libidn" with "libidn2"Alexandre Pion2022-04-28
| |
* | Update DNS data used in testsAlexandre Pion2022-02-16
|/ | | | | | The `se` and `nic.se` zones have evolved a little. The tests made over the network using these zones have been slightly updated to fix errors and be aligned with current zone configuration.
* Updates values on iis.se due to updated hostingMats Dufberg2021-12-03
|
* Be relaxed about the exact number of NS recordsMattias Päivärinta2021-05-27
| | | | | | | There used to be three name servers for iis.se but now there are only two. We arbitrarily picked an upper bound for the expected number of name servers. "It's unlikely there'll be more than six name servers in the near future."
* Test was locale dependent. Corrected that. Issue #102. (#103)Mats Dufberg2020-04-07
|
* Google's public resolver has a new nameMattias Päivärinta2019-08-08
|
* Updated to adjust for changes in live data (#39)matsduf2018-01-23
| | | Updated to adjust for changes in live data and replace fixed value of NS with range. Also updated accepted range of additional records to match range of NS.
* Fixed issue #26 (#27)matsduf2017-12-19
| | | | | | * Fixed so rr.t so it matches current Internet and changed so that tests that depend on network are not run by default (issue #26) * .travis.yml is updated so that network tests are always run. * Updated README.md to document the new solution.
* Centralize minimum Perl requirement declarationMattias Päivärinta2017-10-04
| | | | | | Better to keep things in one place. Feature gates auto-enabled by use VERSION can be enabled with use feature instead, which is clearer to the reader anyway.
* Fix #16: Test wireformat roundtrips for RRsMattias Päivärinta2017-09-29
|
* Rename Net::LDNS to Zonemaster::LDNSMattias Päivärinta2017-09-27
|
* Loosen test suite's assumptions about the InternetMattias Päivärinta2017-09-27
| | | | Sometimes we get really quick replies (less than 1 ms)
* Loosen test suite's assumptions about the InternetMattias Päivärinta2017-09-27
|
* Revert "Add support to explicitly extract and look at OPT records."Mattias Päivärinta2017-09-21
| | | | | | | | This reverts commit ae0b150752c0e025e2a5847f72758ae24ec70601. Conflicts: t/dnssec.t t/optrr.t
* Hostmaster.iis.se SOA refresh value was updatedMattias Päivärinta2017-09-22
|
* Make correct assumptions about the state of the internetMattias Päivärinta2017-05-29
| | | | | | | | | * The old hardcoded name server for cyberpomo.com is no longer responding. * The .se zone has added another name server. The real fix is to not depend on the state of the internet. I'm deferring the real fix for another issue.
* Make it possible to run tests without networkJerry Lundström2016-01-07
|
* Add support to explicitly extract and look at OPT records.Calle Dybedahl2015-04-14
|
* Add method to get/set source IP address on resolvers. Bump version number to ↵Calle Dybedahl2015-03-30
| | | | 0.75.
* Packets created from wireformat were not properly cloned.Calle Dybedahl2015-03-30
|
* Remove checks that did more harm than good (SvOK does not process get magic).Calle Dybedahl2015-03-26
|
* Minor IDN fixes.Calle Dybedahl2015-03-20
|
* Put thread support behind ifdefs.Calle Dybedahl2015-03-19
|
* Threading support for rrlist and packet.Calle Dybedahl2015-03-19
|
* RRs survive threading.Calle Dybedahl2015-03-19
|
* Does not crash under threads for resolvers.Calle Dybedahl2015-03-19
|
* Remove diag printout.Calle Dybedahl2015-03-19
|