]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
signing and verification all looks to be working
authorMiek Gieben <miekg@NLnetLabs.nl>
Thu, 19 May 2005 13:34:16 +0000 (13:34 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Thu, 19 May 2005 13:34:16 +0000 (13:34 +0000)
tests/run-test20.c

index 41b80fef417076911b184d7c323fb41b4ecced78..0fe28b8ad214f8dbea8cec11527f54b88a7392c0 100644 (file)
@@ -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);