]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
'{&dns}' is as valid as '{?dns}' in a SVCB's dohpath
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 5 Sep 2024 13:11:21 +0000 (15:11 +0200)
committerMark Andrews <marka@isc.org>
Tue, 26 Nov 2024 01:38:33 +0000 (12:38 +1100)
See for example section 1.2. "Levels and Expression Types" of rfc6570.

lib/dns/rdata/in_1/svcb_64.c
tests/dns/rdata_test.c

index 1045cf9c519ef769f234d21530f4f10a5a1b12e2..754e3ef71f8d400c567edd530388185636bee479 100644 (file)
@@ -158,7 +158,7 @@ svcb_validate(uint16_t key, isc_region_t *region) {
                                /*
                                 * Minimum valid dohpath is "/{?dns}" as
                                 * it MUST be relative (leading "/") and
-                                * MUST contain "{?dns}".
+                                * MUST contain "{?dns}" or "{&dns}".
                                 */
                                if (region->length < 7) {
                                        return DNS_R_FORMERR;
@@ -173,8 +173,10 @@ svcb_validate(uint16_t key, isc_region_t *region) {
                                {
                                        return DNS_R_FORMERR;
                                }
-                               /* MUST contain "{?dns}" */
+                               /* MUST contain "{?dns}" or "{&dns}" */
                                if (strnstr((char *)region->base, "{?dns}",
+                                           region->length) == NULL &&
+                                   strnstr((char *)region->base, "{&dns}",
                                            region->length) == NULL)
                                {
                                        return DNS_R_FORMERR;
index 6830b3b07193a451253ff197588bea21eb193d05..de7a6b44e89c4bf4b0ad9d59a72b2013ea8f10d2 100644 (file)
@@ -2701,6 +2701,8 @@ ISC_RUN_TEST_IMPL(https_svcb) {
                                   "1 example.net. key7=\"/{?dns}\""),
                TEXT_VALID_LOOPCHG(1, "1 example.net. dohpath=/some/path{?dns}",
                                   "1 example.net. key7=\"/some/path{?dns}\""),
+               TEXT_VALID_LOOPCHG(1, "1 example.net. dohpath=/some/path?key=value{&dns}",
+                                  "1 example.net. key7=\"/some/path?key=value{&dns}\""),
                TEXT_INVALID("1 example.com. dohpath=no-slash"),
                TEXT_INVALID("1 example.com. dohpath=/{?notdns}"),
                TEXT_INVALID("1 example.com. dohpath=/notvariable"),