+3630. [bug] Ensure correct ID computation for MD5 keys. [RT #33033]
+
3625. [bug] Don't send notify messages to machines outside of the
test setup.
static inline isc_result_t
fromwire_dnskey(ARGS_FROMWIRE) {
isc_region_t sr;
+ unsigned char algorithm;
REQUIRE(type == 48);
if (sr.length < 4)
return (ISC_R_UNEXPECTEDEND);
+ /*
+ * RSAMD5 computes key ID differently from other
+ * algorithms: we need to ensure there's enough data
+ * present for the computation
+ */
+ algorithm = sr.base[3];
+ if (algorithm == DST_ALG_RSAMD5 && sr.length < 7)
+ return (ISC_R_UNEXPECTEDEND);
+
isc_buffer_forward(source, sr.length);
return (mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
fromwire_key(ARGS_FROMWIRE) {
isc_region_t sr;
+ unsigned char algorithm;
REQUIRE(type == 25);
if (sr.length < 4)
return (ISC_R_UNEXPECTEDEND);
+ /*
+ * RSAMD5 computes key ID differently from other
+ * algorithms: we need to ensure there's enough data
+ * present for the computation
+ */
+ algorithm = sr.base[3];
+ if (algorithm == DST_ALG_RSAMD5 && sr.length < 3)
+ return (ISC_R_UNEXPECTEDEND);
+
isc_buffer_forward(source, sr.length);
return (mem_tobuffer(target, sr.base, sr.length));
}