diff --git a/CHANGES b/CHANGES index f32838b3ee..aeacb4f99a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3906. [protocol] Update URI record format to comply with + draft-faltstrom-uri-08. [RT #36642] + 3905. [bug] Address deadlock between view.c and adb.c. [RT #36341] 3904. [func] Add the RPZ SOA to the additional section. [RT36507] diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index 0db9583a32..9a687cffcb 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -126,16 +126,13 @@ static isc_result_t txt_fromwire(isc_buffer_t *source, isc_buffer_t *target); static isc_result_t -multitxt_totext(isc_region_t *source, isc_buffer_t *target, - isc_boolean_t lenbyte); +multitxt_totext(isc_region_t *source, isc_buffer_t *target); static isc_result_t -multitxt_fromtext(isc_textregion_t *source, isc_buffer_t *target, - isc_boolean_t lenbyte); +multitxt_fromtext(isc_textregion_t *source, isc_buffer_t *target); static isc_result_t -multitxt_fromwire(isc_buffer_t *source, isc_buffer_t *target, - isc_boolean_t lenbyte); +multitxt_fromwire(isc_buffer_t *source, isc_buffer_t *target); static isc_boolean_t name_prefix(dns_name_t *name, dns_name_t *origin, dns_name_t *target); @@ -1294,15 +1291,9 @@ txt_fromwire(isc_buffer_t *source, isc_buffer_t *target) { /* * Conversion of TXT-like rdata fields without length limits. - * 'lenbyte' indicates whether to use length bytes in the encoding: - * The URI rdatatype uses length bytes for each 255-byte chunk of - * TXT, while the CAA rdatatype's length length is established by - * the overall rdata length. */ static isc_result_t -multitxt_totext(isc_region_t *source, isc_buffer_t *target, - isc_boolean_t lenbyte) -{ +multitxt_totext(isc_region_t *source, isc_buffer_t *target) { unsigned int tl; unsigned int n0, n; unsigned char *sp; @@ -1319,13 +1310,8 @@ multitxt_totext(isc_region_t *source, isc_buffer_t *target, *tp++ = '"'; tl--; do { - if (lenbyte) { - n0 = n = *sp++; - REQUIRE(n0 + 1 <= source->length); - } else { - n = source->length; - n0 = source->length - 1; - } + n = source->length; + n0 = source->length - 1; while (n--) { if (*sp < 0x20 || *sp >= 0x7f) { @@ -1362,9 +1348,7 @@ multitxt_totext(isc_region_t *source, isc_buffer_t *target, } static isc_result_t -multitxt_fromtext(isc_textregion_t *source, isc_buffer_t *target, - isc_boolean_t lenbyte) -{ +multitxt_fromtext(isc_textregion_t *source, isc_buffer_t *target) { isc_region_t tregion; isc_boolean_t escape; unsigned int n, nrem; @@ -1384,16 +1368,6 @@ multitxt_fromtext(isc_textregion_t *source, isc_buffer_t *target, if (nrem < 1) return (ISC_R_NOSPACE); - if (lenbyte) { - /* length byte */ - nrem--; - t++; - - /* 255 byte character-string slice */ - if (nrem > 255) - nrem = 255; - } - while (n != 0) { --n; c = (*s++) & 0xff; @@ -1428,19 +1402,13 @@ multitxt_fromtext(isc_textregion_t *source, isc_buffer_t *target, if (escape) return (DNS_R_SYNTAX); - if (lenbyte) { - *t0 = (unsigned char)(t - t0 - 1); - isc_buffer_add(target, *t0 + 1); - } else - isc_buffer_add(target, t - t0); + isc_buffer_add(target, t - t0); } while (n != 0); return (ISC_R_SUCCESS); } static isc_result_t -multitxt_fromwire(isc_buffer_t *source, isc_buffer_t *target, - isc_boolean_t lenbyte) -{ +multitxt_fromwire(isc_buffer_t *source, isc_buffer_t *target) { unsigned int n; isc_region_t sregion; isc_region_t tregion; @@ -1452,12 +1420,8 @@ multitxt_fromwire(isc_buffer_t *source, isc_buffer_t *target, do { if (n != 256U) return (DNS_R_SYNTAX); - if (lenbyte) { - n = *sregion.base + 1; - if (n > sregion.length) - return (ISC_R_UNEXPECTEDEND); - } else - n = sregion.length; + + n = sregion.length; isc_buffer_availableregion(target, &tregion); if (n > tregion.length) diff --git a/lib/dns/rdata/generic/caa_257.c b/lib/dns/rdata/generic/caa_257.c index 835a23e6bc..8ca43de28b 100644 --- a/lib/dns/rdata/generic/caa_257.c +++ b/lib/dns/rdata/generic/caa_257.c @@ -81,8 +81,7 @@ fromtext_caa(ARGS_FROMTEXT) { if (token.type != isc_tokentype_qstring && token.type != isc_tokentype_string) RETERR(DNS_R_SYNTAX); - RETERR(multitxt_fromtext(&token.value.as_textregion, target, - ISC_FALSE)); + RETERR(multitxt_fromtext(&token.value.as_textregion, target)); return (ISC_R_SUCCESS); } @@ -116,7 +115,7 @@ totext_caa(ARGS_TOTEXT) { /* * Value */ - RETERR(multitxt_totext(®ion, target, ISC_FALSE)); + RETERR(multitxt_totext(®ion, target)); return (ISC_R_SUCCESS); } @@ -164,7 +163,7 @@ fromwire_caa(ARGS_FROMWIRE) { /* * Value */ - RETERR(multitxt_fromwire(source, target, ISC_FALSE)); + RETERR(multitxt_fromwire(source, target)); return (ISC_R_SUCCESS); } diff --git a/lib/dns/rdata/generic/uri_256.c b/lib/dns/rdata/generic/uri_256.c index 345ce97936..8e9c908288 100644 --- a/lib/dns/rdata/generic/uri_256.c +++ b/lib/dns/rdata/generic/uri_256.c @@ -58,8 +58,7 @@ fromtext_uri(ARGS_FROMTEXT) { isc_tokentype_qstring, ISC_FALSE)); if (token.type != isc_tokentype_qstring) RETTOK(DNS_R_SYNTAX); - RETTOK(multitxt_fromtext(&token.value.as_textregion, target, - ISC_TRUE)); + RETTOK(multitxt_fromtext(&token.value.as_textregion, target)); return (ISC_R_SUCCESS); } @@ -95,7 +94,7 @@ totext_uri(ARGS_TOTEXT) { /* * Target URI */ - RETERR(multitxt_totext(®ion, target, ISC_TRUE)); + RETERR(multitxt_totext(®ion, target)); return (ISC_R_SUCCESS); } @@ -122,7 +121,7 @@ fromwire_uri(ARGS_FROMWIRE) { /* * Target URI */ - RETERR(multitxt_fromwire(source, target, ISC_TRUE)); + RETERR(multitxt_fromwire(source, target)); return (ISC_R_SUCCESS); }