From d1cc8a271dca0e3955cf125583c5819c42f87249 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 1 May 2024 14:29:20 +1000 Subject: [PATCH] Only check SVBC alias forms at higher levels Allow SVBC (HTTPS) alias form with parameters to be accepted from the wire and when transfered. This is for possible future extensions. (cherry picked from commit 799046929cb1f23cfec7ae7391e5408e01baface) --- lib/dns/rdata/in_1/svcb_64.c | 11 +---------- tests/dns/rdata_test.c | 6 +++--- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/dns/rdata/in_1/svcb_64.c b/lib/dns/rdata/in_1/svcb_64.c index 0d9da89683..930a68f2ac 100644 --- a/lib/dns/rdata/in_1/svcb_64.c +++ b/lib/dns/rdata/in_1/svcb_64.c @@ -617,10 +617,6 @@ generic_fromtext_in_svcb(ARGS_FROMTEXT) { warn_badname(&name, lexer, callbacks); } - if (alias) { - return (ISC_R_SUCCESS); - } - /* * SvcParams */ @@ -799,7 +795,7 @@ static isc_result_t generic_fromwire_in_svcb(ARGS_FROMWIRE) { dns_name_t name; isc_region_t region, man = { .base = NULL, .length = 0 }; - bool alias, first = true, have_alpn = false; + bool first = true, have_alpn = false; uint16_t lastkey = 0, mankey = 0; UNUSED(type); @@ -817,7 +813,6 @@ generic_fromwire_in_svcb(ARGS_FROMWIRE) { return (ISC_R_UNEXPECTEDEND); } RETERR(mem_tobuffer(target, region.base, 2)); - alias = uint16_fromregion(®ion) == 0; isc_buffer_forward(source, 2); /* @@ -825,10 +820,6 @@ generic_fromwire_in_svcb(ARGS_FROMWIRE) { */ RETERR(dns_name_fromwire(&name, source, dctx, options, target)); - if (alias) { - return (ISC_R_SUCCESS); - } - /* * SvcParams. */ diff --git a/tests/dns/rdata_test.c b/tests/dns/rdata_test.c index 7fed10c805..d79b072e14 100644 --- a/tests/dns/rdata_test.c +++ b/tests/dns/rdata_test.c @@ -2517,8 +2517,8 @@ ISC_RUN_TEST_IMPL(https_svcb) { TEXT_INVALID("0"), /* minimal record */ TEXT_VALID_LOOP(0, "0 ."), - /* Alias form requires SvcFieldValue to be empty */ - TEXT_INVALID("0 . alpn=\"h2\""), + /* Alias form possible future extension */ + TEXT_VALID_LOOP(1, "0 . alpn=\"h2\""), /* no "key" prefix */ TEXT_INVALID("2 svc.example.net. 0=\"2222\""), /* no key value */ @@ -2638,7 +2638,7 @@ ISC_RUN_TEST_IMPL(https_svcb) { */ WIRE_VALID(0x00, 0x00, 0x00), /* - * Alias with non-empty SvcFieldValue (key7=""). + * Alias with invalid dohpath. */ WIRE_INVALID(0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00), /*