2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

3639. [bug] Treat type 65533 (KEYDATA) as opaque except when used

in a key zone. [RT #34238]
This commit is contained in:
Mark Andrews
2013-09-04 13:14:06 +10:00
parent 92f2cf45ce
commit d6f99498d6
12 changed files with 111 additions and 34 deletions

View File

@@ -100,6 +100,21 @@ typedef struct dns_totext_ctx {
isc_boolean_t current_ttl_valid;
} dns_totext_ctx_t;
LIBDNS_EXTERNAL_DATA const dns_master_style_t
dns_master_style_keyzone = {
DNS_STYLEFLAG_OMIT_OWNER |
DNS_STYLEFLAG_OMIT_CLASS |
DNS_STYLEFLAG_REL_OWNER |
DNS_STYLEFLAG_REL_DATA |
DNS_STYLEFLAG_OMIT_TTL |
DNS_STYLEFLAG_TTL |
DNS_STYLEFLAG_COMMENT |
DNS_STYLEFLAG_RRCOMMENT |
DNS_STYLEFLAG_MULTILINE |
DNS_STYLEFLAG_KEYDATA,
24, 24, 24, 32, 80, 8, UINT_MAX
};
LIBDNS_EXTERNAL_DATA const dns_master_style_t
dns_master_style_default = {
DNS_STYLEFLAG_OMIT_OWNER |
@@ -504,9 +519,22 @@ rdataset_totext(dns_rdataset_t *rdataset,
type_start = target->used;
if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0)
RETERR(str_totext("\\-", target));
result = dns_rdatatype_totext(type, target);
if (result != ISC_R_SUCCESS)
return (result);
switch (type) {
case dns_rdatatype_keydata:
#define KEYDATA "KEYDATA"
if ((ctx->style.flags & DNS_STYLEFLAG_KEYDATA) != 0) {
if (isc_buffer_availablelength(target) <
(sizeof(KEYDATA) - 1))
return (ISC_R_NOSPACE);
isc_buffer_putstr(target, KEYDATA);
break;
}
/* FALLTHROUGH */
default:
result = dns_rdatatype_totext(type, target);
if (result != ISC_R_SUCCESS)
return (result);
}
column += (target->used - type_start);
/*