From 4f6a623a885fe3005ec511b67cf22040b049c97b Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 3 Dec 2021 09:11:05 +0100 Subject: [PATCH 01/83] Forgot to attribute bug reports in previous release --- Changelog | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 478778a6..864d008a 100644 --- a/Changelog +++ b/Changelog @@ -1,7 +1,11 @@ +1.8.2 2022-??-?? + + 1.8.1 2021-12-03 * bugfix #146: ldns-1.7.1 had soname 3.0, so ldns-1.8.x soname - needs to larger. + needs to larger. Thanks Leah Neukirchen & Felipe Gasper * Undo PR#123 fix ldns.pc installation when building out-of-source + Thanks Axel Xu 1.8.0 2021-11-26 * bugfix #38: Print "line" before line number when printing From 7a17c48dfb16d9ab0ef59fc63301c8028f37d683 Mon Sep 17 00:00:00 2001 From: Felipe Gasper Date: Thu, 9 Dec 2021 12:02:19 -0500 Subject: [PATCH 02/83] Fix parsing of TAB-separated cstrings. Issue #147 --- rr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rr.c b/rr.c index c98989a4..515e25a3 100644 --- a/rr.c +++ b/rr.c @@ -365,9 +365,9 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str, desc, r_cnt)) && ldns_buffer_remaining(rd_buf) > 0){ - /* skip spaces */ + /* skip spaces & tabs */ while (ldns_buffer_remaining(rd_buf) > 0 && - *(ldns_buffer_current(rd_buf)) == ' ') { + NULL != strchr( LDNS_PARSE_NO_NL, *(ldns_buffer_current(rd_buf)) )) { ldns_buffer_skip(rd_buf, 1); } From dde6a586ccb184e5824f48bd10ce6465c6147558 Mon Sep 17 00:00:00 2001 From: Felipe Gasper Date: Thu, 9 Dec 2021 12:18:55 -0500 Subject: [PATCH 03/83] Add test for tab between character-strings. Issue #147 --- .../27-tab-between-cstrings.db | 1 + .../27-tab-between-cstrings.dsc | 16 ++++++++++++++++ .../27-tab-between-cstrings.help | 1 + .../27-tab-between-cstrings.test | 15 +++++++++++++++ 4 files changed, 33 insertions(+) create mode 100644 test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.db create mode 100644 test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.dsc create mode 100644 test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.help create mode 100644 test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.test diff --git a/test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.db b/test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.db new file mode 100644 index 00000000..bd2c0ed2 --- /dev/null +++ b/test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.db @@ -0,0 +1 @@ +foo 12345 IN HINFO "hohum" "weirdo" diff --git a/test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.dsc b/test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.dsc new file mode 100644 index 00000000..c7215ea4 --- /dev/null +++ b/test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.dsc @@ -0,0 +1,16 @@ +BaseName: 27-tab-between-cstrings +Version: 1.0 +Description: Check for GH 147 regression +CreationDate: Thu Dec 9 12:04:34 EST 2021 +Maintainer: +Category: +Component: +CmdDepends: +Depends: +Help: 27-tab-between-cstrings.help +Pre: +Post: +Test: 27-tab-between-cstrings.test +AuxFiles: +Passed: +Failure: diff --git a/test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.help b/test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.help new file mode 100644 index 00000000..f54a7906 --- /dev/null +++ b/test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.help @@ -0,0 +1 @@ +This requires no arguments. diff --git a/test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.test b/test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.test new file mode 100644 index 00000000..d5381161 --- /dev/null +++ b/test/27-tab-between-cstrings.tpkg/27-tab-between-cstrings.test @@ -0,0 +1,15 @@ +# #-- 27-tab-between-cstrings.test --# +# source the master var file when it's there +[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master + +export PATH=$PATH:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:. + +export LD_LIBRARY_PATH=../../lib:$LD_LIBRARY_PATH + +OUTPUT=`../../examples/ldns-read-zone 27-tab-between-cstrings.db` + +if [[ $? -eq 0 ]]; then + echo $OUTPUT | grep weirdo +else + exit 1 +fi From c695185ffa2cca025da5ea60ed751292760573ff Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Sat, 11 Dec 2021 11:01:11 +0100 Subject: [PATCH 04/83] Fix #147: Tabs before quoted rdata fields --- Changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 864d008a..c2f9b9ba 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,6 @@ 1.8.2 2022-??-?? - + * bugfix #147: Allow for tabs in whitespace before quoted rdata + fields. Thanks Felipe Gasper 1.8.1 2021-12-03 * bugfix #146: ldns-1.7.1 had soname 3.0, so ldns-1.8.x soname From 8803df157f788cec99fd403ccbffff713aa169d3 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Mon, 27 Dec 2021 14:38:54 +0100 Subject: [PATCH 05/83] Comment explaining how empty long strings are represented in rdfs In response to issue #150 --- str2host.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/str2host.c b/str2host.c index ea2fe73a..b33101b0 100644 --- a/str2host.c +++ b/str2host.c @@ -1550,6 +1550,9 @@ ldns_str2rdf_long_str(ldns_rdf **rd, const char *str) return LDNS_STATUS_SYNTAX_BAD_ESCAPE; } if (!(length = (size_t)(dp - data))) { + /* An empty string is a data buffer of 0 bytes. The rdf for + * this long string has to have length 0 and point to NULL. + */ LDNS_FREE(data); data = NULL; } else { From c01ce341c11881e5ea4da14766c5195343fedc03 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Mon, 27 Dec 2021 15:55:27 +0100 Subject: [PATCH 06/83] Doxygen annotate returning values via parameters At least the allocated structs in constructor functions. Also updated the doxygen file. In response to issue #149 --- dnssec_sign.c | 32 ---- ldns/dnssec_sign.h | 9 +- ldns/dnssec_verify.h | 2 +- ldns/host2wire.h | 4 + ldns/keys.h | 8 +- ldns/radix.h | 4 +- ldns/rbtree.h | 2 +- ldns/str2host.h | 74 ++++---- ldns/wire2host.h | 8 +- libdns.doxygen | 409 +++++++++++++++++++++++++++++++------------ 10 files changed, 354 insertions(+), 198 deletions(-) diff --git a/dnssec_sign.c b/dnssec_sign.c index a3a0db3e..61137807 100644 --- a/dnssec_sign.c +++ b/dnssec_sign.c @@ -328,14 +328,6 @@ ldns_sign_public(ldns_rr_list *rrset, ldns_key_list *keys) return signatures; } -/** - * Sign data with DSA - * - * \param[in] to_sign The ldns_buffer containing raw data that is - * to be signed - * \param[in] key The DSA key structure to sign with - * \return ldns_rdf for the RRSIG ldns_rr - */ ldns_rdf * ldns_sign_public_dsa(ldns_buffer *to_sign, DSA *key) { @@ -676,20 +668,6 @@ ldns_dnssec_addresses_on_glue_list( return LDNS_STATUS_OK; } -/** - * Marks the names in the zone that are occluded. Those names will be skipped - * when walking the tree with the ldns_dnssec_name_node_next_nonglue() - * function. But watch out! Names that are partially occluded (like glue with - * the same name as the delegation) will not be marked and should specifically - * be taken into account separately. - * - * When glue_list is given (not NULL), in the process of marking the names, all - * glue resource records will be pushed to that list, even glue at delegation names. - * - * \param[in] zone the zone in which to mark the names - * \param[in] glue_list the list to which to push the glue rrs - * \return LDNS_STATUS_OK on success, an error code otherwise - */ ldns_status ldns_dnssec_zone_mark_and_get_glue(ldns_dnssec_zone *zone, ldns_rr_list *glue_list) @@ -769,16 +747,6 @@ ldns_dnssec_zone_mark_and_get_glue(ldns_dnssec_zone *zone, return LDNS_STATUS_OK; } -/** - * Marks the names in the zone that are occluded. Those names will be skipped - * when walking the tree with the ldns_dnssec_name_node_next_nonglue() - * function. But watch out! Names that are partially occluded (like glue with - * the same name as the delegation) will not be marked and should specifically - * be taken into account separately. - * - * \param[in] zone the zone in which to mark the names - * \return LDNS_STATUS_OK on success, an error code otherwise - */ ldns_status ldns_dnssec_zone_mark_glue(ldns_dnssec_zone *zone) { diff --git a/ldns/dnssec_sign.h b/ldns/dnssec_sign.h index 2f1e5c60..cac47fbf 100644 --- a/ldns/dnssec_sign.h +++ b/ldns/dnssec_sign.h @@ -49,9 +49,10 @@ ldns_rr_list *ldns_sign_public(ldns_rr_list *rrset, ldns_key_list *keys); #if LDNS_BUILD_CONFIG_HAVE_SSL /** * Sign a buffer with the DSA key (hash with SHA1) - * \param[in] to_sign buffer with the data - * \param[in] key the key to use - * \return a ldns_rdf with the signed data + * + * \param[in] to_sign The ldns_buffer containing raw data that is to be signed + * \param[in] key The DSA key structure to sign with + * \return a ldns_rdf for the RRSIG ldns_rr */ ldns_rdf *ldns_sign_public_dsa(ldns_buffer *to_sign, DSA *key); @@ -112,7 +113,7 @@ ldns_dnssec_zone_mark_and_get_glue( * be taken into account separately. * * \param[in] zone the zone in which to mark the names - * \return LDNS_STATUS_OK on succesful completion + * \return LDNS_STATUS_OK on succesful completion, an error code otherwise */ ldns_status ldns_dnssec_zone_mark_glue(ldns_dnssec_zone *zone); diff --git a/ldns/dnssec_verify.h b/ldns/dnssec_verify.h index 80881c68..0ce6ec99 100644 --- a/ldns/dnssec_verify.h +++ b/ldns/dnssec_verify.h @@ -592,7 +592,7 @@ ldns_status ldns_dnssec_verify_denial_nsec3(ldns_rr *rr, * \param[in] packet_qtype The original query RR type * \param[in] packet_nodata True if the providing packet had an empty ANSWER * section - * \param[in] match On match, the given (reference to a) pointer will be set + * \param[out] match On match, the given (reference to a) pointer will be set * to point to the matching nsec resource record. * \return LDNS_STATUS_OK if the NSEC3 RRs deny the existence, error code * containing the reason they do not otherwise diff --git a/ldns/host2wire.h b/ldns/host2wire.h index 5237f6c1..4378f336 100644 --- a/ldns/host2wire.h +++ b/ldns/host2wire.h @@ -196,6 +196,10 @@ ldns_status ldns_rr2wire(uint8_t **dest, const ldns_rr *rr, int section, size_t * given packet in that array. The result_size value contains the * length of the array, if it succeeds, and 0 otherwise (in which case * the function also returns NULL) + * + * \param[out] dest pointer to the array of bytes to be created + * \param[in] p the packet to convert + * \param[out] size the size of the converted result */ ldns_status ldns_pkt2wire(uint8_t **dest, const ldns_pkt *p, size_t *size); diff --git a/ldns/keys.h b/ldns/keys.h index d6435825..0e65f72b 100644 --- a/ldns/keys.h +++ b/ldns/keys.h @@ -235,8 +235,14 @@ ldns_status ldns_key_new_frm_fp_l(ldns_key **k, FILE *fp, int *line_nr); /** * Read the key with the given id from the given engine and store it * in the given ldns_key structure. The algorithm type is set + * + * \param[out] key the new ldns_key structure + * \param[in] e the engine from which to read the key + * \param[in] key_id the id of the key with which to lookup the key in the engine + * \param[in] a the algorithm to set for this key + * \return an error or LDNS_STATUS_OK */ -ldns_status ldns_key_new_frm_engine(ldns_key **key, ENGINE *e, char *key_id, ldns_algorithm); +ldns_status ldns_key_new_frm_engine(ldns_key **key, ENGINE *e, char *key_id, ldns_algorithm a); /** diff --git a/ldns/radix.h b/ldns/radix.h index ec70565a..4cb42b48 100644 --- a/ldns/radix.h +++ b/ldns/radix.h @@ -154,7 +154,7 @@ ldns_radix_node_t* ldns_radix_search(ldns_radix_t* tree, const uint8_t* key, * @param tree: tree to insert to. * @param key: key. * @param len: length of key. - * @param result: the radix node with the exact or closest match. NULL if + * @param[out] result: the radix node with the exact or closest match. NULL if * the key is smaller than the smallest key in the tree. * @return 1 if exact match, 0 otherwise. * @@ -198,7 +198,7 @@ ldns_radix_node_t* ldns_radix_prev(ldns_radix_node_t* node); * Split radix tree intwo. * @param tree1: one tree. * @param num: number of elements to split off. - * @param tree2: another tree. + * @param[out] tree2: another tree. * @return: status. * */ diff --git a/ldns/rbtree.h b/ldns/rbtree.h index 0747a8e5..4cfaf382 100644 --- a/ldns/rbtree.h +++ b/ldns/rbtree.h @@ -151,7 +151,7 @@ ldns_rbnode_t *ldns_rbtree_search(ldns_rbtree_t *rbtree, const void *key); * Find, but match does not have to be exact. * @param rbtree: tree to find in. * @param key: key to find position of. - * @param result: set to the exact node if present, otherwise to element that + * @param[out] result: set to the exact node if present, otherwise to element that * precedes the position of key in the tree. NULL if no smaller element. * @return: true if exact match in result. Else result points to <= element, * or NULL if key is smaller than the smallest key. diff --git a/ldns/str2host.h b/ldns/str2host.h index 0ccfd661..2892db0b 100644 --- a/ldns/str2host.h +++ b/ldns/str2host.h @@ -32,7 +32,7 @@ extern "C" { /** * convert a byte into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] bytestr the string to be converted * \return ldns_status */ @@ -40,7 +40,7 @@ ldns_status ldns_str2rdf_int8(ldns_rdf **rd, const char *bytestr); /** * convert a string to a int16 in wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] shortstr the string to be converted * \return ldns_status */ @@ -48,7 +48,7 @@ ldns_status ldns_str2rdf_int16(ldns_rdf **rd, const char *shortstr); /** * convert a strings into a 4 byte int in wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] longstr the string to be converted * \return ldns_status */ @@ -56,21 +56,21 @@ ldns_status ldns_str2rdf_int32(ldns_rdf **rd, const char *longstr); /** * convert a time string to a time value in wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] time the string to be converted * \return ldns_status */ ldns_status ldns_str2rdf_time(ldns_rdf **rd, const char *time); /* convert string with NSEC3 salt to wireformat) - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * return ldns_status */ ldns_status ldns_str2rdf_nsec3_salt(ldns_rdf **rd, const char *nsec3_salt); /* convert a time period (think TTL's) to wireformat) - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * return ldns_status */ @@ -78,7 +78,7 @@ ldns_status ldns_str2rdf_period(ldns_rdf **rd, const char *str); /** * convert str with an A record into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -86,7 +86,7 @@ ldns_status ldns_str2rdf_a(ldns_rdf **rd, const char *str); /** * convert the str with an AAAA record into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -94,7 +94,7 @@ ldns_status ldns_str2rdf_aaaa(ldns_rdf **rd, const char *str); /** * convert a string into wireformat (think txt record) - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted (NULL terminated) * \return ldns_status */ @@ -102,7 +102,7 @@ ldns_status ldns_str2rdf_str(ldns_rdf **rd, const char *str); /** * convert str with the apl record into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -110,7 +110,7 @@ ldns_status ldns_str2rdf_apl(ldns_rdf **rd, const char *str); /** * convert the string with the b64 data into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -118,7 +118,7 @@ ldns_status ldns_str2rdf_b64(ldns_rdf **rd, const char *str); /** * convert the string with the b32 ext hex data into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -126,7 +126,7 @@ ldns_status ldns_str2rdf_b32_ext(ldns_rdf **rd, const char *str); /** * convert a hex value into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -134,7 +134,7 @@ ldns_status ldns_str2rdf_hex(ldns_rdf **rd, const char *str); /** * convert string with nsec into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -142,7 +142,7 @@ ldns_status ldns_str2rdf_nsec(ldns_rdf **rd, const char *str); /** * convert a rrtype into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -150,7 +150,7 @@ ldns_status ldns_str2rdf_type(ldns_rdf **rd, const char *str); /** * convert string with a classname into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -158,7 +158,7 @@ ldns_status ldns_str2rdf_class(ldns_rdf **rd, const char *str); /** * convert an certificate algorithm value into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -166,7 +166,7 @@ ldns_status ldns_str2rdf_cert_alg(ldns_rdf **rd, const char *str); /** * convert an algorithm value into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -174,7 +174,7 @@ ldns_status ldns_str2rdf_alg(ldns_rdf **rd, const char *str); /** * convert a tlsa certificate usage value into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -182,7 +182,7 @@ ldns_status ldns_str2rdf_certificate_usage(ldns_rdf **rd, const char *str); /** * convert a tlsa selector value into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -190,7 +190,7 @@ ldns_status ldns_str2rdf_selector(ldns_rdf **rd, const char *str); /** * convert a tlsa matching type value into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -198,7 +198,7 @@ ldns_status ldns_str2rdf_matching_type(ldns_rdf **rd, const char *str); /** * convert a string with a unknown RR into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -206,7 +206,7 @@ ldns_status ldns_str2rdf_unknown(ldns_rdf **rd, const char *str); /** * convert string with a protocol service into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -214,7 +214,7 @@ ldns_status ldns_str2rdf_service(ldns_rdf **rd, const char *str); /** * convert a string with a LOC RR into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -222,7 +222,7 @@ ldns_status ldns_str2rdf_loc(ldns_rdf **rd, const char *str); /** * convert string with a WKS RR into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -230,7 +230,7 @@ ldns_status ldns_str2rdf_wks(ldns_rdf **rd, const char *str); /** * convert a str with a NSAP RR into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -238,7 +238,7 @@ ldns_status ldns_str2rdf_nsap(ldns_rdf **rd, const char *str); /** * convert a str with a ATMA RR into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -246,7 +246,7 @@ ldns_status ldns_str2rdf_atma(ldns_rdf **rd, const char *str); /** * convert a str with a IPSECKEY RR into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -254,7 +254,7 @@ ldns_status ldns_str2rdf_ipseckey(ldns_rdf **rd, const char *str); /** * convert a dname string into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -262,7 +262,7 @@ ldns_status ldns_str2rdf_dname(ldns_rdf **rd, const char *str); /** * convert 4 * 16bit hex separated by colons into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -270,7 +270,7 @@ ldns_status ldns_str2rdf_ilnp64(ldns_rdf **rd, const char *str); /** * convert 6 hex bytes separated by dashes into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -278,7 +278,7 @@ ldns_status ldns_str2rdf_eui48(ldns_rdf **rd, const char *str); /** * convert 8 hex bytes separated by dashes into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -286,7 +286,7 @@ ldns_status ldns_str2rdf_eui64(ldns_rdf **rd, const char *str); /** * Convert a non-zero sequence of US-ASCII letters and numbers into wireformat - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -295,7 +295,7 @@ ldns_status ldns_str2rdf_tag(ldns_rdf **rd, const char *str); /** * Convert a encoding of the value field as specified * [RFC1035], Section 5.1., encoded as one bug chunk of data. - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -305,7 +305,7 @@ ldns_status ldns_str2rdf_long_str(ldns_rdf **rd, const char *str); * Convert a " " encoding of the value field as specified * in Section 6. of [RFC5205], encoded as wireformat as specified in Section 5. * of [RFC5205]. - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -316,7 +316,7 @@ ldns_status ldns_str2rdf_hip(ldns_rdf **rd, const char *str); * of the value field as specified in Section 4.3.1 of * [draft-ietf-mboned-driad-amt-discovery], encoded as wireformat as specified in * Section 4.2 of [draft-ietf-mboned-driad-amt-discovery] - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ @@ -325,7 +325,7 @@ ldns_status ldns_str2rdf_amtrelay(ldns_rdf **rd, const char *str); /** * Convert a series of "key[=]" encodings to wireformat as described in * [draft-ietf-dnsop-svcb-https]. - * \param[in] rd the rdf where to put the data + * \param[out] rd the rdf where to put the data * \param[in] str the string to be converted * \return ldns_status */ diff --git a/ldns/wire2host.h b/ldns/wire2host.h index 6a7999c3..67b385c1 100644 --- a/ldns/wire2host.h +++ b/ldns/wire2host.h @@ -118,7 +118,7 @@ extern "C" { * This function will initialize and allocate memory space for the packet * structure. * - * \param[in] packet pointer to the structure to hold the packet + * \param[out] packet pointer to the structure to hold the packet * \param[in] data pointer to the buffer with the data * \param[in] len the length of the data buffer (in bytes) * \return LDNS_STATUS_OK if everything succeeds, error otherwise @@ -130,7 +130,7 @@ ldns_status ldns_wire2pkt(ldns_pkt **packet, const uint8_t *data, size_t len); * This function will initialize and allocate memory space for the packet * structure. * - * \param[in] packet pointer to the structure to hold the packet + * \param[out] packet pointer to the structure to hold the packet * \param[in] buffer the buffer with the data * \return LDNS_STATUS_OK if everything succeeds, error otherwise */ @@ -142,7 +142,7 @@ ldns_status ldns_buffer2pkt_wire(ldns_pkt **packet, const ldns_buffer *buffer); * space for the dname structure. The length of the wiredata of this rdf * is added to the *pos value. * - * \param[in] dname pointer to the structure to hold the rdata value + * \param[out] dname pointer to the structure to hold the rdata value * \param[in] wire pointer to the buffer with the data * \param[in] max the length of the data buffer (in bytes) * \param[in] pos the position of the rdf in the buffer (ie. the number of bytes @@ -177,7 +177,7 @@ ldns_status ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t * * structure. * The length of the wiredata of this rr is added to the *pos value. * - * \param[in] rr pointer to the structure to hold the rdata value + * \param[out] rr pointer to the structure to hold the rdata value * \param[in] wire pointer to the buffer with the data * \param[in] max the length of the data buffer (in bytes) * \param[in] pos the position of the rr in the buffer (ie. the number of bytes diff --git a/libdns.doxygen b/libdns.doxygen index 82b8d1d6..521b54d1 100644 --- a/libdns.doxygen +++ b/libdns.doxygen @@ -1,4 +1,4 @@ -# Doxyfile 1.8.11 +# Doxyfile 1.9.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -17,11 +17,11 @@ # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -93,6 +93,14 @@ ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. @@ -179,6 +187,16 @@ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus @@ -199,6 +217,14 @@ QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. @@ -226,16 +252,15 @@ TAB_SIZE = 8 # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) ALIASES = -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all @@ -264,28 +289,40 @@ OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -293,6 +330,15 @@ EXTENSION_MAPPING = MARKDOWN_SUPPORT = YES +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or @@ -318,7 +364,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -404,6 +450,19 @@ TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 0 +# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which efficively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -424,6 +483,12 @@ EXTRACT_ALL = YES EXTRACT_PRIVATE = NO +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. @@ -461,6 +526,13 @@ EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation @@ -478,8 +550,8 @@ HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO @@ -498,11 +570,18 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. # The default value is: system dependent. CASE_SENSE_NAMES = YES @@ -689,7 +768,7 @@ LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -734,13 +813,17 @@ WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# Possible values are: NO, YES and FAIL_ON_WARNINGS. # The default value is: NO. WARN_AS_ERROR = NO @@ -781,8 +864,8 @@ INPUT = . \ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 @@ -795,11 +878,15 @@ INPUT_ENCODING = UTF-8 # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl, -# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js. +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, *.vhdl, +# *.ucf, *.qsf and *.ice. FILE_PATTERNS = @@ -954,7 +1041,7 @@ INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. +# entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO @@ -986,12 +1073,12 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # @@ -1014,16 +1101,22 @@ USE_HTAGS = NO VERBATIM_HEADERS = YES # If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the -# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the -# cost of reduced performance. This can be particularly helpful with template -# rich C++ code for which doxygen's built-in parser lacks the necessary type -# information. +# clang parser (see: +# http://clang.llvm.org/) for more accurate parsing at the cost of reduced +# performance. This can be particularly helpful with template rich C++ code for +# which doxygen's built-in parser lacks the necessary type information. # Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse-libclang=ON option for CMake. +# generated with the -Duse_libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO +# If clang assisted parsing is enabled and the CLANG_ADD_INC_PATHS tag is set to +# YES then doxygen will add the directory of each input to the include path. +# The default value is: YES. + +CLANG_ADD_INC_PATHS = YES + # If clang assisted parsing is enabled you can provide the compiler with command # line options that you would normally use when invoking the compiler. Note that # the include paths will already be set by doxygen for the files and directories @@ -1032,6 +1125,19 @@ CLANG_ASSISTED_PARSING = NO CLANG_OPTIONS = +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the directory containing a file called compile_commands.json. This +# file is the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the +# options used when the source files were built. This is equivalent to +# specifying the -p option to a clang tool, such as clang-check. These options +# will then be passed to the parser. Any options specified with CLANG_OPTIONS +# will be added as well. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = + #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1043,13 +1149,6 @@ CLANG_OPTIONS = ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 3 - # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored @@ -1150,7 +1249,7 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1186,6 +1285,17 @@ HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = YES +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1209,13 +1319,14 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1254,8 +1365,8 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. +# (see: +# https://www.microsoft.com/en-us/download/details.aspx?id=21138) on Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML @@ -1285,7 +1396,7 @@ CHM_FILE = HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1330,7 +1441,8 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1338,8 +1450,8 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1347,30 +1459,30 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = @@ -1447,6 +1559,17 @@ TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML @@ -1467,8 +1590,14 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1480,7 +1609,7 @@ USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. @@ -1495,8 +1624,8 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://www.mathjax.org/mathjax @@ -1510,7 +1639,8 @@ MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1538,7 +1668,7 @@ MATHJAX_CODEFILE = SEARCHENGINE = NO # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There +# implemented using a web server instead of a web client using JavaScript. There # are two flavors of web server based searching depending on the EXTERNAL_SEARCH # setting. When disabled, doxygen will generate a PHP script for searching and # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing @@ -1557,7 +1687,8 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: +# https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1570,8 +1701,9 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and -# Searching" for details. +# Xapian (see: +# https://xapian.org/). See the section "External Indexing and Searching" for +# details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = @@ -1622,21 +1754,35 @@ LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. # -# Note that when enabling USE_PDFLATEX this option is only used for generating -# bitmaps for formulas in the HTML output, but not in the Makefile that is -# written to the output directory. -# The default file is: latex. +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. MAKEINDEX_CMD_NAME = makeindex +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = makeindex + # If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. @@ -1721,9 +1867,11 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES -# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES, to get a -# higher quality PDF documentation. +# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as +# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX +# files. Set this option to YES, to get a higher quality PDF documentation. +# +# See also section LATEX_CMD_NAME for selecting the engine. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1757,7 +1905,7 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1771,6 +1919,14 @@ LATEX_BIB_STYLE = plain LATEX_TIMESTAMP = NO +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EMOJI_DIRECTORY = + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -1810,9 +1966,9 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's config -# file, i.e. a series of assignments. You only have to provide replacements, -# missing definitions are set to their default value. +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. # # See also section "Doxygen usage" for information on how to generate the # default style sheet that doxygen normally uses. @@ -1821,8 +1977,8 @@ RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is -# similar to doxygen's config file. A template extensions file can be generated -# using doxygen -e rtf extensionFile. +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_EXTENSIONS_FILE = @@ -1908,6 +2064,13 @@ XML_OUTPUT = xml XML_PROGRAMLISTING = YES +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- @@ -1940,9 +2103,9 @@ DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -2109,12 +2272,6 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- @@ -2128,15 +2285,6 @@ PERL_PATH = /usr/bin/perl CLASS_DIAGRAMS = YES -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. @@ -2234,10 +2382,32 @@ UML_LOOK = NO # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. +# This tag requires that the tag UML_LOOK is set to YES. UML_LIMIT_NUM_FIELDS = 10 +# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and +# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS +# tag is set to YES, doxygen will add type and arguments for attributes and +# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen +# will not generate fields with class member information in the UML graphs. The +# class diagrams will look similar to the default class diagrams but using UML +# notation for the relationships. +# Possible values are: NO, YES and NONE. +# The default value is: NO. +# This tag requires that the tag UML_LOOK is set to YES. + +DOT_UML_DETAILS = NO + +# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters +# to display on a single line. If the actual line length exceeds this threshold +# significantly it will wrapped across multiple lines. Some heuristics are apply +# to avoid ugly line breaks. +# Minimum value: 0, maximum value: 1000, default value: 17. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_WRAP_THRESHOLD = 17 + # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. @@ -2366,6 +2536,11 @@ DIAFILE_DIRS = PLANTUML_JAR_PATH = +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. @@ -2424,9 +2599,11 @@ DOT_MULTI_TARGETS = YES GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate # files that are used to generate the various graphs. +# +# Note: This setting is not only used for dot files but also for msc and +# plantuml temporary files. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES From 9610bb727f7277c33bbdc6c948819121f15fc25c Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Mon, 27 Dec 2021 16:10:24 +0100 Subject: [PATCH 07/83] Thank @aldot for suggestion (Issue #149 ) in Changelog --- Changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog b/Changelog index c2f9b9ba..0e4bcf52 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,8 @@ 1.8.2 2022-??-?? * bugfix #147: Allow for tabs in whitespace before quoted rdata fields. Thanks Felipe Gasper + * bugfix #149: Add some missing [out] annotations to doxygen + parameters. Thanks aldot. 1.8.1 2021-12-03 * bugfix #146: ldns-1.7.1 had soname 3.0, so ldns-1.8.x soname From f88a75f7159ec2e85e16234ffadf9903326c133a Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Mon, 3 Jan 2022 13:26:02 +0100 Subject: [PATCH 08/83] * Fix build error on Solaris 10 with inet_ntop redeclaration error. --- Changelog | 1 + configure.ac | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 0e4bcf52..dfee2106 100644 --- a/Changelog +++ b/Changelog @@ -3,6 +3,7 @@ fields. Thanks Felipe Gasper * bugfix #149: Add some missing [out] annotations to doxygen parameters. Thanks aldot. + * Fix build error on Solaris 10 with inet_ntop redeclaration error. 1.8.1 2021-12-03 * bugfix #146: ldns-1.7.1 had soname 3.0, so ldns-1.8.x soname diff --git a/configure.ac b/configure.ac index 840a1d64..f36ffe77 100644 --- a/configure.ac +++ b/configure.ac @@ -136,7 +136,7 @@ AC_CHECK_FUNC([socket], # older Solaris provides inet_ntop in -lresolv. AC_CHECK_FUNC([inet_ntop], [], - [AC_SEARCH_LIBS([inet_ntop], [socket c nsl resolv]) + [AC_SEARCH_LIBS([inet_ntop], [socket c nsl resolv], [ac_cv_func_inet_ntop=yes]) ]) # modern Linux provides inet_pton in -lsocket. @@ -145,7 +145,7 @@ AC_CHECK_FUNC([inet_ntop], # older Solaris provides inet_pton in -lresolv. AC_CHECK_FUNC([inet_pton], [], - [AC_SEARCH_LIBS([inet_pton], [socket c nsl resolv]) + [AC_SEARCH_LIBS([inet_pton], [socket c nsl resolv], [ac_cv_func_inet_pton=yes]) ]) From 887d618239312cc8c11e41c45492eee02a8f28a2 Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Tue, 11 Jan 2022 21:14:24 +0100 Subject: [PATCH 09/83] Use accessors for DSA and RSA objects In the upcoming LibreSSL version 3.5, the DSA and RSA structs will become opaque, so we should use the OpenSSL 1.1 setters and getters to fix the build. The relevant API has been available since LibreSSL 2.7. The last LibreSSL version (2.6) not having these accessors was EOL late 2018, so no users should be affected by this change. --- dnssec.c | 4 ++-- host2str.c | 4 ++-- keys.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dnssec.c b/dnssec.c index 63fece52..fbaa518a 100644 --- a/dnssec.c +++ b/dnssec.c @@ -381,7 +381,7 @@ ldns_key_buf2dsa_raw(const unsigned char* key, size_t len) BN_free(Y); return NULL; } -#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL) +#if OPENSSL_VERSION_NUMBER < 0x10100000 || (defined(HAVE_LIBRESSL) && LIBRESSL_VERSION_NUMBER < 0x20700000) #ifndef S_SPLINT_S dsa->p = P; dsa->q = Q; @@ -468,7 +468,7 @@ ldns_key_buf2rsa_raw(const unsigned char* key, size_t len) BN_free(modulus); return NULL; } -#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL) +#if OPENSSL_VERSION_NUMBER < 0x10100000 || (defined(HAVE_LIBRESSL) && LIBRESSL_VERSION_NUMBER < 0x20700000) #ifndef S_SPLINT_S rsa->n = modulus; rsa->e = exponent; diff --git a/host2str.c b/host2str.c index a207a913..634c5676 100644 --- a/host2str.c +++ b/host2str.c @@ -2451,7 +2451,7 @@ ldns_key2buffer_str(ldns_buffer *output, const ldns_key *k) const BIGNUM *n=NULL, *e=NULL, *d=NULL, *p=NULL, *q=NULL, *dmp1=NULL, *dmq1=NULL, *iqmp=NULL; -#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL) +#if OPENSSL_VERSION_NUMBER < 0x10100000 || (defined(HAVE_LIBRESSL) && LIBRESSL_VERSION_NUMBER < 0x20700000) n = rsa->n; e = rsa->e; d = rsa->d; @@ -2504,7 +2504,7 @@ ldns_key2buffer_str(ldns_buffer *output, const ldns_key *k) if(1) { const BIGNUM *p=NULL, *q=NULL, *g=NULL, *priv_key=NULL, *pub_key=NULL; -#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL) +#if OPENSSL_VERSION_NUMBER < 0x10100000 || (defined(HAVE_LIBRESSL) && LIBRESSL_VERSION_NUMBER < 0x20700000) #ifndef S_SPLINT_S p = dsa->p; q = dsa->q; diff --git a/keys.c b/keys.c index 91a3dffd..78bea972 100644 --- a/keys.c +++ b/keys.c @@ -861,7 +861,7 @@ ldns_key_new_frm_fp_rsa_l(FILE *f, int *line_nr) } #endif /* splint */ -#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL) +#if OPENSSL_VERSION_NUMBER < 0x10100000 || (defined(HAVE_LIBRESSL) && LIBRESSL_VERSION_NUMBER < 0x20700000) # ifndef S_SPLINT_S rsa->n = n; rsa->e = e; @@ -982,7 +982,7 @@ ldns_key_new_frm_fp_dsa_l(FILE *f, ATTR_UNUSED(int *line_nr)) } #endif /* splint */ -#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL) +#if OPENSSL_VERSION_NUMBER < 0x10100000 || (defined(HAVE_LIBRESSL) && LIBRESSL_VERSION_NUMBER < 0x20700000) # ifndef S_SPLINT_S dsa->p = p; dsa->q = q; @@ -1660,7 +1660,7 @@ ldns_key_rsa2bin(unsigned char *data, RSA *k, uint16_t *size) if (!k) { return false; } -#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL) +#if OPENSSL_VERSION_NUMBER < 0x10100000 || (defined(HAVE_LIBRESSL) && LIBRESSL_VERSION_NUMBER < 0x20700000) n = k->n; e = k->e; #else From 8f279b7f089028f0ef06e65b23fe5b8612472e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 9 Feb 2022 18:26:24 +0100 Subject: [PATCH 10/83] Propagate correct version to doxygen template Do not require manual changes to libdns.doxygen. Release version got outdated during recent ldns releases. Configure it with correct version without extra work needed. --- configure.ac | 2 +- libdns.doxygen => libdns.doxygen.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename libdns.doxygen => libdns.doxygen.in (99%) diff --git a/configure.ac b/configure.ac index f36ffe77..fb75a104 100644 --- a/configure.ac +++ b/configure.ac @@ -1176,7 +1176,7 @@ else AC_SUBST(ldns_build_config_have_attr_unused, 0) fi -CONFIG_FILES="Makefile ldns/common.h ldns/net.h ldns/util.h packaging/libldns.pc packaging/ldns-config" +CONFIG_FILES="Makefile libdns.doxygen ldns/common.h ldns/net.h ldns/util.h packaging/libldns.pc packaging/ldns-config" AC_SUBST(CONFIG_FILES) AC_CONFIG_FILES([$CONFIG_FILES]) diff --git a/libdns.doxygen b/libdns.doxygen.in similarity index 99% rename from libdns.doxygen rename to libdns.doxygen.in index 521b54d1..c83cdf4c 100644 --- a/libdns.doxygen +++ b/libdns.doxygen.in @@ -32,13 +32,13 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = ldns +PROJECT_NAME = @PACKAGE_NAME@ # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.7.0 +PROJECT_NUMBER = @PACKAGE_VERSION@ # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a From 552a32dbc5874da16e9e794561123ffa71e83107 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 24 Feb 2022 16:15:20 +0100 Subject: [PATCH 11/83] Fix -U flag with ldns-signzone. Thanks Ulrich and Jonathan --- Changelog | 1 + dnssec_sign.c | 44 +++++++++++++++++++++++++++----------------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/Changelog b/Changelog index dfee2106..538ba2b7 100644 --- a/Changelog +++ b/Changelog @@ -4,6 +4,7 @@ * bugfix #149: Add some missing [out] annotations to doxygen parameters. Thanks aldot. * Fix build error on Solaris 10 with inet_ntop redeclaration error. + * Fix -U flag with ldns-signzone. Thanks Ulrich and Jonathan 1.8.1 2021-12-03 * bugfix #146: ldns-1.7.1 had soname 3.0, so ldns-1.8.x soname diff --git a/dnssec_sign.c b/dnssec_sign.c index 61137807..41d845f3 100644 --- a/dnssec_sign.c +++ b/dnssec_sign.c @@ -1133,17 +1133,22 @@ ldns_key_list_filter_for_dnskey(ldns_key_list *key_list, int flags) if (!ldns_key_list_key_count(key_list)) return; + /* Mark all KSKs */ for (i = 0; i < ldns_key_list_key_count(key_list); i++) { key = ldns_key_list_key(key_list, i); - if ((ldns_key_flags(key) & LDNS_KEY_SEP_KEY) && !saw_ksk) - saw_ksk = ldns_key_algorithm(key); - algos[ldns_key_algorithm(key)] = true; + if ((ldns_key_flags(key) & LDNS_KEY_SEP_KEY)) { + if (!saw_ksk) + saw_ksk = ldns_key_algorithm(key); + algos[ldns_key_algorithm(key)] = true; + } } if (!saw_ksk) - return; - else - algos[saw_ksk] = 0; + return; /* No KSKs means sign using all ZSKs */ + /* Deselect the ZSKs so they do not sign DNSKEY RRs. + * Except with the LDNS_SIGN_WITH_ALL_ALGORITHMS flag, then use it, + * but only if it has an algorithm for which there is no KSK + */ for (i =0; i < ldns_key_list_key_count(key_list); i++) { key = ldns_key_list_key(key_list, i); if (!(ldns_key_flags(key) & LDNS_KEY_SEP_KEY)) { @@ -1151,15 +1156,15 @@ ldns_key_list_filter_for_dnskey(ldns_key_list *key_list, int flags) * Still use it if it has a unique algorithm though! */ if ((flags & LDNS_SIGN_WITH_ALL_ALGORITHMS) && - algos[ldns_key_algorithm(key)]) - algos[ldns_key_algorithm(key)] = false; + !algos[ldns_key_algorithm(key)]) + algos[ldns_key_algorithm(key)] = true; else ldns_key_set_use(key, 0); } } } -/** If there are no ZSKs use KSK as ZSK */ +/** If there are no ZSKs use KSKs as ZSK too */ static void ldns_key_list_filter_for_non_dnskey(ldns_key_list *key_list, int flags) { @@ -1175,17 +1180,22 @@ ldns_key_list_filter_for_non_dnskey(ldns_key_list *key_list, int flags) if (!ldns_key_list_key_count(key_list)) return; + /* Mark all ZSKs */ for (i = 0; i < ldns_key_list_key_count(key_list); i++) { key = ldns_key_list_key(key_list, i); - if (!(ldns_key_flags(key) & LDNS_KEY_SEP_KEY) && !saw_zsk) - saw_zsk = ldns_key_algorithm(key); - algos[ldns_key_algorithm(key)] = true; + if (!(ldns_key_flags(key) & LDNS_KEY_SEP_KEY)) { + if (!saw_zsk) + saw_zsk = ldns_key_algorithm(key); + algos[ldns_key_algorithm(key)] = true; + } } if (!saw_zsk) - return; - else - algos[saw_zsk] = 0; + return; /* No ZSKs means sign using all KSKs */ + /* Deselect the KSKs so they do not sign non DNSKEY RRs. + * Except with the LDNS_SIGN_WITH_ALL_ALGORITHMS flag, then use it, + * but only if it has an algorithm for which there is no ZSK + */ for (i = 0; i < ldns_key_list_key_count(key_list); i++) { key = ldns_key_list_key(key_list, i); if((ldns_key_flags(key) & LDNS_KEY_SEP_KEY)) { @@ -1193,8 +1203,8 @@ ldns_key_list_filter_for_non_dnskey(ldns_key_list *key_list, int flags) * Still use it if it has a unique algorithm though! */ if ((flags & LDNS_SIGN_WITH_ALL_ALGORITHMS) && - algos[ldns_key_algorithm(key)]) - algos[ldns_key_algorithm(key)] = false; + !algos[ldns_key_algorithm(key)]) + algos[ldns_key_algorithm(key)] = true; else ldns_key_set_use(key, 0); } From 2805f529559150e72acb9275ea3a1517b92a078e Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Mon, 14 Mar 2022 16:04:49 +0100 Subject: [PATCH 12/83] Document -U flag to ldns-signzone Thank you Andreas for noticing! --- examples/ldns-signzone.1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/ldns-signzone.1 b/examples/ldns-signzone.1 index ff1a9e3e..68f9f773 100644 --- a/examples/ldns-signzone.1 +++ b/examples/ldns-signzone.1 @@ -91,6 +91,12 @@ small, and only the SEP keys that are passed are used. If there are no SEP keys, the DNSKEY RRset is signed with the non\-SEP keys. This option turns off the default and all keys are used to sign the DNSKEY RRset. +.TP +\fB-U\fR +Sign with every unique algorithm in the provided keys. The DNSKEY set +is signed with all the SEP keys, plus all the non\-SEP keys that have an +algorithm that was not presen in the SEP key set. + .TP \fB-E\fR \fIname\fR Use the EVP cryptographic engine with the given name for signing. This From 60ae20a86d75108e05f21af4773a8418ddf0712a Mon Sep 17 00:00:00 2001 From: Felipe Gasper Date: Tue, 15 Mar 2022 20:57:00 -0400 Subject: [PATCH 13/83] Ensure uniform handling of spaces & tabs when parsing RRs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue #157: This fixes the same type of bug as #147, in a couple places where that issue’s fix didn’t apply. A small refactor is done to deduplicate whitespace-checking logic. Tests are added as well. --- rr.c | 16 +++++++++++----- .../28-tab-between-cstrings-2.db | 1 + .../28-tab-between-cstrings-2.dsc | 16 ++++++++++++++++ .../28-tab-between-cstrings-2.help | 1 + .../28-tab-between-cstrings-2.test | 15 +++++++++++++++ .../29-generic-rdata-tab.db | 2 ++ .../29-generic-rdata-tab.dsc | 16 ++++++++++++++++ .../29-generic-rdata-tab.help | 1 + .../29-generic-rdata-tab.test | 15 +++++++++++++++ 9 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.db create mode 100644 test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.dsc create mode 100644 test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.help create mode 100644 test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.test create mode 100644 test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.db create mode 100644 test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.dsc create mode 100644 test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.help create mode 100644 test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.test diff --git a/rr.c b/rr.c index 382d0b59..2f64c15d 100644 --- a/rr.c +++ b/rr.c @@ -20,6 +20,12 @@ #define LDNS_TTL_DATALEN 21 #define LDNS_RRLIST_INIT 8 +#define _IS_WHITESPACE(chr) \ + ( NULL != strchr( LDNS_PARSE_NO_NL, chr) ) + +#define _BUFFER_IS_AT_WHITESPACE(rd_buf) \ + _IS_WHITESPACE(*(ldns_buffer_current(rd_buf))) + ldns_rr * ldns_rr_new(void) { @@ -372,9 +378,9 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str, desc, r_cnt)) && ldns_buffer_remaining(rd_buf) > 0){ - /* skip spaces & tabs */ + /* skip whitespace */ while (ldns_buffer_remaining(rd_buf) > 0 && - NULL != strchr( LDNS_PARSE_NO_NL, *(ldns_buffer_current(rd_buf)) )) { + _BUFFER_IS_AT_WHITESPACE(rd_buf)) { ldns_buffer_skip(rd_buf, 1); } @@ -396,9 +402,9 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str, * _maximum() only */ - /* skip spaces */ + /* skip whitespace */ while (ldns_buffer_position(rd_buf) < ldns_buffer_limit(rd_buf) - && *(ldns_buffer_current(rd_buf)) == ' ' + && _BUFFER_IS_AT_WHITESPACE(rd_buf) && !quoted) { ldns_buffer_skip(rd_buf, 1); @@ -420,7 +426,7 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str, /* unknown RR data */ if (strncmp(rd, "\\#", 2) == 0 && !quoted && - (rd_strlen == 2 || rd[2]==' ')) { + (rd_strlen == 2 || _IS_WHITESPACE(rd[2]))) { was_unknown_rr_format = 1; /* go back to before \# diff --git a/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.db b/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.db new file mode 100644 index 00000000..99730d31 --- /dev/null +++ b/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.db @@ -0,0 +1 @@ +com. 14400 IN NAPTR 100 10 S SIP+D2U "!^.*$!sip:customer-service@example.com!" com. diff --git a/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.dsc b/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.dsc new file mode 100644 index 00000000..9017a0e6 --- /dev/null +++ b/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.dsc @@ -0,0 +1,16 @@ +BaseName: 28-tab-instead-of-space +Version: 1.0 +Description: Check for GH 157 regression +CreationDate: Tue Mar 15 21:01:34 EST 2022 +Maintainer: +Category: +Component: +CmdDepends: +Depends: +Help: 28-tab-instead-of-space.help +Pre: +Post: +Test: 28-tab-instead-of-space.test +AuxFiles: +Passed: +Failure: diff --git a/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.help b/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.help new file mode 100644 index 00000000..f54a7906 --- /dev/null +++ b/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.help @@ -0,0 +1 @@ +This requires no arguments. diff --git a/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.test b/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.test new file mode 100644 index 00000000..3c6ab2cd --- /dev/null +++ b/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.test @@ -0,0 +1,15 @@ +# #-- 28-tab-instead-of-space.test --# +# source the master var file when it's there +[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master + +export PATH=$PATH:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:. + +export LD_LIBRARY_PATH=../../lib:$LD_LIBRARY_PATH + +OUTPUT=`../../examples/ldns-read-zone 28-tab-instead-of-space.db` + +if [[ $? -eq 0 ]]; then + echo $OUTPUT | grep customer-service +else + exit 1 +fi diff --git a/test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.db b/test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.db new file mode 100644 index 00000000..d32d21d4 --- /dev/null +++ b/test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.db @@ -0,0 +1,2 @@ +a.example. CLASS32 TYPE731 \# 6 abcd ( + ef 01 23 45 ) diff --git a/test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.dsc b/test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.dsc new file mode 100644 index 00000000..67927e1f --- /dev/null +++ b/test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.dsc @@ -0,0 +1,16 @@ +BaseName: 29-generic-rdata-tab +Version: 1.0 +Description: Check for GH 157 regression +CreationDate: Tue Mar 15 21:01:34 EST 2022 +Maintainer: +Category: +Component: +CmdDepends: +Depends: +Help: 29-generic-rdata-tab.help +Pre: +Post: +Test: 29-generic-rdata-tab.test +AuxFiles: +Passed: +Failure: diff --git a/test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.help b/test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.help new file mode 100644 index 00000000..f54a7906 --- /dev/null +++ b/test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.help @@ -0,0 +1 @@ +This requires no arguments. diff --git a/test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.test b/test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.test new file mode 100644 index 00000000..e38136dd --- /dev/null +++ b/test/29-generic-rdata-tab.tpkg/29-generic-rdata-tab.test @@ -0,0 +1,15 @@ +# #-- 29-generic-rdata-tab.test --# +# source the master var file when it's there +[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master + +export PATH=$PATH:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:. + +export LD_LIBRARY_PATH=../../lib:$LD_LIBRARY_PATH + +OUTPUT=`../../examples/ldns-read-zone 29-generic-rdata-tab.db` + +if [[ $? -eq 0 ]]; then + echo $OUTPUT | grep CLASS32 +else + exit 1 +fi From ab833e7705799531d0e41857ad46892c38008cf2 Mon Sep 17 00:00:00 2001 From: Felipe Gasper Date: Tue, 15 Mar 2022 21:18:09 -0400 Subject: [PATCH 14/83] Make `examples`, `drill`, and `test` targets build their dependencies. --- Makefile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 574098c6..610b2e51 100644 --- a/Makefile.in +++ b/Makefile.in @@ -167,7 +167,7 @@ no-drill-config-h: exit -1 ; \ fi -drill/drill: $(DRILL_LOBJS) $(LIB) $(LIBLOBJS) +drill/drill: all $(DRILL_LOBJS) $(LIB) $(LIBLOBJS) $(LINK_EXE) $(DRILL_LOBJS) $(LIBLOBJS) $(LIB) $(LIBSSL_LIBS) $(LIBS) -o drill/drill drill/drill.1: $(srcdir)/drill/drill.1.in @@ -188,7 +188,7 @@ uninstall-drill: clean-drill: $(LIBTOOL) --mode clean rm -f $(DRILL_LOBJS) drill/drill drill/drill.1 -examples: no-examples-config-h $(EXAMPLE_PROGS) $(TESTNS) $(LDNS_DPA) $(LDNS_DANE) $(EX_SSL_PROGS) examples/ldns-dane.1 examples/ldns-verify-zone.1 +examples: no-examples-config-h all $(EXAMPLE_PROGS) $(TESTNS) $(LDNS_DPA) $(LDNS_DANE) $(EX_SSL_PROGS) examples/ldns-dane.1 examples/ldns-verify-zone.1 no-examples-config-h: @if test -e $(srcdir)/examples/config.h -o -e examples/config.h ; \ then echo "A config.h was detected in the examples subdirectory." ; \ @@ -505,7 +505,7 @@ allclean: test-clean clean test-clean: tpkg -b test clean -test: @TEST_P5_DNS_LDNS@ +test: examples drill @TEST_P5_DNS_LDNS@ ./test/test_all.sh From 40cdda81fcfd766f54e410b5e0b9f7812462ed73 Mon Sep 17 00:00:00 2001 From: Felipe Gasper Date: Tue, 15 Mar 2022 23:02:00 -0400 Subject: [PATCH 15/83] Make test_all.sh exit nonzero if any tests fail. Issue #160 --- test/test_all.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/test_all.sh b/test/test_all.sh index 749b40e7..1859218e 100755 --- a/test/test_all.sh +++ b/test/test_all.sh @@ -41,12 +41,16 @@ $TPKG -a ../.. fake 32-unbound-regression.tpkg $TPKG -a ../.. fake 999-compile-nossl.tpkg command -v indent || $TPKG -a ../.. fake codingstyle.tpkg +failed=0 for tests in *.tpkg do COMMAND="$TPKG -a ../.. exe $(basename "$tests")" echo "$COMMAND" $COMMAND + if [ $? -ne 0 ]; then ((failed=failed+1)); fi done echo finished the test at "$(date)" in "$(pwd)" $TPKG report cd .. + +exit $failed From e57fe17becf834172449948be87b2abdd83b1f71 Mon Sep 17 00:00:00 2001 From: Felipe Gasper Date: Tue, 15 Mar 2022 20:47:47 -0400 Subject: [PATCH 16/83] Add GitHub CI to run test suite. --- .github/workflows/testsuite.yml | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/testsuite.yml diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml new file mode 100644 index 00000000..69594e9a --- /dev/null +++ b/.github/workflows/testsuite.yml @@ -0,0 +1,39 @@ +on: + push: + branches: + - '*' + tags-ignore: + - '*' + pull_request: + +jobs: + linux: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - run: libtoolize -ci + - run: autoreconf -fi + - run: ./configure + - run: make test + + mac: + runs-on: macos-latest + + steps: + - run: brew install automake libtool + - uses: actions/checkout@v3 + with: + submodules: recursive + - run: glibtoolize -ci + - run: autoreconf -fi + + # macOS’s system OpenSSL (LibreSSL, actually) isn’t meant for linking, + # and Homebrew’s# OpenSSL isn’t CI-friendly. So build without OpenSSL. + - run: ./configure --without-ssl --disable-sha2 --disable-gost --disable-ecdsa --disable-dane + + # As of now the test suite requires OpenSSL, so no tests. + # cf. https://github.com/NLnetLabs/ldns/issues/162 + - run: make From b4f1ca75399a48e3b215ccf4a09bb196adc64e7a Mon Sep 17 00:00:00 2001 From: Felipe Gasper Date: Tue, 15 Mar 2022 23:15:48 -0400 Subject: [PATCH 17/83] Use wildcards in .gitignore so as to match newly-added tests. --- .gitignore | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/.gitignore b/.gitignore index 906e2876..1e027f60 100644 --- a/.gitignore +++ b/.gitignore @@ -194,44 +194,8 @@ /sha2.o /str2host.lo /str2host.o -/test/.done-01-compile -/test/.done-02-lint -/test/.done-03-run -/test/.done-04-run-normal -/test/.done-05-iana-rr-types -/test/.done-07-compile-examples -/test/.done-08-zonereader -/test/.done-09-doc-check -/test/.done-12-unit-tests-dnssec -/test/.done-13-unit-tests-base -/test/.done-14-read-zone -/test/.done-15-unit-tests-rrtypes -/test/.done-16-compile-builddir -/test/.done-17-stub-resolver -/test/.done-18-drill-tests1 -/test/.done-19-keygen -/test/.done-20-sign-zone -/test/.done-30-load-pyldns -/test/.done-31-load-pyldnsx -/test/.done-32-unbound-1.4.20-regression -/test/.done-33-wget-compile-test-unbound-latest -/test/.done-999-compile-nossl -/test/.done-codingstyle -/test/result.02-lint -/test/result.03-run -/test/result.04-run-normal -/test/result.05-iana-rr-types -/test/result.08-zonereader -/test/result.09-doc-check -/test/result.12-unit-tests-dnssec -/test/result.13-unit-tests-base -/test/result.14-read-zone -/test/result.15-unit-tests-rrtypes -/test/result.17-stub-resolver -/test/result.18-drill-tests1 -/test/result.19-keygen -/test/result.20-sign-zone -/test/result.codingstyle +/test/.done-* +/test/result.* /tsig.lo /tsig.o /update.lo From 1ef3739c40502e095b95bfed097b468cdad06b1d Mon Sep 17 00:00:00 2001 From: Felipe Gasper Date: Wed, 16 Mar 2022 08:43:45 -0400 Subject: [PATCH 18/83] Fix naming of test 28. --- .../{28-tab-between-cstrings-2.db => 28-tab-instead-of-space.db} | 0 ...{28-tab-between-cstrings-2.dsc => 28-tab-instead-of-space.dsc} | 0 ...8-tab-between-cstrings-2.help => 28-tab-instead-of-space.help} | 0 ...8-tab-between-cstrings-2.test => 28-tab-instead-of-space.test} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename test/28-tab-instead-of-space.tpkg/{28-tab-between-cstrings-2.db => 28-tab-instead-of-space.db} (100%) rename test/28-tab-instead-of-space.tpkg/{28-tab-between-cstrings-2.dsc => 28-tab-instead-of-space.dsc} (100%) rename test/28-tab-instead-of-space.tpkg/{28-tab-between-cstrings-2.help => 28-tab-instead-of-space.help} (100%) rename test/28-tab-instead-of-space.tpkg/{28-tab-between-cstrings-2.test => 28-tab-instead-of-space.test} (100%) diff --git a/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.db b/test/28-tab-instead-of-space.tpkg/28-tab-instead-of-space.db similarity index 100% rename from test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.db rename to test/28-tab-instead-of-space.tpkg/28-tab-instead-of-space.db diff --git a/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.dsc b/test/28-tab-instead-of-space.tpkg/28-tab-instead-of-space.dsc similarity index 100% rename from test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.dsc rename to test/28-tab-instead-of-space.tpkg/28-tab-instead-of-space.dsc diff --git a/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.help b/test/28-tab-instead-of-space.tpkg/28-tab-instead-of-space.help similarity index 100% rename from test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.help rename to test/28-tab-instead-of-space.tpkg/28-tab-instead-of-space.help diff --git a/test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.test b/test/28-tab-instead-of-space.tpkg/28-tab-instead-of-space.test similarity index 100% rename from test/28-tab-instead-of-space.tpkg/28-tab-between-cstrings-2.test rename to test/28-tab-instead-of-space.tpkg/28-tab-instead-of-space.test From 1d0e9e2af309af1ad9e1e76175c3dcf2431537c4 Mon Sep 17 00:00:00 2001 From: Adam Stoler Date: Wed, 23 Mar 2022 15:08:38 -0400 Subject: [PATCH 19/83] Rename echconfig SVCB parameter key to ech as per latest RFC draft, but maintain compatibility of parsing echconfig as well Fix off-by-one error in ldns_rdf2buffer_str_svcparams --- host2str.c | 8 ++++---- ldns/rdata.h | 2 +- str2host.c | 13 +++++++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/host2str.c b/host2str.c index 634c5676..45b3f42d 100644 --- a/host2str.c +++ b/host2str.c @@ -1482,7 +1482,7 @@ svcparam_ipv4hint2buffer_str(ldns_buffer *output, size_t sz, uint8_t *data) } static ldns_status -svcparam_echconfig2buffer_str(ldns_buffer *output, size_t sz, uint8_t *data) +svcparam_ech2buffer_str(ldns_buffer *output, size_t sz, uint8_t *data) { size_t str_sz = ldns_b64_ntop_calculate_size(sz); int written; @@ -1561,7 +1561,7 @@ ldns_rdf2buffer_str_svcparams(ldns_buffer *output, const ldns_rdf *rdf) /* No svcparams is just fine. Just nothing to print. */ return LDNS_STATUS_OK; - for (dp = data; dp + 4 < data + sz; dp = next_dp) { + for (dp = data; dp + 4 <= data + sz; dp = next_dp) { ldns_svcparam_key key = ldns_read_uint16(dp); uint16_t val_sz = ldns_read_uint16(dp + 2); @@ -1593,8 +1593,8 @@ ldns_rdf2buffer_str_svcparams(ldns_buffer *output, const ldns_rdf *rdf) case LDNS_SVCPARAM_KEY_IPV4HINT: st = svcparam_ipv4hint2buffer_str(output, val_sz, dp); break; - case LDNS_SVCPARAM_KEY_ECHCONFIG: - st = svcparam_echconfig2buffer_str(output, val_sz, dp); + case LDNS_SVCPARAM_KEY_ECH: + st = svcparam_ech2buffer_str(output, val_sz, dp); break; case LDNS_SVCPARAM_KEY_IPV6HINT: st = svcparam_ipv6hint2buffer_str(output, val_sz, dp); diff --git a/ldns/rdata.h b/ldns/rdata.h index 470810e6..4a7dcb37 100644 --- a/ldns/rdata.h +++ b/ldns/rdata.h @@ -178,7 +178,7 @@ enum ldns_enum_svcparam_key LDNS_SVCPARAM_KEY_NO_DEFAULT_ALPN = 2, LDNS_SVCPARAM_KEY_PORT = 3, LDNS_SVCPARAM_KEY_IPV4HINT = 4, - LDNS_SVCPARAM_KEY_ECHCONFIG = 5, + LDNS_SVCPARAM_KEY_ECH = 5, LDNS_SVCPARAM_KEY_IPV6HINT = 6, LDNS_SVCPARAM_KEY_LAST_KEY = 6, LDNS_SVCPARAM_KEY_RESERVED = 65535 diff --git a/str2host.c b/str2host.c index b33101b0..0639d3f1 100644 --- a/str2host.c +++ b/str2host.c @@ -2076,7 +2076,7 @@ parse_svcparam_ipv4hint(const char **s, uint8_t **dp, uint8_t *eod) } static ldns_status -parse_svcparam_echconfig(const char **s, uint8_t **dp, uint8_t *eod) +parse_svcparam_ech(const char **s, uint8_t **dp, uint8_t *eod) { bool quoted = false; const char *b64_str; @@ -2188,7 +2188,7 @@ static svcparam_key_def svcparam_key_defs[] = { { "mandatory" , 9 } , { "no-default-alpn", 15 } , { "port" , 4 } , { "ipv4hint" , 8 } - , { "echconfig" , 9 } + , { "ech" , 3 } , { "ipv6hint" , 8 } }; static const size_t svcparam_key_defs_len = sizeof(svcparam_key_defs) @@ -2228,6 +2228,11 @@ parse_svcparam_key(const char **s, ldns_svcparam_key *key) return LDNS_STATUS_OK; } } + /* Also allow "echconfig" from earlier draft versions. */ + if (len == 9 && !strncmp(key_str, "echconfig", 9)) { + *key = LDNS_SVCPARAM_KEY_ECH; + return LDNS_STATUS_OK; + } if (len < 4 || len > 8 || strncmp(key_str, "key", 3)) return LDNS_STATUS_SYNTAX_SVCPARAM_KEY_ERR; @@ -2287,8 +2292,8 @@ parse_svcparam(const char **s, uint8_t **dp, uint8_t *eod) case LDNS_SVCPARAM_KEY_IPV4HINT: st = parse_svcparam_ipv4hint(s, dp, eod); break; - case LDNS_SVCPARAM_KEY_ECHCONFIG: - st = parse_svcparam_echconfig(s, dp, eod); + case LDNS_SVCPARAM_KEY_ECH: + st = parse_svcparam_ech(s, dp, eod); break; case LDNS_SVCPARAM_KEY_IPV6HINT: st = parse_svcparam_ipv6hint(s, dp, eod); From 0732aaec47e3a430622ace04ceaf46d73b946025 Mon Sep 17 00:00:00 2001 From: TCY16 Date: Wed, 30 Mar 2022 13:05:33 +0200 Subject: [PATCH 20/83] add edns file and functionality in wire2host --- .gitignore | 2 + Makefile.in | 5 +- drill/drill.c | 2 + edns.c | 98 ++++++++++++++++++++++++++++++++++++++++ host2str.c | 4 ++ ldns/edns.h | 122 +++++++++++++++++++++++++++++++++++++++++++++++++ ldns/ldns.h | 1 + ldns/packet.h | 19 +++++++- ldns/rr.h | 2 +- packet.c | 2 + wire2host.c | 123 +++++++++++++++++++++++++++++++++++++++++++++++--- 11 files changed, 370 insertions(+), 10 deletions(-) create mode 100644 edns.c create mode 100644 ldns/edns.h diff --git a/.gitignore b/.gitignore index 906e2876..4e0296ba 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,8 @@ /duration.o /error.lo /error.o +/edns.lo +/edns.o /examples/.libs/ /examples/ldns-chaos /examples/ldns-chaos.lo diff --git a/Makefile.in b/Makefile.in index 574098c6..4cd4c906 100644 --- a/Makefile.in +++ b/Makefile.in @@ -89,12 +89,12 @@ DEPFLAG = @DEPFLAG@ INSTALL = $(srcdir)/install-sh LIBLOBJS = $(LIBOBJS:.o=.lo) -LDNS_LOBJS = buffer.lo dane.lo dname.lo dnssec.lo dnssec_sign.lo dnssec_verify.lo dnssec_zone.lo duration.lo error.lo higher.lo host2str.lo host2wire.lo keys.lo net.lo packet.lo parse.lo radix.lo rbtree.lo rdata.lo resolver.lo rr.lo rr_functions.lo sha1.lo sha2.lo str2host.lo tsig.lo update.lo util.lo wire2host.lo zone.lo +LDNS_LOBJS = buffer.lo dane.lo dname.lo dnssec.lo dnssec_sign.lo dnssec_verify.lo dnssec_zone.lo duration.lo error.lo higher.lo host2str.lo host2wire.lo keys.lo net.lo packet.lo parse.lo radix.lo rbtree.lo rdata.lo resolver.lo rr.lo rr_functions.lo sha1.lo sha2.lo str2host.lo tsig.lo update.lo util.lo wire2host.lo zone.lo edns.lo LDNS_LOBJS_EX = ^linktest\.c$$ LDNS_ALL_LOBJS = $(LDNS_LOBJS) $(LIBLOBJS) LIB = libldns.la -LDNS_HEADERS = buffer.h dane.h dname.h dnssec.h dnssec_sign.h dnssec_verify.h dnssec_zone.h duration.h error.h higher.h host2str.h host2wire.h keys.h ldns.h packet.h parse.h radix.h rbtree.h rdata.h resolver.h rr_functions.h rr.h sha1.h sha2.h str2host.h tsig.h update.h wire2host.h zone.h +LDNS_HEADERS = buffer.h dane.h dname.h dnssec.h dnssec_sign.h dnssec_verify.h dnssec_zone.h duration.h error.h higher.h host2str.h host2wire.h keys.h ldns.h packet.h parse.h radix.h rbtree.h rdata.h resolver.h rr_functions.h rr.h sha1.h sha2.h str2host.h tsig.h update.h wire2host.h zone.h edns.h LDNS_HEADERS_EX = ^config\.h|common\.h|util\.h|net\.h$$ LDNS_HEADERS_GEN= common.h util.h net.h @@ -799,6 +799,7 @@ zone.lo zone.o: $(srcdir)/zone.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +edns.lo edns.o: $(srcdir)/edns.c ldns/config.h $(srcdir)/ldns/edns.h compat/b64_ntop.lo compat/b64_ntop.o: $(srcdir)/compat/b64_ntop.c ldns/config.h compat/b64_pton.lo compat/b64_pton.o: $(srcdir)/compat/b64_pton.c ldns/config.h compat/calloc.lo compat/calloc.o: $(srcdir)/compat/calloc.c ldns/config.h diff --git a/drill/drill.c b/drill/drill.c index 13afb84f..07695f60 100644 --- a/drill/drill.c +++ b/drill/drill.c @@ -699,6 +699,8 @@ main(int argc, char *argv[]) ldns_resolver_set_tsig_algorithm(res, tsig_algorithm); } + printf("HERE: drill:main() PURPOSE: %d\n", PURPOSE); + /* main switching part of drill */ switch(PURPOSE) { case DRILL_TRACE: diff --git a/edns.c b/edns.c new file mode 100644 index 00000000..2f6d8098 --- /dev/null +++ b/edns.c @@ -0,0 +1,98 @@ +/* + * edns.c + * + * edns implementation + * + * a Net::DNS like library for C + * + * (c) NLnet Labs, 2004-2022 + * + * See the file LICENSE for the license + */ + +#include + +/* + * Access functions + * functions to get and set type checking + */ + +/* read */ +size_t +ldns_edns_get_size(const ldns_edns_option *edns) +{ + assert(edns != NULL); + return edns->_size; +} + +ldns_edns_option_code +ldns_edns_get_code(const ldns_edns_option *edns) +{ + assert(edns != NULL); + return edns->_code; +} + +uint8_t * +ldns_edns_get_data(const ldns_edns_option *edns) +{ + assert(edns != NULL); + return edns->_data; +} + + +/* write */ +void +ldns_edns_set_size(ldns_edns_option *edns, size_t size) +{ + assert(edns != NULL); + edns->_size = size; +} + +void +ldns_edns_set_code(ldns_edns_option *edns, ldns_edns_option_code code) +{ + assert(edns != NULL); + edns->_code = code; +} + +void +ldns_edns_set_data(ldns_edns_option *edns, void *data) +{ + /* only copy the pointer */ + assert(edns != NULL); + edns->_data = data; +} + +/* note: data must be allocated memory */ +ldns_edns_option * +ldns_edns_new(ldns_edns_option_code code, size_t size, void *data) +{ + ldns_edns_option *edns; + edns = LDNS_MALLOC(ldns_edns_option); + if (!edns) { + return NULL; + } + ldns_edns_set_size(edns, size); + ldns_edns_set_code(edns, code); + ldns_edns_set_data(edns, data); + return edns; +} + +void +ldns_edns_deep_free(ldns_edns_option *edns) +{ + if (edns) { + if (edns->_data) { + LDNS_FREE(edns->_data); + } + LDNS_FREE(edns); + } +} + +void +ldns_edns_free(ldns_edns_option *edns) +{ + if (edns) { + LDNS_FREE(edns); + } +} diff --git a/host2str.c b/host2str.c index a207a913..91fbc753 100644 --- a/host2str.c +++ b/host2str.c @@ -2205,6 +2205,10 @@ ldns_pkt2buffer_str_fmt(ldns_buffer *output, if (ldns_pkt_edns_data(pkt)) { ldns_buffer_printf(output, ";; Data: "); + + // @TODO loop through options on the newly created ldns_edns_opt + // struct and create + (void)ldns_rdf2buffer_str(output, ldns_pkt_edns_data(pkt)); ldns_buffer_printf(output, "\n"); diff --git a/ldns/edns.h b/ldns/edns.h new file mode 100644 index 00000000..e7100509 --- /dev/null +++ b/ldns/edns.h @@ -0,0 +1,122 @@ +/* + * edns.h + * + * + * a Net::DNS like library for C + * + * (c) NLnet Labs, 2004-2022 + * + * See the file LICENSE for the license + */ + +#ifndef LDNS_EDNS_H +#define LDNS_EDNS_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + + +/** + * EDNS option codes + */ +enum ldns_enum_edns_option +{ + LDNS_EDNS_LLQ = 1, /* http://files.dns-sd.org/draft-sekar-dns-llq.txt */ + LDNS_EDNS_UL = 2, /* http://files.dns-sd.org/draft-sekar-dns-ul.txt */ + LDNS_EDNS_NSID = 3, /* RFC5001 */ + /* 4 draft-cheshire-edns0-owner-option */ + LDNS_EDNS_DAU = 5, /* RFC6975 */ + LDNS_EDNS_DHU = 6, /* RFC6975 */ + LDNS_EDNS_N3U = 7, /* RFC6975 */ + LDNS_EDNS_CLIENT_SUBNET = 8, /* RFC7871 */ + LDNS_EDNS_KEEPALIVE = 11, /* draft-ietf-dnsop-edns-tcp-keepalive*/ + LDNS_EDNS_PADDING = 12, /* RFC7830 */ + LDNS_EDNS_EDE = 15, /* RFC8914 */ + LDNS_EDNS_CLIENT_TAG = 16 /* draft-bellis-dnsop-edns-tags-01 */ +}; +typedef enum ldns_enum_edns_option ldns_edns_option_code; + +/** + * + * An EDNS option is structed as follows: + +0 (MSB) +1 (LSB) + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + 0: | OPTION-CODE | + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + 2: | OPTION-LENGTH | + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + 4: | | + / OPTION-DATA / + / / + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + * + * + * @TODO write this + */ +struct ldns_struct_edns_option { + ldns_edns_option_code _code; + size_t _size; + void *_data; +}; +typedef struct ldns_struct_edns_option ldns_edns_option; + + +/* + * + * @TODO write this + */ +struct ldns_struct_edns_option_list +{ + size_t _option_count; + size_t _rr_capacity; // ??? + ldns_rr **_options; +}; +typedef struct ldns_struct_edns_option_list edns_option_list; + +/* + * Access functions + * do this as functions to get type checking + */ + +/** + * returns the size of the EDNS data. + * \param[in] *edns the EDNS struct to read from + * \return uint16_t with the size + */ +size_t ldns_edns_get_size(const ldns_edns_option *edns); + +/** + * returns the size of the EDNS data. + * \param[in] *edns the EDNS struct to read from + * \return uint16_t with the size + */ +ldns_edns_option_code ldns_edns_get_code(const ldns_edns_option *edns); + +/** + * returns the EDNS option data. + * \param[in] *edns the rdf to read from + * \return uint8_t* pointer to the rdf's data + */ +uint8_t *ldns_edns_get_data(const ldns_edns_option *edns); + + +/** + * allocates a new EDNS structure and fills it. + * This function DOES NOT copy the contents from + * the buffer, unlike ldns_rdf_new_frm_data() + * \param[in] type type of the rdf + * \param[in] size size of the buffer + * \param[in] data pointer to the buffer to be copied + * \return the new rdf structure or NULL on failure + */ +ldns_edns_option *ldns_edns_new(ldns_edns_option_code code, size_t size, void *data); + +#ifdef __cplusplus +} +#endif + +#endif /* LDNS_EDNS_H */ \ No newline at end of file diff --git a/ldns/ldns.h b/ldns/ldns.h index 60663ef9..74713a21 100644 --- a/ldns/ldns.h +++ b/ldns/ldns.h @@ -123,6 +123,7 @@ Or you can just use the menu above to browse through the API docs. #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/ldns/packet.h b/ldns/packet.h index c0ed0c79..73d04b09 100644 --- a/ldns/packet.h +++ b/ldns/packet.h @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -257,6 +258,10 @@ struct ldns_struct_pkt uint16_t _edns_z; /** Arbitrary EDNS rdata */ ldns_rdf *_edns_data; + + /** Structured ENDS options */ + ldns_edns_option *_edns_options; // @TODO rewrite into "edns_option_list" struct + /** Question section */ ldns_rr_list *_question; /** Answer section */ @@ -719,7 +724,7 @@ uint16_t ldns_pkt_edns_unassigned(const ldns_pkt *packet); void ldns_pkt_set_edns_unassigned(ldns_pkt *packet, uint16_t value); /** - * returns true if this packet needs and EDNS rr to be sent. + * returns true if this packet needs an EDNS rr to be sent. * At the moment the only reason is an expected packet * size larger than 512 bytes, but for instance dnssec would * be a good reason too. @@ -760,6 +765,18 @@ void ldns_pkt_set_edns_z(ldns_pkt *packet, uint16_t z); */ void ldns_pkt_set_edns_data(ldns_pkt *packet, ldns_rdf *data); + +// * +// * Set the packet's edns data +// * \param[in] packet the packet +// * \param[in] data the data +// * \return 0 is there is no next EDNS option in the + +// uint16_t ldns_pkt_get_next_edns_option(ldns_pkt *packet, ); + + + + /** * allocates and initializes a ldns_pkt structure. * \return pointer to the new packet diff --git a/ldns/rr.h b/ldns/rr.h index 2b03a60e..44d54121 100644 --- a/ldns/rr.h +++ b/ldns/rr.h @@ -156,7 +156,7 @@ enum ldns_enum_rr_type LDNS_RR_TYPE_DNAME = 39, /** dnsind-kitchen-sink-02.txt */ LDNS_RR_TYPE_SINK = 40, - /** Pseudo OPT record... */ + /** OPT record RFC 6891 */ LDNS_RR_TYPE_OPT = 41, /** RFC3123 */ LDNS_RR_TYPE_APL = 42, diff --git a/packet.c b/packet.c index a57e1901..0cee38f1 100644 --- a/packet.c +++ b/packet.c @@ -798,6 +798,8 @@ ldns_pkt_new(void) ldns_pkt_set_edns_data(packet, NULL); packet->_edns_present = false; + packet->_edns_options = NULL; //@TODO change this to set_function/list function + ldns_pkt_set_tsig(packet, NULL); return packet; diff --git a/wire2host.c b/wire2host.c index ee70fbde..ab5fdd1b 100644 --- a/wire2host.c +++ b/wire2host.c @@ -185,7 +185,7 @@ ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos) end = *pos + (size_t) rd_length; rdf_index = 0; - while (*pos < end && + while (*pos < end && rdf_index < ldns_rr_descriptor_maximum(descriptor)) { cur_rdf_length = 0; @@ -312,6 +312,104 @@ ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos) } + +/* Parse the additional section like wire2rr with a case for EDNS options */ +// @TODO remove static? +static ldns_status +ldns_wire2rr_additional(ldns_pkt* packet, ldns_rr **rr_p, const uint8_t *wire, + size_t max, size_t *pos) +{ + size_t end; + ldns_rdf *owner = NULL; + ldns_rr *rr = ldns_rr_new(); + ldns_status status; + ldns_rr_type rr_type; + uint16_t rd_length; + + status = ldns_wire2dname(&owner, wire, max, pos); + LDNS_STATUS_CHECK_GOTO(status, status_error); + + ldns_rr_set_owner(rr, owner); + + if (*pos + 4 > max) { + status = LDNS_STATUS_PACKET_OVERFLOW; + goto status_error; + } + + rr_type = ldns_read_uint16(&wire[*pos]); + ldns_rr_set_type(rr, rr_type); + *pos = *pos + 2; + + ldns_rr_set_class(rr, ldns_read_uint16(&wire[*pos])); + *pos = *pos + 2; + + if (*pos + 4 > max) { + status = LDNS_STATUS_PACKET_OVERFLOW; + goto status_error; + } + ldns_rr_set_ttl(rr, ldns_read_uint32(&wire[*pos])); + + *pos = *pos + 4; + + if (rr_type != LDNS_RR_TYPE_OPT) + status = ldns_wire2rdf(rr, wire, max, pos); + else { + ldns_edns_option* edns; + ldns_edns_option_code option_code; + uint16_t option_size; + uint8_t *option_data; + + if (*pos + 2 > max) { + status = LDNS_STATUS_PACKET_OVERFLOW; + goto status_error; + } + + rd_length = ldns_read_uint16(&wire[*pos]); + *pos = *pos + 2; + + if (*pos + rd_length > max) { + status = LDNS_STATUS_PACKET_OVERFLOW; + goto status_error; + } + + end = *pos + (size_t) rd_length; + + while (*pos < end) { // @TODO fix for multiple EDNS opts? + option_code = ldns_read_uint16(&wire[*pos]); + option_size = ldns_read_uint16(&wire[*pos + 2]); + *pos = *pos + 4; + + option_data = LDNS_XMALLOC(uint8_t, option_size); + if (!option_data) { + status = LDNS_STATUS_MEM_ERR; + goto status_error; + } + memcpy(option_data, &wire[*pos], option_size); + + printf("HERE: ldns_wire2rr_additional():option code: %d\n", option_code); + printf("HERE: ldns_wire2rr_additional():option size: %d\n", option_size); + + edns = ldns_edns_new(option_code, option_size, option_data); + + // @TODO push edns to packet/rr list (1) with function (2) + packet->_edns_options = edns; + + *pos = *pos + option_size; + } + + } + + LDNS_STATUS_CHECK_GOTO(status, status_error); + ldns_rr_set_question(rr, false); + + *rr_p = rr; + return LDNS_STATUS_OK; + +status_error: + ldns_rr_free(rr); + return status; +} + /* TODO: can *pos be incremented at READ_INT? or maybe use something like RR_CLASS(wire)? @@ -411,6 +509,8 @@ ldns_wire2pkt(ldns_pkt **packet_p, const uint8_t *wire, size_t max) ldns_pkt *packet = ldns_pkt_new(); ldns_status status = LDNS_STATUS_OK; uint8_t have_edns = 0; + // ldns_rdf *edns; + ldns_edns_option *edns; uint8_t data[4]; @@ -418,6 +518,8 @@ ldns_wire2pkt(ldns_pkt **packet_p, const uint8_t *wire, size_t max) return LDNS_STATUS_MEM_ERR; } + printf("HERE: ldns_wire2pkt()\n"); + status = ldns_wire2pkt_hdr(packet, wire, max, &pos); LDNS_STATUS_CHECK_GOTO(status, status_error); @@ -456,7 +558,10 @@ ldns_wire2pkt(ldns_pkt **packet_p, const uint8_t *wire, size_t max) } } for (i = 0; i < ldns_pkt_arcount(packet); i++) { - status = ldns_wire2rr(&rr, wire, max, &pos, LDNS_SECTION_ADDITIONAL); + + status = ldns_wire2rr_additional(packet ,&rr, wire, max, &pos); + + // status = ldns_wire2rr(&rr, wire, max, &pos, LDNS_SECTION_ADDITIONAL); if (status == LDNS_STATUS_PACKET_OVERFLOW) { status = LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL; } @@ -468,10 +573,16 @@ ldns_wire2pkt(ldns_pkt **packet_p, const uint8_t *wire, size_t max) ldns_pkt_set_edns_extended_rcode(packet, data[0]); ldns_pkt_set_edns_version(packet, data[1]); ldns_pkt_set_edns_z(packet, ldns_read_uint16(&data[2])); - /* edns might not have rdfs */ - if (ldns_rr_rdf(rr, 0)) { - ldns_rdf_deep_free(ldns_pkt_edns_data(packet)); - ldns_pkt_set_edns_data(packet, ldns_rdf_clone(ldns_rr_rdf(rr, 0))); + /* edns is already parsed here in ldns_wire2rr_additional() */ + + if (packet->_edns_options != NULL) { + edns = packet->_edns_options; // @TODO loop-ify + + + printf("HERE: edns code: %d\n", ldns_edns_get_code(edns)); + + // ldns_rdf_deep_free(ldns_pkt_edns_data(packet)); + // ldns_pkt_set_edns_data(packet, ldns_edns_get_data(edns)); } ldns_rr_free(rr); have_edns += 1; From d606e61e8a195df9642591e5135a09abdc8c7bfe Mon Sep 17 00:00:00 2001 From: TCY16 Date: Fri, 1 Apr 2022 15:37:59 +0200 Subject: [PATCH 21/83] remove debug code and add clarity comment in rr.c:ldns_rr_list_pop_rr() --- drill/drill.c | 2 - rr.c | 1 + wire2host.c | 122 +++----------------------------------------------- 3 files changed, 6 insertions(+), 119 deletions(-) diff --git a/drill/drill.c b/drill/drill.c index 07695f60..13afb84f 100644 --- a/drill/drill.c +++ b/drill/drill.c @@ -699,8 +699,6 @@ main(int argc, char *argv[]) ldns_resolver_set_tsig_algorithm(res, tsig_algorithm); } - printf("HERE: drill:main() PURPOSE: %d\n", PURPOSE); - /* main switching part of drill */ switch(PURPOSE) { case DRILL_TRACE: diff --git a/rr.c b/rr.c index 382d0b59..49fb8cae 100644 --- a/rr.c +++ b/rr.c @@ -1190,6 +1190,7 @@ ldns_rr_list_pop_rr(ldns_rr_list *rr_list) rr_list->_rrs = a; rr_list->_rr_capacity = cap; } + /* if the realloc fails, the capacity for the list remains unchanged */ } ldns_rr_list_set_rr_count(rr_list, rr_count - 1); diff --git a/wire2host.c b/wire2host.c index ab5fdd1b..77f6cbf2 100644 --- a/wire2host.c +++ b/wire2host.c @@ -311,105 +311,6 @@ ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos) return LDNS_STATUS_OK; } - - -/* Parse the additional section like wire2rr with a case for EDNS options */ -// @TODO remove static? -static ldns_status -ldns_wire2rr_additional(ldns_pkt* packet, ldns_rr **rr_p, const uint8_t *wire, - size_t max, size_t *pos) -{ - size_t end; - ldns_rdf *owner = NULL; - ldns_rr *rr = ldns_rr_new(); - ldns_status status; - ldns_rr_type rr_type; - uint16_t rd_length; - - status = ldns_wire2dname(&owner, wire, max, pos); - LDNS_STATUS_CHECK_GOTO(status, status_error); - - ldns_rr_set_owner(rr, owner); - - if (*pos + 4 > max) { - status = LDNS_STATUS_PACKET_OVERFLOW; - goto status_error; - } - - rr_type = ldns_read_uint16(&wire[*pos]); - ldns_rr_set_type(rr, rr_type); - *pos = *pos + 2; - - ldns_rr_set_class(rr, ldns_read_uint16(&wire[*pos])); - *pos = *pos + 2; - - if (*pos + 4 > max) { - status = LDNS_STATUS_PACKET_OVERFLOW; - goto status_error; - } - ldns_rr_set_ttl(rr, ldns_read_uint32(&wire[*pos])); - - *pos = *pos + 4; - - if (rr_type != LDNS_RR_TYPE_OPT) - status = ldns_wire2rdf(rr, wire, max, pos); - else { - ldns_edns_option* edns; - ldns_edns_option_code option_code; - uint16_t option_size; - uint8_t *option_data; - - if (*pos + 2 > max) { - status = LDNS_STATUS_PACKET_OVERFLOW; - goto status_error; - } - - rd_length = ldns_read_uint16(&wire[*pos]); - *pos = *pos + 2; - - if (*pos + rd_length > max) { - status = LDNS_STATUS_PACKET_OVERFLOW; - goto status_error; - } - - end = *pos + (size_t) rd_length; - - while (*pos < end) { // @TODO fix for multiple EDNS opts? - option_code = ldns_read_uint16(&wire[*pos]); - option_size = ldns_read_uint16(&wire[*pos + 2]); - *pos = *pos + 4; - - option_data = LDNS_XMALLOC(uint8_t, option_size); - if (!option_data) { - status = LDNS_STATUS_MEM_ERR; - goto status_error; - } - memcpy(option_data, &wire[*pos], option_size); - - printf("HERE: ldns_wire2rr_additional():option code: %d\n", option_code); - printf("HERE: ldns_wire2rr_additional():option size: %d\n", option_size); - - edns = ldns_edns_new(option_code, option_size, option_data); - - // @TODO push edns to packet/rr list (1) with function (2) - packet->_edns_options = edns; - - *pos = *pos + option_size; - } - - } - - LDNS_STATUS_CHECK_GOTO(status, status_error); - ldns_rr_set_question(rr, false); - - *rr_p = rr; - return LDNS_STATUS_OK; - -status_error: - ldns_rr_free(rr); - return status; -} - /* TODO: can *pos be incremented at READ_INT? or maybe use something like RR_CLASS(wire)? @@ -509,8 +410,6 @@ ldns_wire2pkt(ldns_pkt **packet_p, const uint8_t *wire, size_t max) ldns_pkt *packet = ldns_pkt_new(); ldns_status status = LDNS_STATUS_OK; uint8_t have_edns = 0; - // ldns_rdf *edns; - ldns_edns_option *edns; uint8_t data[4]; @@ -518,8 +417,6 @@ ldns_wire2pkt(ldns_pkt **packet_p, const uint8_t *wire, size_t max) return LDNS_STATUS_MEM_ERR; } - printf("HERE: ldns_wire2pkt()\n"); - status = ldns_wire2pkt_hdr(packet, wire, max, &pos); LDNS_STATUS_CHECK_GOTO(status, status_error); @@ -558,10 +455,7 @@ ldns_wire2pkt(ldns_pkt **packet_p, const uint8_t *wire, size_t max) } } for (i = 0; i < ldns_pkt_arcount(packet); i++) { - - status = ldns_wire2rr_additional(packet ,&rr, wire, max, &pos); - - // status = ldns_wire2rr(&rr, wire, max, &pos, LDNS_SECTION_ADDITIONAL); + status = ldns_wire2rr(&rr, wire, max, &pos, LDNS_SECTION_ADDITIONAL); if (status == LDNS_STATUS_PACKET_OVERFLOW) { status = LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL; } @@ -573,16 +467,10 @@ ldns_wire2pkt(ldns_pkt **packet_p, const uint8_t *wire, size_t max) ldns_pkt_set_edns_extended_rcode(packet, data[0]); ldns_pkt_set_edns_version(packet, data[1]); ldns_pkt_set_edns_z(packet, ldns_read_uint16(&data[2])); - /* edns is already parsed here in ldns_wire2rr_additional() */ - - if (packet->_edns_options != NULL) { - edns = packet->_edns_options; // @TODO loop-ify - - - printf("HERE: edns code: %d\n", ldns_edns_get_code(edns)); - - // ldns_rdf_deep_free(ldns_pkt_edns_data(packet)); - // ldns_pkt_set_edns_data(packet, ldns_edns_get_data(edns)); + /* edns might not have rdfs */ + if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_OPT) { + ldns_rdf_deep_free(ldns_pkt_edns_data(packet)); + ldns_pkt_set_edns_data(packet, ldns_rdf_clone(ldns_rr_rdf(rr, 0))); } ldns_rr_free(rr); have_edns += 1; From 5b2f7f3636612803fa79b76f983fea29253bb00f Mon Sep 17 00:00:00 2001 From: TCY16 Date: Fri, 1 Apr 2022 15:54:01 +0200 Subject: [PATCH 22/83] add functions to edns lib --- edns.c | 146 ++++++++++++++++++++++++++++++++++++++++++++++++++++ ldns/edns.h | 118 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 251 insertions(+), 13 deletions(-) diff --git a/edns.c b/edns.c index 2f6d8098..099ea232 100644 --- a/edns.c +++ b/edns.c @@ -96,3 +96,149 @@ ldns_edns_free(ldns_edns_option *edns) LDNS_FREE(edns); } } + +ldns_edns_option_list* +ldns_edns_option_list_new() +{ + ldns_edns_option_list *options_list = LDNS_MALLOC(ldns_edns_option_list); + if(!options_list) { + return NULL; + } + + options_list->_option_count = 0; + options_list->_options = NULL; + return options_list; +} + +void +ldns_edns_option_list_free(ldns_edns_option_list *options_list) +{ + if (options_list) { + LDNS_FREE(options_list->_options); + LDNS_FREE(options_list); + } +} + +void +ldns_edns_option_list_deep_free(ldns_edns_option_list *options_list) +{ + size_t i; + + if (options_list) { + for (i=0; i < ldns_edns_option_list_get_count(options_list); i++) { + ldns_edns_free(ldns_edns_option_list_get_option(options_list, i)); + } + ldns_edns_option_list_free(options_list); + } +} + + +size_t +ldns_edns_option_list_get_count(const ldns_edns_option_list *options_list) +{ + if (options_list) { + return options_list->_option_count; + } else { + return 0; + } +} + +void +ldns_edns_option_list_set_count(ldns_edns_option_list *options_list, size_t count) +{ + assert(options_list); // @TODO does this check need to check more? + options_list->_option_count = count; +} + +ldns_edns_option * +ldns_edns_option_list_get_option(const ldns_edns_option_list *options_list, size_t index) +{ + if (index < ldns_edns_option_list_get_count(options_list)) { + return options_list->_options[index]; + } else { + return NULL; + } +} + +ldns_edns_option * +ldns_edns_option_list_set_option(ldns_edns_option_list *options_list, + const ldns_edns_option *option, size_t index) +{ + ldns_edns_option* old; + + assert(options_list != NULL); + + if (index < ldns_edns_option_list_get_count(options_list)) { + return NULL; + } + + if (option == NULL) { + return NULL; + } + + old = ldns_edns_option_list_get_option(options_list, index); + + /* overwrite the pointer of "old" */ + options_list->_options[index] = (ldns_edns_option*)option; + return old; +} + +bool +ldns_edns_option_list_push(ldns_edns_option_list *options_list, + const ldns_edns_option *option) +{ + assert(options_list != NULL); + + if (option != NULL) { + + // @TODO rethink reallocing per push + + options_list->_options = LDNS_XREALLOC(options_list->_options, ldns_edns_option *, + options_list->_option_count + 1); + if (!options_list) { + return false; + } + ldns_edns_option_list_set_option(options_list, option, + options_list->_option_count); + options_list->_option_count += 1; + + return true; + } + return false; +} + +ldns_edns_option * +ldns_edns_option_list_pop(ldns_edns_option_list *options_list) +{ + ldns_edns_option ** new_list; + ldns_edns_option* pop; + size_t count; + + assert(options_list != NULL); + + count = ldns_edns_option_list_get_count(options_list); + + /* get the last option from the list */ + pop = ldns_edns_option_list_get_option(options_list, count-1); + + if (count <= 0){ + return NULL; + } + + // @TODO rethink reallocing per pop + + /* shrink the array */ + new_list = LDNS_XREALLOC(options_list->_options, ldns_edns_option *, count -1); + if (new_list == NULL){ + return NULL; + // @TODO not sure about returning NULL here, as ldns_rr_list_pop_rr + // just skips the failure + } + + options_list->_options = new_list; + + ldns_edns_option_list_set_count(options_list, count - 1); + + return pop; +} + diff --git a/ldns/edns.h b/ldns/edns.h index e7100509..5fbd9f49 100644 --- a/ldns/edns.h +++ b/ldns/edns.h @@ -41,7 +41,40 @@ enum ldns_enum_edns_option typedef enum ldns_enum_edns_option ldns_edns_option_code; /** - * + * Extended DNS Error (RFC 8914) codes + */ +enum ldns_edns_enum_ede_code +{ + LDNS_EDE_OTHER = 0, + LDNS_EDE_UNSUPPORTED_DNSKEY_ALG = 1, + LDNS_EDE_UNSUPPORTED_DS_DIGEST = 2, + LDNS_EDE_STALE_ANSWER = 3, + LDNS_EDE_FORGED_ANSWER = 4, + LDNS_EDE_DNSSEC_INDETERMINATE = 5, + LDNS_EDE_DNSSEC_BOGUS = 6, + LDNS_EDE_SIGNATURE_EXPIRED = 7, + LDNS_EDE_SIGNATURE_NOT_YET_VALID = 8, + LDNS_EDE_DNSKEY_MISSING = 9, + LDNS_EDE_RRSIGS_MISSING = 10, + LDNS_EDE_NO_ZONE_KEY_BIT_SET = 11, + LDNS_EDE_NSEC_MISSING = 12, + LDNS_EDE_CACHED_ERROR = 13, + LDNS_EDE_NOT_READY = 14, + LDNS_EDE_BLOCKED = 15, + LDNS_EDE_CENSORED = 16, + LDNS_EDE_FILTERED = 17, + LDNS_EDE_PROHIBITED = 18, + LDNS_EDE_STALE_NXDOMAIN_ANSWER = 19, + LDNS_EDE_NOT_AUTHORITATIVE = 20, + LDNS_EDE_NOT_SUPPORTED = 21, + LDNS_EDE_NO_REACHABLE_AUTHORITY = 22, + LDNS_EDE_NETWORK_ERROR = 23, + LDNS_EDE_INVALID_DATA = 24 +}; +typedef enum ldns_edns_enum_ede_code ldns_edns_ede_code; + +/** + * The struct that stores an ordered EDNS option. * An EDNS option is structed as follows: +0 (MSB) +1 (LSB) +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ @@ -53,9 +86,6 @@ typedef enum ldns_enum_edns_option ldns_edns_option_code; / OPTION-DATA / / / +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - * - * - * @TODO write this */ struct ldns_struct_edns_option { ldns_edns_option_code _code; @@ -66,16 +96,14 @@ typedef struct ldns_struct_edns_option ldns_edns_option; /* - * - * @TODO write this + * Array structure to store multiple EDNS options */ struct ldns_struct_edns_option_list { size_t _option_count; - size_t _rr_capacity; // ??? - ldns_rr **_options; + ldns_edns_option **_options; }; -typedef struct ldns_struct_edns_option_list edns_option_list; +typedef struct ldns_struct_edns_option_list ldns_edns_option_list; /* * Access functions @@ -104,17 +132,81 @@ ldns_edns_option_code ldns_edns_get_code(const ldns_edns_option *edns); uint8_t *ldns_edns_get_data(const ldns_edns_option *edns); +/* Constructors and destructors*/ + /** * allocates a new EDNS structure and fills it. - * This function DOES NOT copy the contents from - * the buffer, unlike ldns_rdf_new_frm_data() - * \param[in] type type of the rdf + * This function DOES NOT copy the contents from the buffer + * \param[in] code the EDNS code * \param[in] size size of the buffer * \param[in] data pointer to the buffer to be copied - * \return the new rdf structure or NULL on failure + * \return the new EDNS structure or NULL on failure */ ldns_edns_option *ldns_edns_new(ldns_edns_option_code code, size_t size, void *data); +void ldns_edns_deep_free(ldns_edns_option *edns); +void ldns_edns_free(ldns_edns_option *edns); + + +/** + * allocates space for a new list of EDNS options + * \return the new EDNS option list or NULL on failure + */ +ldns_edns_option_list* ldns_edns_option_list_new(void); +void ldns_edns_option_list_free(ldns_edns_option_list *options_list); +void ldns_edns_list_deep_free(ldns_edns_option_list *options_list); + +/* edns_option_list functions */ + +/** + * returns the number of options in the EDNS options list. + * \param[in] options_list the EDNS options_list to read from + * \return the number of EDNS options + */ +size_t ldns_edns_option_list_get_count(const ldns_edns_option_list *options_list); + +/** + * sets the number of options in the EDNS options list. + * \param[in] options_list the EDNS options_list with the associated counter + * \param[in] count the new cnumber of EDNS options in the list + */ +void ldns_edns_option_list_set_count(ldns_edns_option_list *options_list, size_t count); + +/** + * returns the EDNS option as the specified index in the list of EDNS options. + * \param[in] options_list the EDNS options_list to read from + * \param[in] index the location of the EDNS option to get in the list + * \return the EDNS option located at the index + */ +ldns_edns_option* ldns_edns_option_list_get_option(const ldns_edns_option_list *options_list, + size_t index); + +/** + * adds an EDNS option to the list of options at the specified index. Also + * returns the option that was previously at that index. + * \param[in] options_list the EDNS options_list to add to + * \param[in] option the EDNS option to add to the list + * \return the EDNS option previously located at the index + */ +ldns_edns_option * ldns_edns_option_list_set_option(ldns_edns_option_list *options_list, + const ldns_edns_option *option, size_t index); + +/** + * adds an EDNS option at the end of the list of options. + * \param[in] options_list the EDNS options_list to add to + * \param[in] option the (non-NULL) EDNS option to add to the list + * \return true on success and false of failure + */ +bool ldns_edns_option_list_push(ldns_edns_option_list *options_list, + const ldns_edns_option *option); + +/** + * removes and returns the EDNS option at the end of the list of options. + * \param[in] options_list the EDNS options_list to add to + * \return the EDNS option at the end of the list, or NULL on failure + */ +ldns_edns_option* ldns_edns_option_list_pop(ldns_edns_option_list *options_list); + #ifdef __cplusplus } #endif From 43db2a66cf7375b27b7575d825f50cb4893ede2a Mon Sep 17 00:00:00 2001 From: TCY16 Date: Fri, 1 Apr 2022 15:56:54 +0200 Subject: [PATCH 23/83] add function to packet.c to create a list of structured EDNS options --- ldns/packet.h | 29 ++++++++++------------------ packet.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 60 insertions(+), 22 deletions(-) diff --git a/ldns/packet.h b/ldns/packet.h index 73d04b09..f6ca360c 100644 --- a/ldns/packet.h +++ b/ldns/packet.h @@ -35,8 +35,8 @@ #include #include #include -#include #include +#include #ifdef __cplusplus extern "C" { @@ -258,10 +258,6 @@ struct ldns_struct_pkt uint16_t _edns_z; /** Arbitrary EDNS rdata */ ldns_rdf *_edns_data; - - /** Structured ENDS options */ - ldns_edns_option *_edns_options; // @TODO rewrite into "edns_option_list" struct - /** Question section */ ldns_rr_list *_question; /** Answer section */ @@ -512,7 +508,6 @@ ldns_rr_list *ldns_pkt_rr_list_by_type(const ldns_pkt *p, ldns_rr_type t, ldns_p */ ldns_rr_list *ldns_pkt_rr_list_by_name_and_type(const ldns_pkt *packet, const ldns_rdf *ownername, ldns_rr_type type, ldns_pkt_section sec); - /** * check to see if an rr exist in the packet * \param[in] pkt the packet to examine @@ -724,7 +719,7 @@ uint16_t ldns_pkt_edns_unassigned(const ldns_pkt *packet); void ldns_pkt_set_edns_unassigned(ldns_pkt *packet, uint16_t value); /** - * returns true if this packet needs an EDNS rr to be sent. + * returns true if this packet needs and EDNS rr to be sent. * At the moment the only reason is an expected packet * size larger than 512 bytes, but for instance dnssec would * be a good reason too. @@ -734,6 +729,14 @@ void ldns_pkt_set_edns_unassigned(ldns_pkt *packet, uint16_t value); */ bool ldns_pkt_edns(const ldns_pkt *packet); +/** + * Returns a list of structured EDNS options + * + * \param[in] packet the packet which contains the parsed EDNS data + * \return list of ldns_edns_option structs + */ +ldns_edns_option_list* ldns_pkt_edns_option_list(const ldns_pkt *packet); + /** * Set the packet's edns udp size * \param[in] packet the packet @@ -765,18 +768,6 @@ void ldns_pkt_set_edns_z(ldns_pkt *packet, uint16_t z); */ void ldns_pkt_set_edns_data(ldns_pkt *packet, ldns_rdf *data); - -// * -// * Set the packet's edns data -// * \param[in] packet the packet -// * \param[in] data the data -// * \return 0 is there is no next EDNS option in the - -// uint16_t ldns_pkt_get_next_edns_option(ldns_pkt *packet, ); - - - - /** * allocates and initializes a ldns_pkt structure. * \return pointer to the new packet diff --git a/packet.c b/packet.c index 0cee38f1..27e711b7 100644 --- a/packet.c +++ b/packet.c @@ -738,7 +738,8 @@ ldns_pkt_safe_push_rr_list(ldns_pkt *p, ldns_pkt_section s, ldns_rr_list *list) } bool -ldns_pkt_edns(const ldns_pkt *pkt) { +ldns_pkt_edns(const ldns_pkt *pkt) +{ return (ldns_pkt_edns_udp_size(pkt) > 0 || ldns_pkt_edns_extended_rcode(pkt) > 0 || ldns_pkt_edns_data(pkt) || @@ -747,6 +748,54 @@ ldns_pkt_edns(const ldns_pkt *pkt) { ); } +ldns_edns_option_list* +ldns_pkt_edns_option_list(const ldns_pkt *packet) +{ + size_t pos = 0; + ldns_edns_option_list* edns_list; + size_t max = ldns_rdf_size(ldns_pkt_edns_data(packet)); // @TODO is this ugly? + const uint8_t* wire = ldns_rdf_data(ldns_pkt_edns_data(packet)); // @TODO is this ugly? + + + // @TODO do checks so we don't read into un-auth memory (max !< 4) + + + edns_list = ldns_edns_option_list_new(); + if (edns_list == NULL) { + return NULL; + } + + while (pos < max) { + ldns_edns_option* edns; + uint8_t *data; + ldns_edns_option_code code = ldns_read_uint16(&wire[pos]); + size_t size = ldns_read_uint16(&wire[pos+2]); + pos += 4; + + data = LDNS_XMALLOC(uint8_t, size); + + // @TODO think about commented-out code + // if (!data) { + // status = LDNS_STATUS_MEM_ERR; + // goto status_error; + // printf("HERE: DATA == NULL\n"); + // } + memcpy(data, &wire[pos], size); + pos += size; + + edns = ldns_edns_new(code, size, data); + + if (edns != NULL) { + ldns_edns_option_list_push(edns_list, edns); + } + + // @TODO what do we do in case of edns == NULL? + + } + + return edns_list; +} + /* Create/destroy/convert functions */ @@ -797,8 +846,6 @@ ldns_pkt_new(void) ldns_pkt_set_edns_z(packet, 0); ldns_pkt_set_edns_data(packet, NULL); packet->_edns_present = false; - - packet->_edns_options = NULL; //@TODO change this to set_function/list function ldns_pkt_set_tsig(packet, NULL); From 9cd3d0f84e016fe3121e6cb3348562358717761b Mon Sep 17 00:00:00 2001 From: TCY16 Date: Fri, 1 Apr 2022 15:59:39 +0200 Subject: [PATCH 24/83] first iteration of EDNS printing with output in drill --- host2str.c | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 182 insertions(+), 5 deletions(-) diff --git a/host2str.c b/host2str.c index 91fbc753..31bc8b33 100644 --- a/host2str.c +++ b/host2str.c @@ -2107,6 +2107,175 @@ ldns_pktheader2buffer_str(ldns_buffer *output, const ldns_pkt *pkt) return ldns_buffer_status(output); } + + + + +static void // @TODO change this <- +ldns_edns_option_list2buffer_str(ldns_buffer *output, ldns_edns_option_list* edns_list) +{ + size_t count = ldns_edns_option_list_get_count(edns_list); + size_t i, j; + size_t size; + uint8_t* data; + + for (i = 0; i < count; i++) { + ldns_edns_option_code code; + ldns_edns_option* edns = ldns_edns_option_list_get_option(edns_list, i); + + // @TODO write parser for OPT records "; NSID: " "; EDE: 9 (DNSKEY Missing):" + code = ldns_edns_get_code(edns); + + // @TODO make function + switch(code) { + case LDNS_EDNS_LLQ: + ldns_buffer_printf(output, ";; Long-Lived Query:"); + break; + case LDNS_EDNS_UL: + ldns_buffer_printf(output, ";; Update Lease:"); + break; + case LDNS_EDNS_NSID: + ldns_buffer_printf(output, ";; NSID:"); + break; + case LDNS_EDNS_DAU: + ldns_buffer_printf(output, ";; :"); + break; + case LDNS_EDNS_DHU: + ldns_buffer_printf(output, ";; :"); + break; + case LDNS_EDNS_N3U: + ldns_buffer_printf(output, ";; :"); + break; + case LDNS_EDNS_CLIENT_SUBNET: + ldns_buffer_printf(output, ";; CLIENT-SUBNET:"); + break; + case LDNS_EDNS_KEEPALIVE: + ldns_buffer_printf(output, ";; KEEPALIVE:"); + break; + case LDNS_EDNS_PADDING: + ldns_buffer_printf(output, ";; PADDING:"); + break; + case LDNS_EDNS_EDE: + ldns_buffer_printf(output, ";; EDE:"); + break; + case LDNS_EDNS_CLIENT_TAG: + ldns_buffer_printf(output, ";; CLIENT-TAG:"); + break; + + default: + ldns_buffer_printf(output, ";; OPT=%d:", code); + break; + } + + size = ldns_edns_get_size(edns); + data = ldns_edns_get_data(edns); + + if (code == LDNS_EDNS_EDE && size >= 2) { + uint16_t ede = data[1]; + + // @TODO make function + switch (ede) { + case LDNS_EDE_OTHER: + ldns_buffer_printf(output, " 0 (Other): "); + break; + case LDNS_EDE_UNSUPPORTED_DNSKEY_ALG: + ldns_buffer_printf(output, "1 (Unsupported DNSKEY Algorithm)"); + break; + case LDNS_EDE_UNSUPPORTED_DS_DIGEST: + ldns_buffer_printf(output, " 2 (Unsupported DS Digest type)"); + break; + case LDNS_EDE_STALE_ANSWER: + ldns_buffer_printf(output, " 3 (Stale Answer)"); + break; + case LDNS_EDE_FORGED_ANSWER: + ldns_buffer_printf(output, " 4 (Forged Answer)"); + break; + case LDNS_EDE_DNSSEC_INDETERMINATE: + ldns_buffer_printf(output, " 5 (DNSSEC Indeterminate)"); + break; + case LDNS_EDE_DNSSEC_BOGUS: + ldns_buffer_printf(output, " 6 (DNSSEC Bogus)"); + break; + case LDNS_EDE_SIGNATURE_EXPIRED: + ldns_buffer_printf(output, " 7 (Signature Expired)"); + break; + case LDNS_EDE_SIGNATURE_NOT_YET_VALID: + ldns_buffer_printf(output, " 8 (Signature Not Yet Valid)"); + break; + case LDNS_EDE_DNSKEY_MISSING: + ldns_buffer_printf(output, " 9 (DNSKEY Missing)"); + break; + case LDNS_EDE_RRSIGS_MISSING: + ldns_buffer_printf(output, " 10 (RRSIGs Missing)"); + break; + case LDNS_EDE_NO_ZONE_KEY_BIT_SET: + ldns_buffer_printf(output, " 11 (No Zone Key Bit Set)"); + break; + case LDNS_EDE_NSEC_MISSING: + ldns_buffer_printf(output, " 12 (NSEC Missing)"); + break; + case LDNS_EDE_CACHED_ERROR: + ldns_buffer_printf(output, " 13 (Cached Error)"); + break; + case LDNS_EDE_NOT_READY: + ldns_buffer_printf(output, " 14 (Not Ready)"); + break; + case LDNS_EDE_BLOCKED: + ldns_buffer_printf(output, " 15 (Blocked)"); + break; + case LDNS_EDE_CENSORED: + ldns_buffer_printf(output, " 16 (Censored)"); + break; + case LDNS_EDE_FILTERED: + ldns_buffer_printf(output, " 17 (Filtered)"); + break; + case LDNS_EDE_PROHIBITED: + ldns_buffer_printf(output, " 18 (Prohibited)"); + break; + case LDNS_EDE_STALE_NXDOMAIN_ANSWER: + ldns_buffer_printf(output, " 19 (NXDOMAIN Answer)"); + break; + case LDNS_EDE_NOT_AUTHORITATIVE: + ldns_buffer_printf(output, " 20 (Not Authoritative)"); + break; + case LDNS_EDE_NOT_SUPPORTED: + ldns_buffer_printf(output, " 21 (Not Supported)"); + break; + case LDNS_EDE_NO_REACHABLE_AUTHORITY: + ldns_buffer_printf(output, " 22 (No Reachable Authority)"); + break; + case LDNS_EDE_NETWORK_ERROR: + ldns_buffer_printf(output, " 23 (Network Error)"); + break; + case LDNS_EDE_INVALID_DATA: + ldns_buffer_printf(output, " 24 (Invalid Data)"); + break; + default: + ldns_buffer_printf(output, " %02x", data[0]); + ldns_buffer_printf(output, " %02x:", data[1]); + break; + } + + data += 2; + size -= 2; + } + + if (size > 2) { + /* format the hex bytes */ + ldns_buffer_printf(output, ":"); + for (j = 0; j < size; j++) { + ldns_buffer_printf(output, " %02x", data[j]); + } + + /* format the human-readable string */ + ldns_buffer_printf(output, " ("); + ldns_characters2buffer_str(output, size, data); + ldns_buffer_printf(output, ")\n"); + } + } +} + + ldns_status ldns_pkt2buffer_str_fmt(ldns_buffer *output, const ldns_output_format *fmt, const ldns_pkt *pkt) @@ -2183,6 +2352,7 @@ ldns_pkt2buffer_str_fmt(ldns_buffer *output, } } + ldns_buffer_printf(output, "\n"); /* add some further fields */ ldns_buffer_printf(output, ";; Query time: %d msec\n", @@ -2203,14 +2373,21 @@ ldns_pkt2buffer_str_fmt(ldns_buffer *output, ldns_buffer_printf(output, " ; udp: %u\n", ldns_pkt_edns_udp_size(pkt)); + // @TODO make old output configurable? + if (ldns_pkt_edns_data(pkt)) { - ldns_buffer_printf(output, ";; Data: "); + ldns_edns_option_list* edns_list; + // ldns_buffer_printf(output, ";; Data: "); + + /* parse the EDNS data into separate EDNS options + * and add them to the list */ + edns_list = ldns_pkt_edns_option_list(pkt); + + ldns_edns_option_list2buffer_str(output, edns_list); - // @TODO loop through options on the newly created ldns_edns_opt - // struct and create - (void)ldns_rdf2buffer_str(output, - ldns_pkt_edns_data(pkt)); + // (void)ldns_rdf2buffer_str(output, + // ldns_pkt_edns_data(pkt)); ldns_buffer_printf(output, "\n"); } } From 1d45ab668285a80dd5ad13ceb65a81ff21380f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 1 Apr 2022 17:54:53 +0200 Subject: [PATCH 25/83] Remove undefined status variable from exception Triggered by: ldns.ldns_rdf.new_frm_str("::1", ldns.LDNS_RDF_TYPE_A) --- contrib/python/ldns_rdf.i | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/python/ldns_rdf.i b/contrib/python/ldns_rdf.i index dbbf606c..3d1d261b 100644 --- a/contrib/python/ldns_rdf.i +++ b/contrib/python/ldns_rdf.i @@ -315,8 +315,7 @@ specified in the (16-bit) type field with a value from ldns_rdf_type." """ rr = _ldns.ldns_rdf_new_frm_str(rr_type, string) if (not rr) and raiseException: - raise Exception("Can't create query packet, " + - "error: %d" % status) + raise Exception("Can't create query packet")) return rr # From 9139bfa9a420d50b9a412b18f1dbd3e9ce8a324b Mon Sep 17 00:00:00 2001 From: TCY16 Date: Tue, 5 Apr 2022 10:58:46 +0200 Subject: [PATCH 26/83] add individual functions for EDNS optionss printing --- host2str.c | 584 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 436 insertions(+), 148 deletions(-) diff --git a/host2str.c b/host2str.c index 31bc8b33..e0b9cfa3 100644 --- a/host2str.c +++ b/host2str.c @@ -81,6 +81,15 @@ ldns_lookup_table ldns_algorithms[] = { { 0, NULL } }; +/* Hashing algorithms used in the DS record */ +ldns_lookup_table ldns_hashes[] = { + {LDNS_SHA1 , "SHA1" }, /* RFC 4034 */ + {LDNS_SHA256 , "SHA256" }, /* RFC 4509 */ + {LDNS_HASH_GOST, "HASH-GOST" }, /* RFC 5933 */ + {LDNS_SHA384 , "SHA384" }, /* RFC 6605 */ + { 0, NULL } +}; + /* Taken from RFC 4398 */ ldns_lookup_table ldns_cert_algorithms[] = { { LDNS_CERT_PKIX, "PKIX" }, @@ -2108,171 +2117,450 @@ ldns_pktheader2buffer_str(ldns_buffer *output, const ldns_pkt *pkt) } +/* print EDNS option data in the Dig format: 76 61 6c 69 ... */ +static void +ldns_edns_hex_data2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) +{ + size_t j; + for (j = 0; j < len; j++) { + ldns_buffer_printf(output, " %02x", data[j]); + } +} + +static ldns_status +ldns_edns_llq2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) +{ + /* LLQ constants */ + const char* llq_errors[] = {"NO-ERROR", "SERV-FULL", "STATIC", + "FORMAT-ERR", "NO-SUCH-LLQ", "BAD-VERS", "UNKNOWN_ERR"}; + const unsigned int llq_errors_num = 7; + const char* llq_opcodes[] = {"LLQ-SETUP", "LLQ-REFRESH", "LLQ-EVENT"}; + const unsigned int llq_opcodes_num = 3; + + uint16_t version, llq_opcode, error_code; + uint64_t llq_id; + uint32_t lease_life; /* Requested or granted life of LLQ, in seconds */ + ldns_buffer_printf(output, "; Long-Lived Query:"); + /* read the record */ + if(len != 18) { + ldns_buffer_printf(output, " malformed LLQ "); + ldns_edns_hex_data2buffer_str(output, data, len); + + return ldns_buffer_status(output); + } + version = ldns_read_uint16(data); + llq_opcode = ldns_read_uint16(data+2); + error_code = ldns_read_uint16(data+4); + memmove(&llq_id, data+6, sizeof(uint64_t)); + lease_life = ldns_read_uint32(data+14); -static void // @TODO change this <- -ldns_edns_option_list2buffer_str(ldns_buffer *output, ldns_edns_option_list* edns_list) + /* print option field entires */ + ldns_buffer_printf(output, "v%d ", (int)version); + + if(llq_opcode < llq_opcodes_num) { + ldns_buffer_printf(output, "%s", llq_opcodes[llq_opcode]); + } else { + ldns_buffer_printf(output, "opcode %d", (int)llq_opcode); + } + + if(error_code < llq_errors_num) + ldns_buffer_printf(output, " %s", llq_errors[error_code]); + else { + ldns_buffer_printf(output, " error %d", (int)error_code); + } + +#ifndef USE_WINSOCK + ldns_buffer_printf(output, " id %llx lease-life %lu", + (unsigned long long)llq_id, (unsigned long)lease_life); +#else + ldns_buffer_printf(output, " id %I64x lease-life %lu", + (unsigned long long)llq_id, (unsigned long)lease_life); +#endif + return ldns_buffer_status(output); +} + + +static ldns_status +ldns_edns_ul2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) { - size_t count = ldns_edns_option_list_get_count(edns_list); - size_t i, j; - size_t size; - uint8_t* data; + uint32_t lease; - for (i = 0; i < count; i++) { - ldns_edns_option_code code; - ldns_edns_option* edns = ldns_edns_option_list_get_option(edns_list, i); + ldns_buffer_printf(output, "; Update Lease:"); - // @TODO write parser for OPT records "; NSID: " "; EDE: 9 (DNSKEY Missing):" - code = ldns_edns_get_code(edns); + if(len != 4) { + ldns_buffer_printf(output, " malformed UL "); + ldns_edns_hex_data2buffer_str(output, data, len); + return ldns_buffer_status(output); + } + lease = ldns_read_uint32(data); + ldns_buffer_printf(output, "lease %lu", (unsigned long)lease); - // @TODO make function - switch(code) { - case LDNS_EDNS_LLQ: - ldns_buffer_printf(output, ";; Long-Lived Query:"); - break; - case LDNS_EDNS_UL: - ldns_buffer_printf(output, ";; Update Lease:"); - break; - case LDNS_EDNS_NSID: - ldns_buffer_printf(output, ";; NSID:"); - break; - case LDNS_EDNS_DAU: - ldns_buffer_printf(output, ";; :"); - break; - case LDNS_EDNS_DHU: - ldns_buffer_printf(output, ";; :"); - break; - case LDNS_EDNS_N3U: - ldns_buffer_printf(output, ";; :"); - break; - case LDNS_EDNS_CLIENT_SUBNET: - ldns_buffer_printf(output, ";; CLIENT-SUBNET:"); - break; - case LDNS_EDNS_KEEPALIVE: - ldns_buffer_printf(output, ";; KEEPALIVE:"); - break; - case LDNS_EDNS_PADDING: - ldns_buffer_printf(output, ";; PADDING:"); - break; - case LDNS_EDNS_EDE: - ldns_buffer_printf(output, ";; EDE:"); - break; - case LDNS_EDNS_CLIENT_TAG: - ldns_buffer_printf(output, ";; CLIENT-TAG:"); - break; + return ldns_buffer_status(output); +} - default: - ldns_buffer_printf(output, ";; OPT=%d:", code); - break; +static ldns_status +ldns_edns_nsid2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) +{ + size_t i, printed=0; + + ldns_buffer_printf(output, "; NSID:"); + ldns_edns_hex_data2buffer_str(output, data, len); + + /* print the human-readable text string */ + for(i = 0; i < len; i++) { + if(isprint((unsigned char)data[i]) || data[i] == '\t') { + if(!printed) { + ldns_buffer_printf(output, " ("); + printed = 1; + } + ldns_buffer_printf(output, "%c", (char)data[i]); } + } + if(printed) + ldns_buffer_printf(output, ")"); + return ldns_buffer_status(output); +} - size = ldns_edns_get_size(edns); - data = ldns_edns_get_data(edns); - if (code == LDNS_EDNS_EDE && size >= 2) { - uint16_t ede = data[1]; +static ldns_status +ldns_edns_dau2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) +{ + size_t i; + ldns_lookup_table *lt; - // @TODO make function - switch (ede) { - case LDNS_EDE_OTHER: - ldns_buffer_printf(output, " 0 (Other): "); - break; - case LDNS_EDE_UNSUPPORTED_DNSKEY_ALG: - ldns_buffer_printf(output, "1 (Unsupported DNSKEY Algorithm)"); - break; - case LDNS_EDE_UNSUPPORTED_DS_DIGEST: - ldns_buffer_printf(output, " 2 (Unsupported DS Digest type)"); - break; - case LDNS_EDE_STALE_ANSWER: - ldns_buffer_printf(output, " 3 (Stale Answer)"); - break; - case LDNS_EDE_FORGED_ANSWER: - ldns_buffer_printf(output, " 4 (Forged Answer)"); - break; - case LDNS_EDE_DNSSEC_INDETERMINATE: - ldns_buffer_printf(output, " 5 (DNSSEC Indeterminate)"); - break; - case LDNS_EDE_DNSSEC_BOGUS: - ldns_buffer_printf(output, " 6 (DNSSEC Bogus)"); - break; - case LDNS_EDE_SIGNATURE_EXPIRED: - ldns_buffer_printf(output, " 7 (Signature Expired)"); - break; - case LDNS_EDE_SIGNATURE_NOT_YET_VALID: - ldns_buffer_printf(output, " 8 (Signature Not Yet Valid)"); - break; - case LDNS_EDE_DNSKEY_MISSING: - ldns_buffer_printf(output, " 9 (DNSKEY Missing)"); - break; - case LDNS_EDE_RRSIGS_MISSING: - ldns_buffer_printf(output, " 10 (RRSIGs Missing)"); - break; - case LDNS_EDE_NO_ZONE_KEY_BIT_SET: - ldns_buffer_printf(output, " 11 (No Zone Key Bit Set)"); - break; - case LDNS_EDE_NSEC_MISSING: - ldns_buffer_printf(output, " 12 (NSEC Missing)"); - break; - case LDNS_EDE_CACHED_ERROR: - ldns_buffer_printf(output, " 13 (Cached Error)"); - break; - case LDNS_EDE_NOT_READY: - ldns_buffer_printf(output, " 14 (Not Ready)"); - break; - case LDNS_EDE_BLOCKED: - ldns_buffer_printf(output, " 15 (Blocked)"); - break; - case LDNS_EDE_CENSORED: - ldns_buffer_printf(output, " 16 (Censored)"); - break; - case LDNS_EDE_FILTERED: - ldns_buffer_printf(output, " 17 (Filtered)"); - break; - case LDNS_EDE_PROHIBITED: - ldns_buffer_printf(output, " 18 (Prohibited)"); - break; - case LDNS_EDE_STALE_NXDOMAIN_ANSWER: - ldns_buffer_printf(output, " 19 (NXDOMAIN Answer)"); - break; - case LDNS_EDE_NOT_AUTHORITATIVE: - ldns_buffer_printf(output, " 20 (Not Authoritative)"); - break; - case LDNS_EDE_NOT_SUPPORTED: - ldns_buffer_printf(output, " 21 (Not Supported)"); - break; - case LDNS_EDE_NO_REACHABLE_AUTHORITY: - ldns_buffer_printf(output, " 22 (No Reachable Authority)"); - break; - case LDNS_EDE_NETWORK_ERROR: - ldns_buffer_printf(output, " 23 (Network Error)"); - break; - case LDNS_EDE_INVALID_DATA: - ldns_buffer_printf(output, " 24 (Invalid Data)"); - break; - default: - ldns_buffer_printf(output, " %02x", data[0]); - ldns_buffer_printf(output, " %02x:", data[1]); - break; - } + ldns_buffer_printf(output, "; DAU:"); - data += 2; - size -= 2; + for(i = 0; i name) { + ldns_buffer_printf(output, " %s", lt->name); + } else { + ldns_buffer_printf(output, " ALG%u", data[i]); } + } + return ldns_buffer_status(output); +} - if (size > 2) { - /* format the hex bytes */ - ldns_buffer_printf(output, ":"); - for (j = 0; j < size; j++) { - ldns_buffer_printf(output, " %02x", data[j]); - } +static ldns_status +ldns_edns_dhu2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) +{ + size_t i; + ldns_lookup_table *lt; - /* format the human-readable string */ - ldns_buffer_printf(output, " ("); - ldns_characters2buffer_str(output, size, data); - ldns_buffer_printf(output, ")\n"); + ldns_buffer_printf(output, "; DHU:"); + + for(i = 0; i < len; i++) { + lt = ldns_lookup_by_id(ldns_hashes, data[i]); + if (lt && lt->name) { + ldns_buffer_printf(output, " %s", lt->name); + } else { + ldns_buffer_printf(output, " ALG%u", data[i]); } } + return ldns_buffer_status(output); +} + +static ldns_status +ldns_edns_d3u2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) +{ + size_t i; + + ldns_buffer_printf(output, "; D3U:"); + + for(i=0; i 4) { + ldns_buffer_printf(output, "trailingdata:"); + ldns_edns_hex_data2buffer_str(output, data+4+4, len-4-4); + ldns_buffer_printf(output, " "); + len = 4+4; + } + memmove(ip4, data+4, len-4); + if(!inet_ntop(AF_INET, ip4, buf, (socklen_t) sizeof(buf))) { + ldns_buffer_printf(output, "ip4ntoperror "); + ldns_edns_hex_data2buffer_str(output, data+4+4, len-4-4); + } else { + ldns_buffer_printf(output, "%s", buf); + } + } else if(family == 2) { + /* IPv6 */ + char buf[64]; + uint8_t ip6[16]; + memset(ip6, 0, sizeof(ip6)); + if(len-4 > 16) { + ldns_buffer_printf(output, "trailingdata:"); + ldns_edns_hex_data2buffer_str(output, data+4+16, len-4-16); + ldns_buffer_printf(output, " "); + len = 4+16; + } + memmove(ip6, data+4, len-4); +#ifdef AF_INET6 + if(!inet_ntop(AF_INET6, ip6, buf, (socklen_t) sizeof(buf))) { + ldns_buffer_printf(output, "ip6ntoperror "); + ldns_edns_hex_data2buffer_str(output, data+4+4, len-4-4); + } else { + ldns_buffer_printf(output, "%s", buf); + } +#else + ldns_edns_hex_data2buffer_str(output, data+4+4, len-4-4); +#endif + } else { + /* unknown */ + ldns_buffer_printf(output, "family %d ", (int)family); + ldns_edns_hex_data2buffer_str(output, data, len); + } + ldns_buffer_printf(output, "/%d scope /%d", (int)source, (int)scope); + + return ldns_buffer_status(output); +} + +static ldns_status +ldns_edns_keepalive2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) +{ + uint16_t timeout; + + ldns_buffer_printf(output, "; KEEPALIVE:"); + + if(!(len == 0 || len == 2)) { + ldns_buffer_printf(output, "malformed keepalive "); + ldns_edns_hex_data2buffer_str(output, data, len); + + return ldns_buffer_status(output); + } + + if(len == 0) { + ldns_buffer_printf(output, "no timeout value (only valid for client option)"); + } else { + timeout = ldns_read_uint16(data); + ldns_buffer_printf(output, "timeout value in units of 100ms %u", (int)timeout); + } + return ldns_buffer_status(output); +} + +static ldns_status +ldns_edns_padding2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) +{ + ldns_buffer_printf(output, "; PADDING: "); + ldns_edns_hex_data2buffer_str(output, data, len); + + return ldns_buffer_status(output); +} + +static ldns_status +ldns_edns_ede2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) +{ + size_t i; + uint16_t ede; + ldns_buffer_printf(output, "; EDE:"); + + if(len < 2) { + ldns_buffer_printf(output, "malformed ede "); + ldns_edns_hex_data2buffer_str(output, data, len); + + return ldns_buffer_status(output); + } + + /* currently all EDE options fit into one byte, so skip the first */ + ede = data[1]; + + switch (ede) { + case LDNS_EDE_OTHER: + ldns_buffer_printf(output, " 0 (Other): "); + break; + case LDNS_EDE_UNSUPPORTED_DNSKEY_ALG: + ldns_buffer_printf(output, "1 (Unsupported DNSKEY Algorithm)"); + break; + case LDNS_EDE_UNSUPPORTED_DS_DIGEST: + ldns_buffer_printf(output, " 2 (Unsupported DS Digest type)"); + break; + case LDNS_EDE_STALE_ANSWER: + ldns_buffer_printf(output, " 3 (Stale Answer)"); + break; + case LDNS_EDE_FORGED_ANSWER: + ldns_buffer_printf(output, " 4 (Forged Answer)"); + break; + case LDNS_EDE_DNSSEC_INDETERMINATE: + ldns_buffer_printf(output, " 5 (DNSSEC Indeterminate)"); + break; + case LDNS_EDE_DNSSEC_BOGUS: + ldns_buffer_printf(output, " 6 (DNSSEC Bogus)"); + break; + case LDNS_EDE_SIGNATURE_EXPIRED: + ldns_buffer_printf(output, " 7 (Signature Expired)"); + break; + case LDNS_EDE_SIGNATURE_NOT_YET_VALID: + ldns_buffer_printf(output, " 8 (Signature Not Yet Valid)"); + break; + case LDNS_EDE_DNSKEY_MISSING: + ldns_buffer_printf(output, " 9 (DNSKEY Missing)"); + break; + case LDNS_EDE_RRSIGS_MISSING: + ldns_buffer_printf(output, " 10 (RRSIGs Missing)"); + break; + case LDNS_EDE_NO_ZONE_KEY_BIT_SET: + ldns_buffer_printf(output, " 11 (No Zone Key Bit Set)"); + break; + case LDNS_EDE_NSEC_MISSING: + ldns_buffer_printf(output, " 12 (NSEC Missing)"); + break; + case LDNS_EDE_CACHED_ERROR: + ldns_buffer_printf(output, " 13 (Cached Error)"); + break; + case LDNS_EDE_NOT_READY: + ldns_buffer_printf(output, " 14 (Not Ready)"); + break; + case LDNS_EDE_BLOCKED: + ldns_buffer_printf(output, " 15 (Blocked)"); + break; + case LDNS_EDE_CENSORED: + ldns_buffer_printf(output, " 16 (Censored)"); + break; + case LDNS_EDE_FILTERED: + ldns_buffer_printf(output, " 17 (Filtered)"); + break; + case LDNS_EDE_PROHIBITED: + ldns_buffer_printf(output, " 18 (Prohibited)"); + break; + case LDNS_EDE_STALE_NXDOMAIN_ANSWER: + ldns_buffer_printf(output, " 19 (NXDOMAIN Answer)"); + break; + case LDNS_EDE_NOT_AUTHORITATIVE: + ldns_buffer_printf(output, " 20 (Not Authoritative)"); + break; + case LDNS_EDE_NOT_SUPPORTED: + ldns_buffer_printf(output, " 21 (Not Supported)"); + break; + case LDNS_EDE_NO_REACHABLE_AUTHORITY: + ldns_buffer_printf(output, " 22 (No Reachable Authority)"); + break; + case LDNS_EDE_NETWORK_ERROR: + ldns_buffer_printf(output, " 23 (Network Error)"); + break; + case LDNS_EDE_INVALID_DATA: + ldns_buffer_printf(output, " 24 (Invalid Data)"); + break; + default: + ldns_buffer_printf(output, " %02x", data[0]); + ldns_buffer_printf(output, " %02x:", data[1]); + break; + } + + /* skip the EDE code in the output */ + data += 2; + len -= 2; + + if (len > 2) { + /* format the hex bytes */ + ldns_buffer_printf(output, ":"); + for (i = 0; i < len; i++) { + ldns_buffer_printf(output, " %02x", data[i]); + } + + /* format the human-readable string */ + ldns_buffer_printf(output, " ("); + ldns_characters2buffer_str(output, len, data); + ldns_buffer_printf(output, ")\n"); + } + + return ldns_buffer_status(output); +} + +static ldns_status +ldns_edns_client_tag2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) +{ + ldns_buffer_printf(output, "; CLIENT-TAG:"); + ldns_edns_hex_data2buffer_str(output, data, len); + + return ldns_buffer_status(output); +} + +static ldns_status //@TODO change static? +ldns_edns_list2buffer_str(ldns_buffer *output, ldns_edns_option_list* edns_list) +{ + size_t count = ldns_edns_option_list_get_count(edns_list); + size_t i, size; + uint8_t* data; + + // @TODO parse malformed? of in packet.c:ldns_pkt_edns_option_list() ? + + for (i = 0; i < count; i++) { + ldns_edns_option_code code; + ldns_edns_option* edns = ldns_edns_option_list_get_option(edns_list, i); + + code = ldns_edns_get_code(edns); + size = ldns_edns_get_size(edns); + data = ldns_edns_get_data(edns); + + switch(code) { + case LDNS_EDNS_LLQ: + ldns_edns_llq2buffer_str(output, data, size); + break; + case LDNS_EDNS_UL: + ldns_edns_ul2buffer_str(output, data, size); + break; + case LDNS_EDNS_NSID: + ldns_edns_nsid2buffer_str(output, data, size); + break; + case LDNS_EDNS_DAU: + ldns_edns_dau2buffer_str(output, data, size); + break; + case LDNS_EDNS_DHU: + ldns_edns_dhu2buffer_str(output, data, size); + break; + case LDNS_EDNS_N3U: + ldns_edns_d3u2buffer_str(output, data, size); + break; + case LDNS_EDNS_CLIENT_SUBNET: + ldns_edns_subnet2buffer_str(output, data, size); + break; + case LDNS_EDNS_KEEPALIVE: + ldns_edns_keepalive2buffer_str(output, data, size); + break; + case LDNS_EDNS_PADDING: + ldns_edns_padding2buffer_str(output, data, size); + break; + case LDNS_EDNS_EDE: + ldns_edns_ede2buffer_str(output, data, size); + break; + case LDNS_EDNS_CLIENT_TAG: + ldns_edns_client_tag2buffer_str(output, data, size); + break; + default: + ldns_buffer_printf(output, "; OPT=%d:", code); + ldns_edns_hex_data2buffer_str(output, data, size); + break; + } + } + + return ldns_buffer_status(output); } @@ -2383,7 +2671,7 @@ ldns_pkt2buffer_str_fmt(ldns_buffer *output, * and add them to the list */ edns_list = ldns_pkt_edns_option_list(pkt); - ldns_edns_option_list2buffer_str(output, edns_list); + ldns_edns_list2buffer_str(output, edns_list); // (void)ldns_rdf2buffer_str(output, From c6f6a3a1a9afda76fcaafe83a0588d6408ffb5c2 Mon Sep 17 00:00:00 2001 From: tcarpay <8014108+TCY16@users.noreply.github.com> Date: Tue, 5 Apr 2022 11:33:13 +0200 Subject: [PATCH 27/83] Apply suggestions from @wtoorop's code review Co-authored-by: Willem Toorop --- edns.c | 17 ++++++----------- host2str.c | 2 -- ldns/edns.h | 17 ++++++++++++----- ldns/packet.h | 2 +- packet.c | 37 +++++++++++++++++++++++-------------- wire2host.c | 4 ++-- 6 files changed, 44 insertions(+), 35 deletions(-) diff --git a/edns.c b/edns.c index 099ea232..2771ce0e 100644 --- a/edns.c +++ b/edns.c @@ -126,7 +126,7 @@ ldns_edns_option_list_deep_free(ldns_edns_option_list *options_list) if (options_list) { for (i=0; i < ldns_edns_option_list_get_count(options_list); i++) { - ldns_edns_free(ldns_edns_option_list_get_option(options_list, i)); + ldns_edns_deep_free(ldns_edns_option_list_get_option(options_list, i)); } ldns_edns_option_list_free(options_list); } @@ -218,25 +218,20 @@ ldns_edns_option_list_pop(ldns_edns_option_list *options_list) count = ldns_edns_option_list_get_count(options_list); - /* get the last option from the list */ - pop = ldns_edns_option_list_get_option(options_list, count-1); - - if (count <= 0){ + if (count == 0){ return NULL; } + /* get the last option from the list */ + pop = ldns_edns_option_list_get_option(options_list, count-1); // @TODO rethink reallocing per pop /* shrink the array */ new_list = LDNS_XREALLOC(options_list->_options, ldns_edns_option *, count -1); - if (new_list == NULL){ - return NULL; - // @TODO not sure about returning NULL here, as ldns_rr_list_pop_rr - // just skips the failure + if (new_list){ + options_list->_options = new_list; } - options_list->_options = new_list; - ldns_edns_option_list_set_count(options_list, count - 1); return pop; diff --git a/host2str.c b/host2str.c index e0b9cfa3..91df9f68 100644 --- a/host2str.c +++ b/host2str.c @@ -2661,8 +2661,6 @@ ldns_pkt2buffer_str_fmt(ldns_buffer *output, ldns_buffer_printf(output, " ; udp: %u\n", ldns_pkt_edns_udp_size(pkt)); - // @TODO make old output configurable? - if (ldns_pkt_edns_data(pkt)) { ldns_edns_option_list* edns_list; // ldns_buffer_printf(output, ";; Data: "); diff --git a/ldns/edns.h b/ldns/edns.h index 5fbd9f49..94fd60db 100644 --- a/ldns/edns.h +++ b/ldns/edns.h @@ -25,7 +25,7 @@ extern "C" { */ enum ldns_enum_edns_option { - LDNS_EDNS_LLQ = 1, /* http://files.dns-sd.org/draft-sekar-dns-llq.txt */ + LDNS_EDNS_LLQ = 1, /* RFC8764 */ LDNS_EDNS_UL = 2, /* http://files.dns-sd.org/draft-sekar-dns-ul.txt */ LDNS_EDNS_NSID = 3, /* RFC5001 */ /* 4 draft-cheshire-edns0-owner-option */ @@ -33,10 +33,15 @@ enum ldns_enum_edns_option LDNS_EDNS_DHU = 6, /* RFC6975 */ LDNS_EDNS_N3U = 7, /* RFC6975 */ LDNS_EDNS_CLIENT_SUBNET = 8, /* RFC7871 */ - LDNS_EDNS_KEEPALIVE = 11, /* draft-ietf-dnsop-edns-tcp-keepalive*/ + LDNS_EDNS_EXPIRE = 9, /* RFC7314 */ + LDNS_EDNS_COOKIE = 10, /* RFC7873 */ + LDNS_EDNS_KEEPALIVE = 11, /* RFC7828*/ LDNS_EDNS_PADDING = 12, /* RFC7830 */ + LDNS_EDNS_CHAIN = 13, /* RFC7901 */ + LDNS_EDNS_KEY_TAG = 14, /* RFC8145 */ LDNS_EDNS_EDE = 15, /* RFC8914 */ LDNS_EDNS_CLIENT_TAG = 16 /* draft-bellis-dnsop-edns-tags-01 */ + LDNS_EDNS_SERVER_TAG = 17 /* draft-bellis-dnsop-edns-tags-01 */ }; typedef enum ldns_enum_edns_option ldns_edns_option_code; @@ -69,7 +74,9 @@ enum ldns_edns_enum_ede_code LDNS_EDE_NOT_SUPPORTED = 21, LDNS_EDE_NO_REACHABLE_AUTHORITY = 22, LDNS_EDE_NETWORK_ERROR = 23, - LDNS_EDE_INVALID_DATA = 24 + LDNS_EDE_INVALID_DATA = 24, + LDNS_EDE_SIGNATURE_EXPIRED_BEFORE_VALID = 25, + LDNS_EDE_TOO_EARLY = 26 }; typedef enum ldns_edns_enum_ede_code ldns_edns_ede_code; @@ -118,7 +125,7 @@ typedef struct ldns_struct_edns_option_list ldns_edns_option_list; size_t ldns_edns_get_size(const ldns_edns_option *edns); /** - * returns the size of the EDNS data. + * returns the option code of the EDNS data. * \param[in] *edns the EDNS struct to read from * \return uint16_t with the size */ @@ -139,7 +146,7 @@ uint8_t *ldns_edns_get_data(const ldns_edns_option *edns); * This function DOES NOT copy the contents from the buffer * \param[in] code the EDNS code * \param[in] size size of the buffer - * \param[in] data pointer to the buffer to be copied + * \param[in] data pointer to the buffer to be assigned * \return the new EDNS structure or NULL on failure */ ldns_edns_option *ldns_edns_new(ldns_edns_option_code code, size_t size, void *data); diff --git a/ldns/packet.h b/ldns/packet.h index f6ca360c..5bb0df50 100644 --- a/ldns/packet.h +++ b/ldns/packet.h @@ -732,7 +732,7 @@ bool ldns_pkt_edns(const ldns_pkt *packet); /** * Returns a list of structured EDNS options * - * \param[in] packet the packet which contains the parsed EDNS data + * \param[in] packet the packet which contains the EDNS data * \return list of ldns_edns_option structs */ ldns_edns_option_list* ldns_pkt_edns_option_list(const ldns_pkt *packet); diff --git a/packet.c b/packet.c index 27e711b7..9dc32815 100644 --- a/packet.c +++ b/packet.c @@ -753,10 +753,14 @@ ldns_pkt_edns_option_list(const ldns_pkt *packet) { size_t pos = 0; ldns_edns_option_list* edns_list; - size_t max = ldns_rdf_size(ldns_pkt_edns_data(packet)); // @TODO is this ugly? - const uint8_t* wire = ldns_rdf_data(ldns_pkt_edns_data(packet)); // @TODO is this ugly? - + size_t max; + const uint8_t* wire; + if (!ldns_pkt_edns_data(packet)) + return NULL; + + max = ldns_rdf_size(ldns_pkt_edns_data(packet)); + wire = ldns_rdf_data(ldns_pkt_edns_data(packet)); // @TODO do checks so we don't read into un-auth memory (max !< 4) @@ -768,28 +772,33 @@ ldns_pkt_edns_option_list(const ldns_pkt *packet) while (pos < max) { ldns_edns_option* edns; uint8_t *data; + if (pos + 4 > max) { + ldns_edns_option_list_deep_free(edns_list); + return NULL; + } ldns_edns_option_code code = ldns_read_uint16(&wire[pos]); size_t size = ldns_read_uint16(&wire[pos+2]); pos += 4; - + if (pos + size > max) { + ldns_edns_option_list_deep_free(edns_list); + return NULL; + } data = LDNS_XMALLOC(uint8_t, size); - // @TODO think about commented-out code - // if (!data) { - // status = LDNS_STATUS_MEM_ERR; - // goto status_error; - // printf("HERE: DATA == NULL\n"); - // } + if (!data) { + ldns_edns_option_list_deep_free(edns_list); + return NULL; + } memcpy(data, &wire[pos], size); pos += size; edns = ldns_edns_new(code, size, data); - if (edns != NULL) { - ldns_edns_option_list_push(edns_list, edns); + if (!edns) { + ldns_edns_option_list_deep_free(edns_list); + return NULL; } - - // @TODO what do we do in case of edns == NULL? + ldns_edns_option_list_push(edns_list, edns); } diff --git a/wire2host.c b/wire2host.c index 77f6cbf2..63b67a0d 100644 --- a/wire2host.c +++ b/wire2host.c @@ -185,7 +185,7 @@ ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos) end = *pos + (size_t) rd_length; rdf_index = 0; - while (*pos < end && + while (*pos < end && rdf_index < ldns_rr_descriptor_maximum(descriptor)) { cur_rdf_length = 0; @@ -468,7 +468,7 @@ ldns_wire2pkt(ldns_pkt **packet_p, const uint8_t *wire, size_t max) ldns_pkt_set_edns_version(packet, data[1]); ldns_pkt_set_edns_z(packet, ldns_read_uint16(&data[2])); /* edns might not have rdfs */ - if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_OPT) { + if (ldns_rr_rdf(rr, 0)) { ldns_rdf_deep_free(ldns_pkt_edns_data(packet)); ldns_pkt_set_edns_data(packet, ldns_rdf_clone(ldns_rr_rdf(rr, 0))); } From e99e263ed37ceca61ffe179d31fbf34ee606b1e6 Mon Sep 17 00:00:00 2001 From: TCY16 Date: Fri, 8 Apr 2022 13:06:46 +0200 Subject: [PATCH 28/83] reformat spaces to tabs --- edns.c | 259 ++++++++++++++++++++++++++++------------------------ ldns/edns.h | 138 +++++++++++++++------------- 2 files changed, 214 insertions(+), 183 deletions(-) diff --git a/edns.c b/edns.c index 2771ce0e..1d786b6c 100644 --- a/edns.c +++ b/edns.c @@ -21,219 +21,242 @@ size_t ldns_edns_get_size(const ldns_edns_option *edns) { - assert(edns != NULL); - return edns->_size; + assert(edns != NULL); + return edns->_size; } ldns_edns_option_code ldns_edns_get_code(const ldns_edns_option *edns) { - assert(edns != NULL); - return edns->_code; + assert(edns != NULL); + return edns->_code; } uint8_t * ldns_edns_get_data(const ldns_edns_option *edns) { - assert(edns != NULL); - return edns->_data; + assert(edns != NULL); + return edns->_data; } - /* write */ void ldns_edns_set_size(ldns_edns_option *edns, size_t size) { - assert(edns != NULL); - edns->_size = size; + assert(edns != NULL); + edns->_size = size; } void ldns_edns_set_code(ldns_edns_option *edns, ldns_edns_option_code code) { - assert(edns != NULL); - edns->_code = code; + assert(edns != NULL); + edns->_code = code; } void ldns_edns_set_data(ldns_edns_option *edns, void *data) { - /* only copy the pointer */ - assert(edns != NULL); - edns->_data = data; + /* only copy the pointer */ + assert(edns != NULL); + edns->_data = data; } /* note: data must be allocated memory */ ldns_edns_option * ldns_edns_new(ldns_edns_option_code code, size_t size, void *data) { - ldns_edns_option *edns; - edns = LDNS_MALLOC(ldns_edns_option); - if (!edns) { - return NULL; - } - ldns_edns_set_size(edns, size); - ldns_edns_set_code(edns, code); - ldns_edns_set_data(edns, data); - return edns; + ldns_edns_option *edns; + edns = LDNS_MALLOC(ldns_edns_option); + if (!edns) { + return NULL; + } + ldns_edns_set_size(edns, size); + ldns_edns_set_code(edns, code); + ldns_edns_set_data(edns, data); + return edns; } void ldns_edns_deep_free(ldns_edns_option *edns) { - if (edns) { - if (edns->_data) { - LDNS_FREE(edns->_data); - } - LDNS_FREE(edns); - } + if (edns) { + if (edns->_data) { + LDNS_FREE(edns->_data); + } + LDNS_FREE(edns); + } } void ldns_edns_free(ldns_edns_option *edns) { - if (edns) { - LDNS_FREE(edns); - } + if (edns) { + LDNS_FREE(edns); + } } ldns_edns_option_list* ldns_edns_option_list_new() { - ldns_edns_option_list *options_list = LDNS_MALLOC(ldns_edns_option_list); - if(!options_list) { - return NULL; - } - - options_list->_option_count = 0; - options_list->_options = NULL; - return options_list; + ldns_edns_option_list *option_list = LDNS_MALLOC(ldns_edns_option_list); + if(!option_list) { + return NULL; + } + + option_list->_option_count = 0; + option_list->_options_size = 0; + option_list->_options = NULL; + return option_list; } void -ldns_edns_option_list_free(ldns_edns_option_list *options_list) +ldns_edns_option_list_free(ldns_edns_option_list *option_list) { - if (options_list) { - LDNS_FREE(options_list->_options); - LDNS_FREE(options_list); - } + if (option_list) { + LDNS_FREE(option_list->_options); + LDNS_FREE(option_list); + } } void -ldns_edns_option_list_deep_free(ldns_edns_option_list *options_list) +ldns_edns_option_list_deep_free(ldns_edns_option_list *option_list) { - size_t i; - - if (options_list) { - for (i=0; i < ldns_edns_option_list_get_count(options_list); i++) { - ldns_edns_deep_free(ldns_edns_option_list_get_option(options_list, i)); - } - ldns_edns_option_list_free(options_list); - } + size_t i; + + if (option_list) { + for (i=0; i < ldns_edns_option_list_get_count(option_list); i++) { + ldns_edns_deep_free(ldns_edns_option_list_get_option(option_list, i)); + } + ldns_edns_option_list_free(option_list); + } } size_t -ldns_edns_option_list_get_count(const ldns_edns_option_list *options_list) +ldns_edns_option_list_get_count(const ldns_edns_option_list *option_list) { - if (options_list) { - return options_list->_option_count; - } else { - return 0; - } + if (option_list) { + return option_list->_option_count; + } else { + return 0; + } } void -ldns_edns_option_list_set_count(ldns_edns_option_list *options_list, size_t count) +ldns_edns_option_list_set_count(ldns_edns_option_list *option_list, size_t count) { - assert(options_list); // @TODO does this check need to check more? - options_list->_option_count = count; + assert(option_list); // @TODO does this check need to check more? + option_list->_option_count = count; } ldns_edns_option * -ldns_edns_option_list_get_option(const ldns_edns_option_list *options_list, size_t index) +ldns_edns_option_list_get_option(const ldns_edns_option_list *option_list, size_t index) { - if (index < ldns_edns_option_list_get_count(options_list)) { - return options_list->_options[index]; - } else { - return NULL; - } + if (option_list && index < ldns_edns_option_list_get_count(option_list)) { + return option_list->_options[index]; + } else { + return NULL; + } } +size_t +ldns_edns_option_list_get_options_size(const ldns_edns_option_list *option_list) +{ + if (option_list) { + return option_list->_options_size; + } else { + return 0; + } +} + + ldns_edns_option * -ldns_edns_option_list_set_option(ldns_edns_option_list *options_list, - const ldns_edns_option *option, size_t index) +ldns_edns_option_list_set_option(ldns_edns_option_list *option_list, + const ldns_edns_option *option, size_t index) { - ldns_edns_option* old; + ldns_edns_option* old; + + assert(option_list != NULL); - assert(options_list != NULL); + if (index < ldns_edns_option_list_get_count(option_list)) { + return NULL; + } - if (index < ldns_edns_option_list_get_count(options_list)) { - return NULL; - } + if (option == NULL) { + return NULL; + } - if (option == NULL) { - return NULL; - } + old = ldns_edns_option_list_get_option(option_list, index); - old = ldns_edns_option_list_get_option(options_list, index); + /* shrink the total EDNS size if the old EDNS option exists */ + if (old != NULL) { + option_list->_options_size -= (ldns_edns_get_size(old) + 4); + } - /* overwrite the pointer of "old" */ - options_list->_options[index] = (ldns_edns_option*)option; - return old; + option_list->_options_size += (ldns_edns_get_size(option) + 4); + + /* overwrite the pointer of "old" */ + option_list->_options[index] = (ldns_edns_option*)option; + return old; } bool -ldns_edns_option_list_push(ldns_edns_option_list *options_list, - const ldns_edns_option *option) +ldns_edns_option_list_push(ldns_edns_option_list *option_list, + const ldns_edns_option *option) { - assert(options_list != NULL); + assert(option_list != NULL); - if (option != NULL) { + if (option != NULL) { - // @TODO rethink reallocing per push + // @TODO rethink reallocing per push - options_list->_options = LDNS_XREALLOC(options_list->_options, ldns_edns_option *, - options_list->_option_count + 1); - if (!options_list) { - return false; - } - ldns_edns_option_list_set_option(options_list, option, - options_list->_option_count); - options_list->_option_count += 1; + option_list->_options = LDNS_XREALLOC(option_list->_options, + ldns_edns_option *, option_list->_option_count + 1); + if (!option_list) { + return false; + } + ldns_edns_option_list_set_option(option_list, option, + option_list->_option_count); + option_list->_option_count += 1; - return true; - } - return false; + return true; + } + return false; } ldns_edns_option * -ldns_edns_option_list_pop(ldns_edns_option_list *options_list) +ldns_edns_option_list_pop(ldns_edns_option_list *option_list) { - ldns_edns_option ** new_list; - ldns_edns_option* pop; - size_t count; + ldns_edns_option ** new_list; + ldns_edns_option* pop; + size_t count; + + assert(option_list != NULL); - assert(options_list != NULL); + count = ldns_edns_option_list_get_count(option_list); - count = ldns_edns_option_list_get_count(options_list); + if (count == 0){ + return NULL; + } + /* get the last option from the list */ + pop = ldns_edns_option_list_get_option(option_list, count-1); - if (count == 0){ - return NULL; - } - /* get the last option from the list */ - pop = ldns_edns_option_list_get_option(options_list, count-1); + // @TODO rethink reallocing per pop - // @TODO rethink reallocing per pop + /* shrink the array */ + new_list = LDNS_XREALLOC(option_list->_options, ldns_edns_option *, count -1); + if (new_list){ + option_list->_options = new_list; + } - /* shrink the array */ - new_list = LDNS_XREALLOC(options_list->_options, ldns_edns_option *, count -1); - if (new_list){ - options_list->_options = new_list; - } + /* shrink the total EDNS size if the popped EDNS option exists */ + if (pop != NULL) { + option_list->_options_size -= (ldns_edns_get_size(pop) + 4); + } - ldns_edns_option_list_set_count(options_list, count - 1); + ldns_edns_option_list_set_count(option_list, count - 1); - return pop; + return pop; } diff --git a/ldns/edns.h b/ldns/edns.h index 94fd60db..c6c2ebb1 100644 --- a/ldns/edns.h +++ b/ldns/edns.h @@ -25,23 +25,23 @@ extern "C" { */ enum ldns_enum_edns_option { - LDNS_EDNS_LLQ = 1, /* RFC8764 */ - LDNS_EDNS_UL = 2, /* http://files.dns-sd.org/draft-sekar-dns-ul.txt */ - LDNS_EDNS_NSID = 3, /* RFC5001 */ - /* 4 draft-cheshire-edns0-owner-option */ - LDNS_EDNS_DAU = 5, /* RFC6975 */ - LDNS_EDNS_DHU = 6, /* RFC6975 */ - LDNS_EDNS_N3U = 7, /* RFC6975 */ - LDNS_EDNS_CLIENT_SUBNET = 8, /* RFC7871 */ - LDNS_EDNS_EXPIRE = 9, /* RFC7314 */ - LDNS_EDNS_COOKIE = 10, /* RFC7873 */ - LDNS_EDNS_KEEPALIVE = 11, /* RFC7828*/ - LDNS_EDNS_PADDING = 12, /* RFC7830 */ - LDNS_EDNS_CHAIN = 13, /* RFC7901 */ - LDNS_EDNS_KEY_TAG = 14, /* RFC8145 */ - LDNS_EDNS_EDE = 15, /* RFC8914 */ - LDNS_EDNS_CLIENT_TAG = 16 /* draft-bellis-dnsop-edns-tags-01 */ - LDNS_EDNS_SERVER_TAG = 17 /* draft-bellis-dnsop-edns-tags-01 */ + LDNS_EDNS_LLQ = 1, /* RFC8764 */ + LDNS_EDNS_UL = 2, /* http://files.dns-sd.org/draft-sekar-dns-ul.txt */ + LDNS_EDNS_NSID = 3, /* RFC5001 */ + /* 4 draft-cheshire-edns0-owner-option */ + LDNS_EDNS_DAU = 5, /* RFC6975 */ + LDNS_EDNS_DHU = 6, /* RFC6975 */ + LDNS_EDNS_N3U = 7, /* RFC6975 */ + LDNS_EDNS_CLIENT_SUBNET = 8, /* RFC7871 */ + LDNS_EDNS_EXPIRE = 9, /* RFC7314 */ + LDNS_EDNS_COOKIE = 10, /* RFC7873 */ + LDNS_EDNS_KEEPALIVE = 11, /* RFC7828*/ + LDNS_EDNS_PADDING = 12, /* RFC7830 */ + LDNS_EDNS_CHAIN = 13, /* RFC7901 */ + LDNS_EDNS_KEY_TAG = 14, /* RFC8145 */ + LDNS_EDNS_EDE = 15, /* RFC8914 */ + LDNS_EDNS_CLIENT_TAG = 16, /* draft-bellis-dnsop-edns-tags-01 */ + LDNS_EDNS_SERVER_TAG = 17 /* draft-bellis-dnsop-edns-tags-01 */ }; typedef enum ldns_enum_edns_option ldns_edns_option_code; @@ -50,54 +50,54 @@ typedef enum ldns_enum_edns_option ldns_edns_option_code; */ enum ldns_edns_enum_ede_code { - LDNS_EDE_OTHER = 0, - LDNS_EDE_UNSUPPORTED_DNSKEY_ALG = 1, - LDNS_EDE_UNSUPPORTED_DS_DIGEST = 2, - LDNS_EDE_STALE_ANSWER = 3, - LDNS_EDE_FORGED_ANSWER = 4, - LDNS_EDE_DNSSEC_INDETERMINATE = 5, - LDNS_EDE_DNSSEC_BOGUS = 6, - LDNS_EDE_SIGNATURE_EXPIRED = 7, - LDNS_EDE_SIGNATURE_NOT_YET_VALID = 8, - LDNS_EDE_DNSKEY_MISSING = 9, - LDNS_EDE_RRSIGS_MISSING = 10, - LDNS_EDE_NO_ZONE_KEY_BIT_SET = 11, - LDNS_EDE_NSEC_MISSING = 12, - LDNS_EDE_CACHED_ERROR = 13, - LDNS_EDE_NOT_READY = 14, - LDNS_EDE_BLOCKED = 15, - LDNS_EDE_CENSORED = 16, - LDNS_EDE_FILTERED = 17, - LDNS_EDE_PROHIBITED = 18, - LDNS_EDE_STALE_NXDOMAIN_ANSWER = 19, - LDNS_EDE_NOT_AUTHORITATIVE = 20, - LDNS_EDE_NOT_SUPPORTED = 21, - LDNS_EDE_NO_REACHABLE_AUTHORITY = 22, - LDNS_EDE_NETWORK_ERROR = 23, - LDNS_EDE_INVALID_DATA = 24, - LDNS_EDE_SIGNATURE_EXPIRED_BEFORE_VALID = 25, - LDNS_EDE_TOO_EARLY = 26 + LDNS_EDE_OTHER = 0, + LDNS_EDE_UNSUPPORTED_DNSKEY_ALG = 1, + LDNS_EDE_UNSUPPORTED_DS_DIGEST = 2, + LDNS_EDE_STALE_ANSWER = 3, + LDNS_EDE_FORGED_ANSWER = 4, + LDNS_EDE_DNSSEC_INDETERMINATE = 5, + LDNS_EDE_DNSSEC_BOGUS = 6, + LDNS_EDE_SIGNATURE_EXPIRED = 7, + LDNS_EDE_SIGNATURE_NOT_YET_VALID = 8, + LDNS_EDE_DNSKEY_MISSING = 9, + LDNS_EDE_RRSIGS_MISSING = 10, + LDNS_EDE_NO_ZONE_KEY_BIT_SET = 11, + LDNS_EDE_NSEC_MISSING = 12, + LDNS_EDE_CACHED_ERROR = 13, + LDNS_EDE_NOT_READY = 14, + LDNS_EDE_BLOCKED = 15, + LDNS_EDE_CENSORED = 16, + LDNS_EDE_FILTERED = 17, + LDNS_EDE_PROHIBITED = 18, + LDNS_EDE_STALE_NXDOMAIN_ANSWER = 19, + LDNS_EDE_NOT_AUTHORITATIVE = 20, + LDNS_EDE_NOT_SUPPORTED = 21, + LDNS_EDE_NO_REACHABLE_AUTHORITY = 22, + LDNS_EDE_NETWORK_ERROR = 23, + LDNS_EDE_INVALID_DATA = 24, + LDNS_EDE_SIGNATURE_EXPIRED_BEFORE_VALID = 25, + LDNS_EDE_TOO_EARLY = 26 }; typedef enum ldns_edns_enum_ede_code ldns_edns_ede_code; /** * The struct that stores an ordered EDNS option. * An EDNS option is structed as follows: - +0 (MSB) +1 (LSB) - +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - 0: | OPTION-CODE | - +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - 2: | OPTION-LENGTH | - +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - 4: | | - / OPTION-DATA / - / / - +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + +0 (MSB) +1 (LSB) + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + 0: | OPTION-CODE | + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + 2: | OPTION-LENGTH | + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + 4: | | + / OPTION-DATA / + / / + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ */ struct ldns_struct_edns_option { - ldns_edns_option_code _code; - size_t _size; - void *_data; + ldns_edns_option_code _code; + size_t _size; + void *_data; }; typedef struct ldns_struct_edns_option ldns_edns_option; @@ -107,8 +107,9 @@ typedef struct ldns_struct_edns_option ldns_edns_option; */ struct ldns_struct_edns_option_list { - size_t _option_count; - ldns_edns_option **_options; + size_t _option_count; + size_t _options_size; /* the total size of the options in the list*/ + ldns_edns_option **_options; }; typedef struct ldns_struct_edns_option_list ldns_edns_option_list; @@ -138,7 +139,6 @@ ldns_edns_option_code ldns_edns_get_code(const ldns_edns_option *edns); */ uint8_t *ldns_edns_get_data(const ldns_edns_option *edns); - /* Constructors and destructors*/ /** @@ -161,7 +161,7 @@ void ldns_edns_free(ldns_edns_option *edns); */ ldns_edns_option_list* ldns_edns_option_list_new(void); void ldns_edns_option_list_free(ldns_edns_option_list *options_list); -void ldns_edns_list_deep_free(ldns_edns_option_list *options_list); +void ldns_edns_option_list_deep_free(ldns_edns_option_list *options_list); /* edns_option_list functions */ @@ -183,10 +183,18 @@ void ldns_edns_option_list_set_count(ldns_edns_option_list *options_list, size_t * returns the EDNS option as the specified index in the list of EDNS options. * \param[in] options_list the EDNS options_list to read from * \param[in] index the location of the EDNS option to get in the list - * \return the EDNS option located at the index + * \return the EDNS option located at the index or NULL on failure */ ldns_edns_option* ldns_edns_option_list_get_option(const ldns_edns_option_list *options_list, - size_t index); + size_t index); + + +/** + * returns the total size of all the individual EDNS options in the EDNS list. + * \param[in] options_list the EDNS options_list to read from + * \return the total size of the options combined + */ +size_t ldns_edns_option_list_get_options_size(const ldns_edns_option_list *options_list); /** * adds an EDNS option to the list of options at the specified index. Also @@ -196,7 +204,7 @@ ldns_edns_option* ldns_edns_option_list_get_option(const ldns_edns_option_list * * \return the EDNS option previously located at the index */ ldns_edns_option * ldns_edns_option_list_set_option(ldns_edns_option_list *options_list, - const ldns_edns_option *option, size_t index); + const ldns_edns_option *option, size_t index); /** * adds an EDNS option at the end of the list of options. @@ -205,7 +213,7 @@ ldns_edns_option * ldns_edns_option_list_set_option(ldns_edns_option_list *optio * \return true on success and false of failure */ bool ldns_edns_option_list_push(ldns_edns_option_list *options_list, - const ldns_edns_option *option); + const ldns_edns_option *option); /** * removes and returns the EDNS option at the end of the list of options. From ac477de2b950f79c9d2b4c18665e8b7d6c755ce4 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Tue, 12 Apr 2022 10:41:15 +0200 Subject: [PATCH 29/83] Fixes #170 Update reference to issues Thanks Mats Dufberg --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 5fb1f858..98575917 100644 --- a/README +++ b/README @@ -97,7 +97,7 @@ contrib/build-solaris.sh KNOWN ISSUES A complete list of currently known open issues can be found here: -http://www.nlnetlabs.nl/projects/ldns/bugs +https://github.com/NLnetLabs/ldns/issues * pyldns Compiling pyldns produces many ``unused parameter'' warnings. Those are From 367dc0dee80689406c6228ecb01ab22ab4f633a1 Mon Sep 17 00:00:00 2001 From: TCY16 Date: Tue, 12 Apr 2022 11:05:40 +0200 Subject: [PATCH 30/83] add printing out of missing EDNS options --- host2str.c | 164 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 146 insertions(+), 18 deletions(-) diff --git a/host2str.c b/host2str.c index 91df9f68..82c024dc 100644 --- a/host2str.c +++ b/host2str.c @@ -2230,7 +2230,7 @@ ldns_edns_dau2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) size_t i; ldns_lookup_table *lt; - ldns_buffer_printf(output, "; DAU:"); + ldns_buffer_printf(output, "; DNSSEC Algorithm Understood (DAU):"); for(i = 0; i = 16 && len < 40))) { + ldns_buffer_printf(output, "malformed cookie "); + ldns_edns_hex_data2buffer_str(output, data, len); + } + ldns_edns_hex_data2buffer_str(output, data, len); + + return ldns_buffer_status(output); +} + static ldns_status ldns_edns_keepalive2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) { @@ -2374,6 +2409,48 @@ ldns_edns_padding2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) return ldns_buffer_status(output); } +static ldns_status +ldns_edns_chain2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) +{ + ldns_rdf** temp = NULL; + + ldns_buffer_printf(output, "; CHAIN: "); + + if (ldns_str2rdf_dname(temp, (char*) data) != LDNS_STATUS_OK) { + ldns_buffer_printf(output, "malformed chain "); + ldns_edns_hex_data2buffer_str(output, data, len); + + return ldns_buffer_status(output); + } + + ldns_characters2buffer_str(output, len, data); + + return ldns_buffer_status(output); +} + +static ldns_status +ldns_edns_key_tag2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) +{ + size_t i; + + ldns_buffer_printf(output, "; KEY TAG: "); + + if(len < 2 || len % 2 != 0) { + ldns_buffer_printf(output, "malformed key tag "); + ldns_edns_hex_data2buffer_str(output, data, len); + + return ldns_buffer_status(output); + } + + for (i = 0; i < len; i += 2) { + uint16_t tag = ldns_read_uint16(data); + + ldns_buffer_printf(output, " %hu", tag); + } + + return ldns_buffer_status(output); +} + static ldns_status ldns_edns_ede2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) { @@ -2388,15 +2465,14 @@ ldns_edns_ede2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) return ldns_buffer_status(output); } - /* currently all EDE options fit into one byte, so skip the first */ - ede = data[1]; + ede = ldns_read_uint16(data); switch (ede) { case LDNS_EDE_OTHER: ldns_buffer_printf(output, " 0 (Other): "); break; case LDNS_EDE_UNSUPPORTED_DNSKEY_ALG: - ldns_buffer_printf(output, "1 (Unsupported DNSKEY Algorithm)"); + ldns_buffer_printf(output, " 1 (Unsupported DNSKEY Algorithm)"); break; case LDNS_EDE_UNSUPPORTED_DS_DIGEST: ldns_buffer_printf(output, " 2 (Unsupported DS Digest type)"); @@ -2467,6 +2543,12 @@ ldns_edns_ede2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) case LDNS_EDE_INVALID_DATA: ldns_buffer_printf(output, " 24 (Invalid Data)"); break; + case LDNS_EDE_SIGNATURE_EXPIRED_BEFORE_VALID: + ldns_buffer_printf(output, " 25 (Signature Expired Before Valid)"); + break; + case LDNS_EDE_TOO_EARLY: + ldns_buffer_printf(output, " 26 (Too Early)"); + break; default: ldns_buffer_printf(output, " %02x", data[0]); ldns_buffer_printf(output, " %02x:", data[1]); @@ -2487,7 +2569,7 @@ ldns_edns_ede2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) /* format the human-readable string */ ldns_buffer_printf(output, " ("); ldns_characters2buffer_str(output, len, data); - ldns_buffer_printf(output, ")\n"); + ldns_buffer_printf(output, ")"); } return ldns_buffer_status(output); @@ -2497,13 +2579,38 @@ static ldns_status ldns_edns_client_tag2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) { ldns_buffer_printf(output, "; CLIENT-TAG:"); + + if (len > 2) { + ldns_buffer_printf(output, "malformed client-tag "); + ldns_edns_hex_data2buffer_str(output, data, len); + + return ldns_buffer_status(output); + } + + ldns_edns_hex_data2buffer_str(output, data, len); + + return ldns_buffer_status(output); +} + +static ldns_status +ldns_edns_server_tag2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) +{ + ldns_buffer_printf(output, "; SERVER-TAG:"); + + if (len > 2) { + ldns_buffer_printf(output, "malformed server-tag "); + ldns_edns_hex_data2buffer_str(output, data, len); + + return ldns_buffer_status(output); + } + ldns_edns_hex_data2buffer_str(output, data, len); return ldns_buffer_status(output); } static ldns_status //@TODO change static? -ldns_edns_list2buffer_str(ldns_buffer *output, ldns_edns_option_list* edns_list) +ldns_edns_option_list2buffer_str(ldns_buffer *output, ldns_edns_option_list* edns_list) { size_t count = ldns_edns_option_list_get_count(edns_list); size_t i, size; @@ -2515,6 +2622,10 @@ ldns_edns_list2buffer_str(ldns_buffer *output, ldns_edns_option_list* edns_list) ldns_edns_option_code code; ldns_edns_option* edns = ldns_edns_option_list_get_option(edns_list, i); + if (!edns) { + break; + } + code = ldns_edns_get_code(edns); size = ldns_edns_get_size(edns); data = ldns_edns_get_data(edns); @@ -2541,23 +2652,39 @@ ldns_edns_list2buffer_str(ldns_buffer *output, ldns_edns_option_list* edns_list) case LDNS_EDNS_CLIENT_SUBNET: ldns_edns_subnet2buffer_str(output, data, size); break; + case LDNS_EDNS_EXPIRE: + ldns_edns_expire2buffer_str(output, data, size); + break; + case LDNS_EDNS_COOKIE: + ldns_edns_cookie2buffer_str(output, data, size); + break; case LDNS_EDNS_KEEPALIVE: ldns_edns_keepalive2buffer_str(output, data, size); break; case LDNS_EDNS_PADDING: ldns_edns_padding2buffer_str(output, data, size); break; + case LDNS_EDNS_CHAIN: + ldns_edns_chain2buffer_str(output, data, size); + break; + case LDNS_EDNS_KEY_TAG: + ldns_edns_key_tag2buffer_str(output, data, size); + break; case LDNS_EDNS_EDE: ldns_edns_ede2buffer_str(output, data, size); break; case LDNS_EDNS_CLIENT_TAG: ldns_edns_client_tag2buffer_str(output, data, size); break; + case LDNS_EDNS_SERVER_TAG: + ldns_edns_server_tag2buffer_str(output, data, size); + break; default: ldns_buffer_printf(output, "; OPT=%d:", code); ldns_edns_hex_data2buffer_str(output, data, size); break; } + ldns_buffer_printf(output, "\n"); } return ldns_buffer_status(output); @@ -2663,18 +2790,19 @@ ldns_pkt2buffer_str_fmt(ldns_buffer *output, if (ldns_pkt_edns_data(pkt)) { ldns_edns_option_list* edns_list; - // ldns_buffer_printf(output, ";; Data: "); - /* parse the EDNS data into separate EDNS options * and add them to the list */ - edns_list = ldns_pkt_edns_option_list(pkt); - - ldns_edns_list2buffer_str(output, edns_list); - - - // (void)ldns_rdf2buffer_str(output, - // ldns_pkt_edns_data(pkt)); - ldns_buffer_printf(output, "\n"); + if ((edns_list = ldns_pkt_edns_get_option_list(pkt))) { + ldns_edns_option_list2buffer_str(output, edns_list); + /* TODO: We need to free for now, but maybe we + * should do this differently eventually + * use a member in pkt or something... + */ + ldns_edns_option_list_deep_free(edns_list); + } else { + ldns_buffer_printf(output, ";; Data: "); + (void)ldns_rdf2buffer_str(output, ldns_pkt_edns_data(pkt)); + } } } if (ldns_pkt_tsig(pkt)) { From fa36106918d11843d0ccb8f9a798bd3d5d40784c Mon Sep 17 00:00:00 2001 From: TCY16 Date: Tue, 12 Apr 2022 11:10:49 +0200 Subject: [PATCH 31/83] add serializing functions for single edns options and option lists --- edns.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++---- ldns/edns.h | 30 ++++++++++++--- 2 files changed, 125 insertions(+), 13 deletions(-) diff --git a/edns.c b/edns.c index 1d786b6c..f6a8a797 100644 --- a/edns.c +++ b/edns.c @@ -39,6 +39,37 @@ ldns_edns_get_data(const ldns_edns_option *edns) return edns->_data; } +ldns_buffer * +ldns_edns_get_wireformat_buffer(const ldns_edns_option *edns) +{ + uint16_t option; + size_t size; + uint8_t* data; + ldns_buffer* buffer; + + if (edns == NULL) { + return NULL; + } + + option = ldns_edns_get_code(edns); + size = ldns_edns_get_size(edns); + data = ldns_edns_get_data(edns); + + buffer = ldns_buffer_new(size + 4); + + if (buffer == NULL) { + return NULL; + } + + ldns_buffer_write_u16(buffer, option); + ldns_buffer_write_u16(buffer, size); + ldns_buffer_write(buffer, data, size); + + ldns_buffer_flip(buffer); + + return buffer; +} + /* write */ void ldns_edns_set_size(ldns_edns_option *edns, size_t size) @@ -71,9 +102,32 @@ ldns_edns_new(ldns_edns_option_code code, size_t size, void *data) if (!edns) { return NULL; } - ldns_edns_set_size(edns, size); ldns_edns_set_code(edns, code); + ldns_edns_set_size(edns, size); ldns_edns_set_data(edns, data); + + return edns; +} + +ldns_edns_option * +ldns_edns_new_from_data(ldns_edns_option_code code, size_t size, const void *data) +{ + ldns_edns_option *edns; + edns = LDNS_MALLOC(ldns_edns_option); + if (!edns) { + return NULL; + } + edns->_data = LDNS_XMALLOC(uint8_t, size); + if (!edns->_data) { + LDNS_FREE(edns); + return NULL; + } + + /* set the values */ + ldns_edns_set_code(edns, code); + ldns_edns_set_size(edns, size); + memcpy(edns->_data, data, size); + return edns; } @@ -146,7 +200,7 @@ ldns_edns_option_list_get_count(const ldns_edns_option_list *option_list) void ldns_edns_option_list_set_count(ldns_edns_option_list *option_list, size_t count) { - assert(option_list); // @TODO does this check need to check more? + assert(option_list); option_list->_option_count = count; } @@ -196,7 +250,7 @@ ldns_edns_option_list_set_option(ldns_edns_option_list *option_list, option_list->_options_size += (ldns_edns_get_size(option) + 4); - /* overwrite the pointer of "old" */ + /* overwrite the pointer of the old entry */ option_list->_options[index] = (ldns_edns_option*)option; return old; } @@ -209,8 +263,7 @@ ldns_edns_option_list_push(ldns_edns_option_list *option_list, if (option != NULL) { - // @TODO rethink reallocing per push - + /* grow the array */ option_list->_options = LDNS_XREALLOC(option_list->_options, ldns_edns_option *, option_list->_option_count + 1); if (!option_list) { @@ -242,8 +295,6 @@ ldns_edns_option_list_pop(ldns_edns_option_list *option_list) /* get the last option from the list */ pop = ldns_edns_option_list_get_option(option_list, count-1); - // @TODO rethink reallocing per pop - /* shrink the array */ new_list = LDNS_XREALLOC(option_list->_options, ldns_edns_option *, count -1); if (new_list){ @@ -260,3 +311,46 @@ ldns_edns_option_list_pop(ldns_edns_option_list *option_list) return pop; } +ldns_buffer * +ldns_edns_option_list2wireformat_buffer(const ldns_edns_option_list *option_list) +{ + size_t i, list_size, options_size, option, size; + ldns_buffer* buffer; + ldns_edns_option *edns; + uint8_t* data = NULL; + + /* get the number of EDNS options in the list*/ + list_size = ldns_edns_option_list_get_count(option_list); + + /* create buffer the size of the total EDNS wireformat options */ + options_size = ldns_edns_option_list_get_options_size(option_list); + buffer = ldns_buffer_new(options_size); + + /* write individual serialized EDNS options to final buffer*/ + for (i = 0; i < list_size; i++) { + edns = ldns_edns_option_list_get_option(option_list, i); + + if (edns == NULL) { + /* this shouldn't be possible */ + return NULL; + } + + option = ldns_edns_get_code(edns); + size = ldns_edns_get_size(edns); + data = ldns_edns_get_data(edns); + + /* make sure the option fits */ + if (ldns_buffer_capacity(buffer) > size + 4) { + ldns_buffer_free(buffer); + return NULL; + } + + ldns_buffer_write_u16(buffer, option); + ldns_buffer_write_u16(buffer, size); + ldns_buffer_write(buffer, data, size); + } + + ldns_buffer_flip(buffer); + + return buffer; +} diff --git a/ldns/edns.h b/ldns/edns.h index c6c2ebb1..9d821ee9 100644 --- a/ldns/edns.h +++ b/ldns/edns.h @@ -95,9 +95,9 @@ typedef enum ldns_edns_enum_ede_code ldns_edns_ede_code; +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ */ struct ldns_struct_edns_option { - ldns_edns_option_code _code; - size_t _size; - void *_data; + ldns_edns_option_code _code; + size_t _size; + void *_data; }; typedef struct ldns_struct_edns_option ldns_edns_option; @@ -108,7 +108,7 @@ typedef struct ldns_struct_edns_option ldns_edns_option; struct ldns_struct_edns_option_list { size_t _option_count; - size_t _options_size; /* the total size of the options in the list*/ + size_t _options_size; /* the total size of the options serialized */ ldns_edns_option **_options; }; typedef struct ldns_struct_edns_option_list ldns_edns_option_list; @@ -134,11 +134,19 @@ ldns_edns_option_code ldns_edns_get_code(const ldns_edns_option *edns); /** * returns the EDNS option data. - * \param[in] *edns the rdf to read from - * \return uint8_t* pointer to the rdf's data + * \param[in] *edns the EDNS option to read from + * \return uint8_t* pointer to the EDNS option's data */ uint8_t *ldns_edns_get_data(const ldns_edns_option *edns); + +/** + * serialise the EDNS option into wireformat. + * \param[in] *edns the EDNS option to read from + * \return ldns_buffer* the buffer containing the data + */ +ldns_buffer *ldns_edns_get_wireformat_buffer(const ldns_edns_option *edns); + /* Constructors and destructors*/ /** @@ -151,6 +159,9 @@ uint8_t *ldns_edns_get_data(const ldns_edns_option *edns); */ ldns_edns_option *ldns_edns_new(ldns_edns_option_code code, size_t size, void *data); +// @TODO write this/determine if we need it +ldns_edns_option *ldns_edns_new_from_data(ldns_edns_option_code code, size_t size, const void *data); + void ldns_edns_deep_free(ldns_edns_option *edns); void ldns_edns_free(ldns_edns_option *edns); @@ -222,6 +233,13 @@ bool ldns_edns_option_list_push(ldns_edns_option_list *options_list, */ ldns_edns_option* ldns_edns_option_list_pop(ldns_edns_option_list *options_list); +/** + * serializes all the EDNS options into a single wireformat buffer + * \param[in] options_list the EDNS options_list to combine into one wireformat + * \return the filled buffer or NULL on failure + */ +ldns_buffer *ldns_edns_option_list2wireformat_buffer(const ldns_edns_option_list *option_list); + #ifdef __cplusplus } #endif From d1e962425ad744b8dbbfca82cd89b74e29956532 Mon Sep 17 00:00:00 2001 From: TCY16 Date: Tue, 12 Apr 2022 12:57:49 +0200 Subject: [PATCH 32/83] add clone functionality to the edns struct and list, as well as doc strings --- edns.c | 41 ++++++++++++++++++++++++++++++++++++++++- ldns/edns.h | 40 +++++++++++++++++++++++++++++++++++----- 2 files changed, 75 insertions(+), 6 deletions(-) diff --git a/edns.c b/edns.c index f6a8a797..b1db5f03 100644 --- a/edns.c +++ b/edns.c @@ -131,6 +131,20 @@ ldns_edns_new_from_data(ldns_edns_option_code code, size_t size, const void *dat return edns; } +ldns_edns_option * +ldns_edns_clone(ldns_edns_option *edns) +{ + ldns_edns_option *new_option; + + assert(edns != NULL); + + new_option = ldns_edns_new_from_data(ldns_edns_get_code(edns), + ldns_edns_get_size(edns), + ldns_edns_get_data(edns)); + + return new_option; +} + void ldns_edns_deep_free(ldns_edns_option *edns) { @@ -164,6 +178,32 @@ ldns_edns_option_list_new() return option_list; } +ldns_edns_option_list * +ldns_edns_option_list_clone(ldns_edns_option_list *old_list) +{ + size_t i; + ldns_edns_option_list *new_list; + + if (!old_list) { + return NULL; + } + + new_list = ldns_edns_option_list_new(); + if (!new_list) { + return NULL; + } + + new_list->_option_count = old_list->_option_count; + + /* adding options also updates the total options size */ + for (i = 0; i < old_list->_option_count; i++) { + ldns_edns_option_list_push(new_list, + ldns_edns_clone(ldns_edns_option_list_get_option(old_list, i))); + } + + return new_list; +} + void ldns_edns_option_list_free(ldns_edns_option_list *option_list) { @@ -186,7 +226,6 @@ ldns_edns_option_list_deep_free(ldns_edns_option_list *option_list) } } - size_t ldns_edns_option_list_get_count(const ldns_edns_option_list *option_list) { diff --git a/ldns/edns.h b/ldns/edns.h index 9d821ee9..a1bfa91f 100644 --- a/ldns/edns.h +++ b/ldns/edns.h @@ -107,7 +107,7 @@ typedef struct ldns_struct_edns_option ldns_edns_option; */ struct ldns_struct_edns_option_list { - size_t _option_count; + size_t _option_count; /* the number of EDNS options in the list */ size_t _options_size; /* the total size of the options serialized */ ldns_edns_option **_options; }; @@ -150,8 +150,8 @@ ldns_buffer *ldns_edns_get_wireformat_buffer(const ldns_edns_option *edns); /* Constructors and destructors*/ /** - * allocates a new EDNS structure and fills it. - * This function DOES NOT copy the contents from the buffer + * allocates a new EDNS structure and fills it. This function *DOES NOT* copy + * the contents from the data parameter. * \param[in] code the EDNS code * \param[in] size size of the buffer * \param[in] data pointer to the buffer to be assigned @@ -159,18 +159,48 @@ ldns_buffer *ldns_edns_get_wireformat_buffer(const ldns_edns_option *edns); */ ldns_edns_option *ldns_edns_new(ldns_edns_option_code code, size_t size, void *data); -// @TODO write this/determine if we need it +/** + * allocates a new EDNS structure and fills it. This function *DOES* copy + * the contents from the data parameter. + * \param[in] code the EDNS code + * \param[in] size size of the buffer + * \param[in] data pointer to the buffer to be assigned + * \return the new EDNS structure or NULL on failure + */ ldns_edns_option *ldns_edns_new_from_data(ldns_edns_option_code code, size_t size, const void *data); +/** + * clone an EDNS option + * \param[in] the EDNS option + * \return the new EDNS structure + */ +ldns_edns_option *ldns_edns_clone(ldns_edns_option *edns); + +/** + * free the EDNS option. Use deep_free if the _data member is allocated. + * \param[in] the EDNS option to free + */ void ldns_edns_deep_free(ldns_edns_option *edns); void ldns_edns_free(ldns_edns_option *edns); - /** * allocates space for a new list of EDNS options * \return the new EDNS option list or NULL on failure */ ldns_edns_option_list* ldns_edns_option_list_new(void); + +/** + * clone the EDNS options list and it's contents + * \param[in] options_list the EDNS options_list to read from + * \return the new EDNS option list + */ +ldns_edns_option_list *ldns_edns_option_list_clone(ldns_edns_option_list *options_list); + +/** + * free the EDNS option list. Use deep_free to free the options options + * in the list as well. + * \param[in] the EDNS option to free + */ void ldns_edns_option_list_free(ldns_edns_option_list *options_list); void ldns_edns_option_list_deep_free(ldns_edns_option_list *options_list); From f69685dfb83159b688e3d4dddbdae1b9f2650b4c Mon Sep 17 00:00:00 2001 From: TCY16 Date: Tue, 12 Apr 2022 13:17:50 +0200 Subject: [PATCH 33/83] add getters and setters to the new EDNS options list and add serializer function --- ldns/packet.h | 37 +++++++++++++++++++++++++++++------ packet.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 82 insertions(+), 9 deletions(-) diff --git a/ldns/packet.h b/ldns/packet.h index 5bb0df50..f383d0dd 100644 --- a/ldns/packet.h +++ b/ldns/packet.h @@ -252,12 +252,14 @@ struct ldns_struct_pkt uint8_t _edns_extended_rcode; /** EDNS Version */ uint8_t _edns_version; - /* OPT pseudo-RR presence flag */ - uint8_t _edns_present; + /* OPT pseudo-RR presence flag */ + uint8_t _edns_present; /** Reserved EDNS data bits */ uint16_t _edns_z; /** Arbitrary EDNS rdata */ ldns_rdf *_edns_data; + /** Structed EDNS data */ + ldns_edns_option_list *_edns_list; /** Question section */ ldns_rr_list *_question; /** Answer section */ @@ -687,12 +689,19 @@ uint8_t ldns_pkt_edns_version(const ldns_pkt *packet); */ uint16_t ldns_pkt_edns_z(const ldns_pkt *packet); /** - * return the packet's edns data + * return the packet's arbitrary EDNS data * \param[in] packet the packet * \return the data */ ldns_rdf *ldns_pkt_edns_data(const ldns_pkt *packet); +/** + * return the packet's structured EDNS data option list + * \param[in] packet the packet + * \return the list of EDNS options + */ +ldns_edns_option_list* ldns_pkt_edns_option_list(const ldns_pkt *packet); + /** * return the packet's edns do bit * \param[in] packet the packet @@ -733,9 +742,18 @@ bool ldns_pkt_edns(const ldns_pkt *packet); * Returns a list of structured EDNS options * * \param[in] packet the packet which contains the EDNS data - * \return list of ldns_edns_option structs + * \return the list of EDNS options */ -ldns_edns_option_list* ldns_pkt_edns_option_list(const ldns_pkt *packet); +ldns_edns_option_list* ldns_pkt_edns_get_option_list(const ldns_pkt *packet); + +/** + * Serialize the EDNS options to wireformat and write to the arbitrary EDNS data member + * \param[in] packet the packet which contains the EDNS data + * \param[in] edns_list the list of EDNS options + * \return true if succesful and false if not + */ +bool ldns_pkt_edns_write_option_list_to_edns_data(ldns_pkt *packet, + ldns_edns_option_list* edns_list); /** * Set the packet's edns udp size @@ -762,12 +780,19 @@ void ldns_pkt_set_edns_version(ldns_pkt *packet, uint8_t v); */ void ldns_pkt_set_edns_z(ldns_pkt *packet, uint16_t z); /** - * Set the packet's edns data + * Set the packet's arbitrary EDNS data * \param[in] packet the packet * \param[in] data the data */ void ldns_pkt_set_edns_data(ldns_pkt *packet, ldns_rdf *data); +/** + * Set the packet's structured EDNS data + * \param[in] packet the packet + * \param[in] data the data + */ +void ldns_pkt_set_edns_option_list(ldns_pkt *packet, ldns_edns_option_list *list); + /** * allocates and initializes a ldns_pkt structure. * \return pointer to the new packet diff --git a/packet.c b/packet.c index 9dc32815..b39b0e10 100644 --- a/packet.c +++ b/packet.c @@ -262,6 +262,12 @@ ldns_pkt_edns_data(const ldns_pkt *packet) return packet->_edns_data; } +ldns_edns_option_list* +ldns_pkt_edns_option_list(const ldns_pkt *packet) +{ + return packet->_edns_list; +} + /* return only those rr that share the ownername */ ldns_rr_list * ldns_pkt_rr_list_by_name(const ldns_pkt *packet, @@ -638,6 +644,13 @@ ldns_pkt_set_edns_data(ldns_pkt *packet, ldns_rdf *data) packet->_edns_data = data; } +void +ldns_pkt_set_edns_option_list(ldns_pkt *packet, ldns_edns_option_list *list) +{ + packet->_edns_list = list; +} + + void ldns_pkt_set_section_count(ldns_pkt *packet, ldns_pkt_section s, uint16_t count) { @@ -749,7 +762,7 @@ ldns_pkt_edns(const ldns_pkt *pkt) } ldns_edns_option_list* -ldns_pkt_edns_option_list(const ldns_pkt *packet) +ldns_pkt_edns_get_option_list(const ldns_pkt *packet) { size_t pos = 0; ldns_edns_option_list* edns_list; @@ -758,12 +771,18 @@ ldns_pkt_edns_option_list(const ldns_pkt *packet) if (!ldns_pkt_edns_data(packet)) return NULL; - + + /* return the list if it already exists */ + if (packet->_edns_list != NULL) { + return packet->_edns_list; + } + + /* if the list doesn't exists, we create it by parsing the _edns_data */ + max = ldns_rdf_size(ldns_pkt_edns_data(packet)); wire = ldns_rdf_data(ldns_pkt_edns_data(packet)); // @TODO do checks so we don't read into un-auth memory (max !< 4) - edns_list = ldns_edns_option_list_new(); if (edns_list == NULL) { return NULL; @@ -805,6 +824,30 @@ ldns_pkt_edns_option_list(const ldns_pkt *packet) return edns_list; } +bool +ldns_pkt_edns_write_option_list_to_edns_data(ldns_pkt *packet, + ldns_edns_option_list* edns_list) +{ + ldns_buffer* buffer; + ldns_rdf* edns_rdf; + + /* get the EDNS options in wireformat */ + buffer = ldns_edns_option_list2wireformat_buffer(edns_list); + + if (buffer == NULL) { + return false; + } + + /* read the data and create the EDNS RDF */ + edns_rdf = ldns_rdf_new(LDNS_RDF_TYPE_UNKNOWN, ldns_buffer_limit(buffer), + ldns_buffer_export(buffer)); + + /* set the new EDNS RDF in the packet */ + ldns_pkt_set_edns_data(packet, edns_rdf); + + return true; +} + /* Create/destroy/convert functions */ @@ -854,6 +897,7 @@ ldns_pkt_new(void) ldns_pkt_set_edns_version(packet, 0); ldns_pkt_set_edns_z(packet, 0); ldns_pkt_set_edns_data(packet, NULL); + ldns_pkt_set_edns_option_list(packet, NULL); packet->_edns_present = false; ldns_pkt_set_tsig(packet, NULL); @@ -872,6 +916,7 @@ ldns_pkt_free(ldns_pkt *packet) ldns_rr_list_deep_free(packet->_additional); ldns_rr_free(packet->_tsig_rr); ldns_rdf_deep_free(packet->_edns_data); + ldns_edns_option_list_deep_free(packet->_edns_list); ldns_rdf_deep_free(packet->_answerfrom); LDNS_FREE(packet); } @@ -1221,6 +1266,9 @@ ldns_pkt_clone(const ldns_pkt *pkt) ldns_pkt_set_edns_data(new_pkt, ldns_rdf_clone(ldns_pkt_edns_data(pkt))); ldns_pkt_set_edns_do(new_pkt, ldns_pkt_edns_do(pkt)); + if (ldns_pkt_edns_option_list(pkt)) + ldns_pkt_set_edns_option_list(new_pkt, + ldns_edns_option_list_clone(ldns_pkt_edns_get_option_list(pkt))); ldns_rr_list_deep_free(new_pkt->_question); ldns_rr_list_deep_free(new_pkt->_answer); From 2dfc33c893b12c24fe9aac7ee111fadb20c61df1 Mon Sep 17 00:00:00 2001 From: TCY16 Date: Tue, 12 Apr 2022 13:55:12 +0200 Subject: [PATCH 34/83] remove non-const cast from ldns_edns_option * --- edns.c | 5 ++--- ldns/edns.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/edns.c b/edns.c index b1db5f03..bc40f226 100644 --- a/edns.c +++ b/edns.c @@ -266,7 +266,7 @@ ldns_edns_option_list_get_options_size(const ldns_edns_option_list *option_list) ldns_edns_option * ldns_edns_option_list_set_option(ldns_edns_option_list *option_list, - const ldns_edns_option *option, size_t index) + ldns_edns_option *option, size_t index) { ldns_edns_option* old; @@ -289,8 +289,7 @@ ldns_edns_option_list_set_option(ldns_edns_option_list *option_list, option_list->_options_size += (ldns_edns_get_size(option) + 4); - /* overwrite the pointer of the old entry */ - option_list->_options[index] = (ldns_edns_option*)option; + option_list->_options[index] = option; return old; } diff --git a/ldns/edns.h b/ldns/edns.h index a1bfa91f..272351d0 100644 --- a/ldns/edns.h +++ b/ldns/edns.h @@ -245,7 +245,7 @@ size_t ldns_edns_option_list_get_options_size(const ldns_edns_option_list *optio * \return the EDNS option previously located at the index */ ldns_edns_option * ldns_edns_option_list_set_option(ldns_edns_option_list *options_list, - const ldns_edns_option *option, size_t index); + ldns_edns_option *option, size_t index); /** * adds an EDNS option at the end of the list of options. From 947f6ec722862d1c3864beedf83a43e857b6fc0f Mon Sep 17 00:00:00 2001 From: TCY16 Date: Tue, 12 Apr 2022 14:27:43 +0200 Subject: [PATCH 35/83] add NSID query functionality to drill, which integrates the new structured EDNS logic --- drill/drill.c | 51 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/drill/drill.c b/drill/drill.c index 13afb84f..9a117592 100644 --- a/drill/drill.c +++ b/drill/drill.c @@ -203,6 +203,7 @@ main(int argc, char *argv[]) qusevc = false; qrandom = true; key_verified = NULL; + ldns_edns_option_list* edns_list = NULL; ldns_init_random(NULL, 0); @@ -210,7 +211,7 @@ main(int argc, char *argv[]) /* global first, query opt next, option with parm's last * and sorted */ /* "46DITSVQf:i:w:q:achuvxzy:so:p:b:k:" */ - while ((c = getopt(argc, argv, "46ab:c:d:Df:hi:I:k:o:p:q:Qr:sStTuvV:w:xy:z")) != -1) { + while ((c = getopt(argc, argv, "46ab:c:d:e:Df:hi:I:k:o:p:q:Qr:sStTuvV:w:xy:z")) != -1) { switch(c) { /* global options */ case '4': @@ -290,6 +291,27 @@ main(int argc, char *argv[]) case 'c': resolv_conf_file = optarg; break; + case 'e': + if (strstr(optarg, "nsid")) { + ldns_edns_option *edns; + edns_list = ldns_edns_option_list_new(); + + /* create NSID EDNS*/ + edns = ldns_edns_new_from_data(LDNS_EDNS_NSID, 0, NULL); + + if (edns_list == NULL || edns == NULL) { + error("EDNS option could not be allocated"); + break; + } + + // @TODO rethink this error + if (!(ldns_edns_option_list_push(edns_list, edns))) { + error("EDNS option could not be attached"); + break; + } + + break; + } case 't': qusevc = true; break; @@ -796,7 +818,7 @@ main(int argc, char *argv[]) } status = ldns_resolver_prepare_query_pkt(&qpkt, res, qname, type, clas, qflags); if(status != LDNS_STATUS_OK) { - error("%s", "making query: %s", + error("%s", "making query: %s", ldns_get_errorstr_by_id(status)); } dump_hex(qpkt, query_file); @@ -867,9 +889,24 @@ main(int argc, char *argv[]) } else { /* create a packet and set the RD flag on it */ pkt = NULL; - status = ldns_resolver_query_status( - &pkt, res, qname, - type, clas, qflags); + + status = ldns_resolver_prepare_query_pkt(&qpkt, + res, qname, type, clas, qflags); + if(status != LDNS_STATUS_OK) { + error("%s", "making query: %s", + ldns_get_errorstr_by_id(status)); + } + + if (edns_list) { + /* attach the structed EDNS options for completeness */ + ldns_pkt_set_edns_option_list(qpkt, edns_list); + + /* write the structured EDNS data to unstructured data */ + ldns_pkt_edns_write_option_list_to_edns_data(qpkt, edns_list); + } + + status = ldns_resolver_send_pkt(&pkt, res, qpkt); + if (status != LDNS_STATUS_OK) { error("error sending query: %s" , ldns_get_errorstr_by_id( @@ -878,7 +915,8 @@ main(int argc, char *argv[]) } } - if (!pkt) { + /* now handling the response message/packet */ + if (!pkt) { mesg("No packet received"); result = EXIT_FAILURE; } else { @@ -991,6 +1029,7 @@ main(int argc, char *argv[]) ldns_rr_list_deep_free(key_list); ldns_rr_list_deep_free(cmdline_rr_list); ldns_rdf_deep_free(trace_start_name); + ldns_edns_option_list_deep_free(edns_list); xfree(progname); xfree(tsig_name); xfree(tsig_data); From 5e0a53a5f59dd9458da57c3907adda8c16dbcecd Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 13 Apr 2022 16:53:48 -0700 Subject: [PATCH 36/83] Revert "spelling: distclean" "distclean" is a *different* kind of target than "destclean" "destclean" presumably means "uninstall from the destination". "distclean" means, by convention, "clean the source into the way that you would like before creating a tarball for distribution" This switch introduced some ugliness for debian packaging, as can be seen in https://salsa.debian.org/dns-team/ldns/-/commit/8b84b73590ac4321e1bf0982d60a7e94b037d6e5 This reverts commit 298b2a65920944aee833d4392e3651f25421c759. --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 610b2e51..7657c60e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -350,7 +350,7 @@ install: install-h install-lib install-pc @INSTALL_CONFIG@ install-manpages $(py uninstall: uninstall-manpages @UNINSTALL_CONFIG@ uninstall-h uninstall-lib uninstall-pc $(pyldns_uninst) $(pyldnsx_uninst) @UNINSTALL_P5_DNS_LDNS@ @UNINSTALL_DRILL@ @UNINSTALL_EXAMPLES@ -distclean: uninstall +destclean: uninstall install-config: $(INSTALL) -d $(DESTDIR)$(bindir) From 4b2aea43199df3a12d88b3b682e10534a5fc2d91 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 13 Apr 2022 17:39:29 -0700 Subject: [PATCH 37/83] non-substantive spelling fixes --- Changelog | 14 +++++++------- dname.c | 2 +- dnssec_zone.c | 4 ++-- doc/API-header.xml | 2 +- doc/API.xml | 2 +- examples/ldns-testns.1 | 4 ++-- examples/nsd-test/nsd-ldnsd.c | 2 +- ldns/dane.h | 2 +- ldns/dnssec_sign.h | 2 +- ldns/parse.h | 12 ++++++------ packaging/fedora/ldns.spec | 2 +- pcat/pcat-diff.c | 4 ++-- rdata.c | 2 +- rr.c | 2 +- rr_functions.c | 4 ++-- zone.c | 2 +- 16 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Changelog b/Changelog index 538ba2b7..c0c7c5f3 100644 --- a/Changelog +++ b/Changelog @@ -55,7 +55,7 @@ Thanks Felipe Gasper * PR #126: Link with libldns.la in Makefile.in. Thanks orbea - * PR #127: Addes option -Q to drill to give short answer. + * PR #127: Added option -Q to drill to give short answer. Thanks niknah * PR #133: Update m4 files for python modules. Thanks Petr Menšík @@ -243,7 +243,7 @@ Thanks William King * Use OpenSSL DANE functions for verification (unless explicitly disabled with --disable-dane-ta-usage). - * Bumb .so version + * Bump .so version * Include OPENPGPKEY RR type by default * rdata processing for SMIMEA RR type * Fix crash in displaying TLSA RR's. @@ -313,7 +313,7 @@ * bugfix #505: Manpage and usage output fixes (Thanks Tomas Hozza) * Adjust ldns_sha1() so that the input data is not modified (Thanks Marc Buijsman) - * Messages to stderr are now off by default and can be reenabled with + * Messages to stderr are now off by default and can be re-enabled with the --enable-stderr-msgs configure option. 1.6.16 2012-11-13 @@ -656,7 +656,7 @@ * --enable-gost : use the GOST algorithm (experimental). * Added some missing options to drill manpage * Some fixes to --without-ssl option - * Fixed quote parsing withing strings + * Fixed quote parsing within strings * Bitmask fix in EDNS handling * Fixed non-fqdn domain name completion for rdata field domain names of length 1 @@ -945,7 +945,7 @@ * -r was killed in favor of -o
which allows for a header bits setting (and maybe more in the future) - * DNSSEC is never automaticaly set, even when you query + * DNSSEC is never automatically set, even when you query for DNSKEY/RRSIG or DS. * Implement a crude RTT check, it now distinguishes between reachable and unreachable. @@ -1017,7 +1017,7 @@ * char *_when was removed from the ldns_pkt structure 18 Oct 2005: 1.0.0: ldns-team - * Commited a patch from HÃ¥kan Olsson + * Committed a patch from HÃ¥kan Olsson * Added UPDATE support (Jakob Schlyter and HÃ¥kan Olsson) * License change: ldns is now BSD licensed * ldns now depends on SSL @@ -1059,7 +1059,7 @@ 23 May 2005: 0.60: ldns-team * Removed config.h from the header installed files - (you're not supposed to include that in a libary) + (you're not supposed to include that in a library) * Further tweaking - DNSSEC signing/verification works - Assorted bug fixes and tweaks (memory management) diff --git a/dname.c b/dname.c index 17afe1d3..4f311ee2 100644 --- a/dname.c +++ b/dname.c @@ -3,7 +3,7 @@ * * dname specific rdata implementations * A dname is a rdf structure with type LDNS_RDF_TYPE_DNAME - * It is not a /real/ type! All function must therefor check + * It is not a /real/ type! All function must therefore check * for LDNS_RDF_TYPE_DNAME. * * a Net::DNS like library for C diff --git a/dnssec_zone.c b/dnssec_zone.c index 39572255..7be6791e 100644 --- a/dnssec_zone.c +++ b/dnssec_zone.c @@ -631,7 +631,7 @@ ldns_dnssec_zone_new_frm_fp_l(ldns_dnssec_zone** z, FILE* fp, const ldns_rdf* or nsec3_ents (where ent is e.n.t.; i.e. empty non terminal) will hold the NSEC3s that still didn't have a matching name in the zone tree, even after all names were read. They can only match - after the zone is equiped with all the empty non terminals. */ + after the zone is equipped with all the empty non terminals. */ ldns_rbtree_t todo_nsec3_ents; ldns_rbnode_t *new_node; ldns_rr_list* todo_nsec3_rrsigs = ldns_rr_list_new(); @@ -705,7 +705,7 @@ ldns_dnssec_zone_new_frm_fp_l(ldns_dnssec_zone** z, FILE* fp, const ldns_rdf* or my_ttl = ldns_rr_ttl(cur_rr); } /* When ttl is implicit, try to adhere to the rules as - * much as posssible. (also for compatibility with bind) + * much as possible. (also for compatibility with bind) * This was changed when fixing an issue with ZONEMD * which hashes the TTL too. */ diff --git a/doc/API-header.xml b/doc/API-header.xml index 937a9d7c..eac42fc2 100644 --- a/doc/API-header.xml +++ b/doc/API-header.xml @@ -97,7 +97,7 @@ Further more it is to be expected that lDNS will depend on OpenSSL for its cryptography. -As said, lDNS is modelled after Net::DNS, therefor its application API +As said, lDNS is modelled after Net::DNS, therefore its application API looks very much like the one used for Net::DNS. Some modification are made of course, because not all functionality of Perl can be caught in C. diff --git a/doc/API.xml b/doc/API.xml index 3438b594..3d873d88 100644 --- a/doc/API.xml +++ b/doc/API.xml @@ -97,7 +97,7 @@ Further more it is to be expected that lDNS will depend on OpenSSL for its cryptography. -As said, lDNS is modelled after Net::DNS, therefor its application API +As said, lDNS is modelled after Net::DNS, therefore its application API looks very much like the one used for Net::DNS. Some modification are made of course, because not all functionality of Perl can be caught in C. diff --git a/examples/ldns-testns.1 b/examples/ldns-testns.1 index c8173e5d..e21bcf08 100644 --- a/examples/ldns-testns.1 +++ b/examples/ldns-testns.1 @@ -1,7 +1,7 @@ .TH ldns-testns 1 "14 Dec 2006" .SH NAME ldns-testns \- simple fake nameserver tool -.SH SYNOPSYS +.SH SYNOPSIS .B ldns-testns [ .IR OPTION @@ -11,7 +11,7 @@ ldns-testns \- simple fake nameserver tool .SH DESCRIPTION \fBldns-testns\fR can be used to provide answers to DNS queries for testing. The answers are premade, and can be tailored to testing -needs. The answers can be wildly invalid or unparseable. +needs. The answers can be wildly invalid or unparsable. This program is a debugging aid. It is not efficient, especially with a long config file, but it can give any reply to any query. diff --git a/examples/nsd-test/nsd-ldnsd.c b/examples/nsd-test/nsd-ldnsd.c index d728866a..938f0802 100644 --- a/examples/nsd-test/nsd-ldnsd.c +++ b/examples/nsd-test/nsd-ldnsd.c @@ -83,7 +83,7 @@ main(int argc, char **argv) usage(stdout); exit(EXIT_FAILURE); } else { - fprintf(stderr, "quiting after %d qs\n", (int)maxcount); + fprintf(stderr, "quitting after %d qs\n", (int)maxcount); } } else { fprintf(stderr, "Use -Number for max count\n"); diff --git a/ldns/dane.h b/ldns/dane.h index 3bde5463..b5366e0e 100644 --- a/ldns/dane.h +++ b/ldns/dane.h @@ -43,7 +43,7 @@ enum ldns_enum_tlsa_certificate_usage /** CA constraint */ LDNS_TLSA_USAGE_PKIX_TA = 0, LDNS_TLSA_USAGE_CA_CONSTRAINT = 0, - /** Sevice certificate constraint */ + /** Service certificate constraint */ LDNS_TLSA_USAGE_PKIX_EE = 1, LDNS_TLSA_USAGE_SERVICE_CERTIFICATE_CONSTRAINT = 1, /** Trust anchor assertion */ diff --git a/ldns/dnssec_sign.h b/ldns/dnssec_sign.h index cac47fbf..4523811f 100644 --- a/ldns/dnssec_sign.h +++ b/ldns/dnssec_sign.h @@ -113,7 +113,7 @@ ldns_dnssec_zone_mark_and_get_glue( * be taken into account separately. * * \param[in] zone the zone in which to mark the names - * \return LDNS_STATUS_OK on succesful completion, an error code otherwise + * \return LDNS_STATUS_OK on successful completion, an error code otherwise */ ldns_status ldns_dnssec_zone_mark_glue(ldns_dnssec_zone *zone); diff --git a/ldns/parse.h b/ldns/parse.h index e98fb95b..ba7edf56 100644 --- a/ldns/parse.h +++ b/ldns/parse.h @@ -112,9 +112,9 @@ ssize_t ldns_bget_token(ldns_buffer *b, char *token, const char *delim, size_t l * after the keyword + k_del until we hit d_del * \param[in] f file pointer to read from * \param[in] keyword keyword to look for - * \param[in] k_del keyword delimeter + * \param[in] k_del keyword delimiter * \param[out] data the data found - * \param[in] d_del the data delimeter + * \param[in] d_del the data delimiter * \param[in] data_limit maximum size the the data buffer * \return the number of character read */ @@ -125,9 +125,9 @@ ssize_t ldns_fget_keyword_data(FILE *f, const char *keyword, const char *k_del, * after the keyword + k_del until we hit d_del * \param[in] f file pointer to read from * \param[in] keyword keyword to look for - * \param[in] k_del keyword delimeter + * \param[in] k_del keyword delimiter * \param[out] data the data found - * \param[in] d_del the data delimeter + * \param[in] d_del the data delimiter * \param[in] data_limit maximum size the the data buffer * \param[in] line_nr pointer to an integer containing the current line number (for debugging purposes) @@ -140,9 +140,9 @@ ssize_t ldns_fget_keyword_data_l(FILE *f, const char *keyword, const char *k_del * after the keyword + k_del until we hit d_del * \param[in] b buffer pointer to read from * \param[in] keyword keyword to look for - * \param[in] k_del keyword delimeter + * \param[in] k_del keyword delimiter * \param[out] data the data found - * \param[in] d_del the data delimeter + * \param[in] d_del the data delimiter * \param[in] data_limit maximum size the the data buffer * \return the number of character read */ diff --git a/packaging/fedora/ldns.spec b/packaging/fedora/ldns.spec index 6ae8759f..9b02cfd2 100644 --- a/packaging/fedora/ldns.spec +++ b/packaging/fedora/ldns.spec @@ -23,7 +23,7 @@ BuildRequires: python-devel, swig %endif %description -ldns is a library with the aim to simplify DNS programing in C. All +ldns is a library with the aim to simplify DNS programming in C. All lowlevel DNS/DNSSEC operations are supported. We also define a higher level API which allows a programmer to (for instance) create or sign packets. diff --git a/pcat/pcat-diff.c b/pcat/pcat-diff.c index 127c5f8d..4c57238e 100644 --- a/pcat/pcat-diff.c +++ b/pcat/pcat-diff.c @@ -498,7 +498,7 @@ compare_to_file(ldns_pkt *qp, ldns_pkt *pkt1, ldns_pkt *pkt2) /* first, try query match */ - /* special case for unparseable queries */ + /* special case for unparsable queries */ if (!qp) { if (strncmp(query_match, "BADPACKET\n", 11) == 0 || strncmp(query_match, "*\n", 3) == 0 @@ -664,7 +664,7 @@ compare_to_file(ldns_pkt *qp, ldns_pkt *pkt1, ldns_pkt *pkt2) /* ok the query matches, now look at both answers */ /* special case if one packet is null (ie. one server - answers and one doesnt) */ + answers and one doesn't) */ if (same && (!pkt1 || !pkt2)) { if (strncmp(answer_match, "NOANSWER\n", 10) == 0 || strncmp(answer_match, "*\n", 3) == 0 diff --git a/rdata.c b/rdata.c index 4eebeafa..3f899a21 100644 --- a/rdata.c +++ b/rdata.c @@ -624,7 +624,7 @@ ldns_octet(char *word, size_t *length) return LDNS_STATUS_DDD_OVERFLOW; } } else { - /* an espaced character, like \ ? + /* an escaped character, like \ ? * remove the '\' keep the rest */ *p = *++s; (*length)++; diff --git a/rr.c b/rr.c index 2f64c15d..eb24f3c9 100644 --- a/rr.c +++ b/rr.c @@ -1323,7 +1323,7 @@ ldns_rr_set_push_rr(ldns_rr_list *rr_list, ldns_rr *rr) return false; } /* ok, still alive - check if the rr already - * exists - if so, dont' add it */ + * exists - if so, don't add it */ for(i = 0; i < rr_count; i++) { if(ldns_rr_compare( ldns_rr_list_rr(rr_list, i), rr) == 0) { diff --git a/rr_functions.c b/rr_functions.c index 8d72696b..b9b9eae5 100644 --- a/rr_functions.c +++ b/rr_functions.c @@ -24,7 +24,7 @@ * return a specific rdf * \param[in] type type of RR * \param[in] rr the rr itself - * \param[in] pos at which postion to get it + * \param[in] pos at which position to get it * \return the rdf sought */ static ldns_rdf * @@ -41,7 +41,7 @@ ldns_rr_function(ldns_rr_type type, const ldns_rr *rr, size_t pos) * \param[in] type type of RR * \param[in] rr the rr itself * \param[in] rdf the rdf to set - * \param[in] pos at which postion to set it + * \param[in] pos at which position to set it * \return true or false */ static bool diff --git a/zone.c b/zone.c index a3d534e5..9a5d4c4e 100644 --- a/zone.c +++ b/zone.c @@ -253,7 +253,7 @@ ldns_zone_new_frm_fp_l(ldns_zone **z, FILE *fp, const ldns_rdf *origin, my_ttl = ldns_rr_ttl(rr); } /* When ttl is implicit, try to adhere to the rules as - * much as posssible. (also for compatibility with bind) + * much as possible. (also for compatibility with bind) * This was changed when fixing an issue with ZONEMD * which hashes the TTL too. */ From fe3bd19d99c7696a70d7fffa0da46ba7109e32a6 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 13 Apr 2022 17:40:15 -0700 Subject: [PATCH 38/83] recommend exit(EXIT_SUCCESS) instead of exit(SUCCES) In addition to being misspelled, the form without the EXIT_ prefix doesn't appear anywhere else in the codebase. --- doc/CodingStyle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/CodingStyle b/doc/CodingStyle index a326e5c3..693fdd31 100644 --- a/doc/CodingStyle +++ b/doc/CodingStyle @@ -60,5 +60,5 @@ The libdns coding style guide arcount = additional section count ldns- -* use exit(EXIT_FAILURE)/ exit(SUCCES) +* use exit(EXIT_FAILURE)/ exit(EXIT_SUCCESS) * From 36317a1f978c89b3ff6bf54b56134cb515d0c438 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 13 Apr 2022 17:41:45 -0700 Subject: [PATCH 39/83] Spell "success" and "false" correctly. "falsed" is actually a word, but I think "false" was intended here. --- ldns/zone.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldns/zone.h b/ldns/zone.h index f30d7c48..805661f8 100644 --- a/ldns/zone.h +++ b/ldns/zone.h @@ -97,7 +97,7 @@ void ldns_zone_set_rrs(ldns_zone *z, ldns_rr_list *rrlist); * copying, so the rr_list structure inside z is modified! * \param[in] z the zone to add to * \param[in] list the list to add - * \return a true on succes otherwise falsed + * \return a true on success otherwise false */ bool ldns_zone_push_rr_list(ldns_zone *z, const ldns_rr_list *list); @@ -106,7 +106,7 @@ bool ldns_zone_push_rr_list(ldns_zone *z, const ldns_rr_list *list); * copying, so the rr_list structure inside z is modified! * \param[in] z the zone to add to * \param[in] rr the rr to add - * \return a true on succes otherwise falsed + * \return a true on success otherwise false */ bool ldns_zone_push_rr(ldns_zone *z, ldns_rr *rr); From 45a091f9bb8e10fcc0701681c8fa548707e2fb09 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 13 Apr 2022 17:45:21 -0700 Subject: [PATCH 40/83] use "difference_count" instead of "differents" "differents" is a peculiar idiom that some spellcheckers (like "codespell") think is a misspelling of either "different" or "difference". Clearer language is less likely to confuse both people and machines. --- pcat/pcat-diff.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pcat/pcat-diff.c b/pcat/pcat-diff.c index 4c57238e..592e5906 100644 --- a/pcat/pcat-diff.c +++ b/pcat/pcat-diff.c @@ -174,25 +174,25 @@ void print_known_differences(FILE *output) { size_t i; - size_t differents = 0; + size_t difference_count = 0; size_t total; double percentage; qsort(known_differences, known_differences_size, sizeof(known_differences_count), compare_known_differences); for (i = 0; i < known_differences_size; i++) { - differents += known_differences[i].count; + difference_count += known_differences[i].count; } - total = differents + sames; + total = difference_count + sames; for (i = 0; i < known_differences_size; i++) { - percentage = (double) (((double) known_differences[i].count / (double)differents) * 100.0); + percentage = (double) (((double) known_differences[i].count / (double)difference_count) * 100.0); fprintf(output, "%-48s", known_differences[i].descr); fprintf(output, "%8u\t(%02.2f%%)\n", (unsigned int) known_differences[i].count, percentage); } - fprintf(output, "Total number of differences: %u (100%%)\n", (unsigned int) differents); + fprintf(output, "Total number of differences: %u (100%%)\n", (unsigned int) difference_count); fprintf(output, "Number of packets the same after normalization: %u\n", (unsigned int) sames); fprintf(output, "Number of packets exactly the same on the wire: %u\n", (unsigned int) bytesames); fprintf(output, "Total number of packets inspected: %u\n", (unsigned int) total); From 298a46a10e5182a1b8c81a4337c314bfa7b5a740 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 13 Apr 2022 18:33:41 -0700 Subject: [PATCH 41/83] clear up "alloced" When referring to a literal alloc() function call, use "alloc'ed". When referring to a struct member "name_alloced", refer to it by full name. --- ldns/dnssec.h | 2 +- ldns/dnssec_zone.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ldns/dnssec.h b/ldns/dnssec.h index 9881fda7..6ce305ae 100644 --- a/ldns/dnssec.h +++ b/ldns/dnssec.h @@ -355,7 +355,7 @@ uint8_t ldns_nsec3_salt_length(const ldns_rr *nsec3_rr); /** * Returns the salt bytes used in the given NSEC3 RR * \param[in] *nsec3_rr The RR to read from - * \return The salt in bytes, this is alloced, so you need to free it + * \return The salt in bytes, this is alloc'ed, so you need to free it */ uint8_t *ldns_nsec3_salt_data(const ldns_rr *nsec3_rr); diff --git a/ldns/dnssec_zone.h b/ldns/dnssec_zone.h index 119668cc..156e3910 100644 --- a/ldns/dnssec_zone.h +++ b/ldns/dnssec_zone.h @@ -53,7 +53,7 @@ struct ldns_struct_dnssec_name * Usually, the name is a pointer to the owner name of the first rr for * this name, but sometimes there is no actual data to point to, * for instance in - * names representing empty nonterminals. If so, set alloced to true to + * names representing empty nonterminals. If so, set name_alloced to true to * indicate that this data must also be freed when the name is freed */ bool name_alloced; From 58a83d912e61c296dbd83983617961886324c1c3 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 13 Apr 2022 18:34:24 -0700 Subject: [PATCH 42/83] contrib/python: fix misspellings --- contrib/python/docs/source/install.rst | 2 +- contrib/python/examples/test_dname.py | 2 +- contrib/python/ldns_resolver.i | 2 +- contrib/python/ldns_zone.i | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/python/docs/source/install.rst b/contrib/python/docs/source/install.rst index 03d0f53f..27bf0765 100644 --- a/contrib/python/docs/source/install.rst +++ b/contrib/python/docs/source/install.rst @@ -14,7 +14,7 @@ is required. **Download** -The lates source codes can be downloaded from `here`_. +The latest source codes can be downloaded from `here`_. .. _here: http://nlnetlabs.nl/projects/ldns/ diff --git a/contrib/python/examples/test_dname.py b/contrib/python/examples/test_dname.py index 33237467..4603543f 100755 --- a/contrib/python/examples/test_dname.py +++ b/contrib/python/examples/test_dname.py @@ -44,7 +44,7 @@ def set_error(): except: set_error() # - # Error when printing a dname wich was created from an empty string. + # Error when printing a dname which was created from an empty string. # Must find out why. # try: diff --git a/contrib/python/ldns_resolver.i b/contrib/python/ldns_resolver.i index afe3eeb6..8468cce3 100644 --- a/contrib/python/ldns_resolver.i +++ b/contrib/python/ldns_resolver.i @@ -350,7 +350,7 @@ record." Creates a resolver object from given file name :param filename: Name of file which contains resolver - informations (usually /etc/resolv.conf). + information (usually /etc/resolv.conf). :type filename: str :param raiseException: If True, an exception occurs in case a resolver object can't be created. diff --git a/contrib/python/ldns_zone.i b/contrib/python/ldns_zone.i index db7dd3c7..bbb8d8f2 100644 --- a/contrib/python/ldns_zone.i +++ b/contrib/python/ldns_zone.i @@ -216,7 +216,7 @@ The ``zone.txt`` file contains the following records:: :param rr: the rr to add - :returns: (bool) a true on succes otherwise falsed + :returns: (bool) a true on success otherwise falsed """ return _ldns.ldns_zone_push_rr(self,rr) #parameters: ldns_zone *,ldns_rr *, @@ -229,7 +229,7 @@ The ``zone.txt`` file contains the following records:: :param list: the list to add - :returns: (bool) a true on succes otherwise falsed + :returns: (bool) a true on success otherwise falsed """ return _ldns.ldns_zone_push_rr_list(self,list) #parameters: ldns_zone *,ldns_rr_list *, From 4efa5203b3d81ad76c9100ba9515a351ef7cdb8d Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 13 Apr 2022 18:37:00 -0700 Subject: [PATCH 43/83] contrib/ldnsx: fix spelling of unnecessary --- contrib/ldnsx/ldnsx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ldnsx/ldnsx.py b/contrib/ldnsx/ldnsx.py index 357a97dd..e2bd0e51 100644 --- a/contrib/ldnsx/ldnsx.py +++ b/contrib/ldnsx/ldnsx.py @@ -384,7 +384,7 @@ def AXFR(self,name): >>> tlds.append(rr.owner()) """ - #Dname seems to be unecessary on some computers, but it is on others. Avoid bugs. + #Dname seems to be unnecessary on some computers, but it is on others. Avoid bugs. if self._ldns_resolver.axfr_start(ldns.ldns_dname(name), ldns.LDNS_RR_CLASS_IN) != ldns.LDNS_STATUS_OK: raise Exception("Starting AXFR failed. Error: %s" % ldns.ldns_get_errorstr_by_id(status)) pres = self._ldns_resolver.axfr_next() From 439e4300d13d95294536d7d9288010242ac98126 Mon Sep 17 00:00:00 2001 From: TCY16 Date: Thu, 21 Apr 2022 09:49:31 +0200 Subject: [PATCH 44/83] remove const remaining after 2dfc33c --- edns.c | 2 +- ldns/edns.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/edns.c b/edns.c index bc40f226..5b11f562 100644 --- a/edns.c +++ b/edns.c @@ -295,7 +295,7 @@ ldns_edns_option_list_set_option(ldns_edns_option_list *option_list, bool ldns_edns_option_list_push(ldns_edns_option_list *option_list, - const ldns_edns_option *option) + ldns_edns_option *option) { assert(option_list != NULL); diff --git a/ldns/edns.h b/ldns/edns.h index 272351d0..b121581c 100644 --- a/ldns/edns.h +++ b/ldns/edns.h @@ -254,7 +254,7 @@ ldns_edns_option * ldns_edns_option_list_set_option(ldns_edns_option_list *optio * \return true on success and false of failure */ bool ldns_edns_option_list_push(ldns_edns_option_list *options_list, - const ldns_edns_option *option); + ldns_edns_option *option); /** * removes and returns the EDNS option at the end of the list of options. From 76175fc63c777eb8b41d005ba323d2d8110095c9 Mon Sep 17 00:00:00 2001 From: TCY16 Date: Fri, 22 Apr 2022 11:51:53 +0200 Subject: [PATCH 45/83] change EDNS opt behavior in drill from -e to + --- drill/drill.c | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/drill/drill.c b/drill/drill.c index 9a117592..08c96d17 100644 --- a/drill/drill.c +++ b/drill/drill.c @@ -211,7 +211,7 @@ main(int argc, char *argv[]) /* global first, query opt next, option with parm's last * and sorted */ /* "46DITSVQf:i:w:q:achuvxzy:so:p:b:k:" */ - while ((c = getopt(argc, argv, "46ab:c:d:e:Df:hi:I:k:o:p:q:Qr:sStTuvV:w:xy:z")) != -1) { + while ((c = getopt(argc, argv, "46ab:c:d:Df:hi:I:k:o:p:q:Qr:sStTuvV:w:xy:z")) != -1) { switch(c) { /* global options */ case '4': @@ -291,27 +291,6 @@ main(int argc, char *argv[]) case 'c': resolv_conf_file = optarg; break; - case 'e': - if (strstr(optarg, "nsid")) { - ldns_edns_option *edns; - edns_list = ldns_edns_option_list_new(); - - /* create NSID EDNS*/ - edns = ldns_edns_new_from_data(LDNS_EDNS_NSID, 0, NULL); - - if (edns_list == NULL || edns == NULL) { - error("EDNS option could not be allocated"); - break; - } - - // @TODO rethink this error - if (!(ldns_edns_option_list_push(edns_list, edns))) { - error("EDNS option could not be attached"); - break; - } - - break; - } case 't': qusevc = true; break; @@ -479,6 +458,30 @@ main(int argc, char *argv[]) serv = argv[i] + 1; continue; } + /* if ^+ then it's an EDNS option */ + if (argv[i][0] == '+') { + if (strstr(argv[i], "nsid")) { + ldns_edns_option *edns; + edns_list = ldns_edns_option_list_new(); + + /* create NSID EDNS*/ + edns = ldns_edns_new_from_data(LDNS_EDNS_NSID, 0, NULL); + + if (edns_list == NULL || edns == NULL) { + error("EDNS option could not be allocated"); + break; + } + + if (!(ldns_edns_option_list_push(edns_list, edns))) { + error("EDNS option NSID could not be attached"); + break; + } + } + else { + error("Requested EDNS option not supported"); + break; + } + } /* if has a dot, it's a name */ if (strchr(argv[i], '.')) { name = argv[i]; From 5faa6bd5957e5e3a3de1446ea3f61d2467af50a8 Mon Sep 17 00:00:00 2001 From: TCY16 Date: Fri, 22 Apr 2022 13:08:09 +0200 Subject: [PATCH 46/83] change the ends_option_list growing logic to be in line with rr_list --- edns.c | 67 ++++++++++++++++++++++++++++++++++++++++------------- ldns/edns.h | 1 + 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/edns.c b/edns.c index 5b11f562..10f39d99 100644 --- a/edns.c +++ b/edns.c @@ -12,8 +12,10 @@ #include +#define LDNS_OPTIONLIST_INIT 8 + /* - * Access functions + * Access functions * functions to get and set type checking */ @@ -173,6 +175,7 @@ ldns_edns_option_list_new() } option_list->_option_count = 0; + option_list->_option_capacity = 0; option_list->_options_size = 0; option_list->_options = NULL; return option_list; @@ -297,34 +300,58 @@ bool ldns_edns_option_list_push(ldns_edns_option_list *option_list, ldns_edns_option *option) { + size_t cap; + size_t option_count; + assert(option_list != NULL); - if (option != NULL) { + if (option == NULL) { + return false; + } + + cap = option_list->_option_capacity; + option_count = ldns_edns_option_list_get_count(option_list); + + /* verify we need to grow the array to fit the new option */ + if (option_count+1 > cap) { + ldns_edns_option **new_list; + + /* initialize the capacity if needed, otherwise grow by doubling */ + if (cap == 0) { + cap = LDNS_OPTIONLIST_INIT; /* initial list size */ + } else { + cap *= 2; + } + + new_list = LDNS_XREALLOC(option_list->_options, + ldns_edns_option *, cap); - /* grow the array */ - option_list->_options = LDNS_XREALLOC(option_list->_options, - ldns_edns_option *, option_list->_option_count + 1); - if (!option_list) { + if (!new_list) { return false; } - ldns_edns_option_list_set_option(option_list, option, - option_list->_option_count); - option_list->_option_count += 1; - return true; + option_list->_options = new_list; + option_list->_option_capacity = cap; } - return false; + + /* add the new option */ + ldns_edns_option_list_set_option(option_list, option, + option_list->_option_count); + option_list->_option_count += 1; + + return true; } ldns_edns_option * ldns_edns_option_list_pop(ldns_edns_option_list *option_list) { - ldns_edns_option ** new_list; ldns_edns_option* pop; size_t count; + size_t cap; assert(option_list != NULL); + cap = option_list->_option_capacity; count = ldns_edns_option_list_get_count(option_list); if (count == 0){ @@ -334,12 +361,20 @@ ldns_edns_option_list_pop(ldns_edns_option_list *option_list) pop = ldns_edns_option_list_get_option(option_list, count-1); /* shrink the array */ - new_list = LDNS_XREALLOC(option_list->_options, ldns_edns_option *, count -1); - if (new_list){ - option_list->_options = new_list; + if (cap > LDNS_OPTIONLIST_INIT && count-1 <= cap/2) { + ldns_edns_option **new_list; + + cap /= 2; + + new_list = LDNS_XREALLOC(option_list->_options, + ldns_edns_option *, cap); + if (new_list) { + option_list->_options = new_list; + } + /* if the realloc fails, the capacity for the list remains unchanged */ } - /* shrink the total EDNS size if the popped EDNS option exists */ + /* shrink the total EDNS size of the options if the popped EDNS option exists */ if (pop != NULL) { option_list->_options_size -= (ldns_edns_get_size(pop) + 4); } diff --git a/ldns/edns.h b/ldns/edns.h index b121581c..553b3447 100644 --- a/ldns/edns.h +++ b/ldns/edns.h @@ -108,6 +108,7 @@ typedef struct ldns_struct_edns_option ldns_edns_option; struct ldns_struct_edns_option_list { size_t _option_count; /* the number of EDNS options in the list */ + size_t _option_capacity; /* the amount of options that fit into the list */ size_t _options_size; /* the total size of the options serialized */ ldns_edns_option **_options; }; From 70e6552ebbb84e6c3e5dbee0c94792fae0ab0a0c Mon Sep 17 00:00:00 2001 From: TCY16 Date: Mon, 25 Apr 2022 10:07:39 +0200 Subject: [PATCH 47/83] add assert in ldns_pkt_edns_get_option_list() --- packet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packet.c b/packet.c index b39b0e10..0c16fd53 100644 --- a/packet.c +++ b/packet.c @@ -769,8 +769,9 @@ ldns_pkt_edns_get_option_list(const ldns_pkt *packet) size_t max; const uint8_t* wire; - if (!ldns_pkt_edns_data(packet)) + if (!ldns_pkt_edns_data(packet)) { return NULL; + } /* return the list if it already exists */ if (packet->_edns_list != NULL) { @@ -779,9 +780,9 @@ ldns_pkt_edns_get_option_list(const ldns_pkt *packet) /* if the list doesn't exists, we create it by parsing the _edns_data */ + assert(ldns_pkt_edns_data(packet)); max = ldns_rdf_size(ldns_pkt_edns_data(packet)); wire = ldns_rdf_data(ldns_pkt_edns_data(packet)); - // @TODO do checks so we don't read into un-auth memory (max !< 4) edns_list = ldns_edns_option_list_new(); if (edns_list == NULL) { From a500ab110758bcbb87a92b6b1e30328cfc3fe3a4 Mon Sep 17 00:00:00 2001 From: TCY16 Date: Mon, 25 Apr 2022 10:12:03 +0200 Subject: [PATCH 48/83] add +nsid documentation in the manpage --- drill/drill.1.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drill/drill.1.in b/drill/drill.1.in index b86b880d..f2494243 100644 --- a/drill/drill.1.in +++ b/drill/drill.1.in @@ -222,6 +222,15 @@ specify named base64 tsig key, and optional an algorithm (defaults to hmac-md5.s \fB\-z \fR don't randomize the nameserver list before sending queries. + +.SS EDNS QUERY OPTIONS + +.TP +\fB\+nsid \fR +When set, this EDNS option includes an EDNS name server ID request in the query. + + + .SH "EXIT STATUS" The exit status is 0 if the looked up answer is secure and trusted, or insecure. From 514984785ce1abe9a5ada6564b453def443b06ff Mon Sep 17 00:00:00 2001 From: TCY16 Date: Thu, 28 Apr 2022 12:54:21 +0200 Subject: [PATCH 49/83] fix final @TODOs with comments and better printing --- host2str.c | 8 +++----- ldns/host2str.h | 11 +++++++++++ packet.c | 9 ++++++--- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/host2str.c b/host2str.c index 82c024dc..26d62b87 100644 --- a/host2str.c +++ b/host2str.c @@ -2355,7 +2355,7 @@ ldns_edns_expire2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) return ldns_buffer_status(output); } - // @TODO change this to be more accurate output + // TODO can this output be more accurate? ldns_edns_hex_data2buffer_str(output, data, len); return ldns_buffer_status(output); @@ -2551,7 +2551,7 @@ ldns_edns_ede2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) break; default: ldns_buffer_printf(output, " %02x", data[0]); - ldns_buffer_printf(output, " %02x:", data[1]); + ldns_buffer_printf(output, " %02x", data[1]); break; } @@ -2609,15 +2609,13 @@ ldns_edns_server_tag2buffer_str(ldns_buffer* output, uint8_t* data, size_t len) return ldns_buffer_status(output); } -static ldns_status //@TODO change static? +ldns_status ldns_edns_option_list2buffer_str(ldns_buffer *output, ldns_edns_option_list* edns_list) { size_t count = ldns_edns_option_list_get_count(edns_list); size_t i, size; uint8_t* data; - // @TODO parse malformed? of in packet.c:ldns_pkt_edns_option_list() ? - for (i = 0; i < count; i++) { ldns_edns_option_code code; ldns_edns_option* edns = ldns_edns_option_list_get_option(edns_list, i); diff --git a/ldns/host2str.h b/ldns/host2str.h index f3cffd36..79f5561a 100644 --- a/ldns/host2str.h +++ b/ldns/host2str.h @@ -515,6 +515,17 @@ ldns_status ldns_rr2buffer_str_fmt(ldns_buffer *output, */ ldns_status ldns_pkt2buffer_str(ldns_buffer *output, const ldns_pkt *pkt); +/** + * Converts the list of EDNS options to presentation + * format (as char *) and appends it to the given buffer + * + * \param[in] output pointer to the buffer to append the data to + * \param[in] edns_list the list of EDNS options + * \return status + */ +ldns_status ldns_edns_option_list2buffer_str(ldns_buffer *output, + ldns_edns_option_list* edns_list); + /** * Converts the data in the DNS packet to presentation * format (as char *) and appends it to the given buffer diff --git a/packet.c b/packet.c index 0c16fd53..71d74cfe 100644 --- a/packet.c +++ b/packet.c @@ -778,7 +778,9 @@ ldns_pkt_edns_get_option_list(const ldns_pkt *packet) return packet->_edns_list; } - /* if the list doesn't exists, we create it by parsing the _edns_data */ + /* if the list doesn't exists, we create it by parsing the + * packet->_edns_data + */ assert(ldns_pkt_edns_data(packet)); max = ldns_rdf_size(ldns_pkt_edns_data(packet)); @@ -792,14 +794,15 @@ ldns_pkt_edns_get_option_list(const ldns_pkt *packet) while (pos < max) { ldns_edns_option* edns; uint8_t *data; - if (pos + 4 > max) { + if (pos + 4 > max) { /* make sure the header is */ ldns_edns_option_list_deep_free(edns_list); return NULL; } ldns_edns_option_code code = ldns_read_uint16(&wire[pos]); size_t size = ldns_read_uint16(&wire[pos+2]); pos += 4; - if (pos + size > max) { + + if (pos + size > max) { /* make sure the size fits the data */ ldns_edns_option_list_deep_free(edns_list); return NULL; } From 602d0035f7920fc4da32851f80798754958165bd Mon Sep 17 00:00:00 2001 From: TCY16 Date: Wed, 4 May 2022 13:08:37 +0200 Subject: [PATCH 50/83] fix +nsid position bug by adding forgotten continue --- drill/drill.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drill/drill.c b/drill/drill.c index 08c96d17..f70519b7 100644 --- a/drill/drill.c +++ b/drill/drill.c @@ -476,6 +476,7 @@ main(int argc, char *argv[]) error("EDNS option NSID could not be attached"); break; } + continue; } else { error("Requested EDNS option not supported"); From 8097d24a48a99421882ccdf831e5c16ccdd6e25b Mon Sep 17 00:00:00 2001 From: TCY16 Date: Mon, 23 May 2022 16:05:31 +0200 Subject: [PATCH 51/83] create basis for tpkg test --- Makefile.in | 1 + ldns/ldns.h | 2 +- .../16-unit-tests-edns.Makefile.in | 45 +++++++++ .../16-unit-tests-edns.c | 47 +++++++++ .../16-unit-tests-edns.configure.ac | 96 +++++++++++++++++++ .../16-unit-tests-edns.dsc | 16 ++++ .../16-unit-tests-edns.pre | 45 +++++++++ .../16-unit-tests-edns.test | 14 +++ 8 files changed, 265 insertions(+), 1 deletion(-) create mode 100644 test/16-unit-tests-edns.tpkg/16-unit-tests-edns.Makefile.in create mode 100644 test/16-unit-tests-edns.tpkg/16-unit-tests-edns.c create mode 100644 test/16-unit-tests-edns.tpkg/16-unit-tests-edns.configure.ac create mode 100644 test/16-unit-tests-edns.tpkg/16-unit-tests-edns.dsc create mode 100644 test/16-unit-tests-edns.tpkg/16-unit-tests-edns.pre create mode 100644 test/16-unit-tests-edns.tpkg/16-unit-tests-edns.test diff --git a/Makefile.in b/Makefile.in index 4cd4c906..e6344335 100644 --- a/Makefile.in +++ b/Makefile.in @@ -641,6 +641,7 @@ dnssec_zone.lo dnssec_zone.o: $(srcdir)/dnssec_zone.c ldns/config.h $(srcdir)/ld $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h duration.lo duration.o: $(srcdir)/duration.c ldns/config.h $(srcdir)/ldns/duration.h +edns.lo edns.o: $(srcdir)/edns.c $(srcdir)/ldns/ldns.h $(srcdir)/ldns/common.h error.lo error.o: $(srcdir)/error.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ diff --git a/ldns/ldns.h b/ldns/ldns.h index 74713a21..9b0bc066 100644 --- a/ldns/ldns.h +++ b/ldns/ldns.h @@ -101,6 +101,7 @@ Or you can just use the menu above to browse through the API docs. #include #include #include +#include #include #include #include @@ -123,7 +124,6 @@ Or you can just use the menu above to browse through the API docs. #include #include #include -#include #ifdef __cplusplus extern "C" { diff --git a/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.Makefile.in b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.Makefile.in new file mode 100644 index 00000000..6c691362 --- /dev/null +++ b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.Makefile.in @@ -0,0 +1,45 @@ +# Standard installation pathnames +# See the file LICENSE for the license +SHELL = @SHELL@ +VERSION = @PACKAGE_VERSION@ +basesrcdir = $(shell basename `pwd`) +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +mandir = @mandir@ +datarootdir = @datarootdir@ + +CC = @CC@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ @LIBSSL_CPPFLAGS@ -I../.. +LDFLAGS = @LDFLAGS@ @LIBSSL_LDFLAGS@ -L../../.libs +LIBS = @LIBS@ @LIBSSL_SSL_LIBS@ -lldns + +COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) + +HEADER = config.h +TESTS = 16-unit-tests-edns + +.PHONY: all clean realclean +%.o: + $(COMPILE) -c $(srcdir)/$*.c + +all: $(TESTS) + +13-unit-tests-base: 16-unit-tests-edns.o + $(LINK) -o $@ $+ $(LIBS) + +clean: + rm -f *.o + rm -f $(TESTS) + rm -f lua-rns + +realclean: clean + rm -rf autom4te.cache/ + rm -f config.log config.status aclocal.m4 config.h.in configure Makefile + rm -f config.h + +confclean: clean + rm -rf config.log config.status config.h Makefile diff --git a/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.c b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.c new file mode 100644 index 00000000..dc2e7fc7 --- /dev/null +++ b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.c @@ -0,0 +1,47 @@ + + +#include "config.h" + +#include + +static int +check_option() +{ + ldns_edns_option *edns; + uint8_t *data = LDNS_XMALLOC(uint8_t, 4); + data[0] = 74; + data[1] = 65; + data[2] = 73; + data[3] = 74; + + edns = ldns_edns_new(LDNS_EDNS_EDE, 4, data); + + if (ldns_edns_get_size(edns) != 4) { + printf("Error: EDNS size is incorrect\n"); + return 1; + } + if (ldns_edns_get_code(edns) != LDNS_EDNS_EDE) { + printf("Error: EDNS code is incorrect\n"); + return 1; + } + // if (ldns_edns_get_data(edns)) {} + // if (ldns_edns_get_wireformat_buffer(edns)) {} + + + + // ldns_edns_option *edns2 = ldns_edns_new_from_data(LDNS_EDNS_EDE, size_t size, const void *data); + + return 0; +} + +int main(void) +{ + int result = EXIT_SUCCESS; + + if (!check_option()) { + printf("check_option() failed.\n"); + result = EXIT_FAILURE; + } + + exit(result); +} diff --git a/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.configure.ac b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.configure.ac new file mode 100644 index 00000000..47a0f337 --- /dev/null +++ b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.configure.ac @@ -0,0 +1,96 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.57) +AC_INIT(drill, 1.1.0, ldns-team@nlnetlabs.nl, ldns-team) +AC_CONFIG_SRCDIR([13-unit-tests-base.c]) + +AC_AIX +# Checks for programs. +AC_PROG_CC +AC_PROG_MAKE_SET + +# Checks for libraries. +# Checks for header files. +#AC_HEADER_STDC +#AC_HEADER_SYS_WAIT +# do the very minimum - we can always extend this +AC_CHECK_HEADERS([getopt.h stdlib.h stdio.h assert.h netinet/in.hctype.h time.h]) +AC_CHECK_HEADERS(sys/param.h sys/mount.h,,, +[ + [ + #if HAVE_SYS_PARAM_H + # include + #endif + ] +]) + +# ssl dir if needed +AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=PATH], [set ssl library directory]), +[ + CPPFLAGS="$CPPFLAGS -I$withval/include" + LDFLAGS="$LDFLAGS -L$withval -L$withval/lib" +]) + +# check for ldns +AC_ARG_WITH(ldns, + AC_HELP_STRING([--with-ldns=PATH specify prefix of path of ldns library to use]) + , + [ + specialldnsdir="$withval" + CPPFLAGS="$CPPFLAGS -I$withval/include" + LDFLAGS="$LDFLAGS -L$withval/lib" + ] +) + +AC_CHECK_LIB(ldns, ldns_rr_new,, [ + AC_MSG_ERROR([Can't find ldns library]) + ] +) + +AC_CHECK_HEADER(ldns/ldns.h,, [ + AC_MSG_ERROR([Can't find ldns headers]) + ] +) + +AH_BOTTOM([ + +#include +#include +#include +#include + +#if STDC_HEADERS +#include +#include +#endif + +#ifdef HAVE_STDINT_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +#ifdef HAVE_NETINET_IN_H +#include +#endif + +#ifdef HAVE_ARPA_INET_H +#include +#endif + +#ifdef HAVE_TIME_H +#include +#endif +]) + + +#AC_CHECK_FUNCS([mkdir rmdir strchr strrchr strstr]) + +#AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir") + +AC_CONFIG_FILES([13-unit-tests-base.Makefile]) +AC_CONFIG_HEADER([config.h]) +AC_OUTPUT diff --git a/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.dsc b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.dsc new file mode 100644 index 00000000..a47c52a0 --- /dev/null +++ b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.dsc @@ -0,0 +1,16 @@ +BaseName: 16-unit-tests-edns +Version: 1.0 +Description: Run EDNS unit tests on base 32 / 64 converters and sha1/sha2 functions +CreationDate: Wed Mar 15 10:15:57 CET 2006 +Maintainer: Tom Carpay +Category: +Component: +CmdDepends: +Depends: +Help: +Pre: 16-unit-tests-edns.pre +Post: +Test: 16-unit-tests-edns.test +AuxFiles: 16-unit-tests-edns.Makefile.in 16-unit-tests-edns.configure.ac 16-unit-tests-edns.c +Passed: +Failure: diff --git a/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.pre b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.pre new file mode 100644 index 00000000..ef15d50f --- /dev/null +++ b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.pre @@ -0,0 +1,45 @@ +# #-- 16-unit-tests-edns.pre--# +# source the master var file when it's there +[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master +# use .tpkg.var.test for in test variable passing +[ -f .tpkg.var.test ] && source .tpkg.var.test +# svnserve resets the path, you may need to adjust it, like this: +export PATH=$PATH:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:. + +conf=`which autoconf` ||\ +conf=`which autoconf-2.59` ||\ +conf=`which autoconf-2.61` ||\ +conf=`which autoconf259` + +hdr=`which autoheader` ||\ +hdr=`which autoheader-2.59` ||\ +hdr=`which autoheader-2.61` ||\ +hdr=`which autoheader259` + +mk=`which gmake` ||\ +mk=`which make` + +echo "autoconf: $conf" +echo "autoheader: $hdr" +echo "make: $mk" + +opts=`../../config.status --config` +echo options: $opts + +if [ ! $mk ] || [ ! $conf ] || [ ! $hdr ] ; then + echo "Error, one or more build tools not found, aborting" + exit 1 +fi; + +ssl=`` +if [[ "$OSTYPE" == "darwin"* && -d "/opt/homebrew/Cellar/openssl@1.1" ]]; then + ssl=/opt/homebrew/Cellar/openssl@1.1/1.1.1n/ +fi; + +#$conf 13-unit-tests-base.configure.ac > configure && \ +#chmod +x configure && \ +#$hdr 13-unit-tests-base.configure.ac &&\ +#eval ./configure --with-ldns=../../ with-ssl=$ssl "$opts" && \ +../../config.status --file 16-unit-tests-edns.Makefile +$mk -f 16-unit-tests-edns.Makefile + diff --git a/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.test b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.test new file mode 100644 index 00000000..ee8620fa --- /dev/null +++ b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.test @@ -0,0 +1,14 @@ +# #-- 16-unit-tests-edns.test --# +# source the master var file when it's there +[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master +# use .tpkg.var.test for in test variable passing +[ -f .tpkg.var.test ] && source .tpkg.var.test +# svnserve resets the path, you may need to adjust it, like this: +#PATH=$PATH:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:. + +export LD_LIBRARY_PATH="../../lib:$LD_LIBRARY_PATH" +export DYLD_LIBRARY_PATH="../../lib:$DYLD_LIBRARY_PATH" + +# run the test +./16-unit-tests-edns +exit $? From 01b11942357c76b9ad1888b27d47083f44dc3048 Mon Sep 17 00:00:00 2001 From: TCY16 Date: Mon, 23 May 2022 16:13:56 +0200 Subject: [PATCH 52/83] fix typo in Makefile --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index e6344335..2495644a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -641,7 +641,7 @@ dnssec_zone.lo dnssec_zone.o: $(srcdir)/dnssec_zone.c ldns/config.h $(srcdir)/ld $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h duration.lo duration.o: $(srcdir)/duration.c ldns/config.h $(srcdir)/ldns/duration.h -edns.lo edns.o: $(srcdir)/edns.c $(srcdir)/ldns/ldns.h $(srcdir)/ldns/common.h +edns.lo edns.o: $(srcdir)/edns.c $(srcdir)/ldns/ldns.h ldns/common.h error.lo error.o: $(srcdir)/error.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ From 53d401a00a51e418d1e87b63789565b284f71429 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Tue, 24 May 2022 14:06:00 +0200 Subject: [PATCH 53/83] Program is link target --- test/16-unit-tests-edns.tpkg/16-unit-tests-edns.Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.Makefile.in b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.Makefile.in index 6c691362..459e9e35 100644 --- a/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.Makefile.in +++ b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.Makefile.in @@ -28,7 +28,7 @@ TESTS = 16-unit-tests-edns all: $(TESTS) -13-unit-tests-base: 16-unit-tests-edns.o +16-unit-tests-edns: 16-unit-tests-edns.o $(LINK) -o $@ $+ $(LIBS) clean: From e87512976d7d960da9b6c3148b88d557a59f83bf Mon Sep 17 00:00:00 2001 From: TCY16 Date: Wed, 25 May 2022 15:21:29 +0200 Subject: [PATCH 54/83] finalize tests, fix some limit bugs found during testing --- edns.c | 18 +- ldns/edns.h | 9 +- .../16-unit-tests-edns.c | 248 ++++++++++++++++-- 3 files changed, 241 insertions(+), 34 deletions(-) diff --git a/edns.c b/edns.c index 10f39d99..f77aa73a 100644 --- a/edns.c +++ b/edns.c @@ -196,7 +196,9 @@ ldns_edns_option_list_clone(ldns_edns_option_list *old_list) return NULL; } - new_list->_option_count = old_list->_option_count; + if (old_list->_option_count == 0) { + return new_list; + } /* adding options also updates the total options size */ for (i = 0; i < old_list->_option_count; i++) { @@ -239,17 +241,11 @@ ldns_edns_option_list_get_count(const ldns_edns_option_list *option_list) } } -void -ldns_edns_option_list_set_count(ldns_edns_option_list *option_list, size_t count) -{ - assert(option_list); - option_list->_option_count = count; -} - ldns_edns_option * ldns_edns_option_list_get_option(const ldns_edns_option_list *option_list, size_t index) { if (option_list && index < ldns_edns_option_list_get_count(option_list)) { + assert(option_list->_options[index]); return option_list->_options[index]; } else { return NULL; @@ -275,7 +271,7 @@ ldns_edns_option_list_set_option(ldns_edns_option_list *option_list, assert(option_list != NULL); - if (index < ldns_edns_option_list_get_count(option_list)) { + if (index > ldns_edns_option_list_get_count(option_list)) { return NULL; } @@ -379,7 +375,7 @@ ldns_edns_option_list_pop(ldns_edns_option_list *option_list) option_list->_options_size -= (ldns_edns_get_size(pop) + 4); } - ldns_edns_option_list_set_count(option_list, count - 1); + option_list->_option_count = count - 1; return pop; } @@ -413,7 +409,7 @@ ldns_edns_option_list2wireformat_buffer(const ldns_edns_option_list *option_list data = ldns_edns_get_data(edns); /* make sure the option fits */ - if (ldns_buffer_capacity(buffer) > size + 4) { + if (!(ldns_buffer_available(buffer, size + 4))) { ldns_buffer_free(buffer); return NULL; } diff --git a/ldns/edns.h b/ldns/edns.h index 553b3447..8382364c 100644 --- a/ldns/edns.h +++ b/ldns/edns.h @@ -214,13 +214,6 @@ void ldns_edns_option_list_deep_free(ldns_edns_option_list *options_list); */ size_t ldns_edns_option_list_get_count(const ldns_edns_option_list *options_list); -/** - * sets the number of options in the EDNS options list. - * \param[in] options_list the EDNS options_list with the associated counter - * \param[in] count the new cnumber of EDNS options in the list - */ -void ldns_edns_option_list_set_count(ldns_edns_option_list *options_list, size_t count); - /** * returns the EDNS option as the specified index in the list of EDNS options. * \param[in] options_list the EDNS options_list to read from @@ -245,7 +238,7 @@ size_t ldns_edns_option_list_get_options_size(const ldns_edns_option_list *optio * \param[in] option the EDNS option to add to the list * \return the EDNS option previously located at the index */ -ldns_edns_option * ldns_edns_option_list_set_option(ldns_edns_option_list *options_list, +ldns_edns_option *ldns_edns_option_list_set_option(ldns_edns_option_list *options_list, ldns_edns_option *option, size_t index); /** diff --git a/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.c b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.c index dc2e7fc7..1607df0b 100644 --- a/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.c +++ b/test/16-unit-tests-edns.tpkg/16-unit-tests-edns.c @@ -1,37 +1,251 @@ #include "config.h" - #include +static int +check_option_entries(ldns_edns_option *edns, ldns_edns_option_code code, + size_t size, uint8_t *hex_data) +{ + size_t i; + uint8_t *edns_data; + ldns_buffer *buf; + + if (ldns_edns_get_size(edns) != size) { + printf("Error: EDNS size is incorrect\n"); + return 0; + } + if (ldns_edns_get_code(edns) != code) { + printf("Error: EDNS code is incorrect\n"); + return 0; + } + + edns_data = ldns_edns_get_data(edns); + if (!(edns_data)) { + printf("Error: EDNS data is not returned\n"); + return 0; + } + for (i = 0; i < size; i++) { + if (edns_data[i] != hex_data[i]) { + printf("Error: EDNS data is incorrect\n"); + return 0; + } + } + + buf = ldns_edns_get_wireformat_buffer(edns); + if (ldns_buffer_read_u16(buf) != code) { + printf("Error: EDNS type is incorrect\n"); + return 0; + } + if (ldns_buffer_read_u16(buf) != size) { + printf("Error: EDNS length is incorrect\n"); + return 0; + } + + for (i = 0; i < size; i++) { + if (ldns_buffer_read_u8_at(buf, i+4) != hex_data[i]) { + printf("Error: EDNS data is incorrect: %d, %d\n", + ldns_buffer_read_u8_at(buf, i+4), hex_data[i]); + return 0; + } + } + + return 1; +} + static int check_option() { ldns_edns_option *edns; + ldns_edns_option *clone; uint8_t *data = LDNS_XMALLOC(uint8_t, 4); - data[0] = 74; - data[1] = 65; - data[2] = 73; - data[3] = 74; + + uint8_t hex_data[] = {74, 65, 73, 74}; + + /* Fill the data with "test" in hex */ + data[0] = hex_data[0]; + data[1] = hex_data[1]; + data[2] = hex_data[2]; + data[3] = hex_data[3]; edns = ldns_edns_new(LDNS_EDNS_EDE, 4, data); - if (ldns_edns_get_size(edns) != 4) { - printf("Error: EDNS size is incorrect\n"); - return 1; + if (!(check_option_entries(edns, LDNS_EDNS_EDE, 4, hex_data))) { + return 0; } - if (ldns_edns_get_code(edns) != LDNS_EDNS_EDE) { - printf("Error: EDNS code is incorrect\n"); - return 1; + + ldns_edns_free(edns); + + edns = ldns_edns_new_from_data(LDNS_EDNS_EDE, 4, hex_data); + + if (!(check_option_entries(edns, LDNS_EDNS_EDE, 4, hex_data))) { + return 0; + } + + clone = ldns_edns_clone(edns); + + if (!(check_option_entries(clone, LDNS_EDNS_EDE, 4, hex_data))) { + return 0; } - // if (ldns_edns_get_data(edns)) {} - // if (ldns_edns_get_wireformat_buffer(edns)) {} + ldns_edns_deep_free(edns); + ldns_edns_deep_free(clone); + + return 1; +} + +static int check_option_list_entries(ldns_edns_option_list *list, + ldns_edns_option *option, size_t count, ldns_edns_option_code code, size_t size, + uint8_t *hex_data) +{ + size_t c = ldns_edns_option_list_get_count(list); + + if (c != count) { + printf("Error: EDNS list count is incorrect\n"); + return 0; + } + if (!(option)) { + printf("Error: EDNS list option setter doesn't return option\n"); + return 0; + } - // ldns_edns_option *edns2 = ldns_edns_new_from_data(LDNS_EDNS_EDE, size_t size, const void *data); + if (!(check_option_entries(option, code, size, hex_data))) { + printf("Error: EDNS list option is incorrect\n"); + return 0; + } - return 0; + return 1; +} + +static int +check_option_list() +{ + size_t size, i; + ldns_edns_option_list* list; + ldns_edns_option_list* clone; + ldns_edns_option *option; + ldns_edns_option *copy; + ldns_edns_option *pop; + ldns_buffer *buf; + uint8_t hex_data[] = {74, 65, 73, 74}; + uint8_t hex_data2[] = {74, 65, 73, 74, 74}; + + list = ldns_edns_option_list_new(); // don't verify, this function asserts + + /* Add first option */ + option = ldns_edns_new_from_data(LDNS_EDNS_EDE, 4, hex_data); + + if (ldns_edns_option_list_get_count(list)) { + printf("Error: EDNS list count is incorrect after init\n"); + return 0; + } + + ldns_edns_option_list_push(list, option); + + copy = ldns_edns_option_list_get_option(list, 0); + + if (!(check_option_list_entries(list, copy, 1, LDNS_EDNS_EDE, 4, hex_data))) { + printf("Error: EDNS list entries are incorrect\n"); + return 0; + } + + size = ldns_edns_option_list_get_options_size(list); + + if (size != 8) { // size of the data + 4 for the code and size + printf("Error: EDNS list total option size is incorrect\n"); + return 0; + } + + /* Add second option */ + option = ldns_edns_new_from_data(LDNS_EDNS_PADDING, 5, hex_data2); + + ldns_edns_option_list_push(list, option); + + if (!(check_option_list_entries(list, option, 2, LDNS_EDNS_PADDING, 5, hex_data2))) { + printf("Error: EDNS list entries are incorrect\n"); + return 0; + } + + buf = ldns_edns_option_list2wireformat_buffer(list); + + if (!(buf)) { + printf("Error: EDNS list entries list2wireformat buffer is NULL\n"); + return 0; + } + + /* Verify the wireformat options with the hex data */ + ldns_buffer_skip(buf, 4); + + for (i = 0; i < 4; i++) { + if (ldns_buffer_read_u8(buf) != hex_data[i]) { + printf("Error: EDNS data is incorrect: %d, %d\n", + ldns_buffer_read_u8_at(buf, i), hex_data[i]); + return 0; + } + } + + ldns_buffer_skip(buf, 4); + + for (i = 0; i < 5; i++) { + if (ldns_buffer_read_u8(buf) != hex_data2[i]) { + printf("Error: EDNS data is incorrect: %d, %d\n", + ldns_buffer_read_u8_at(buf, i), hex_data2[i]); + return 0; + } + } + + /* Replace the first option with a copy of the second */ + option = ldns_edns_new_from_data(LDNS_EDNS_PADDING, 5, hex_data2); + + pop = ldns_edns_option_list_set_option(list, option, 0); + + if (!(check_option_list_entries(list, pop, 2, LDNS_EDNS_EDE, 4, hex_data))) { + printf("Error: EDNS list entries are incorrect\n"); + return 0; + } + + ldns_edns_deep_free(pop); + + /* Remove one option from the list */ + + pop = ldns_edns_option_list_pop(list); + + if (!(check_option_list_entries(list, option, 1, LDNS_EDNS_PADDING, 5, hex_data2))) { + printf("Error: EDNS list entries are incorrect\n"); + return 0; + } + + ldns_edns_deep_free(pop); + + /* Clone the list */ + clone = ldns_edns_option_list_clone(list); + + if (!(clone)) { + printf("Error: EDNS list clone does not exist\n"); + return 0; + } + + if (!(check_option_list_entries(clone, option, 1, LDNS_EDNS_PADDING, 5, hex_data2))) { + printf("Error: EDNS list entries are incorrect\n"); + return 0; + } + + /* Remove final entry from cloned list */ + pop = ldns_edns_option_list_pop(list); + + ldns_edns_deep_free(pop); + + if (ldns_edns_option_list_get_count(clone) == 0) { + printf("Error: EDNS list entries are incorrect at zero\n"); + return 0; + } + + ldns_edns_option_list_free(clone); + + ldns_edns_option_list_deep_free(list); + + return 1; } int main(void) @@ -42,6 +256,10 @@ int main(void) printf("check_option() failed.\n"); result = EXIT_FAILURE; } + if (!check_option_list()) { + printf("check_option_list() failed.\n"); + result = EXIT_FAILURE; + } exit(result); } From d34309fbe6a131215f2b7974a102aef28db3bf8f Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 9 Jun 2022 12:27:34 +0200 Subject: [PATCH 55/83] Enable compile of SVCB and HTTPS support by default Since it is almost RFC. See also Issue #177 --- Changelog | 1 + configure.ac | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Changelog b/Changelog index c0c7c5f3..c51e473c 100644 --- a/Changelog +++ b/Changelog @@ -5,6 +5,7 @@ parameters. Thanks aldot. * Fix build error on Solaris 10 with inet_ntop redeclaration error. * Fix -U flag with ldns-signzone. Thanks Ulrich and Jonathan + * Enable compile of SVCB and HTTPS support by default. 1.8.1 2021-12-03 * bugfix #146: ldns-1.7.1 had soname 3.0, so ldns-1.8.x soname diff --git a/configure.ac b/configure.ac index fb75a104..6def676f 100644 --- a/configure.ac +++ b/configure.ac @@ -724,12 +724,12 @@ case "$enable_rrtype_amtrelay" in no|*) ;; esac -AC_ARG_ENABLE(rrtype-svcb-https, AC_HELP_STRING([--enable-rrtype-svcb-https], [Enable draft RR types SVCB and HTTPS.])) +AC_ARG_ENABLE(rrtype-svcb-https, AC_HELP_STRING([--disable-rrtype-svcb-https], [Disable RR types SVCB and HTTPS.])) case "$enable_rrtype_svcb_https" in - yes) - AC_DEFINE_UNQUOTED([RRTYPE_SVCB_HTTPS], [], [Define this to enable RR types SVCB and HTTPS.]) + no) ;; - no|*) + yes|*) + AC_DEFINE_UNQUOTED([RRTYPE_SVCB_HTTPS], [], [Define this to enable RR types SVCB and HTTPS.]) ;; esac From ea1c323bfafea8dad00de34f72682b90e2ca13d5 Mon Sep 17 00:00:00 2001 From: Claudius Zingerli Date: Tue, 21 Jun 2022 16:58:29 +0200 Subject: [PATCH 56/83] Free line memory even if zone file parsing fails --- rr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rr.c b/rr.c index eb24f3c9..d12e5b16 100644 --- a/rr.c +++ b/rr.c @@ -742,6 +742,7 @@ _ldns_rr_new_frm_fp_l_internal(ldns_rr **newrr, FILE *fp, /* read an entire line in from the file */ if ((s = ldns_fget_token_l_st( fp, &line, &limit, false , LDNS_PARSE_SKIP_SPACE, line_nr))) + LDNS_FREE(line); return s; if (strncmp(line, "$ORIGIN", 7) == 0 && isspace((unsigned char)line[7])) { From 758e32816b5694e9fdb36ae910248f8d8951f4ed Mon Sep 17 00:00:00 2001 From: Claudius Zingerli Date: Tue, 21 Jun 2022 17:23:12 +0200 Subject: [PATCH 57/83] Adding braces --- rr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rr.c b/rr.c index d12e5b16..a0ffdb21 100644 --- a/rr.c +++ b/rr.c @@ -741,9 +741,10 @@ _ldns_rr_new_frm_fp_l_internal(ldns_rr **newrr, FILE *fp, } /* read an entire line in from the file */ if ((s = ldns_fget_token_l_st( fp, &line, &limit, false - , LDNS_PARSE_SKIP_SPACE, line_nr))) + , LDNS_PARSE_SKIP_SPACE, line_nr))) { LDNS_FREE(line); return s; + } if (strncmp(line, "$ORIGIN", 7) == 0 && isspace((unsigned char)line[7])) { if (*origin) { From e78feeef8003acf4963ecf0b3dc6ad1f6a9f67a4 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Tue, 12 Jul 2022 10:40:41 +0200 Subject: [PATCH 58/83] Correct dname count for SVCB and HTTPS --- rr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rr.c b/rr.c index eb24f3c9..c6c3d421 100644 --- a/rr.c +++ b/rr.c @@ -2233,9 +2233,9 @@ static ldns_rr_descriptor rdata_field_descriptors[] = { {LDNS_RR_TYPE_ZONEMD, "ZONEMD", 4, 4, type_zonemd_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 }, #ifdef RRTYPE_SVCB_HTTPS /* 64 */ - {LDNS_RR_TYPE_SVCB, "SVCB", 2, 3, type_svcb_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 }, + {LDNS_RR_TYPE_SVCB, "SVCB", 2, 3, type_svcb_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 }, /* 65 */ - {LDNS_RR_TYPE_HTTPS, "HTTPS", 2, 3, type_svcb_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 }, + {LDNS_RR_TYPE_HTTPS, "HTTPS", 2, 3, type_svcb_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 }, #else {LDNS_RR_TYPE_NULL, "TYPE64", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 }, From 9fa2cb97a2ca75dddf9d1ac8408e3f4a5e191a60 Mon Sep 17 00:00:00 2001 From: TCY16 Date: Tue, 12 Jul 2022 15:22:19 +0200 Subject: [PATCH 59/83] change meaning of +, and fix incorrect string compare --- drill/drill.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drill/drill.c b/drill/drill.c index f70519b7..04b930b6 100644 --- a/drill/drill.c +++ b/drill/drill.c @@ -460,7 +460,7 @@ main(int argc, char *argv[]) } /* if ^+ then it's an EDNS option */ if (argv[i][0] == '+') { - if (strstr(argv[i], "nsid")) { + (strncmp(argv[i]+1, "nsid", 4)) ldns_edns_option *edns; edns_list = ldns_edns_option_list_new(); @@ -479,7 +479,7 @@ main(int argc, char *argv[]) continue; } else { - error("Requested EDNS option not supported"); + error("Unsupported argument after '+'"); break; } } From 2042e6d822dbc99a2470d192e8b37b69059ed2cc Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Tue, 12 Jul 2022 15:29:02 +0200 Subject: [PATCH 60/83] edns_option_list as part of the packet --- drill/drill.c | 8 ++------ edns.c | 5 +++++ host2str.c | 13 +++++-------- host2wire.c | 17 +++++++++++++++-- ldns/packet.h | 30 +++++++++--------------------- packet.c | 50 +++++++++++--------------------------------------- 6 files changed, 47 insertions(+), 76 deletions(-) diff --git a/drill/drill.c b/drill/drill.c index f70519b7..5940f706 100644 --- a/drill/drill.c +++ b/drill/drill.c @@ -460,7 +460,7 @@ main(int argc, char *argv[]) } /* if ^+ then it's an EDNS option */ if (argv[i][0] == '+') { - if (strstr(argv[i], "nsid")) { + if (strcmp(argv[i]+1, "nsid")) { ldns_edns_option *edns; edns_list = ldns_edns_option_list_new(); @@ -902,11 +902,8 @@ main(int argc, char *argv[]) } if (edns_list) { - /* attach the structed EDNS options for completeness */ + /* attach the structed EDNS options */ ldns_pkt_set_edns_option_list(qpkt, edns_list); - - /* write the structured EDNS data to unstructured data */ - ldns_pkt_edns_write_option_list_to_edns_data(qpkt, edns_list); } status = ldns_resolver_send_pkt(&pkt, res, qpkt); @@ -1033,7 +1030,6 @@ main(int argc, char *argv[]) ldns_rr_list_deep_free(key_list); ldns_rr_list_deep_free(cmdline_rr_list); ldns_rdf_deep_free(trace_start_name); - ldns_edns_option_list_deep_free(edns_list); xfree(progname); xfree(tsig_name); xfree(tsig_data); diff --git a/edns.c b/edns.c index f77aa73a..b9d1828b 100644 --- a/edns.c +++ b/edns.c @@ -388,12 +388,17 @@ ldns_edns_option_list2wireformat_buffer(const ldns_edns_option_list *option_list ldns_edns_option *edns; uint8_t* data = NULL; + if (!option_list) + return NULL; + /* get the number of EDNS options in the list*/ list_size = ldns_edns_option_list_get_count(option_list); /* create buffer the size of the total EDNS wireformat options */ options_size = ldns_edns_option_list_get_options_size(option_list); buffer = ldns_buffer_new(options_size); + if (!buffer) + return NULL; /* write individual serialized EDNS options to final buffer*/ for (i = 0; i < list_size; i++) { diff --git a/host2str.c b/host2str.c index ffb956f1..c29f523b 100644 --- a/host2str.c +++ b/host2str.c @@ -2765,7 +2765,6 @@ ldns_pkt2buffer_str_fmt(ldns_buffer *output, } } - ldns_buffer_printf(output, "\n"); /* add some further fields */ ldns_buffer_printf(output, ";; Query time: %d msec\n", @@ -2786,17 +2785,15 @@ ldns_pkt2buffer_str_fmt(ldns_buffer *output, ldns_buffer_printf(output, " ; udp: %u\n", ldns_pkt_edns_udp_size(pkt)); - if (ldns_pkt_edns_data(pkt)) { + if (pkt->_edns_list) + ldns_edns_option_list2buffer_str(output, pkt->_edns_list); + + else if (ldns_pkt_edns_data(pkt)) { ldns_edns_option_list* edns_list; /* parse the EDNS data into separate EDNS options * and add them to the list */ - if ((edns_list = ldns_pkt_edns_get_option_list(pkt))) { + if ((edns_list = ldns_pkt_edns_get_option_list((ldns_pkt *)pkt))) { ldns_edns_option_list2buffer_str(output, edns_list); - /* TODO: We need to free for now, but maybe we - * should do this differently eventually - * use a member in pkt or something... - */ - ldns_edns_option_list_deep_free(edns_list); } else { ldns_buffer_printf(output, ";; Data: "); (void)ldns_rdf2buffer_str(output, ldns_pkt_edns_data(pkt)); diff --git a/host2wire.c b/host2wire.c index 96fbd6ec..32c9c545 100644 --- a/host2wire.c +++ b/host2wire.c @@ -396,6 +396,9 @@ ldns_pkt2buffer_wire_compress(ldns_buffer *buffer, const ldns_pkt *packet, ldns_ ldns_rr *edns_rr; uint8_t edata[4]; + ldns_buffer *edns_buf = NULL; + ldns_rdf *edns_rdf = NULL; + (void) ldns_hdr2buffer_wire(buffer, packet); rr_list = ldns_pkt_question(packet); @@ -440,8 +443,18 @@ ldns_pkt2buffer_wire_compress(ldns_buffer *buffer, const ldns_pkt *packet, ldns_ ldns_write_uint16(&edata[2], ldns_pkt_edns_z(packet)); ldns_rr_set_ttl(edns_rr, ldns_read_uint32(edata)); /* don't forget to add the edns rdata (if any) */ - if (packet->_edns_data) - ldns_rr_push_rdf (edns_rr, packet->_edns_data); + edns_buf = ldns_edns_option_list2wireformat_buffer(packet->_edns_list); + if (edns_buf) + edns_rdf = ldns_rdf_new( LDNS_RDF_TYPE_UNKNOWN + , ldns_buffer_limit(edns_buf) + , ldns_buffer_export(edns_buf)); + ldns_buffer_free(edns_buf); + if (edns_rdf) { + ldns_rr_push_rdf(edns_rr, edns_rdf); + ldns_rdf_deep_free(edns_rdf); + + } else if (packet->_edns_data) + ldns_rr_push_rdf(edns_rr, packet->_edns_data); (void)ldns_rr2buffer_wire_compress(buffer, edns_rr, LDNS_SECTION_ADDITIONAL, compression_data); /* take the edns rdata back out of the rr before we free rr */ if (packet->_edns_data) diff --git a/ldns/packet.h b/ldns/packet.h index f383d0dd..4c07a855 100644 --- a/ldns/packet.h +++ b/ldns/packet.h @@ -510,6 +510,7 @@ ldns_rr_list *ldns_pkt_rr_list_by_type(const ldns_pkt *p, ldns_rr_type t, ldns_p */ ldns_rr_list *ldns_pkt_rr_list_by_name_and_type(const ldns_pkt *packet, const ldns_rdf *ownername, ldns_rr_type type, ldns_pkt_section sec); + /** * check to see if an rr exist in the packet * \param[in] pkt the packet to examine @@ -689,19 +690,12 @@ uint8_t ldns_pkt_edns_version(const ldns_pkt *packet); */ uint16_t ldns_pkt_edns_z(const ldns_pkt *packet); /** - * return the packet's arbitrary EDNS data + * return the packet's EDNS data * \param[in] packet the packet * \return the data */ ldns_rdf *ldns_pkt_edns_data(const ldns_pkt *packet); -/** - * return the packet's structured EDNS data option list - * \param[in] packet the packet - * \return the list of EDNS options - */ -ldns_edns_option_list* ldns_pkt_edns_option_list(const ldns_pkt *packet); - /** * return the packet's edns do bit * \param[in] packet the packet @@ -739,21 +733,14 @@ void ldns_pkt_set_edns_unassigned(ldns_pkt *packet, uint16_t value); bool ldns_pkt_edns(const ldns_pkt *packet); /** - * Returns a list of structured EDNS options + * Returns a list of structured EDNS options. The list will be automatically + * freed when the packet is freed. The option list can be manipulated and + * will be used when converting the packet to wireformat with ldns_pkt2wire. * * \param[in] packet the packet which contains the EDNS data * \return the list of EDNS options */ -ldns_edns_option_list* ldns_pkt_edns_get_option_list(const ldns_pkt *packet); - -/** - * Serialize the EDNS options to wireformat and write to the arbitrary EDNS data member - * \param[in] packet the packet which contains the EDNS data - * \param[in] edns_list the list of EDNS options - * \return true if succesful and false if not - */ -bool ldns_pkt_edns_write_option_list_to_edns_data(ldns_pkt *packet, - ldns_edns_option_list* edns_list); +ldns_edns_option_list* ldns_pkt_edns_get_option_list(ldns_pkt *packet); /** * Set the packet's edns udp size @@ -780,14 +767,15 @@ void ldns_pkt_set_edns_version(ldns_pkt *packet, uint8_t v); */ void ldns_pkt_set_edns_z(ldns_pkt *packet, uint16_t z); /** - * Set the packet's arbitrary EDNS data + * Set the packet's EDNS data * \param[in] packet the packet * \param[in] data the data */ void ldns_pkt_set_edns_data(ldns_pkt *packet, ldns_rdf *data); /** - * Set the packet's structured EDNS data + * Set the packet's structured EDNS data. Once an edns_option_list is set + * (or get), the option list will be used for converting into wireformat. * \param[in] packet the packet * \param[in] data the data */ diff --git a/packet.c b/packet.c index 71d74cfe..3562b399 100644 --- a/packet.c +++ b/packet.c @@ -262,12 +262,6 @@ ldns_pkt_edns_data(const ldns_pkt *packet) return packet->_edns_data; } -ldns_edns_option_list* -ldns_pkt_edns_option_list(const ldns_pkt *packet) -{ - return packet->_edns_list; -} - /* return only those rr that share the ownername */ ldns_rr_list * ldns_pkt_rr_list_by_name(const ldns_pkt *packet, @@ -647,6 +641,8 @@ ldns_pkt_set_edns_data(ldns_pkt *packet, ldns_rdf *data) void ldns_pkt_set_edns_option_list(ldns_pkt *packet, ldns_edns_option_list *list) { + if (packet->_edns_list) + ldns_edns_option_list_deep_free(packet->_edns_list); packet->_edns_list = list; } @@ -762,17 +758,13 @@ ldns_pkt_edns(const ldns_pkt *pkt) } ldns_edns_option_list* -ldns_pkt_edns_get_option_list(const ldns_pkt *packet) +ldns_pkt_edns_get_option_list(ldns_pkt *packet) { size_t pos = 0; ldns_edns_option_list* edns_list; size_t max; const uint8_t* wire; - if (!ldns_pkt_edns_data(packet)) { - return NULL; - } - /* return the list if it already exists */ if (packet->_edns_list != NULL) { return packet->_edns_list; @@ -781,6 +773,9 @@ ldns_pkt_edns_get_option_list(const ldns_pkt *packet) /* if the list doesn't exists, we create it by parsing the * packet->_edns_data */ + if (!ldns_pkt_edns_data(packet)) { + return NULL; + } assert(ldns_pkt_edns_data(packet)); max = ldns_rdf_size(ldns_pkt_edns_data(packet)); @@ -825,31 +820,8 @@ ldns_pkt_edns_get_option_list(const ldns_pkt *packet) } - return edns_list; -} - -bool -ldns_pkt_edns_write_option_list_to_edns_data(ldns_pkt *packet, - ldns_edns_option_list* edns_list) -{ - ldns_buffer* buffer; - ldns_rdf* edns_rdf; - - /* get the EDNS options in wireformat */ - buffer = ldns_edns_option_list2wireformat_buffer(edns_list); - - if (buffer == NULL) { - return false; - } - - /* read the data and create the EDNS RDF */ - edns_rdf = ldns_rdf_new(LDNS_RDF_TYPE_UNKNOWN, ldns_buffer_limit(buffer), - ldns_buffer_export(buffer)); - - /* set the new EDNS RDF in the packet */ - ldns_pkt_set_edns_data(packet, edns_rdf); - - return true; + packet->_edns_list = edns_list; + return packet->_edns_list; } @@ -901,7 +873,7 @@ ldns_pkt_new(void) ldns_pkt_set_edns_version(packet, 0); ldns_pkt_set_edns_z(packet, 0); ldns_pkt_set_edns_data(packet, NULL); - ldns_pkt_set_edns_option_list(packet, NULL); + packet->_edns_list = NULL; packet->_edns_present = false; ldns_pkt_set_tsig(packet, NULL); @@ -1270,9 +1242,9 @@ ldns_pkt_clone(const ldns_pkt *pkt) ldns_pkt_set_edns_data(new_pkt, ldns_rdf_clone(ldns_pkt_edns_data(pkt))); ldns_pkt_set_edns_do(new_pkt, ldns_pkt_edns_do(pkt)); - if (ldns_pkt_edns_option_list(pkt)) + if (pkt->_edns_list) ldns_pkt_set_edns_option_list(new_pkt, - ldns_edns_option_list_clone(ldns_pkt_edns_get_option_list(pkt))); + ldns_edns_option_list_clone(pkt->_edns_list)); ldns_rr_list_deep_free(new_pkt->_question); ldns_rr_list_deep_free(new_pkt->_answer); From 6eec1eab1c7d6e087ae89d6b0c515f75610090d3 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Tue, 12 Jul 2022 16:52:08 +0200 Subject: [PATCH 61/83] Log bugfix #179 --- Changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog b/Changelog index c51e473c..2a9b79e6 100644 --- a/Changelog +++ b/Changelog @@ -6,6 +6,8 @@ * Fix build error on Solaris 10 with inet_ntop redeclaration error. * Fix -U flag with ldns-signzone. Thanks Ulrich and Jonathan * Enable compile of SVCB and HTTPS support by default. + * bugfix #179: Free line memory even if zone file parsing fails + Thanks Claudius Zingerli 1.8.1 2021-12-03 * bugfix #146: ldns-1.7.1 had soname 3.0, so ldns-1.8.x soname From dcf0440accf5ac3d3aafae481a7cf911bcf5891e Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Tue, 12 Jul 2022 16:53:56 +0200 Subject: [PATCH 62/83] Fix #166 Grow buffer when converting to presentation format --- Changelog | 3 +++ host2str.c | 42 +++++++++++++++++++++--------------------- ldns/buffer.h | 31 +++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 21 deletions(-) diff --git a/Changelog b/Changelog index 2a9b79e6..601a2ecf 100644 --- a/Changelog +++ b/Changelog @@ -8,6 +8,9 @@ * Enable compile of SVCB and HTTPS support by default. * bugfix #179: Free line memory even if zone file parsing fails Thanks Claudius Zingerli + * bugfix #166: Grow buffer when writing chars and fixed size + strings when converting to presentation format, preventing + potential assersion errors. 1.8.1 2021-12-03 * bugfix #146: ldns-1.7.1 had soname 3.0, so ldns-1.8.x soname diff --git a/host2str.c b/host2str.c index 45b3f42d..b0c76e93 100644 --- a/host2str.c +++ b/host2str.c @@ -1286,7 +1286,7 @@ ldns_rdf2buffer_str_hip(ldns_buffer *output, const ldns_rdf *rdf) ldns_buffer_printf(output, "%02x", (int) *data); } - ldns_buffer_write_u8(output, (uint8_t) ' '); + ldns_buffer_write_char(output, (uint8_t) ' '); if (ldns_buffer_reserve(output, ldns_b64_ntop_calculate_size(pk_size))) { @@ -1402,7 +1402,7 @@ svcparam_mandatory2buffer_str(ldns_buffer *output, size_t sz, uint8_t *data) svcparam_key2buffer_str(output, ldns_read_uint16(data)); for (data += 2, sz -= 2; sz; data += 2, sz -= 2) { - ldns_buffer_write_u8(output, ','); + ldns_buffer_write_char(output, ','); svcparam_key2buffer_str(output, ldns_read_uint16(data)); } return ldns_buffer_status(output); @@ -1425,7 +1425,7 @@ svcparam_alpn2buffer_str(ldns_buffer *output, size_t sz, uint8_t *data) quote = i < *dp; } if (quote) - ldns_buffer_write_u8(output, '"'); + ldns_buffer_write_char(output, '"'); while (data < eod) { uint8_t *eot = data + 1 + *data; @@ -1433,22 +1433,22 @@ svcparam_alpn2buffer_str(ldns_buffer *output, size_t sz, uint8_t *data) return LDNS_STATUS_INVALID_SVCPARAM_VALUE; if (eod - data < (int)sz) - ldns_buffer_write_u8(output, ','); + ldns_buffer_write_char(output, ','); for (data += 1; data < eot; data += 1) { uint8_t ch = *data; if (isprint(ch) || ch == '\t') { if (ch == '"' || ch == ',' || ch == '\\') - ldns_buffer_write_u8(output, '\\'); - ldns_buffer_write_u8(output, ch); + ldns_buffer_write_char(output, '\\'); + ldns_buffer_write_char(output, ch); } else ldns_buffer_printf(output, "\\%03u" , (unsigned)ch); } } if (quote) - ldns_buffer_write_u8(output, '"'); + ldns_buffer_write_char(output, '"'); return ldns_buffer_status(output); } @@ -1469,14 +1469,14 @@ svcparam_ipv4hint2buffer_str(ldns_buffer *output, size_t sz, uint8_t *data) if (sz % 4 || !inet_ntop(AF_INET, data, str, INET_ADDRSTRLEN)) return LDNS_STATUS_INVALID_SVCPARAM_VALUE; - ldns_buffer_write_string(output, str); + ldns_buffer_write_chars(output, str); for (data += 4, sz -= 4; sz ; data += 4, sz -= 4 ) { - ldns_buffer_write_u8(output, ','); + ldns_buffer_write_char(output, ','); if (!inet_ntop(AF_INET, data, str, INET_ADDRSTRLEN)) return LDNS_STATUS_INVALID_SVCPARAM_VALUE; - ldns_buffer_write_string(output, str); + ldns_buffer_write_chars(output, str); } return ldns_buffer_status(output); } @@ -1508,14 +1508,14 @@ svcparam_ipv6hint2buffer_str(ldns_buffer *output, size_t sz, uint8_t *data) if (sz % 16 || !inet_ntop(AF_INET6, data, str, INET6_ADDRSTRLEN)) return LDNS_STATUS_INVALID_SVCPARAM_VALUE; - ldns_buffer_write_string(output, str); + ldns_buffer_write_chars(output, str); for (data += 16, sz -= 16; sz ; data += 16, sz -= 16) { - ldns_buffer_write_u8(output, ','); + ldns_buffer_write_char(output, ','); if (!inet_ntop(AF_INET6, data, str, INET6_ADDRSTRLEN)) return LDNS_STATUS_INVALID_SVCPARAM_VALUE; - ldns_buffer_write_string(output, str); + ldns_buffer_write_chars(output, str); } return ldns_buffer_status(output); } @@ -1530,20 +1530,20 @@ svcparam_value2buffer_str(ldns_buffer *output, size_t sz, uint8_t *data) ; /* pass */ if ((quote = dp < eod)) - ldns_buffer_write_u8(output, '"'); + ldns_buffer_write_char(output, '"'); for (dp = data; dp < eod; dp++) { uint8_t ch = *dp; if (isprint(ch) || ch == '\t') { if (ch == '"' || ch == '\\') - ldns_buffer_write_u8(output, '\\'); - ldns_buffer_write_u8(output, ch); + ldns_buffer_write_char(output, '\\'); + ldns_buffer_write_char(output, ch); } else ldns_buffer_printf(output, "\\%03u", (unsigned)ch); } if (quote) - ldns_buffer_write_u8(output, '"'); + ldns_buffer_write_char(output, '"'); return ldns_buffer_status(output); } @@ -1569,7 +1569,7 @@ ldns_rdf2buffer_str_svcparams(ldns_buffer *output, const ldns_rdf *rdf) return LDNS_STATUS_RDATA_OVERFLOW; if (dp > data) - ldns_buffer_write_u8(output, ' '); + ldns_buffer_write_char(output, ' '); if ((st = svcparam_key2buffer_str(output, key))) return st; @@ -1577,7 +1577,7 @@ ldns_rdf2buffer_str_svcparams(ldns_buffer *output, const ldns_rdf *rdf) if (val_sz == 0) continue; dp += 4; - ldns_buffer_write_u8(output, '='); + ldns_buffer_write_char(output, '='); switch (key) { case LDNS_SVCPARAM_KEY_MANDATORY: st = svcparam_mandatory2buffer_str(output, val_sz, dp); @@ -2653,7 +2653,7 @@ ldns_buffer2str(ldns_buffer *buffer) if (!ldns_buffer_reserve(buffer, 1)) { return NULL; } - ldns_buffer_write_u8(buffer, (uint8_t) '\0'); + ldns_buffer_write_char(buffer, (uint8_t) '\0'); if (!ldns_buffer_set_capacity(buffer, ldns_buffer_position(buffer))) { return NULL; } @@ -2676,7 +2676,7 @@ ldns_buffer_export2str(ldns_buffer *buffer) if (! ldns_buffer_reserve(buffer, 1)) { return NULL; } - ldns_buffer_write_u8(buffer, 0); + ldns_buffer_write_char(buffer, 0); /* reallocate memory to the size of the string and export */ ldns_buffer_set_capacity(buffer, ldns_buffer_position(buffer)); diff --git a/ldns/buffer.h b/ldns/buffer.h index f49a550b..79ae0f5c 100644 --- a/ldns/buffer.h +++ b/ldns/buffer.h @@ -399,6 +399,22 @@ ldns_buffer_write_string(ldns_buffer *buffer, const char *str) ldns_buffer_write(buffer, str, strlen(str)); } +/** + * copies the given (null-delimited) string to the current position at the buffer + * increasing the capacity if necessary + * \param[in] buffer the buffer + * \param[in] str the string to write + */ +INLINE void +ldns_buffer_write_chars(ldns_buffer *buffer, const char *str) +{ + if (!ldns_buffer_reserve(buffer, strlen(str))) + buffer->_status = LDNS_STATUS_MEM_ERR; + else + ldns_buffer_write_string(buffer, str); +} + + /** * writes the given byte of data at the given position in the buffer * \param[in] buffer the buffer @@ -424,6 +440,21 @@ ldns_buffer_write_u8(ldns_buffer *buffer, uint8_t data) buffer->_position += sizeof(data); } +/** + * writes the given byte of data at the current position in the buffer + * increasing the capacity if necessary + * \param[in] buffer the buffer + * \param[in] data the 8 bits to write + */ +INLINE void +ldns_buffer_write_char(ldns_buffer *buffer, uint8_t data) +{ + if (!ldns_buffer_reserve(buffer, sizeof(data))) + buffer->_status = LDNS_STATUS_MEM_ERR; + else + ldns_buffer_write_u8(buffer, data); +} + /** * writes the given 2 byte integer at the given position in the buffer * \param[in] buffer the buffer From 8504801aebd5ed66c0e5eb7ae22be208a4f838ca Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 13 Jul 2022 22:05:06 +0200 Subject: [PATCH 63/83] strcmp returns 0 if equal --- drill/drill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drill/drill.c b/drill/drill.c index a686710b..62e0c4dd 100644 --- a/drill/drill.c +++ b/drill/drill.c @@ -460,7 +460,7 @@ main(int argc, char *argv[]) } /* if ^+ then it's an EDNS option */ if (argv[i][0] == '+') { - if (strcmp(argv[i]+1, "nsid")) { + if (!strcmp(argv[i]+1, "nsid")) { ldns_edns_option *edns; edns_list = ldns_edns_option_list_new(); From 39f9dbefe4558ce092dc37fdb53c1f59aa0837b7 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 13 Jul 2022 22:28:57 +0200 Subject: [PATCH 64/83] Algorithm names and numbers don't require crypto even if not supported --- host2str.c | 14 -------------- ldns/keys.h | 8 -------- 2 files changed, 22 deletions(-) diff --git a/host2str.c b/host2str.c index b0c76e93..7b172ca3 100644 --- a/host2str.c +++ b/host2str.c @@ -49,32 +49,18 @@ ldns_lookup_table ldns_algorithms[] = { { LDNS_RSAMD5, "RSAMD5" }, { LDNS_DH, "DH" }, -#ifdef USE_DSA { LDNS_DSA, "DSA" }, -#endif /* USE_DSA */ { LDNS_ECC, "ECC" }, { LDNS_RSASHA1, "RSASHA1" }, -#ifdef USE_DSA { LDNS_DSA_NSEC3, "DSA-NSEC3-SHA1" }, -#endif /* USE_DSA */ { LDNS_RSASHA1_NSEC3, "RSASHA1-NSEC3-SHA1" }, -#ifdef USE_SHA2 { LDNS_RSASHA256, "RSASHA256"}, { LDNS_RSASHA512, "RSASHA512"}, -#endif -#ifdef USE_GOST { LDNS_ECC_GOST, "ECC-GOST"}, -#endif -#ifdef USE_ECDSA { LDNS_ECDSAP256SHA256, "ECDSAP256SHA256"}, { LDNS_ECDSAP384SHA384, "ECDSAP384SHA384"}, -#endif -#ifdef USE_ED25519 { LDNS_ED25519, "ED25519"}, -#endif -#ifdef USE_ED448 { LDNS_ED448, "ED448"}, -#endif { LDNS_INDIRECT, "INDIRECT" }, { LDNS_PRIVATEDNS, "PRIVATEDNS" }, { LDNS_PRIVATEOID, "PRIVATEOID" }, diff --git a/ldns/keys.h b/ldns/keys.h index 0e65f72b..847825e5 100644 --- a/ldns/keys.h +++ b/ldns/keys.h @@ -45,26 +45,18 @@ enum ldns_enum_algorithm { LDNS_RSAMD5 = 1, /* RFC 4034,4035 */ LDNS_DH = 2, -#if LDNS_BUILD_CONFIG_USE_DSA LDNS_DSA = 3, -#endif /* LDNS_BUILD_CONFIG_USE_DSA */ LDNS_ECC = 4, LDNS_RSASHA1 = 5, -#if LDNS_BUILD_CONFIG_USE_DSA LDNS_DSA_NSEC3 = 6, -#endif /* LDNS_BUILD_CONFIG_USE_DSA */ LDNS_RSASHA1_NSEC3 = 7, LDNS_RSASHA256 = 8, /* RFC 5702 */ LDNS_RSASHA512 = 10, /* RFC 5702 */ LDNS_ECC_GOST = 12, /* RFC 5933 */ LDNS_ECDSAP256SHA256 = 13, /* RFC 6605 */ LDNS_ECDSAP384SHA384 = 14, /* RFC 6605 */ -#if LDNS_BUILD_CONFIG_USE_ED25519 LDNS_ED25519 = 15, /* RFC 8080 */ -#endif /* LDNS_BUILD_CONFIG_USE_ED25519 */ -#if LDNS_BUILD_CONFIG_USE_ED448 LDNS_ED448 = 16, /* RFC 8080 */ -#endif /* LDNS_BUILD_CONFIG_USE_ED448 */ LDNS_INDIRECT = 252, LDNS_PRIVATEDNS = 253, LDNS_PRIVATEOID = 254 From e9a61ea273ca32a334cb3f69657d1683d01fb4a7 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 13 Jul 2022 22:49:07 +0200 Subject: [PATCH 65/83] Fix #162 Skip tests that require OpenSSL with --without-ssl --- test/test_all.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test_all.sh b/test/test_all.sh index 1859218e..4bde7432 100755 --- a/test/test_all.sh +++ b/test/test_all.sh @@ -40,6 +40,11 @@ $TPKG -a ../.. fake 31-load-pyldnsx.tpkg $TPKG -a ../.. fake 32-unbound-regression.tpkg $TPKG -a ../.. fake 999-compile-nossl.tpkg command -v indent || $TPKG -a ../.. fake codingstyle.tpkg +grep -q '^#define HAVE_SSL 1' ../ldns/config.h || ( + $TPKG -a ../.. fake 19-keygen.tpkg + $TPKG -a ../.. fake 20-sign-zone.tpkg + $TPKG -a ../.. fake 25-ZONEMD.tpkg +) failed=0 for tests in *.tpkg From 5a79ab28ca064393774e734f2361cd8011cac201 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 13 Jul 2022 23:00:57 +0200 Subject: [PATCH 66/83] Fix skipping OpenSSL tests --- test/test_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_all.sh b/test/test_all.sh index 4bde7432..c727d8a5 100755 --- a/test/test_all.sh +++ b/test/test_all.sh @@ -40,7 +40,7 @@ $TPKG -a ../.. fake 31-load-pyldnsx.tpkg $TPKG -a ../.. fake 32-unbound-regression.tpkg $TPKG -a ../.. fake 999-compile-nossl.tpkg command -v indent || $TPKG -a ../.. fake codingstyle.tpkg -grep -q '^#define HAVE_SSL 1' ../ldns/config.h || ( +grep -q '^#define HAVE_SSL ' ../ldns/config.h || ( $TPKG -a ../.. fake 19-keygen.tpkg $TPKG -a ../.. fake 20-sign-zone.tpkg $TPKG -a ../.. fake 25-ZONEMD.tpkg From 09ebd88d1fbc46f49d45fa0ea527f534925ab091 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 13 Jul 2022 23:36:06 +0200 Subject: [PATCH 67/83] Fix #46: Print network errors when secure tracing --- Changelog | 2 ++ drill/dnssec.c | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 601a2ecf..23651c50 100644 --- a/Changelog +++ b/Changelog @@ -11,6 +11,8 @@ * bugfix #166: Grow buffer when writing chars and fixed size strings when converting to presentation format, preventing potential assersion errors. + * bugfix #46: Print failed to get packet instead of null when + secure tracing with drill. Thanks reedjc 1.8.1 2021-12-03 * bugfix #146: ldns-1.7.1 had soname 3.0, so ldns-1.8.x soname diff --git a/drill/dnssec.c b/drill/dnssec.c index d4170492..687cfe55 100644 --- a/drill/dnssec.c +++ b/drill/dnssec.c @@ -180,7 +180,20 @@ ldns_verify_denial(ldns_pkt *pkt, ldns_rdf *name, ldns_rr_type type, ldns_rr_lis ldns_rr_list *nsecs; ldns_status result; - + const ldns_rr_descriptor *descriptor; + + if (!pkt) { + descriptor = ldns_rr_descript(type); + + printf("NETWORk ERROR! Cannot verify denial for: "); + ldns_rdf_print(stdout, name); + printf(" type "); + if (descriptor && descriptor->_name) + printf("%s", descriptor->_name); + else + printf("TYPE%u", type); + return LDNS_STATUS_CRYPTO_NO_RRSIG; + } if (verbosity >= 5) { printf("VERIFY DENIAL FROM:\n"); ldns_pkt_print(stdout, pkt); From 5e2209ccde7c60f750ffdff86964176a7455c8c6 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 13 Jul 2022 23:45:45 +0200 Subject: [PATCH 68/83] Update version for release candidate --- Changelog | 4 ++-- configure.ac | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Changelog b/Changelog index 23651c50..389c1e49 100644 --- a/Changelog +++ b/Changelog @@ -11,8 +11,8 @@ * bugfix #166: Grow buffer when writing chars and fixed size strings when converting to presentation format, preventing potential assersion errors. - * bugfix #46: Print failed to get packet instead of null when - secure tracing with drill. Thanks reedjc + * bugfix #46: Print network errors when secure tracing. + Thanks reedjc 1.8.1 2021-12-03 * bugfix #146: ldns-1.7.1 had soname 3.0, so ldns-1.8.x soname diff --git a/configure.ac b/configure.ac index 6def676f..99b5e3ea 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ sinclude(acx_nlnetlabs.m4) # must be numbers. ac_defun because of later processing. m4_define([VERSION_MAJOR],[1]) m4_define([VERSION_MINOR],[8]) -m4_define([VERSION_MICRO],[1]) +m4_define([VERSION_MICRO],[2]) AC_INIT(ldns, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), libdns@nlnetlabs.nl, libdns) AC_CONFIG_SRCDIR([packet.c]) # needed to build correct soname @@ -30,8 +30,9 @@ AC_SUBST(LDNS_VERSION_MICRO, [VERSION_MICRO]) # ldns-1.7.1 had libversion 3:0:0 (though it should have had 3:0:1) # ldns-1.8.0 had libversion 4:0:2 (though it should have had 4:0:1) # ldns-1.8.1 has libversion 5:0:2 +# ldns-1.8.1 has libversion 6:0:3 # -AC_SUBST(VERSION_INFO, [5:0:2]) +AC_SUBST(VERSION_INFO, [6:0:3]) AC_AIX if test "$ac_cv_header_minix_config_h" = "yes"; then From 417492583829593c2f8bc3436fd9d096f826c27b Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 14 Jul 2022 09:33:44 +0200 Subject: [PATCH 69/83] ldns_pkt_edns() also true for `_edns_list`s + few fixes for memory management errors --- drill/drill.c | 1 + host2wire.c | 15 +++++---------- packet.c | 1 + 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drill/drill.c b/drill/drill.c index 62e0c4dd..611c81f3 100644 --- a/drill/drill.c +++ b/drill/drill.c @@ -907,6 +907,7 @@ main(int argc, char *argv[]) } status = ldns_resolver_send_pkt(&pkt, res, qpkt); + ldns_pkt_free(qpkt); if (status != LDNS_STATUS_OK) { error("error sending query: %s" diff --git a/host2wire.c b/host2wire.c index 32c9c545..49e4924a 100644 --- a/host2wire.c +++ b/host2wire.c @@ -443,21 +443,16 @@ ldns_pkt2buffer_wire_compress(ldns_buffer *buffer, const ldns_pkt *packet, ldns_ ldns_write_uint16(&edata[2], ldns_pkt_edns_z(packet)); ldns_rr_set_ttl(edns_rr, ldns_read_uint32(edata)); /* don't forget to add the edns rdata (if any) */ - edns_buf = ldns_edns_option_list2wireformat_buffer(packet->_edns_list); - if (edns_buf) + if ((edns_buf = ldns_edns_option_list2wireformat_buffer(packet->_edns_list))) { edns_rdf = ldns_rdf_new( LDNS_RDF_TYPE_UNKNOWN , ldns_buffer_limit(edns_buf) , ldns_buffer_export(edns_buf)); - ldns_buffer_free(edns_buf); - if (edns_rdf) { - ldns_rr_push_rdf(edns_rr, edns_rdf); - ldns_rdf_deep_free(edns_rdf); - - } else if (packet->_edns_data) - ldns_rr_push_rdf(edns_rr, packet->_edns_data); + ldns_buffer_free(edns_buf); + } + ldns_rr_push_rdf(edns_rr, edns_rdf ? edns_rdf : packet->_edns_data); (void)ldns_rr2buffer_wire_compress(buffer, edns_rr, LDNS_SECTION_ADDITIONAL, compression_data); /* take the edns rdata back out of the rr before we free rr */ - if (packet->_edns_data) + if (!edns_rdf) (void)ldns_rr_pop_rdf (edns_rr); ldns_rr_free(edns_rr); } diff --git a/packet.c b/packet.c index 3562b399..96adaabd 100644 --- a/packet.c +++ b/packet.c @@ -753,6 +753,7 @@ ldns_pkt_edns(const ldns_pkt *pkt) ldns_pkt_edns_extended_rcode(pkt) > 0 || ldns_pkt_edns_data(pkt) || ldns_pkt_edns_do(pkt) || + pkt->_edns_list || pkt->_edns_present ); } From b50e3594e12fe0c564b1127183fd469c31ab9188 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 14 Jul 2022 10:07:02 +0200 Subject: [PATCH 70/83] Eliminate non-const cast --- host2str.c | 7 ++++++- packet.c | 51 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/host2str.c b/host2str.c index 179ed71b..7282db9e 100644 --- a/host2str.c +++ b/host2str.c @@ -43,6 +43,10 @@ #define INET6_ADDRSTRLEN 46 #endif +/* Internal helper function */ +ldns_edns_option_list* +pkt_edns_data2edns_option_list(const ldns_rdf *edns_data); + /* lookup tables for standard DNS stuff */ /* Taken from RFC 2535, section 7. */ @@ -2778,8 +2782,9 @@ ldns_pkt2buffer_str_fmt(ldns_buffer *output, ldns_edns_option_list* edns_list; /* parse the EDNS data into separate EDNS options * and add them to the list */ - if ((edns_list = ldns_pkt_edns_get_option_list((ldns_pkt *)pkt))) { + if ((edns_list = pkt_edns_data2edns_option_list(ldns_pkt_edns_data(pkt)))) { ldns_edns_option_list2buffer_str(output, edns_list); + ldns_edns_option_list_deep_free(edns_list); } else { ldns_buffer_printf(output, ";; Data: "); (void)ldns_rdf2buffer_str(output, ldns_pkt_edns_data(pkt)); diff --git a/packet.c b/packet.c index 96adaabd..afa59005 100644 --- a/packet.c +++ b/packet.c @@ -759,37 +759,28 @@ ldns_pkt_edns(const ldns_pkt *pkt) } ldns_edns_option_list* -ldns_pkt_edns_get_option_list(ldns_pkt *packet) +pkt_edns_data2edns_option_list(const ldns_rdf *edns_data) { size_t pos = 0; ldns_edns_option_list* edns_list; size_t max; const uint8_t* wire; - /* return the list if it already exists */ - if (packet->_edns_list != NULL) { - return packet->_edns_list; - } - - /* if the list doesn't exists, we create it by parsing the - * packet->_edns_data - */ - if (!ldns_pkt_edns_data(packet)) { + if (!edns_data) return NULL; - } - assert(ldns_pkt_edns_data(packet)); - max = ldns_rdf_size(ldns_pkt_edns_data(packet)); - wire = ldns_rdf_data(ldns_pkt_edns_data(packet)); + max = ldns_rdf_size(edns_data); + wire = ldns_rdf_data(edns_data); + if (!max) + return NULL; - edns_list = ldns_edns_option_list_new(); - if (edns_list == NULL) { + if (!(edns_list = ldns_edns_option_list_new())) return NULL; - } while (pos < max) { ldns_edns_option* edns; uint8_t *data; + if (pos + 4 > max) { /* make sure the header is */ ldns_edns_option_list_deep_free(edns_list); return NULL; @@ -817,12 +808,30 @@ ldns_pkt_edns_get_option_list(ldns_pkt *packet) ldns_edns_option_list_deep_free(edns_list); return NULL; } - ldns_edns_option_list_push(edns_list, edns); - + if (!ldns_edns_option_list_push(edns_list, edns)) { + ldns_edns_option_list_deep_free(edns_list); + return NULL; + } } + return edns_list; + +} + +ldns_edns_option_list* +ldns_pkt_edns_get_option_list(ldns_pkt *packet) +{ + /* return the list if it already exists */ + if (packet->_edns_list != NULL) + return packet->_edns_list; + + /* if the list doesn't exists, we create it by parsing the + * packet->_edns_data + */ + if (!ldns_pkt_edns_data(packet)) + return NULL; - packet->_edns_list = edns_list; - return packet->_edns_list; + return ( packet->_edns_list + = pkt_edns_data2edns_option_list(ldns_pkt_edns_data(packet))); } From a3cd1ca318ea7c0efd60469bff63c9f636e96b57 Mon Sep 17 00:00:00 2001 From: TCY16 Date: Thu, 14 Jul 2022 15:33:49 +0200 Subject: [PATCH 71/83] add check in ldns_edns_option_list_clone --- edns.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/edns.c b/edns.c index b9d1828b..bdb4bf1c 100644 --- a/edns.c +++ b/edns.c @@ -202,8 +202,11 @@ ldns_edns_option_list_clone(ldns_edns_option_list *old_list) /* adding options also updates the total options size */ for (i = 0; i < old_list->_option_count; i++) { - ldns_edns_option_list_push(new_list, - ldns_edns_clone(ldns_edns_option_list_get_option(old_list, i))); + if (!(ldns_edns_option_list_push(new_list, + ldns_edns_clone(ldns_edns_option_list_get_option(old_list, i))))){ + ldns_edns_option_list_deep_free(new_list); + return NULL; + } } return new_list; @@ -350,7 +353,7 @@ ldns_edns_option_list_pop(ldns_edns_option_list *option_list) cap = option_list->_option_capacity; count = ldns_edns_option_list_get_count(option_list); - if (count == 0){ + if (count == 0) { return NULL; } /* get the last option from the list */ @@ -388,8 +391,9 @@ ldns_edns_option_list2wireformat_buffer(const ldns_edns_option_list *option_list ldns_edns_option *edns; uint8_t* data = NULL; - if (!option_list) + if (!option_list) { return NULL; + } /* get the number of EDNS options in the list*/ list_size = ldns_edns_option_list_get_count(option_list); @@ -397,8 +401,10 @@ ldns_edns_option_list2wireformat_buffer(const ldns_edns_option_list *option_list /* create buffer the size of the total EDNS wireformat options */ options_size = ldns_edns_option_list_get_options_size(option_list); buffer = ldns_buffer_new(options_size); - if (!buffer) + + if (!buffer) { return NULL; + } /* write individual serialized EDNS options to final buffer*/ for (i = 0; i < list_size; i++) { From 4ad3da8d4a276d3ab91a1d796dafd8b116f98dea Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 15 Jul 2022 17:26:14 +0200 Subject: [PATCH 72/83] Log EDNS0 option handling feature --- Changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog b/Changelog index 389c1e49..a64914e9 100644 --- a/Changelog +++ b/Changelog @@ -13,6 +13,7 @@ potential assersion errors. * bugfix #46: Print network errors when secure tracing. Thanks reedjc + * EDNS0 Option handling and conversion into presentation format. 1.8.1 2021-12-03 * bugfix #146: ldns-1.7.1 had soname 3.0, so ldns-1.8.x soname From 4d8768ab871b657caff54529166973504e359976 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 15 Jul 2022 17:26:54 +0200 Subject: [PATCH 73/83] Release today --- Changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog b/Changelog index a64914e9..da831bb4 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,4 @@ -1.8.2 2022-??-?? +1.8.2 2022-07-15 * bugfix #147: Allow for tabs in whitespace before quoted rdata fields. Thanks Felipe Gasper * bugfix #149: Add some missing [out] annotations to doxygen From 991999f55a87ffc979fd6299a3c1aab8e91e4874 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 15 Jul 2022 17:30:24 +0200 Subject: [PATCH 74/83] Revert "Release today" This reverts commit 4d8768ab871b657caff54529166973504e359976. --- Changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog b/Changelog index da831bb4..a64914e9 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,4 @@ -1.8.2 2022-07-15 +1.8.2 2022-??-?? * bugfix #147: Allow for tabs in whitespace before quoted rdata fields. Thanks Felipe Gasper * bugfix #149: Add some missing [out] annotations to doxygen From 22ddabdf16070de0d1ac12bb034292662cf27bbe Mon Sep 17 00:00:00 2001 From: TCY16 Date: Fri, 12 Aug 2022 10:57:29 +0200 Subject: [PATCH 75/83] add SVCB dohpath support --- ldns/rdata.h | 3 ++- str2host.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ldns/rdata.h b/ldns/rdata.h index 4a7dcb37..c8a0396c 100644 --- a/ldns/rdata.h +++ b/ldns/rdata.h @@ -180,7 +180,8 @@ enum ldns_enum_svcparam_key LDNS_SVCPARAM_KEY_IPV4HINT = 4, LDNS_SVCPARAM_KEY_ECH = 5, LDNS_SVCPARAM_KEY_IPV6HINT = 6, - LDNS_SVCPARAM_KEY_LAST_KEY = 6, + LDNS_SVCPARAM_KEY_DOHPATH = 7, + LDNS_SVCPARAM_KEY_LAST_KEY = 7, LDNS_SVCPARAM_KEY_RESERVED = 65535 }; typedef enum ldns_enum_svcparam_key ldns_svcparam_key; diff --git a/str2host.c b/str2host.c index 0639d3f1..5b78e5bc 100644 --- a/str2host.c +++ b/str2host.c @@ -2189,7 +2189,8 @@ static svcparam_key_def svcparam_key_defs[] = { { "mandatory" , 9 } , { "port" , 4 } , { "ipv4hint" , 8 } , { "ech" , 3 } - , { "ipv6hint" , 8 } }; + , { "ipv6hint" , 8 } + , { "dohpath" , 7 } }; static const size_t svcparam_key_defs_len = sizeof(svcparam_key_defs) / sizeof(svcparam_key_def); From 2b51b26bc9be4580bf708dd3078cebda07d8b09c Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 12 Aug 2022 11:38:52 +0200 Subject: [PATCH 76/83] Address Issue #145 by naming everything occluded occluded Even though some of those are (also) glue --- Changelog | 2 ++ examples/ldns-verify-zone.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index a64914e9..034619b1 100644 --- a/Changelog +++ b/Changelog @@ -14,6 +14,8 @@ * bugfix #46: Print network errors when secure tracing. Thanks reedjc * EDNS0 Option handling and conversion into presentation format. + * bugfix #145: ldns-verify-zone should not call occluded records + glue. Thanks Habbie 1.8.1 2021-12-03 * bugfix #146: ldns-1.7.1 had soname 3.0, so ldns-1.8.x soname diff --git a/examples/ldns-verify-zone.c b/examples/ldns-verify-zone.c index 898d937a..ac076cd1 100644 --- a/examples/ldns-verify-zone.c +++ b/examples/ldns-verify-zone.c @@ -437,7 +437,8 @@ verify_dnssec_name(ldns_rdf *zone_name, ldns_dnssec_zone* zone, fprintf(myerr, "\t"); print_type(myerr, cur_rrset->type); fprintf(myerr, " has signature(s)," - " but is glue\n"); + " but is occluded" + " (or glue)\n"); } result = LDNS_STATUS_ERR; } @@ -448,7 +449,8 @@ verify_dnssec_name(ldns_rdf *zone_name, ldns_dnssec_zone* zone, fprintf(myerr, "Error: "); ldns_rdf_print(myerr, name->name); fprintf(myerr, " has an NSEC(3)," - " but is glue\n"); + " but is occluded" + " (or glue)\n"); } result = LDNS_STATUS_ERR; } From faea07e4735a927039bd6d2e47ce18f207ed0eb7 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 12 Aug 2022 11:42:43 +0200 Subject: [PATCH 77/83] Set release date and bumb version --- Changelog | 2 +- configure.ac | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Changelog b/Changelog index 034619b1..ca301b88 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,4 @@ -1.8.2 2022-??-?? +1.8.2 2022-08-12 * bugfix #147: Allow for tabs in whitespace before quoted rdata fields. Thanks Felipe Gasper * bugfix #149: Add some missing [out] annotations to doxygen diff --git a/configure.ac b/configure.ac index 99b5e3ea..1045536d 100644 --- a/configure.ac +++ b/configure.ac @@ -29,10 +29,11 @@ AC_SUBST(LDNS_VERSION_MICRO, [VERSION_MICRO]) # ldns-1.7.0 had libversion 2:0:0 # ldns-1.7.1 had libversion 3:0:0 (though it should have had 3:0:1) # ldns-1.8.0 had libversion 4:0:2 (though it should have had 4:0:1) -# ldns-1.8.1 has libversion 5:0:2 -# ldns-1.8.1 has libversion 6:0:3 +# ldns-1.8.1 had libversion 5:0:2 +# ldns-1.8.1 had libversion 6:0:3 +# ldns-1.8.2 has libversion 7:0:4 # -AC_SUBST(VERSION_INFO, [6:0:3]) +AC_SUBST(VERSION_INFO, [7:0:4]) AC_AIX if test "$ac_cv_header_minix_config_h" = "yes"; then From ed1dbd4972ce0e813007d8bfc5a6c9a08bdbdd50 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 12 Aug 2022 12:00:21 +0200 Subject: [PATCH 78/83] Memory leak in ldns_edns_option_list_clone --- edns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/edns.c b/edns.c index bdb4bf1c..3d002d67 100644 --- a/edns.c +++ b/edns.c @@ -202,13 +202,13 @@ ldns_edns_option_list_clone(ldns_edns_option_list *old_list) /* adding options also updates the total options size */ for (i = 0; i < old_list->_option_count; i++) { - if (!(ldns_edns_option_list_push(new_list, - ldns_edns_clone(ldns_edns_option_list_get_option(old_list, i))))){ + ldns_edns_option *option = ldns_edns_clone(ldns_edns_option_list_get_option(old_list, i)); + if (!ldns_edns_option_list_push(new_list, option)) { + ldns_edns_deep_free(option); ldns_edns_option_list_deep_free(new_list); return NULL; } } - return new_list; } From deeaa0b1d0fda4101982783495fc73fc00da9e2a Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 12 Aug 2022 12:29:15 +0200 Subject: [PATCH 79/83] Update dependencies --- Makefile.in | 506 +++++++++++++++++++++++++++------------------------- 1 file changed, 259 insertions(+), 247 deletions(-) diff --git a/Makefile.in b/Makefile.in index 58330b59..a84d8207 100644 --- a/Makefile.in +++ b/Makefile.in @@ -586,130 +586,137 @@ depend: buffer.lo buffer.o: $(srcdir)/buffer.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dane.lo dane.o: $(srcdir)/dane.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dname.lo dname.o: $(srcdir)/dname.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dnssec.lo dnssec.o: $(srcdir)/dnssec.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dnssec_sign.lo dnssec_sign.o: $(srcdir)/dnssec_sign.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dnssec_verify.lo dnssec_verify.o: $(srcdir)/dnssec_verify.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dnssec_zone.lo dnssec_zone.o: $(srcdir)/dnssec_zone.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +duration.lo duration.o: $(srcdir)/duration.c ldns/config.h $(srcdir)/ldns/duration.h +edns.lo edns.o: $(srcdir)/edns.c $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \ + $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \ + $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ + $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -duration.lo duration.o: $(srcdir)/duration.c ldns/config.h $(srcdir)/ldns/duration.h -edns.lo edns.o: $(srcdir)/edns.c $(srcdir)/ldns/ldns.h ldns/common.h error.lo error.o: $(srcdir)/error.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h higher.lo higher.o: $(srcdir)/higher.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h host2str.lo host2str.o: $(srcdir)/host2str.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h host2wire.lo host2wire.o: $(srcdir)/host2wire.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h keys.lo keys.o: $(srcdir)/keys.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h linktest.lo linktest.o: $(srcdir)/linktest.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h net.lo net.o: $(srcdir)/net.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h packet.lo packet.o: $(srcdir)/packet.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h parse.lo parse.o: $(srcdir)/parse.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ @@ -719,40 +726,40 @@ radix.lo radix.o: $(srcdir)/radix.c ldns/config.h $(srcdir)/ldns/radix.h $(srcdi rbtree.lo rbtree.o: $(srcdir)/rbtree.c ldns/config.h $(srcdir)/ldns/rbtree.h ldns/util.h ldns/common.h rdata.lo rdata.o: $(srcdir)/rdata.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h resolver.lo resolver.o: $(srcdir)/resolver.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h rr.lo rr.o: $(srcdir)/rr.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h rr_functions.lo rr_functions.o: $(srcdir)/rr_functions.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h sha1.lo sha1.o: $(srcdir)/sha1.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ @@ -760,24 +767,24 @@ sha1.lo sha1.o: $(srcdir)/sha1.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h sha2.lo sha2.o: $(srcdir)/sha2.c ldns/config.h $(srcdir)/ldns/sha2.h str2host.lo str2host.o: $(srcdir)/str2host.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h tsig.lo tsig.o: $(srcdir)/tsig.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h update.lo update.o: $(srcdir)/update.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ @@ -786,21 +793,20 @@ util.lo util.o: $(srcdir)/util.c ldns/config.h $(srcdir)/ldns/rdata.h ldns/commo ldns/util.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/buffer.h wire2host.lo wire2host.o: $(srcdir)/wire2host.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h zone.lo zone.o: $(srcdir)/zone.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -edns.lo edns.o: $(srcdir)/edns.c ldns/config.h $(srcdir)/ldns/edns.h compat/b64_ntop.lo compat/b64_ntop.o: $(srcdir)/compat/b64_ntop.c ldns/config.h compat/b64_pton.lo compat/b64_pton.o: $(srcdir)/compat/b64_pton.c ldns/config.h compat/calloc.lo compat/calloc.o: $(srcdir)/compat/calloc.c ldns/config.h @@ -822,280 +828,286 @@ compat/strlcpy.lo compat/strlcpy.o: $(srcdir)/compat/strlcpy.c ldns/config.h compat/timegm.lo compat/timegm.o: $(srcdir)/compat/timegm.c ldns/config.h examples/ldns-chaos.lo examples/ldns-chaos.o: $(srcdir)/examples/ldns-chaos.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-compare-zones.lo examples/ldns-compare-zones.o: $(srcdir)/examples/ldns-compare-zones.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ + $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ + $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ + $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ + ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +examples/ldns-dane.lo examples/ldns-dane.o: $(srcdir)/examples/ldns-dane.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ + ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -examples/ldns-dane.lo examples/ldns-dane.o: $(srcdir)/examples/ldns-dane.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ - ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldnsd.lo examples/ldnsd.o: $(srcdir)/examples/ldnsd.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ - $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ - $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h \ + $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-dpa.lo examples/ldns-dpa.o: $(srcdir)/examples/ldns-dpa.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-dpa.h + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-dpa.h examples/ldns-gen-zone.lo examples/ldns-gen-zone.o: $(srcdir)/examples/ldns-gen-zone.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ + $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ + $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ + $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ + ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +examples/ldns-key2ds.lo examples/ldns-key2ds.o: $(srcdir)/examples/ldns-key2ds.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ + ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -examples/ldns-key2ds.lo examples/ldns-key2ds.o: $(srcdir)/examples/ldns-key2ds.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ - ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-keyfetcher.lo examples/ldns-keyfetcher.o: $(srcdir)/examples/ldns-keyfetcher.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ + $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ + $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ + $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ + ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +examples/ldns-keygen.lo examples/ldns-keygen.o: $(srcdir)/examples/ldns-keygen.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ + ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -examples/ldns-keygen.lo examples/ldns-keygen.o: $(srcdir)/examples/ldns-keygen.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ - ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-mx.lo examples/ldns-mx.o: $(srcdir)/examples/ldns-mx.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -examples/ldns-notify.lo examples/ldns-notify.o: $(srcdir)/examples/ldns-notify.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ - ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -examples/ldns-nsec3-hash.lo examples/ldns-nsec3-hash.o: $(srcdir)/examples/ldns-nsec3-hash.c ldns/config.h $(srcdir)/ldns/ldns.h \ - ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ - $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -examples/ldns-read-zone.lo examples/ldns-read-zone.o: $(srcdir)/examples/ldns-read-zone.c ldns/config.h $(srcdir)/ldns/ldns.h \ - ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ - $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ +examples/ldns-notify.lo examples/ldns-notify.o: $(srcdir)/examples/ldns-notify.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ + ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +examples/ldns-nsec3-hash.lo examples/ldns-nsec3-hash.o: $(srcdir)/examples/ldns-nsec3-hash.c ldns/config.h $(srcdir)/ldns/ldns.h \ + ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ + $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ + $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ + $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ + $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ + ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +examples/ldns-read-zone.lo examples/ldns-read-zone.o: $(srcdir)/examples/ldns-read-zone.c ldns/config.h $(srcdir)/ldns/ldns.h \ + ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ + $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ + $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ + $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ + $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ + ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-resolver.lo examples/ldns-resolver.o: $(srcdir)/examples/ldns-resolver.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ + $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ + $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ + $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ + ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +examples/ldns-revoke.lo examples/ldns-revoke.o: $(srcdir)/examples/ldns-revoke.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ + ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -examples/ldns-revoke.lo examples/ldns-revoke.o: $(srcdir)/examples/ldns-revoke.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ - ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-rrsig.lo examples/ldns-rrsig.o: $(srcdir)/examples/ldns-rrsig.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -examples/ldns-signzone.lo examples/ldns-signzone.o: $(srcdir)/examples/ldns-signzone.c ldns/config.h $(srcdir)/ldns/ldns.h \ - ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ - $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +examples/ldns-signzone.lo examples/ldns-signzone.o: $(srcdir)/examples/ldns-signzone.c ldns/config.h $(srcdir)/ldns/ldns.h \ + ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ + $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ + $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ + $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ + $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ + ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-test-edns.lo examples/ldns-test-edns.o: $(srcdir)/examples/ldns-test-edns.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ + $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ + $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ + $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ + ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +examples/ldns-testns.lo examples/ldns-testns.o: $(srcdir)/examples/ldns-testns.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ + ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -examples/ldns-testns.lo examples/ldns-testns.o: $(srcdir)/examples/ldns-testns.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ - ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-testpkts.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h \ + $(srcdir)/examples/ldns-testpkts.h examples/ldns-testpkts.lo examples/ldns-testpkts.o: $(srcdir)/examples/ldns-testpkts.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ + $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ + $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ + $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ + ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h \ + $(srcdir)/examples/ldns-testpkts.h +examples/ldns-update.lo examples/ldns-update.o: $(srcdir)/examples/ldns-update.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ + ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h \ - $(srcdir)/examples/ldns-testpkts.h -examples/ldns-update.lo examples/ldns-update.o: $(srcdir)/examples/ldns-update.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ - ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-verify-zone.lo examples/ldns-verify-zone.o: $(srcdir)/examples/ldns-verify-zone.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ + $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ + $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ + $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ + ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +examples/ldns-version.lo examples/ldns-version.o: $(srcdir)/examples/ldns-version.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ + ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -examples/ldns-version.lo examples/ldns-version.o: $(srcdir)/examples/ldns-version.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ - ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-walk.lo examples/ldns-walk.o: $(srcdir)/examples/ldns-walk.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-zcat.lo examples/ldns-zcat.o: $(srcdir)/examples/ldns-zcat.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ - $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ - $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ - $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-zsplit.lo examples/ldns-zsplit.o: $(srcdir)/examples/ldns-zsplit.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ - $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ - $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h \ + $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h \ + $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ + $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ + $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +drill/chasetrace.lo drill/chasetrace.o: $(srcdir)/drill/chasetrace.c $(srcdir)/drill/drill.h ldns/config.h \ + $(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \ + $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \ + $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ + $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -drill/chasetrace.lo drill/chasetrace.o: $(srcdir)/drill/chasetrace.c $(srcdir)/drill/drill.h ldns/config.h \ - $(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \ - $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \ - $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h \ +drill/dnssec.lo drill/dnssec.o: $(srcdir)/drill/dnssec.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ + $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ + $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ + $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h \ $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \ $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \ $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -drill/dnssec.lo drill/dnssec.o: $(srcdir)/drill/dnssec.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ - $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ - $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ - $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ - $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ - $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ - ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/drill.lo drill/drill.o: $(srcdir)/drill/drill.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ - $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ - $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ - $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ - ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -drill/drill_util.lo drill/drill_util.o: $(srcdir)/drill/drill_util.c $(srcdir)/drill/drill.h ldns/config.h \ - $(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \ - $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \ - $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h \ + $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h \ $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \ $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \ $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +drill/drill_util.lo drill/drill_util.o: $(srcdir)/drill/drill_util.c $(srcdir)/drill/drill.h ldns/config.h \ + $(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \ + $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \ + $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ + $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ + $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/error.lo drill/error.o: $(srcdir)/drill/error.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ - $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ - $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ - $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ - ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h \ + $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \ + $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \ + $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/root.lo drill/root.o: $(srcdir)/drill/root.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ - $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ - $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ - $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ - ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h -drill/securetrace.lo drill/securetrace.o: $(srcdir)/drill/securetrace.c $(srcdir)/drill/drill.h ldns/config.h \ - $(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \ - $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \ - $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h \ + $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h \ $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \ $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \ $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +drill/securetrace.lo drill/securetrace.o: $(srcdir)/drill/securetrace.c $(srcdir)/drill/drill.h ldns/config.h \ + $(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \ + $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \ + $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ + $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ + $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ + $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/work.lo drill/work.o: $(srcdir)/drill/work.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ - $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h \ - $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ - $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ - ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/packet.h $(srcdir)/ldns/edns.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h \ + $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \ + $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \ + $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-chaos: examples/ldns-chaos.lo examples/ldns-chaos.o $(LIB) examples/ldns-compare-zones: examples/ldns-compare-zones.lo examples/ldns-compare-zones.o $(LIB) examples/ldnsd: examples/ldnsd.lo examples/ldnsd.o $(LIB) From 45c599948dba524e6603548dbb8a14e0b4104f84 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 12 Aug 2022 12:35:40 +0200 Subject: [PATCH 80/83] Cycles in the Makefile.in --- Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index a84d8207..30a516a0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -167,7 +167,7 @@ no-drill-config-h: exit -1 ; \ fi -drill/drill: all $(DRILL_LOBJS) $(LIB) $(LIBLOBJS) +drill/drill: lib $(DRILL_LOBJS) $(LIB) $(LIBLOBJS) $(LINK_EXE) $(DRILL_LOBJS) $(LIBLOBJS) $(LIB) $(LIBSSL_LIBS) $(LIBS) -o drill/drill drill/drill.1: $(srcdir)/drill/drill.1.in @@ -188,7 +188,7 @@ uninstall-drill: clean-drill: $(LIBTOOL) --mode clean rm -f $(DRILL_LOBJS) drill/drill drill/drill.1 -examples: no-examples-config-h all $(EXAMPLE_PROGS) $(TESTNS) $(LDNS_DPA) $(LDNS_DANE) $(EX_SSL_PROGS) examples/ldns-dane.1 examples/ldns-verify-zone.1 +examples: no-examples-config-h lib $(EXAMPLE_PROGS) $(TESTNS) $(LDNS_DPA) $(LDNS_DANE) $(EX_SSL_PROGS) examples/ldns-dane.1 examples/ldns-verify-zone.1 no-examples-config-h: @if test -e $(srcdir)/examples/config.h -o -e examples/config.h ; \ then echo "A config.h was detected in the examples subdirectory." ; \ From d27063247ef1d9a8dedb7694367bdc8dab9939ae Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 12 Aug 2022 12:41:25 +0200 Subject: [PATCH 81/83] Superfluous dependecies in Makefile --- Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 30a516a0..6dad8288 100644 --- a/Makefile.in +++ b/Makefile.in @@ -167,7 +167,7 @@ no-drill-config-h: exit -1 ; \ fi -drill/drill: lib $(DRILL_LOBJS) $(LIB) $(LIBLOBJS) +drill/drill: $(DRILL_LOBJS) $(LIB) $(LIBLOBJS) $(LINK_EXE) $(DRILL_LOBJS) $(LIBLOBJS) $(LIB) $(LIBSSL_LIBS) $(LIBS) -o drill/drill drill/drill.1: $(srcdir)/drill/drill.1.in @@ -188,7 +188,7 @@ uninstall-drill: clean-drill: $(LIBTOOL) --mode clean rm -f $(DRILL_LOBJS) drill/drill drill/drill.1 -examples: no-examples-config-h lib $(EXAMPLE_PROGS) $(TESTNS) $(LDNS_DPA) $(LDNS_DANE) $(EX_SSL_PROGS) examples/ldns-dane.1 examples/ldns-verify-zone.1 +examples: no-examples-config-h $(EXAMPLE_PROGS) $(TESTNS) $(LDNS_DPA) $(LDNS_DANE) $(EX_SSL_PROGS) examples/ldns-dane.1 examples/ldns-verify-zone.1 no-examples-config-h: @if test -e $(srcdir)/examples/config.h -o -e examples/config.h ; \ then echo "A config.h was detected in the examples subdirectory." ; \ From 06ec12c07474943006e587d43cfd442abd02e287 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 12 Aug 2022 12:46:35 +0200 Subject: [PATCH 82/83] Fix doxygen errors --- ldns/edns.h | 11 ++++++----- ldns/packet.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ldns/edns.h b/ldns/edns.h index 8382364c..594fda22 100644 --- a/ldns/edns.h +++ b/ldns/edns.h @@ -172,14 +172,14 @@ ldns_edns_option *ldns_edns_new_from_data(ldns_edns_option_code code, size_t siz /** * clone an EDNS option - * \param[in] the EDNS option + * \param[in] edns the EDNS option * \return the new EDNS structure */ ldns_edns_option *ldns_edns_clone(ldns_edns_option *edns); /** * free the EDNS option. Use deep_free if the _data member is allocated. - * \param[in] the EDNS option to free + * \param[in] edns the EDNS option to free */ void ldns_edns_deep_free(ldns_edns_option *edns); void ldns_edns_free(ldns_edns_option *edns); @@ -200,7 +200,7 @@ ldns_edns_option_list *ldns_edns_option_list_clone(ldns_edns_option_list *option /** * free the EDNS option list. Use deep_free to free the options options * in the list as well. - * \param[in] the EDNS option to free + * \param[in] options_list the EDNS option to free */ void ldns_edns_option_list_free(ldns_edns_option_list *options_list); void ldns_edns_option_list_deep_free(ldns_edns_option_list *options_list); @@ -236,6 +236,7 @@ size_t ldns_edns_option_list_get_options_size(const ldns_edns_option_list *optio * returns the option that was previously at that index. * \param[in] options_list the EDNS options_list to add to * \param[in] option the EDNS option to add to the list + * \param[in] index the index in the list where to set the option * \return the EDNS option previously located at the index */ ldns_edns_option *ldns_edns_option_list_set_option(ldns_edns_option_list *options_list, @@ -259,7 +260,7 @@ ldns_edns_option* ldns_edns_option_list_pop(ldns_edns_option_list *options_list) /** * serializes all the EDNS options into a single wireformat buffer - * \param[in] options_list the EDNS options_list to combine into one wireformat + * \param[in] option_list the EDNS options_list to combine into one wireformat * \return the filled buffer or NULL on failure */ ldns_buffer *ldns_edns_option_list2wireformat_buffer(const ldns_edns_option_list *option_list); @@ -268,4 +269,4 @@ ldns_buffer *ldns_edns_option_list2wireformat_buffer(const ldns_edns_option_list } #endif -#endif /* LDNS_EDNS_H */ \ No newline at end of file +#endif /* LDNS_EDNS_H */ diff --git a/ldns/packet.h b/ldns/packet.h index 4c07a855..2c60609f 100644 --- a/ldns/packet.h +++ b/ldns/packet.h @@ -777,7 +777,7 @@ void ldns_pkt_set_edns_data(ldns_pkt *packet, ldns_rdf *data); * Set the packet's structured EDNS data. Once an edns_option_list is set * (or get), the option list will be used for converting into wireformat. * \param[in] packet the packet - * \param[in] data the data + * \param[in] list the options list that will create the data */ void ldns_pkt_set_edns_option_list(ldns_pkt *packet, ldns_edns_option_list *list); From c48b6317da31eb4234085d999bcec88537c5baac Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 12 Aug 2022 12:57:35 +0200 Subject: [PATCH 83/83] Make the Makefile deps correct to enable doing make test from the start and not causing dependency loops --- Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6dad8288..57957d08 100644 --- a/Makefile.in +++ b/Makefile.in @@ -157,7 +157,7 @@ putdown-builddir: if test -d compat -a ! -f compat/malloc.c; then rmdir compat || : ; fi rm -rf builddir/ -drill: no-drill-config-h drill/drill drill/drill.1 +drill: setup-builddir no-drill-config-h drill/drill drill/drill.1 no-drill-config-h: @if test -e $(srcdir)/drill/config.h -o -e drill/config.h ; \ then echo "A config.h was detected in the drill subdirectory." ; \ @@ -188,7 +188,7 @@ uninstall-drill: clean-drill: $(LIBTOOL) --mode clean rm -f $(DRILL_LOBJS) drill/drill drill/drill.1 -examples: no-examples-config-h $(EXAMPLE_PROGS) $(TESTNS) $(LDNS_DPA) $(LDNS_DANE) $(EX_SSL_PROGS) examples/ldns-dane.1 examples/ldns-verify-zone.1 +examples: setup-builddir no-examples-config-h $(LIB) $(EXAMPLE_PROGS) $(TESTNS) $(LDNS_DPA) $(LDNS_DANE) $(EX_SSL_PROGS) examples/ldns-dane.1 examples/ldns-verify-zone.1 no-examples-config-h: @if test -e $(srcdir)/examples/config.h -o -e examples/config.h ; \ then echo "A config.h was detected in the examples subdirectory." ; \