Commit fad44a20 authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

omit parenthesis when DNS_STYLEFLAG_MULTILINE is not set

parent a1b72e1f
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: tsig_250.c,v 1.11 1999/06/08 10:35:08 gson Exp $ */
/* $Id: tsig_250.c,v 1.12 1999/06/08 20:41:30 gson Exp $ */
/* draft-ietf-dnsind-tsig-07.txt */
......@@ -144,18 +144,22 @@ totext_any_tsig(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
/* Signature Size */
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
sprintf(buf, "%u ", n);
sprintf(buf, "%u", n);
RETERR(str_totext(buf, target));
/* Signature */
REQUIRE(n <= sr.length);
sigr = sr;
sigr.length = n;
RETERR(str_totext("(", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
RETERR(isc_base64_totext(&sigr, tctx->width - 2,
tctx->linebreak, target));
RETERR(str_totext(" ) ", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" ) ", target));
else
RETERR(str_totext(" ", target));
isc_region_consume(&sr, n);
/* Original ID */
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: cert_37.c,v 1.9 1999/06/08 10:35:09 gson Exp $ */
/* $Id: cert_37.c,v 1.10 1999/06/08 20:41:31 gson Exp $ */
/* draft-ietf-dnssec-certs-04.txt */
......@@ -101,15 +101,16 @@ totext_cert(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
/* algorithm */
RETERR(dns_secalg_totext(sr.base[0], target));
RETERR(str_totext(" ", target));
isc_region_consume(&sr, 1);
/* cert */
RETERR(str_totext("(", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
RETERR(str_totext(" )", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" )", target));
return (DNS_R_SUCCESS);
}
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: key_25.c,v 1.7 1999/06/08 10:35:11 gson Exp $ */
/* $Id: key_25.c,v 1.8 1999/06/08 20:41:31 gson Exp $ */
/* RFC 2065 */
......@@ -99,11 +99,13 @@ totext_key(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
return (DNS_R_SUCCESS);
/* key */
RETERR(str_totext(" (", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
RETERR(str_totext(" )", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" )", target));
return DNS_R_SUCCESS;
}
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: sig_24.c,v 1.13 1999/06/08 10:35:19 gson Exp $ */
/* $Id: sig_24.c,v 1.14 1999/06/08 20:41:31 gson Exp $ */
/* RFC 2065 */
......@@ -148,9 +148,9 @@ totext_sig(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
exp = uint32_fromregion(&sr);
isc_region_consume(&sr, 4);
RETERR(dns_time32_totext(exp, target));
RETERR(str_totext(" ", target));
RETERR(str_totext("(", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
/* time signed */
......@@ -178,7 +178,8 @@ totext_sig(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
RETERR(str_totext(tctx->linebreak, target));
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
RETERR(str_totext(" )", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" )", target));
return DNS_R_SUCCESS;
}
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: tkey_249.c,v 1.11 1999/06/08 10:35:20 gson Exp $ */
/* $Id: tkey_249.c,v 1.12 1999/06/08 20:41:31 gson Exp $ */
/* draft-ietf-dnssec-tkey-01.txt */
......@@ -148,18 +148,22 @@ totext_tkey(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
/* Signature Size */
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
sprintf(buf, "%lu ", n);
sprintf(buf, "%lu", n);
RETERR(str_totext(buf, target));
/* Signature */
REQUIRE(n <= sr.length);
sigr = sr;
sigr.length = n;
RETERR(str_totext("(", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
RETERR(isc_base64_totext(&sigr, tctx->width - 2,
tctx->linebreak, target));
RETERR(str_totext(" ) ", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" ) ", target));
else
RETERR(str_totext(" ", target));
isc_region_consume(&sr, n);
/* Other Size */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment