Changeset View
Changeset View
Standalone View
Standalone View
contrib/ldns/drill/dnssec.c
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | |||||
ldns_status | ldns_status | ||||
ldns_verify_denial(ldns_pkt *pkt, ldns_rdf *name, ldns_rr_type type, ldns_rr_list **nsec_rrs, ldns_rr_list **nsec_rr_sigs) | ldns_verify_denial(ldns_pkt *pkt, ldns_rdf *name, ldns_rr_type type, ldns_rr_list **nsec_rrs, ldns_rr_list **nsec_rr_sigs) | ||||
{ | { | ||||
#ifdef HAVE_SSL | #ifdef HAVE_SSL | ||||
uint16_t nsec_i; | uint16_t nsec_i; | ||||
ldns_rr_list *nsecs; | ldns_rr_list *nsecs; | ||||
ldns_status result; | 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) { | if (verbosity >= 5) { | ||||
printf("VERIFY DENIAL FROM:\n"); | printf("VERIFY DENIAL FROM:\n"); | ||||
ldns_pkt_print(stdout, pkt); | ldns_pkt_print(stdout, pkt); | ||||
} | } | ||||
result = LDNS_STATUS_CRYPTO_NO_RRSIG; | result = LDNS_STATUS_CRYPTO_NO_RRSIG; | ||||
/* Try to see if there are NSECS in the packet */ | /* Try to see if there are NSECS in the packet */ | ||||
nsecs = ldns_pkt_rr_list_by_type(pkt, LDNS_RR_TYPE_NSEC, LDNS_SECTION_ANY_NOQUESTION); | nsecs = ldns_pkt_rr_list_by_type(pkt, LDNS_RR_TYPE_NSEC, LDNS_SECTION_ANY_NOQUESTION); | ||||
▲ Show 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | if (verbosity >= 3) { | ||||
printf(" hashes to: "); | printf(" hashes to: "); | ||||
} | } | ||||
hashed_sname = ldns_nsec3_hash_name(sname, algorithm, iterations, salt_length, salt); | hashed_sname = ldns_nsec3_hash_name(sname, algorithm, iterations, salt_length, salt); | ||||
if (hashed_sname == NULL) { | if (hashed_sname == NULL) { | ||||
goto done; | goto done; | ||||
} | } | ||||
if (ldns_dname_cat(hashed_sname, zone_name) != LDNS_STATUS_OK){ | if (ldns_dname_cat(hashed_sname, zone_name) != LDNS_STATUS_OK){ | ||||
ldns_rdf_deep_free(hashed_sname); | |||||
goto done; | goto done; | ||||
} | } | ||||
if (verbosity >= 3) { | if (verbosity >= 3) { | ||||
ldns_rdf_print(stdout, hashed_sname); | ldns_rdf_print(stdout, hashed_sname); | ||||
printf("\n"); | printf("\n"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |