summaryrefslogtreecommitdiff
path: root/examples/ldns-keyfetcher.c
diff options
context:
space:
mode:
authorJelte Jansen <jeltejan@NLnetLabs.nl>2007-06-07 10:38:50 +0200
committerJelte Jansen <jeltejan@NLnetLabs.nl>2007-06-07 10:38:50 +0200
commit99273f6b1d5ba65bbb14557fa41d46975f0517b6 (patch)
tree8d98f39af5ae19ece7868c9044bb405f3f8df0af /examples/ldns-keyfetcher.c
parented854e22fb2b9cb7950aba5e0200973f4253485c (diff)
downloadldns-99273f6b1d5ba65bbb14557fa41d46975f0517b6.tar.gz
'insecurer' mode in ldns-keyfetcher (just ask a recursive server for the key)
Diffstat (limited to 'examples/ldns-keyfetcher.c')
-rw-r--r--examples/ldns-keyfetcher.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/examples/ldns-keyfetcher.c b/examples/ldns-keyfetcher.c
index 13e9e384..28eec706 100644
--- a/examples/ldns-keyfetcher.c
+++ b/examples/ldns-keyfetcher.c
@@ -27,6 +27,7 @@ usage(FILE *fp, char *prog) {
fprintf(fp, "-r <file>\tUse file to read root hints from\n");
fprintf(fp, "-s\t\tDon't print the keys but store them in files\n\t\tcalled K<file>.+<alg>.+<keytag>.key\n");
fprintf(fp, "-v <int>\tVerbosity level (0-5, not verbose-very verbose)\n");
+ fprintf(fp, "-i\tInsecurer mode; don't do checks, just query for the keys\n");
}
ldns_rr_list *
@@ -564,6 +565,9 @@ main(int argc, char *argv[])
ldns_buffer *outputfile_buffer;
FILE *outputfile;
ldns_rr *k;
+
+ bool insecure = false;
+ ldns_pkt *pkt;
domain = NULL;
res = NULL;
@@ -610,6 +614,8 @@ main(int argc, char *argv[])
verbosity = atoi(argv[i+1]);
i++;
}
+ } else if (strncmp("-i", argv[i], 2) == 0) {
+ insecure = true;
} else {
/* create a rdf from the command line arg */
if (domain) {
@@ -652,8 +658,13 @@ main(int argc, char *argv[])
ldns_resolver_set_ip6(res, address_family);
- l = retrieve_dnskeys(res, domain, LDNS_RR_TYPE_DNSKEY, LDNS_RR_CLASS_IN, dns_root);
-
+ if (insecure) {
+ pkt = ldns_resolver_query(res, domain, LDNS_RR_TYPE_DNSKEY, LDNS_RR_CLASS_IN, LDNS_RD);
+ l = ldns_pkt_rr_list_by_type(pkt, LDNS_RR_TYPE_DNSKEY, LDNS_SECTION_ANY_NOQUESTION);
+ } else {
+ l = retrieve_dnskeys(res, domain, LDNS_RR_TYPE_DNSKEY, LDNS_RR_CLASS_IN, dns_root);
+ }
+
/* separator for result data and verbosity data */
if (verbosity > 0) {
fprintf(stdout, "; ---------------------------\n");