From: Miek Gieben Date: Thu, 19 May 2005 13:34:16 +0000 (+0000) Subject: signing and verification all looks to be working X-Git-Tag: release-0.60^2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=866d1972e4967db457e58313a907025cccaeee48;p=thirdparty%2Fldns.git signing and verification all looks to be working --- diff --git a/tests/run-test20.c b/tests/run-test20.c index 41b80fef..0fe28b8a 100644 --- a/tests/run-test20.c +++ b/tests/run-test20.c @@ -88,8 +88,8 @@ main(void) } privkey = ldns_key_new_frm_fp(f); printf("Kom ik hier nog wel ofzo?\n"); - fclose(f); + if (!privkey) { printf("arrg no key could be found!\n"); exit(1); @@ -108,11 +108,36 @@ main(void) exit(1); } + f = fopen("Kmiek.nl.+001+05920.private", "r"); + printf("Opening %s\n", "Kmiek.nl.+001+05920.private "); + if (!f) { + return 0; + } + + privkey = ldns_key_new_frm_fp(f); + printf("Kom ik hier nog wel ofzo?\n"); + fclose(f); + + if (!privkey) { + printf("arrg no key could be found!\n"); + exit(1); + } + + dnskey = ldns_key2rr(privkey); + if (dnskey) { + ldns_rr_print(stdout, dnskey); + /* + printf("; {%d}\n", + (int) ldns_calc_keytag(dnskey)); + */ + printf("\n"); + ldns_key_set_keytag(privkey, ldns_calc_keytag(dnskey)); + } else { + exit(1); + } - return 0; - /* this is all kaput... :-( */ signatures = ldns_sign_public(rrs, keys); ldns_rr_list_print(stdout, signatures);