]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
print the keytag alla drill0.x
authorMiek Gieben <miekg@NLnetLabs.nl>
Tue, 24 May 2005 12:26:15 +0000 (12:26 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Tue, 24 May 2005 12:26:15 +0000 (12:26 +0000)
dnssec.c
host2str.c

index 7641cc3aceabe1ba870a9b6a79f102ca601a7d7b..96b90bc60df3f779d705306b1202403e778fcf9e 100644 (file)
--- 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;
        }
index a2b742a87b10ca693f7861625aff5680fb714e90..097078d3e3b7df67a7f1ca08b39f52ea57906fe8 100644 (file)
@@ -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);
 }