diff options
Diffstat (limited to 'external/mpl/bind/dist/lib/dns/keytable.c')
| -rw-r--r-- | external/mpl/bind/dist/lib/dns/keytable.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/external/mpl/bind/dist/lib/dns/keytable.c b/external/mpl/bind/dist/lib/dns/keytable.c index 66a33b00ce8..23e0253d987 100644 --- a/external/mpl/bind/dist/lib/dns/keytable.c +++ b/external/mpl/bind/dist/lib/dns/keytable.c @@ -1,4 +1,4 @@ -/* $NetBSD: keytable.c,v 1.8 2022/09/23 12:15:29 christos Exp $ */ +/* $NetBSD: keytable.c,v 1.9 2023/06/26 22:03:00 christos Exp $ */ /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") @@ -461,10 +461,6 @@ dns_keytable_deletekey(dns_keytable_t *keytable, const dns_name_t *keyname, REQUIRE(VALID_KEYTABLE(keytable)); REQUIRE(dnskey != NULL); - isc_buffer_init(&b, data, sizeof(data)); - dns_rdata_fromstruct(&rdata, dnskey->common.rdclass, - dns_rdatatype_dnskey, dnskey, &b); - RWLOCK(&keytable->rwlock, isc_rwlocktype_write); result = dns_rbt_findnode(keytable->table, keyname, NULL, &node, NULL, DNS_RBTFIND_NOOPTIONS, NULL, NULL); @@ -491,6 +487,13 @@ dns_keytable_deletekey(dns_keytable_t *keytable, const dns_name_t *keyname, } RWUNLOCK(&knode->rwlock, isc_rwlocktype_read); + isc_buffer_init(&b, data, sizeof(data)); + result = dns_rdata_fromstruct(&rdata, dnskey->common.rdclass, + dns_rdatatype_dnskey, dnskey, &b); + if (result != ISC_R_SUCCESS) { + goto finish; + } + result = dns_ds_fromkeyrdata(keyname, &rdata, DNS_DSDIGEST_SHA256, digest, &ds); if (result != ISC_R_SUCCESS) { |
