From: Mark Andrews Date: Mon, 29 Jun 2026 22:40:15 +0000 (+1000) Subject: Set the active region for the dst_algorithm_fromprivatedns() call X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bf7d245d2462c7183d22c56637f044516fc5544;p=thirdparty%2Fbind9.git Set the active region for the dst_algorithm_fromprivatedns() call dst_algorithm_fromprivatedns() reads the name with dns_name_fromwire(), which parses only the active region of the buffer. frombuffer() did not set it, so the name could never be parsed and every PRIVATEDNS key was rejected with DST_R_UNSUPPORTEDALG. Document the requirement in dst.h. --- diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c index d4307b309a8..c84a7f9ba36 100644 --- a/lib/dns/dst_api.c +++ b/lib/dns/dst_api.c @@ -2099,6 +2099,7 @@ frombuffer(const dns_name_t *name, unsigned int alg, unsigned int flags, if (alg == DNS_KEYALG_PRIVATEDNS) { isc_buffer_t b = *source; + isc_buffer_setactive(&b, isc_buffer_remaininglength(&b)); alg = dst_algorithm_fromprivatedns(&b); if (alg == 0) { return DST_R_UNSUPPORTEDALG; diff --git a/lib/dns/include/dst/dst.h b/lib/dns/include/dst/dst.h index 0da1c5f0d6c..bb24b63c07a 100644 --- a/lib/dns/include/dst/dst.h +++ b/lib/dns/include/dst/dst.h @@ -226,10 +226,13 @@ dst_algorithm_fromprivateoid(isc_buffer_t *buffer); */ dst_algorithm_t -dst_algorithm_fromprivatedns(isc_buffer_t *buf); +dst_algorithm_fromprivatedns(isc_buffer_t *buffer); /* * Extract the dst algorithm identifier that matches * the DNS name found at the start of 'buffer'. + * + * The active region needs to be set on 'buffer' as + * dns_name_fromwire is called. */ bool