]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
* ldns-signzone checks if public key file is for the right zone.
authorWouter Wijngaards <wouter@NLnetLabs.nl>
Wed, 30 Jun 2010 07:32:44 +0000 (07:32 +0000)
committerWouter Wijngaards <wouter@NLnetLabs.nl>
Wed, 30 Jun 2010 07:32:44 +0000 (07:32 +0000)
Changelog
examples/ldns-signzone.c

index 8179e3d2ca1c89c307dfdf35441c78f3253f66ed..bceb008f12a851b1bce555e366533bab4062332c 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -6,6 +6,7 @@
        * Fix crash using GOST for particular platform configurations.
        * extern C declarations used in the header file.
        * Removed debug fprintf from resolver.c.
+       * ldns-signzone checks if public key file is for the right zone.
 
 1.6.5
        * Catch \X where X is a digit as an error.
index 86584d37c54920c1e7447947750427d17cb56aac..39b63603a564bf499be4fbf1435d627c06df94a4 100644 (file)
@@ -266,6 +266,11 @@ find_or_create_pubkey(const char *keyfile_name_base, ldns_key *key, ldns_zone *o
                                ldns_key_set_keytag(key, ldns_key_keytag(key) - 1);
                        }
                }
+               if(pubkey && ldns_dname_compare(ldns_rr_owner(pubkey), ldns_rr_owner(ldns_zone_soa(orig_zone))) != 0) {
+                       fprintf(stderr, "Error %s.key has wrong name: %s\n",
+                               keyfile_name_base, ldns_rdf2str(ldns_rr_owner(pubkey)));
+                       exit(EXIT_FAILURE); /* leak rdf2str, but we exit */
+               }
        }
        
        if (!pubkey) {