From bf237274fc859f2f198ceab3d069b1700c9b2c7f Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Sat, 24 Jan 2026 18:32:40 +1100 Subject: [PATCH 1/3] Fix isc_base64_tobuffer call for brid and hhit Zero length records were not being rejected. (cherry picked from commit bdb9c838a82558f7b3e1bcf0b9dd7e6f1cfb9aa8) --- lib/dns/rdata/generic/brid_68.c | 2 +- lib/dns/rdata/generic/hhit_67.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dns/rdata/generic/brid_68.c b/lib/dns/rdata/generic/brid_68.c index ac3bbb35ae..beded91e88 100644 --- a/lib/dns/rdata/generic/brid_68.c +++ b/lib/dns/rdata/generic/brid_68.c @@ -28,7 +28,7 @@ fromtext_brid(ARGS_FROMTEXT) { UNUSED(options); UNUSED(callbacks); - return isc_base64_tobuffer(lexer, target, -1); + return isc_base64_tobuffer(lexer, target, -2); } static isc_result_t diff --git a/lib/dns/rdata/generic/hhit_67.c b/lib/dns/rdata/generic/hhit_67.c index c0b57730e7..b0eb4e9c98 100644 --- a/lib/dns/rdata/generic/hhit_67.c +++ b/lib/dns/rdata/generic/hhit_67.c @@ -28,7 +28,7 @@ fromtext_hhit(ARGS_FROMTEXT) { UNUSED(options); UNUSED(callbacks); - return isc_base64_tobuffer(lexer, target, -1); + return isc_base64_tobuffer(lexer, target, -2); } static isc_result_t From 3b049e21cfefcd62cbacf9941e8628eb4451e922 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Sat, 24 Jan 2026 18:33:47 +1100 Subject: [PATCH 2/3] Remove extraneous space at start of brid and hhit records (cherry picked from commit 10366e4f4e52f45ba46a7e839ffd3df9d4ab15ef) --- lib/dns/rdata/generic/brid_68.c | 2 -- lib/dns/rdata/generic/hhit_67.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/lib/dns/rdata/generic/brid_68.c b/lib/dns/rdata/generic/brid_68.c index beded91e88..0b05fb3faa 100644 --- a/lib/dns/rdata/generic/brid_68.c +++ b/lib/dns/rdata/generic/brid_68.c @@ -45,8 +45,6 @@ totext_brid(ARGS_TOTEXT) { RETERR(str_totext(" (", target)); } - RETERR(str_totext(tctx->linebreak, target)); - if (tctx->width == 0) { /* No splitting */ RETERR(isc_base64_totext(&sr, 60, "", target)); } else { diff --git a/lib/dns/rdata/generic/hhit_67.c b/lib/dns/rdata/generic/hhit_67.c index b0eb4e9c98..1fa869c218 100644 --- a/lib/dns/rdata/generic/hhit_67.c +++ b/lib/dns/rdata/generic/hhit_67.c @@ -45,8 +45,6 @@ totext_hhit(ARGS_TOTEXT) { RETERR(str_totext(" (", target)); } - RETERR(str_totext(tctx->linebreak, target)); - if (tctx->width == 0) { /* No splitting */ RETERR(isc_base64_totext(&sr, 60, "", target)); } else { From 975eab94b2421b892a0e9c2d99e1e0a86f5efc84 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Sat, 24 Jan 2026 18:37:52 +1100 Subject: [PATCH 3/3] Fix brid and hhit unit tests These tests were not being run. (cherry picked from commit 97af8fc519590bd0d794f1208b6ad60aa717e2c7) --- tests/dns/rdata_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/dns/rdata_test.c b/tests/dns/rdata_test.c index e95cf5cc8f..ff653adc91 100644 --- a/tests/dns/rdata_test.c +++ b/tests/dns/rdata_test.c @@ -1102,7 +1102,7 @@ ISC_RUN_TEST_IMPL(amtrelay) { } /* BRIB RDATA - base64 encoded opaque */ -ISC_RUN_TEST_IMPL(brib) { +ISC_RUN_TEST_IMPL(brid) { text_ok_t text_ok[] = { /* empty */ TEXT_INVALID(""), /* valid base64 string */ @@ -3280,6 +3280,7 @@ ISC_TEST_LIST_START ISC_TEST_ENTRY(amtrelay) ISC_TEST_ENTRY(apl) ISC_TEST_ENTRY(atma) +ISC_TEST_ENTRY(brid) ISC_TEST_ENTRY(cdnskey) ISC_TEST_ENTRY(csync) ISC_TEST_ENTRY(dnskey) @@ -3287,6 +3288,7 @@ ISC_TEST_ENTRY(doa) ISC_TEST_ENTRY(ds) ISC_TEST_ENTRY(dsync) ISC_TEST_ENTRY(eid) +ISC_TEST_ENTRY(hhit) ISC_TEST_ENTRY(hip) ISC_TEST_ENTRY(https_svcb) ISC_TEST_ENTRY(isdn) @@ -3296,8 +3298,8 @@ ISC_TEST_ENTRY(nimloc) ISC_TEST_ENTRY(nsec) ISC_TEST_ENTRY(nsec3) ISC_TEST_ENTRY(nxt) -ISC_TEST_ENTRY(rkey) ISC_TEST_ENTRY(resinfo) +ISC_TEST_ENTRY(rkey) ISC_TEST_ENTRY(sshfp) ISC_TEST_ENTRY(wallet) ISC_TEST_ENTRY(wks)