generic_fromwire_in_svcb(ARGS_FROMWIRE) {
dns_name_t name;
isc_region_t region, man = { .base = NULL, .length = 0 };
- bool alias, first = true;
+ bool alias, first = true, have_alpn = false;
uint16_t lastkey = 0, mankey = 0;
UNUSED(type);
}
}
+ /*
+ * Check alpn present when no-default-alpn is set.
+ */
+ if (key == SVCB_ALPN_KEY) {
+ have_alpn = true;
+ } else if (key == SVCB_NO_DEFAULT_ALPN_KEY && !have_alpn) {
+ return (DNS_R_FORMERR);
+ }
+
first = false;
lastkey = key;
*/
WIRE_VALID_LOOP(0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x09,
5, 'h', '1', '\\', 'h', '2', 2, 'h', '3'),
+ /*
+ * no-default-alpn (0x00 0x02) without alpn, alpn is required.
+ */
+ WIRE_INVALID(0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00),
WIRE_SENTINEL()
};
/* Test vectors from RFCXXXX */