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.
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;
*/
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