2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 23:25:38 +00:00

3062. [func] Made several changes to enhance human readability

of DNSSEC data in dig output and in generated
			zone files:
			 - DNSKEY record comments are more verbose, no
			   longer used in multiline mode only
			 - multiline RRSIG records reformatted
			 - multiline output mode for NSEC3PARAM records
			 - "dig +norrcomments" suppresses DNSKEY comments
			 - "dig +split=X" breaks hex/base64 records into
			   fields of width X; "dig +nosplit" disables this.
			[RT #22820]
This commit is contained in:
Evan Hunt
2011-03-05 19:39:07 +00:00
parent 59563d2a5d
commit 9a859983d7
28 changed files with 367 additions and 129 deletions

12
CHANGES
View File

@@ -1,3 +1,15 @@
3062. [func] Made several changes to enhance human readability
of DNSSEC data in dig output and in generated
zone files:
- DNSKEY record comments are more verbose, no
longer used in multiline mode only
- multiline RRSIG records reformatted
- multiline output mode for NSEC3PARAM records
- "dig +norrcomments" suppresses DNSKEY comments
- "dig +split=X" breaks hex/base64 records into
fields of width X; "dig +nosplit" disables this.
[RT #22820]
3061. [func] New option "dnssec-signzone -D", only write out
generated DNSSEC records. [RT #22896]

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dig.c,v 1.239 2011/03/01 23:48:05 tbox Exp $ */
/* $Id: dig.c,v 1.240 2011/03/05 19:39:06 each Exp $ */
/*! \file */
@@ -67,7 +67,8 @@ static char domainopt[DNS_NAME_MAXTEXT];
static isc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE,
ip6_int = ISC_FALSE, plusquest = ISC_FALSE, pluscomm = ISC_FALSE,
multiline = ISC_FALSE, nottl = ISC_FALSE, noclass = ISC_FALSE,
onesoa = ISC_FALSE;
onesoa = ISC_FALSE, rrcomments = ISC_FALSE;
static isc_uint32_t splitwidth = 0xffffffff;
/*% opcode text */
static const char * const opcodetext[] = {
@@ -201,6 +202,8 @@ help(void) {
" +[no]cl (Control display of class in records)\n"
" +[no]cmd (Control display of command line)\n"
" +[no]comments (Control display of comment lines)\n"
" +[no]rrcomments (Control display of per-record "
"comments)\n"
" +[no]question (Control display of question)\n"
" +[no]answer (Control display of answer)\n"
" +[no]authority (Control display of authority)\n"
@@ -223,6 +226,7 @@ help(void) {
" +[no]topdown (Do DNSSEC validation top down mode)\n"
#endif
#endif
" +[no]split=## (Split hex/base64 fields into chunks)\n"
" +[no]multiline (Print records in an expanded format)\n"
" +[no]onesoa (AXFR prints only one soa record)\n"
" global d-opts and servers (before host name) affect all queries.\n"
@@ -391,6 +395,8 @@ printrdataset(dns_name_t *owner_name, dns_rdataset_t *rdataset,
styleflags |= DNS_STYLEFLAG_NO_TTL;
if (noclass)
styleflags |= DNS_STYLEFLAG_NO_CLASS;
if (rrcomments)
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
if (multiline) {
styleflags |= DNS_STYLEFLAG_OMIT_OWNER;
styleflags |= DNS_STYLEFLAG_OMIT_CLASS;
@@ -399,16 +405,21 @@ printrdataset(dns_name_t *owner_name, dns_rdataset_t *rdataset,
styleflags |= DNS_STYLEFLAG_TTL;
styleflags |= DNS_STYLEFLAG_MULTILINE;
styleflags |= DNS_STYLEFLAG_COMMENT;
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
}
if (multiline || (nottl && noclass))
result = dns_master_stylecreate(&style, styleflags,
24, 24, 24, 32, 80, 8, mctx);
result = dns_master_stylecreate2(&style, styleflags,
24, 24, 24, 32, 80, 8,
splitwidth, mctx);
else if (nottl || noclass)
result = dns_master_stylecreate(&style, styleflags,
24, 24, 32, 40, 80, 8, mctx);
result = dns_master_stylecreate2(&style, styleflags,
24, 24, 32, 40, 80, 8,
splitwidth, mctx);
else
result = dns_master_stylecreate(&style, styleflags,
24, 32, 40, 48, 80, 8, mctx);
result = dns_master_stylecreate2(&style, styleflags,
24, 32, 40, 48, 80, 8,
splitwidth, mctx);
check_result(result, "dns_master_stylecreate");
result = dns_master_rdatasettotext(owner_name, rdataset, style, target);
@@ -433,6 +444,10 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
unsigned int styleflags = 0;
styleflags |= DNS_STYLEFLAG_REL_OWNER;
if (query->lookup->comments)
styleflags |= DNS_STYLEFLAG_COMMENT;
if (rrcomments)
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
if (nottl)
styleflags |= DNS_STYLEFLAG_NO_TTL;
if (noclass)
@@ -444,17 +459,20 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
styleflags |= DNS_STYLEFLAG_OMIT_TTL;
styleflags |= DNS_STYLEFLAG_TTL;
styleflags |= DNS_STYLEFLAG_MULTILINE;
styleflags |= DNS_STYLEFLAG_COMMENT;
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
}
if (multiline || (nottl && noclass))
result = dns_master_stylecreate(&style, styleflags,
24, 24, 24, 32, 80, 8, mctx);
result = dns_master_stylecreate2(&style, styleflags,
24, 24, 24, 32, 80, 8,
splitwidth, mctx);
else if (nottl || noclass)
result = dns_master_stylecreate(&style, styleflags,
24, 24, 32, 40, 80, 8, mctx);
result = dns_master_stylecreate2(&style, styleflags,
24, 24, 32, 40, 80, 8,
splitwidth, mctx);
else
result = dns_master_stylecreate(&style, styleflags,
24, 32, 40, 48, 80, 8, mctx);
result = dns_master_stylecreate2(&style, styleflags,
24, 32, 40, 48, 80, 8,
splitwidth, mctx);
check_result(result, "dns_master_stylecreate");
if (query->lookup->cmdline[0] != 0) {
@@ -756,6 +774,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
lookup->section_answer = state;
lookup->section_additional = state;
lookup->comments = state;
rrcomments = state;
lookup->stats = state;
printcmd = state;
break;
@@ -914,6 +933,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
lookup->identify = ISC_TRUE;
lookup->stats = ISC_FALSE;
lookup->comments = ISC_FALSE;
rrcomments = ISC_FALSE;
lookup->section_additional = ISC_FALSE;
lookup->section_authority = ISC_FALSE;
lookup->section_question = ISC_FALSE;
@@ -973,6 +993,10 @@ plus_option(char *option, isc_boolean_t is_batchfile,
default:
goto invalid_option;
}
break;
case 'r': /* rrcomments */
FULLCHECK("rrcomments");
rrcomments = state;
break;
default:
goto invalid_option;
@@ -1000,6 +1024,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
lookup->section_authority = ISC_FALSE;
lookup->section_question = ISC_FALSE;
lookup->comments = ISC_FALSE;
rrcomments = ISC_FALSE;
lookup->stats = ISC_FALSE;
}
break;
@@ -1022,6 +1047,36 @@ plus_option(char *option, isc_boolean_t is_batchfile,
lookup->dnssec = ISC_TRUE;
break;
#endif
case 'p': /* split */
FULLCHECK("split");
if (value != NULL && !state)
goto invalid_option;
if (!state) {
splitwidth = 0;
break;
} else if (value == NULL)
break;
result = parse_uint(&splitwidth, value,
1023, "split");
if (splitwidth % 4 != 0) {
splitwidth = ((splitwidth + 3) / 4) * 4;
fprintf(stderr, ";; Warning, split must be "
"a multiple of 4; adjusting "
"to %d\n", splitwidth);
}
/*
* There is an adjustment done in the
* totext_<rrtype>() functions which causes
* splitwidth to shrink. This is okay when we're
* using the default width but incorrect in this
* case, so we correct for it
*/
if (splitwidth)
splitwidth += 3;
if (result != ISC_R_SUCCESS)
fatal("Couldn't parse retries");
break;
case 't': /* stats */
FULLCHECK("stats");
lookup->stats = state;
@@ -1066,6 +1121,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
lookup->recurse = ISC_FALSE;
lookup->identify = ISC_TRUE;
lookup->comments = ISC_FALSE;
rrcomments = ISC_FALSE;
lookup->stats = ISC_FALSE;
lookup->section_additional = ISC_FALSE;
lookup->section_authority = ISC_TRUE;

View File

@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: dig.docbook,v 1.47 2010/03/04 23:50:34 tbox Exp $ -->
<!-- $Id: dig.docbook,v 1.48 2011/03/05 19:39:06 each Exp $ -->
<refentry id="man.dig">
<refentryinfo>
@@ -587,8 +587,35 @@
<listitem>
<para>
Toggle the display of comment lines in the output. The default
is to
print comments.
is to print comments.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]rrcomments</option></term>
<listitem>
<para>
Toggle the display of per-record comments in the output (for
example, human-readable key information about DNSKEY records).
The default is not to print record comments unless multiline
mode is active.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+split=W</option></term>
<listitem>
<para>
Split long hex- or base64-formatted fields in resource
records into chunks of <parameter>W</parameter> characters
(where <parameter>W</parameter> is rounded up to the nearest
multiple of 4).
<parameter>+nosplit</parameter> or
<parameter>+split=0</parameter> causes fields not to be
split at all. The default is 56 characters, or 44 characters
when multiline mode is active.
</para>
</listitem>
</varlistentry>

View File

@@ -15,7 +15,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: clean.sh,v 1.39 2011/03/05 06:35:40 marka Exp $
# $Id: clean.sh,v 1.40 2011/03/05 19:39:06 each Exp $
exit
@@ -54,6 +54,7 @@ rm -f ns3/auto-nsec.example.db ns3/auto-nsec3.example.db
rm -f ns3/secure.below-cname.example.db
rm -f signer/example.db.after signer/example.db.before
rm -f signer/example.db.changed
rm -f signer/nsec3param.out
rm -f ns3/ttlpatch.example.db ns3/ttlpatch.example.db.signed
rm -f ns3/ttlpatch.example.db.patched
rm -f ns3/split-smart.example.db

View File

@@ -15,7 +15,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: tests.sh,v 1.81 2011/03/05 06:35:40 marka Exp $
# $Id: tests.sh,v 1.82 2011/03/05 19:39:06 each Exp $
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
@@ -953,7 +953,15 @@ key1=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 1024 -n zone $zone`
key2=`$KEYGEN -q -r $RANDFILE -f KSK -a NSEC3RSASHA1 -b 1024 -n zone $zone`
cat example.db.in $key1.key $key2.key > example.db
$SIGNER -3 - -H 10 -o example -f example.db example.db > /dev/null 2>&1
grep "IQF9LQTLKKNFK0KVIFELRAK4IC4QLTMG.example. 0 IN NSEC3 1 0 10 - IQF9LQTLKKNFK0KVIFELRAK4IC4QLTMG A NS SOA RRSIG DNSKEY NSEC3PARAM" example.db > /dev/null
awk '/^IQF9LQTLK/ {
printf("%s ", $0);
getline;
printf ("%s ", $0);
getline;
print;
}' example.db | sed 's/[ ][ ]*/ /g' > nsec3param.out
grep "IQF9LQTLKKNFK0KVIFELRAK4IC4QLTMG.example. 0 IN NSEC3 1 0 10 - ( IQF9LQTLKKNFK0KVIFELRAK4IC4QLTMG A NS SOA RRSIG DNSKEY NSEC3PARAM )" nsec3param.out > /dev/null
) || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi

View File

@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: named.conf,v 1.2 2011/03/04 14:43:57 smann Exp $ */
/* $Id: named.conf,v 1.5 2011/03/11 17:19:05 each Exp $ */
options {
query-source address 10.53.0.1;

View File

@@ -14,7 +14,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: tests.sh,v 1.5 2009/12/02 17:54:45 each Exp $
# $Id: tests.sh,v 1.6 2011/03/05 19:39:06 each Exp $
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
@@ -46,8 +46,8 @@ $SIGNER -Sg -o $pzone $pfile > /dev/null 2>&1
awk '$2 ~ /RRSIG/ {
type = $3;
getline;
id = $2;
if ($3 ~ /'${czone}'/) {
id = $3;
if ($4 ~ /'${czone}'/) {
print type, id
}
}' < ${cfile}.signed > sigs
@@ -56,7 +56,7 @@ awk '$2 ~ /DNSKEY/ {
flags = $3;
while ($0 !~ /key id =/)
getline;
id = $6;
id = $NF;
print flags, id;
}' < ${cfile}.signed > keys

View File

@@ -14,7 +14,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: tests.sh,v 1.7 2011/03/04 22:20:21 each Exp $
# $Id: tests.sh,v 1.8 2011/03/05 19:39:06 each Exp $
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
@@ -134,7 +134,7 @@ status=`expr $status + $ret`
echo "I:checking child zone signatures"
ret=0
# check DNSKEY signatures first
awk '$2 == "RRSIG" && $3 == "DNSKEY" { getline; print $2 }' $cfile.signed > dnskey.sigs
awk '$2 == "RRSIG" && $3 == "DNSKEY" { getline; print $3 }' $cfile.signed > dnskey.sigs
grep "$ckactive" dnskey.sigs > /dev/null || ret=1
grep "$ckrevoked" dnskey.sigs > /dev/null || ret=1
grep "$czactive" dnskey.sigs > /dev/null || ret=1
@@ -145,7 +145,7 @@ grep "$czpublished" dnskey.sigs > /dev/null && ret=1
grep "$czinactive" dnskey.sigs > /dev/null && ret=1
grep "$czgenerated" dnskey.sigs > /dev/null && ret=1
# now check other signatures first
awk '$2 == "RRSIG" && $3 != "DNSKEY" { getline; print $2 }' $cfile.signed | sort -un > other.sigs
awk '$2 == "RRSIG" && $3 != "DNSKEY" { getline; print $3 }' $cfile.signed | sort -un > other.sigs
# should not be there:
grep "$ckactive" other.sigs > /dev/null && ret=1
grep "$ckpublished" other.sigs > /dev/null && ret=1
@@ -181,7 +181,7 @@ status=`expr $status + $ret`
echo "I:checking child zone signatures again"
ret=0
awk '$2 == "RRSIG" && $3 == "DNSKEY" { getline; print $2 }' $cfile.signed > dnskey.sigs
awk '$2 == "RRSIG" && $3 == "DNSKEY" { getline; print $3 }' $cfile.signed > dnskey.sigs
grep "$ckpublished" dnskey.sigs > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: masterdump.h,v 1.42 2008/09/24 02:46:23 marka Exp $ */
/* $Id: masterdump.h,v 1.43 2011/03/05 19:39:06 each Exp $ */
#ifndef DNS_MASTERDUMP_H
#define DNS_MASTERDUMP_H 1
@@ -329,6 +329,12 @@ dns_master_stylecreate(dns_master_style_t **style, unsigned int flags,
unsigned int line_length, unsigned int tab_width,
isc_mem_t *mctx);
isc_result_t
dns_master_stylecreate2(dns_master_style_t **style, unsigned int flags,
unsigned int ttl_column, unsigned int class_column,
unsigned int type_column, unsigned int rdata_column,
unsigned int line_length, unsigned int tab_width,
unsigned int split_width, isc_mem_t *mctx);
void
dns_master_styledestroy(dns_master_style_t **style, isc_mem_t *mctx);

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdata.h,v 1.77 2009/12/04 21:09:33 marka Exp $ */
/* $Id: rdata.h,v 1.78 2011/03/05 19:39:06 each Exp $ */
#ifndef DNS_RDATA_H
#define DNS_RDATA_H 1
@@ -158,6 +158,7 @@ struct dns_rdata {
/*% Output explanatory comments. */
#define DNS_STYLEFLAG_COMMENT 0x00000002U
#define DNS_STYLEFLAG_RRCOMMENT 0x00000004U
#define DNS_RDATA_DOWNCASE DNS_NAME_DOWNCASE
#define DNS_RDATA_CHECKNAMES DNS_NAME_CHECKNAMES
@@ -423,8 +424,8 @@ dns_rdata_totext(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target);
isc_result_t
dns_rdata_tofmttext(dns_rdata_t *rdata, dns_name_t *origin, unsigned int flags,
unsigned int width, const char *linebreak,
isc_buffer_t *target);
unsigned int width, unsigned int split_width,
const char *linebreak, isc_buffer_t *target);
/*%<
* Like dns_rdata_totext, but do formatted output suitable for
* database dumps. This is intended for use by dns_db_dump();
@@ -446,6 +447,11 @@ dns_rdata_tofmttext(dns_rdata_t *rdata, dns_name_t *origin, unsigned int flags,
* comments next to things like the SOA timer fields. Some
* comments (e.g., the SOA ones) are only printed when multiline
* output is selected.
*
* base64 rdata text (e.g., DNSKEY records) will be split into chunks
* of 'split_width' characters. If split_width == 0, the text will
* not be split at all. If split_width == 0xffffffff, then it is undefined
* and falls back to the default value of 'width'
*/
isc_result_t

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: masterdump.c,v 1.99 2009/11/17 23:55:18 marka Exp $ */
/* $Id: masterdump.c,v 1.100 2011/03/05 19:39:06 each Exp $ */
/*! \file */
@@ -74,6 +74,7 @@ struct dns_master_style {
unsigned int rdata_column;
unsigned int line_length;
unsigned int tab_width;
unsigned int split_width;
};
/*%
@@ -108,15 +109,16 @@ dns_master_style_default = {
DNS_STYLEFLAG_OMIT_TTL |
DNS_STYLEFLAG_TTL |
DNS_STYLEFLAG_COMMENT |
DNS_STYLEFLAG_RRCOMMENT |
DNS_STYLEFLAG_MULTILINE,
24, 24, 24, 32, 80, 8
24, 24, 24, 32, 80, 8, -1
};
LIBDNS_EXTERNAL_DATA const dns_master_style_t
dns_master_style_full = {
DNS_STYLEFLAG_COMMENT |
DNS_STYLEFLAG_RESIGN,
46, 46, 46, 64, 120, 8
46, 46, 46, 64, 120, 8, -1
};
LIBDNS_EXTERNAL_DATA const dns_master_style_t
@@ -126,8 +128,9 @@ dns_master_style_explicitttl = {
DNS_STYLEFLAG_REL_OWNER |
DNS_STYLEFLAG_REL_DATA |
DNS_STYLEFLAG_COMMENT |
DNS_STYLEFLAG_RRCOMMENT |
DNS_STYLEFLAG_MULTILINE,
24, 32, 32, 40, 80, 8
24, 32, 32, 40, 80, 8, -1
};
LIBDNS_EXTERNAL_DATA const dns_master_style_t
@@ -137,13 +140,13 @@ dns_master_style_cache = {
DNS_STYLEFLAG_MULTILINE |
DNS_STYLEFLAG_TRUST |
DNS_STYLEFLAG_NCACHE,
24, 32, 32, 40, 80, 8
24, 32, 32, 40, 80, 8, -1
};
LIBDNS_EXTERNAL_DATA const dns_master_style_t
dns_master_style_simple = {
0,
24, 32, 32, 40, 80, 8
24, 32, 32, 40, 80, 8, -1
};
/*%
@@ -152,7 +155,7 @@ dns_master_style_simple = {
LIBDNS_EXTERNAL_DATA const dns_master_style_t
dns_master_style_debug = {
DNS_STYLEFLAG_REL_OWNER,
24, 32, 40, 48, 80, 8
24, 32, 40, 48, 80, 8, -1
};
@@ -373,7 +376,7 @@ ncache_summary(dns_rdataset_t *rdataset, isc_boolean_t omit_final_dot,
dns_rdataset_current(&rds, &rdata);
CHECK(str_totext(" ", target));
CHECK(dns_rdata_tofmttext(&rdata, dns_rootname,
0, 0, " ", target));
0, 0, 0, " ", target));
CHECK(str_totext("\n", target));
}
}
@@ -536,6 +539,7 @@ rdataset_totext(dns_rdataset_t *rdataset,
ctx->style.flags,
ctx->style.line_length -
ctx->style.rdata_column,
ctx->style.split_width,
ctx->linebreak,
target));
@@ -1787,6 +1791,19 @@ dns_master_stylecreate(dns_master_style_t **stylep, unsigned int flags,
unsigned int type_column, unsigned int rdata_column,
unsigned int line_length, unsigned int tab_width,
isc_mem_t *mctx)
{
return (dns_master_stylecreate2(stylep, flags, ttl_column,
class_column, type_column,
rdata_column, line_length,
tab_width, 0xffffffff, mctx));
}
isc_result_t
dns_master_stylecreate2(dns_master_style_t **stylep, unsigned int flags,
unsigned int ttl_column, unsigned int class_column,
unsigned int type_column, unsigned int rdata_column,
unsigned int line_length, unsigned int tab_width,
unsigned int split_width, isc_mem_t *mctx)
{
dns_master_style_t *style;
@@ -1802,6 +1819,7 @@ dns_master_stylecreate(dns_master_style_t **stylep, unsigned int flags,
style->rdata_column = rdata_column;
style->line_length = line_length;
style->tab_width = tab_width;
style->split_width = split_width;
*stylep = style;
return (ISC_R_SUCCESS);

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdata.c,v 1.211 2011/03/03 14:10:27 fdupont Exp $ */
/* $Id: rdata.c,v 1.212 2011/03/05 19:39:06 each Exp $ */
/*! \file */
@@ -726,7 +726,13 @@ rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
result = str_totext(" ( ", target);
else
result = str_totext(" ", target);
if (result == ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS)
return (result);
if (tctx->width == 0) /* No splitting */
result = isc_hex_totext(&sr, 0, "", target);
else
result = isc_hex_totext(&sr, tctx->width - 2,
tctx->linebreak,
target);
@@ -759,7 +765,8 @@ dns_rdata_totext(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target)
isc_result_t
dns_rdata_tofmttext(dns_rdata_t *rdata, dns_name_t *origin,
unsigned int flags, unsigned int width,
const char *linebreak, isc_buffer_t *target)
unsigned int split_width, const char *linebreak,
isc_buffer_t *target)
{
dns_rdata_textctx_t tctx;
@@ -770,11 +777,16 @@ dns_rdata_tofmttext(dns_rdata_t *rdata, dns_name_t *origin,
*/
tctx.origin = origin;
tctx.flags = flags;
if ((flags & DNS_STYLEFLAG_MULTILINE) != 0) {
if (split_width == 0xffffffff)
tctx.width = width;
else
tctx.width = split_width;
if ((flags & DNS_STYLEFLAG_MULTILINE) != 0)
tctx.linebreak = linebreak;
} else {
tctx.width = 60; /* Used for hex word length only. */
else {
if (split_width == 0xffffffff)
tctx.width = 60; /* Used for hex word length only. */
tctx.linebreak = " ";
}
return (rdata_totext(rdata, &tctx, target));

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: tsig_250.c,v 1.65 2009/12/04 22:06:37 tbox Exp $ */
/* $Id: tsig_250.c,v 1.66 2011/03/05 19:39:06 each Exp $ */
/* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */
@@ -202,8 +202,11 @@ totext_any_tsig(ARGS_TOTEXT) {
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));
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
@@ -241,7 +244,10 @@ totext_any_tsig(ARGS_TOTEXT) {
/*
* Other.
*/
return (isc_base64_totext(&sr, 60, " ", target));
if (tctx->width == 0) /* No splitting */
return (isc_base64_totext(&sr, 60, "", target));
else
return (isc_base64_totext(&sr, 60, " ", target));
}
static inline isc_result_t

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: cert_37.c,v 1.52 2009/12/04 22:06:37 tbox Exp $ */
/* $Id: cert_37.c,v 1.53 2011/03/05 19:39:07 each Exp $ */
/* Reviewed: Wed Mar 15 21:14:32 EST 2000 by tale */
@@ -109,8 +109,11 @@ totext_cert(ARGS_TOTEXT) {
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));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sr, 60, "", target));
else
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" )", target));
return (ISC_R_SUCCESS);

View File

@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dlv_32769.c,v 1.10 2010/12/23 23:47:08 tbox Exp $ */
/* $Id: dlv_32769.c,v 1.11 2011/03/05 19:39:07 each Exp $ */
/* draft-ietf-dnsext-delegation-signer-05.txt */
@@ -134,7 +134,11 @@ totext_dlv(ARGS_TOTEXT) {
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
RETERR(isc_hex_totext(&sr, tctx->width - 2, tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_hex_totext(&sr, 0, "", target));
else
RETERR(isc_hex_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" )", target));
return (ISC_R_SUCCESS);

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dnskey_48.c,v 1.10 2009/12/04 22:06:37 tbox Exp $ */
/* $Id: dnskey_48.c,v 1.11 2011/03/05 19:39:07 each Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
@@ -76,7 +76,8 @@ totext_dnskey(ARGS_TOTEXT) {
char buf[sizeof("64000")];
unsigned int flags;
unsigned char algorithm;
char namebuf[DNS_NAME_FORMATSIZE];
char algbuf[DNS_NAME_FORMATSIZE];
const char *keyinfo;
REQUIRE(rdata->type == 48);
REQUIRE(rdata->length != 0);
@@ -89,6 +90,13 @@ totext_dnskey(ARGS_TOTEXT) {
sprintf(buf, "%u", flags);
RETERR(str_totext(buf, target));
RETERR(str_totext(" ", target));
if ((flags & DNS_KEYFLAG_KSK) != 0) {
if (flags & DNS_KEYFLAG_REVOKE)
keyinfo = "revoked KSK";
else
keyinfo = "KSK";
} else
keyinfo = "ZSK";
/* protocol */
sprintf(buf, "%u", sr.base[0]);
@@ -106,23 +114,28 @@ totext_dnskey(ARGS_TOTEXT) {
if ((flags & 0xc000) == 0xc000)
return (ISC_R_SUCCESS);
if ((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0 &&
if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0 &&
algorithm == DNS_KEYALG_PRIVATEDNS) {
dns_name_t name;
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &sr);
dns_name_format(&name, namebuf, sizeof(namebuf));
} else
namebuf[0] = 0;
dns_name_format(&name, algbuf, sizeof(algbuf));
} else {
dns_secalg_format((dns_secalg_t) algorithm, algbuf,
sizeof(algbuf));
}
/* key */
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));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sr, 0, "", target));
else
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0)
if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0)
RETERR(str_totext(tctx->linebreak, target));
else if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" ", target));
@@ -130,18 +143,17 @@ totext_dnskey(ARGS_TOTEXT) {
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(")", target));
if ((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0) {
if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0) {
isc_region_t tmpr;
RETERR(str_totext(" ; key id = ", target));
RETERR(str_totext(" ; ", target));
RETERR(str_totext(keyinfo, target));
RETERR(str_totext("; alg = ", target));
RETERR(str_totext(algbuf, target));
RETERR(str_totext("; key id = ", target));
dns_rdata_toregion(rdata, &tmpr);
sprintf(buf, "%u", dst_region_computeid(&tmpr, algorithm));
RETERR(str_totext(buf, target));
if (algorithm == DNS_KEYALG_PRIVATEDNS) {
RETERR(str_totext(tctx->linebreak, target));
RETERR(str_totext("; alg = ", target));
RETERR(str_totext(namebuf, target));
}
}
return (ISC_R_SUCCESS);
}

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: ds_43.c,v 1.16 2010/12/23 23:47:08 tbox Exp $ */
/* $Id: ds_43.c,v 1.17 2011/03/05 19:39:07 each Exp $ */
/* draft-ietf-dnsext-delegation-signer-05.txt */
@@ -134,7 +134,11 @@ totext_ds(ARGS_TOTEXT) {
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
RETERR(isc_hex_totext(&sr, tctx->width - 2, tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_hex_totext(&sr, 0, "", target));
else
RETERR(isc_hex_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" )", target));
return (ISC_R_SUCCESS);

View File

@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: ipseckey_45.c,v 1.11 2011/01/13 04:59:26 tbox Exp $ */
/* $Id: ipseckey_45.c,v 1.12 2011/03/05 19:39:07 each Exp $ */
#ifndef RDATA_GENERIC_IPSECKEY_45_C
#define RDATA_GENERIC_IPSECKEY_45_C
@@ -190,8 +190,11 @@ totext_ipseckey(ARGS_TOTEXT) {
*/
if (region.length > 0U) {
RETERR(str_totext(tctx->linebreak, target));
RETERR(isc_base64_totext(&region, tctx->width - 2,
tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&region, 60, "", target));
else
RETERR(isc_base64_totext(&region, tctx->width - 2,
tctx->linebreak, target));
}
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: key_25.c,v 1.53 2009/12/04 22:06:37 tbox Exp $ */
/* $Id: key_25.c,v 1.54 2011/03/05 19:39:07 each Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
@@ -106,7 +106,7 @@ totext_key(ARGS_TOTEXT) {
if ((flags & 0xc000) == 0xc000)
return (ISC_R_SUCCESS);
if ((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0 &&
if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0 &&
algorithm == DNS_KEYALG_PRIVATEDNS) {
dns_name_t name;
dns_name_init(&name, NULL);
@@ -119,10 +119,13 @@ totext_key(ARGS_TOTEXT) {
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));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sr, 60, "", target));
else
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0)
if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0)
RETERR(str_totext(tctx->linebreak, target));
else if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" ", target));
@@ -130,7 +133,7 @@ totext_key(ARGS_TOTEXT) {
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(")", target));
if ((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0) {
if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0) {
isc_region_t tmpr;
RETERR(str_totext(" ; key id = ", target));

View File

@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: keydata_65533.c,v 1.3 2009/12/04 21:09:33 marka Exp $ */
/* $Id: keydata_65533.c,v 1.4 2011/03/05 19:39:07 each Exp $ */
#ifndef GENERIC_KEYDATA_65533_C
#define GENERIC_KEYDATA_65533_C 1
@@ -89,6 +89,8 @@ totext_keydata(ARGS_TOTEXT) {
unsigned int flags;
unsigned char algorithm;
unsigned long when;
char algbuf[DNS_NAME_FORMATSIZE];
const char *keyinfo;
REQUIRE(rdata->type == 65533);
REQUIRE(rdata->length != 0);
@@ -119,6 +121,13 @@ totext_keydata(ARGS_TOTEXT) {
sprintf(buf, "%u", flags);
RETERR(str_totext(buf, target));
RETERR(str_totext(" ", target));
if ((flags & DNS_KEYFLAG_KSK) != 0) {
if (flags & DNS_KEYFLAG_REVOKE)
keyinfo = "revoked KSK";
else
keyinfo = "KSK";
} else
keyinfo = "ZSK";
/* protocol */
sprintf(buf, "%u", sr.base[0]);
@@ -140,10 +149,13 @@ totext_keydata(ARGS_TOTEXT) {
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));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sr, 60, "", target));
else
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0)
if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0)
RETERR(str_totext(tctx->linebreak, target));
else if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" ", target));
@@ -151,10 +163,16 @@ totext_keydata(ARGS_TOTEXT) {
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(")", target));
if ((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0) {
if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0) {
isc_region_t tmpr;
RETERR(str_totext(" ; key id = ", target));
RETERR(str_totext(" ; ", target));
RETERR(str_totext(keyinfo, target));
dns_secalg_format((dns_secalg_t) algorithm, algbuf,
sizeof(algbuf));
RETERR(str_totext("; alg = ", target));
RETERR(str_totext(algbuf, target));
RETERR(str_totext("; key id = ", target));
dns_rdata_toregion(rdata, &tmpr);
/* Skip over refresh, addhd, and removehd */
isc_region_consume(&tmpr, 12);

View File

@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: nsec3_50.c,v 1.7 2009/12/04 21:09:34 marka Exp $ */
/* $Id: nsec3_50.c,v 1.8 2011/03/05 19:39:07 each Exp $ */
/*
* Copyright (C) 2004 Nominet, Ltd.
@@ -146,28 +146,27 @@ totext_nsec3(ARGS_TOTEXT) {
REQUIRE(rdata->type == 50);
REQUIRE(rdata->length != 0);
UNUSED(tctx);
dns_rdata_toregion(rdata, &sr);
/* Hash */
hash = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
flags = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
iterations = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
sprintf(buf, "%u ", hash);
RETERR(str_totext(buf, target));
/* Flags */
flags = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
sprintf(buf, "%u ", flags);
RETERR(str_totext(buf, target));
/* Iterations */
iterations = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
sprintf(buf, "%u ", iterations);
RETERR(str_totext(buf, target));
/* Salt */
j = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
INSIST(j <= sr.length);
@@ -177,10 +176,14 @@ totext_nsec3(ARGS_TOTEXT) {
sr.length = j;
RETERR(isc_hex_totext(&sr, 1, "", target));
sr.length = i - j;
RETERR(str_totext(" ", target));
} else
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));
/* Next hash */
j = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
INSIST(j <= sr.length);
@@ -190,7 +193,14 @@ totext_nsec3(ARGS_TOTEXT) {
RETERR(isc_base32hex_totext(&sr, 1, "", target));
sr.length = i - j;
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(tctx->linebreak, target));
else
RETERR(str_totext(" ", target));
/* Types covered */
for (i = 0; i < sr.length; i += len) {
isc_boolean_t first = ISC_TRUE;
INSIST(i + 2 <= sr.length);
window = sr.base[i];
len = sr.base[i + 1];
@@ -205,7 +215,9 @@ totext_nsec3(ARGS_TOTEXT) {
if ((sr.base[i + j] & (0x80 >> k)) == 0)
continue;
t = window * 256 + j * 8 + k;
RETERR(str_totext(" ", target));
if (!first)
RETERR(str_totext(" ", target));
first = ISC_FALSE;
if (dns_rdatatype_isknown(t)) {
RETERR(dns_rdatatype_totext(t, target));
} else {
@@ -216,6 +228,10 @@ totext_nsec3(ARGS_TOTEXT) {
}
}
}
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" )", target));
return (ISC_R_SUCCESS);
}

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: opt_41.c,v 1.35 2009/12/04 22:06:37 tbox Exp $ */
/* $Id: opt_41.c,v 1.36 2011/03/05 19:39:07 each Exp $ */
/* Reviewed: Thu Mar 16 14:06:44 PST 2000 by gson */
@@ -76,8 +76,12 @@ totext_opt(ARGS_TOTEXT) {
RETERR(str_totext(tctx->linebreak, target));
or = r;
or.length = length;
RETERR(isc_base64_totext(&or, tctx->width - 2,
tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&or, 60, "", target));
else
RETERR(isc_base64_totext(&or, tctx->width - 2,
tctx->linebreak,
target));
isc_region_consume(&r, length);
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" )", target));

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rrsig_46.c,v 1.14 2011/01/13 04:59:26 tbox Exp $ */
/* $Id: rrsig_46.c,v 1.15 2011/03/05 19:39:07 each Exp $ */
/* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */
@@ -181,7 +181,10 @@ totext_rrsig(ARGS_TOTEXT) {
isc_region_consume(&sr, 4);
sprintf(buf, "%lu", ttl);
RETERR(str_totext(buf, target));
RETERR(str_totext(" ", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
/*
* Sig exp.
@@ -189,10 +192,7 @@ totext_rrsig(ARGS_TOTEXT) {
exp = uint32_fromregion(&sr);
isc_region_consume(&sr, 4);
RETERR(dns_time32_totext(exp, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
RETERR(str_totext(" ", target));
/*
* Time signed.
@@ -223,8 +223,11 @@ totext_rrsig(ARGS_TOTEXT) {
* Sig.
*/
RETERR(str_totext(tctx->linebreak, target));
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sr, 60, "", target));
else
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" )", target));

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sig_24.c,v 1.68 2009/12/04 22:06:37 tbox Exp $ */
/* $Id: sig_24.c,v 1.69 2011/03/05 19:39:07 each Exp $ */
/* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */
@@ -227,8 +227,11 @@ totext_sig(ARGS_TOTEXT) {
* Sig.
*/
RETERR(str_totext(tctx->linebreak, target));
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sr, 60, "", target));
else
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" )", target));

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: soa_6.c,v 1.64 2009/12/04 21:09:34 marka Exp $ */
/* $Id: soa_6.c,v 1.65 2011/03/05 19:39:07 each Exp $ */
/* Reviewed: Thu Mar 16 15:18:32 PST 2000 by explorer */
@@ -102,7 +102,7 @@ totext_soa(ARGS_TOTEXT) {
multiline = ISC_TF((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0);
if (multiline)
comment = ISC_TF((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0);
comment = ISC_TF((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0);
else
comment = ISC_FALSE;

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sshfp_44.c,v 1.9 2009/12/04 22:06:37 tbox Exp $ */
/* $Id: sshfp_44.c,v 1.10 2011/03/05 19:39:07 each Exp $ */
/* RFC 4255 */
@@ -96,7 +96,11 @@ totext_sshfp(ARGS_TOTEXT) {
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
RETERR(isc_hex_totext(&sr, tctx->width - 2, tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_hex_totext(&sr, 0, "", target));
else
RETERR(isc_hex_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" )", target));
return (ISC_R_SUCCESS);

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: tkey_249.c,v 1.59 2009/12/04 22:06:37 tbox Exp $ */
/* $Id: tkey_249.c,v 1.60 2011/03/05 19:39:07 each Exp $ */
/*
* Reviewed: Thu Mar 16 17:35:30 PST 2000 by halley.
@@ -201,8 +201,11 @@ totext_tkey(ARGS_TOTEXT) {
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
RETERR(isc_base64_totext(&dr, tctx->width - 2,
tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&dr, 60, "", target));
else
RETERR(isc_base64_totext(&dr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" ) ", target));
else
@@ -227,8 +230,11 @@ totext_tkey(ARGS_TOTEXT) {
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" (", target));
RETERR(str_totext(tctx->linebreak, target));
RETERR(isc_base64_totext(&dr, tctx->width - 2,
tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&dr, 60, "", target));
else
RETERR(isc_base64_totext(&dr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" )", target));
}

View File

@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dhcid_49.c,v 1.7 2009/12/04 22:06:37 tbox Exp $ */
/* $Id: dhcid_49.c,v 1.8 2011/03/05 19:39:07 each Exp $ */
/* RFC 4701 */
@@ -52,8 +52,11 @@ totext_in_dhcid(ARGS_TOTEXT) {
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext("( " /*)*/, target));
RETERR(isc_base64_totext(&sr, tctx->width - 2, tctx->linebreak,
target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sr, 60, "", target));
else
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
RETERR(str_totext(/* ( */ " )", target));
if (rdata->length > 2) {