From ee2970c8610178a71c735f57844ca408bfce946d Mon Sep 17 00:00:00 2001 From: Matthijs Mekking Date: Wed, 5 Oct 2022 16:22:37 +0200 Subject: [PATCH] Fix dns_zone_getkasp() function For inline-signing zones, sometimes kasp was not detected because the function was called on the raw (unsigned) version of the zone, but the kasp is only set on the secure (signed) version of the zone. Fix the dns_zone_getkasp() function to check whether the zone structure is inline_raw(), and if so, use the kasp from the secure version. (cherry picked from commit 681e2ae4b5cd09ea3fd7b36eb93e0d86f40521be) --- lib/dns/zone.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 672d2997bc..fd8431408e 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -5921,6 +5921,10 @@ dns_kasp_t * dns_zone_getkasp(dns_zone_t *zone) { REQUIRE(DNS_ZONE_VALID(zone)); + if (inline_raw(zone) && zone->secure != NULL) { + return (zone->secure->kasp); + } + return (zone->kasp); }