'{&dns}' is as valid as '{?dns}' in a SVCB's dohpath
See for example section 1.2. "Levels and Expression Types" of rfc6570.
(cherry picked from commit e74052ea71)
This commit is contained in:
committed by
Mark Andrews
parent
41fd5e9955
commit
cc9366031b
@@ -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;
|
||||
|
||||
@@ -2659,6 +2659,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"),
|
||||
|
||||
Reference in New Issue
Block a user