]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
libdns: Change check_dnskey_sigs() return type to void to match the reality how the...
authorOndřej Surý <ondrej@sury.org>
Thu, 24 Oct 2019 11:55:56 +0000 (13:55 +0200)
committerOndřej Surý <ondrej@sury.org>
Mon, 4 Nov 2019 15:15:22 +0000 (16:15 +0100)
lib/dns/zoneverify.c

index 267f0bf50ce6a5da4a0ebd6cb68a7a7bbef70bb8..a1d43d9496eac0bab0598eee94b5957b5782f116 100644 (file)
@@ -1499,7 +1499,7 @@ check_apex_rrsets(vctx_t *vctx) {
  * The variables to update are chosen based on 'is_ksk', which is true when
  * 'dnskey' is a KSK and false otherwise.
  */
-static isc_result_t
+static void
 check_dnskey_sigs(vctx_t *vctx, const dns_rdata_dnskey_t *dnskey,
                  dns_rdata_t *rdata, bool is_ksk)
 {
@@ -1513,25 +1513,26 @@ check_dnskey_sigs(vctx_t *vctx, const dns_rdata_dnskey_t *dnskey,
        standby_keys = (is_ksk ? vctx->standby_ksk : vctx->standby_zsk);
        goodkey = (is_ksk ? &vctx->goodksk : &vctx->goodzsk);
 
-       if (dns_dnssec_selfsigns(rdata, vctx->origin, &vctx->keyset,
+       if (!dns_dnssec_selfsigns(rdata, vctx->origin, &vctx->keyset,
                                 &vctx->keysigs, false, vctx->mctx))
        {
-               if (active_keys[dnskey->algorithm] != 255) {
-                       active_keys[dnskey->algorithm]++;
-               }
-       } else if (!is_ksk &&
-                  dns_dnssec_signs(rdata, vctx->origin, &vctx->soaset,
-                                   &vctx->soasigs, false, vctx->mctx))
-       {
-               if (active_keys[dnskey->algorithm] != 255) {
-                       active_keys[dnskey->algorithm]++;
-               }
-               return (ISC_R_SUCCESS);
-       } else {
-               if (standby_keys[dnskey->algorithm] != 255) {
-                       standby_keys[dnskey->algorithm]++;
+               if (!is_ksk &&
+                   dns_dnssec_signs(rdata, vctx->origin, &vctx->soaset,
+                                    &vctx->soasigs, false, vctx->mctx))
+               {
+                       if (active_keys[dnskey->algorithm] != 255) {
+                               active_keys[dnskey->algorithm]++;
+                       }
+               } else {
+                       if (standby_keys[dnskey->algorithm] != 255) {
+                               standby_keys[dnskey->algorithm]++;
+                       }
                }
-               return (ISC_R_SUCCESS);
+               return;
+       }
+
+       if (active_keys[dnskey->algorithm] != 255) {
+               active_keys[dnskey->algorithm]++;
        }
 
        /*
@@ -1540,7 +1541,7 @@ check_dnskey_sigs(vctx_t *vctx, const dns_rdata_dnskey_t *dnskey,
         */
        if (vctx->secroots == NULL) {
                *goodkey = true;
-               return (ISC_R_SUCCESS);
+               return;
        }
 
        /*
@@ -1549,7 +1550,7 @@ check_dnskey_sigs(vctx_t *vctx, const dns_rdata_dnskey_t *dnskey,
        result = dns_dnssec_keyfromrdata(vctx->origin, rdata, vctx->mctx,
                                         &key);
        if (result != ISC_R_SUCCESS) {
-               return (result);
+               goto cleanup;
        }
 
        result = dns_keytable_findkeynode(vctx->secroots, vctx->origin,
@@ -1560,10 +1561,6 @@ check_dnskey_sigs(vctx_t *vctx, const dns_rdata_dnskey_t *dnskey,
         * No such trust anchor.
         */
        if (result != ISC_R_SUCCESS) {
-               if (result == DNS_R_PARTIALMATCH || result == ISC_R_NOTFOUND) {
-                       result = ISC_R_SUCCESS;
-               }
-
                goto cleanup;
        }
 
@@ -1592,7 +1589,6 @@ check_dnskey_sigs(vctx_t *vctx, const dns_rdata_dnskey_t *dnskey,
        if (key != NULL) {
                dst_key_free(&key);
        }
-       return (ISC_R_SUCCESS);
 }
 
 /*%