2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

only emit a single space between mac length and the orginal id if the mac length is zero

This commit is contained in:
Mark Andrews 2018-09-14 15:49:51 +10:00 committed by Evan Hunt
parent 26699ac57e
commit ac1c3aaa27

View File

@ -187,22 +187,26 @@ totext_any_tsig(ARGS_TOTEXT) {
/*
* Signature.
*/
REQUIRE(n <= sr.length);
sigr = sr;
sigr.length = n;
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sigr, 60, "", target));
else
RETERR(isc_base64_totext(&sigr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" ) ", target));
else
if (n != 0U) {
REQUIRE(n <= sr.length);
sigr = sr;
sigr.length = n;
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sigr, 60, "", target));
else
RETERR(isc_base64_totext(&sigr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" ) ", target));
else
RETERR(str_totext(" ", target));
isc_region_consume(&sr, n);
} else {
RETERR(str_totext(" ", target));
isc_region_consume(&sr, n);
}
/*
* Original ID.