From: Wouter Wijngaards Date: Fri, 19 Feb 2016 10:48:23 +0000 (+0000) Subject: - Print understandable debug log when unusable DS record is seen. X-Git-Tag: release-1.5.8~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c94a5b312f6f1457473b39743b6600c2899bf02;p=thirdparty%2Funbound.git - Print understandable debug log when unusable DS record is seen. git-svn-id: file:///svn/unbound/trunk@3627 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index eeca4ca1f..cf0e56b45 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +19 February 2016: Wouter + - Print understandable debug log when unusable DS record is seen. + 17 February 2016: Wouter - Fix that "make install" fails due to "text file busy" error. diff --git a/validator/val_utils.c b/validator/val_utils.c index 475b0c905..0315cade2 100644 --- a/validator/val_utils.c +++ b/validator/val_utils.c @@ -54,6 +54,8 @@ #include "util/net_help.h" #include "util/module.h" #include "util/regional.h" +#include "sldns/wire2str.h" +#include "sldns/parseutil.h" enum val_classification val_classify_response(uint16_t query_flags, struct query_info* origqinf, @@ -691,6 +693,31 @@ val_dsset_isusable(struct ub_packed_rrset_key* ds_rrset) ds_key_algo_is_supported(ds_rrset, i)) return 1; } + if(verbose < VERB_ALGO) + return 0; + if(rrset_get_count(ds_rrset) == 0) + verbose(VERB_ALGO, "DS is not usable"); + else { + /* report usability for the first DS RR */ + sldns_lookup_table *lt; + char herr[64], aerr[64]; + lt = sldns_lookup_by_id(sldns_hashes, + (int)ds_get_digest_algo(ds_rrset, i)); + if(lt) snprintf(herr, sizeof(herr), "%s", lt->name); + else snprintf(herr, sizeof(herr), "%d", + (int)ds_get_digest_algo(ds_rrset, i)); + lt = sldns_lookup_by_id(sldns_algorithms, + (int)ds_get_key_algo(ds_rrset, i)); + if(lt) snprintf(aerr, sizeof(aerr), "%s", lt->name); + else snprintf(aerr, sizeof(aerr), "%d", + (int)ds_get_key_algo(ds_rrset, i)); + verbose(VERB_ALGO, "DS unsupported, hash %s %s, " + "key algorithm %s %s", herr, + (ds_digest_algo_is_supported(ds_rrset, 0)? + "(supported)":"(unsupported)"), aerr, + (ds_key_algo_is_supported(ds_rrset, 0)? + "(supported)":"(unsupported)")); + } return 0; }