From: Miek Gieben Date: Tue, 24 May 2005 12:26:15 +0000 (+0000) Subject: print the keytag alla drill0.x X-Git-Tag: release-0.60^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4199b0c7447428fa050acad4471e54411f09fb50;p=thirdparty%2Fldns.git print the keytag alla drill0.x --- diff --git a/dnssec.c b/dnssec.c index 7641cc3a..96b90bc6 100644 --- a/dnssec.c +++ b/dnssec.c @@ -32,8 +32,13 @@ ldns_calc_keytag(ldns_rr *key) ldns_buffer *keybuf; size_t keysize; - ac = 0; + if (!key) { + return 0; + } + + ac = 0; + if (ldns_rr_get_type(key) != LDNS_RR_TYPE_DNSKEY) { return 0; } diff --git a/host2str.c b/host2str.c index a2b742a8..097078d3 100644 --- a/host2str.c +++ b/host2str.c @@ -848,6 +848,15 @@ ldns_rr2buffer_str(ldns_buffer *output, ldns_rr *rr) status = ldns_rdf2buffer_str(output, ldns_rr_rdf(rr, i)); ldns_buffer_printf(output, " "); } + /* print the id of dnskey's also */ + if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_DNSKEY && + ldns_rr_rd_count(rr) > 0) { + /* last check to prevent question sec. rr from + * getting here */ + ldns_buffer_printf(output, "; {id = %d}", + ldns_calc_keytag(rr)); + + } } return ldns_buffer_status(output); }