From: Mark Andrews Date: Mon, 22 Jul 2002 02:49:14 +0000 (+0000) Subject: 1254. [bug] When signing/verifying rdatasets, duplicate rdatas X-Git-Tag: v9.2.3rc1~104^2~468 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=9db3d9d14e2f3641d696dadc59c40c52b6f888bc;p=thirdparty%2Fbind9.git 1254. [bug] When signing/verifying rdatasets, duplicate rdatas need to be suppressed. --- diff --git a/CHANGES b/CHANGES index 850f29380e3..3922a41cdf3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +1254. [bug] When signing/verifying rdatasets, duplicate rdatas + need to be suppressed. + 1253. [contrib] queryperf now reports a summary of returned rcodes (-c), rcodes are printed in neumonic form (-v). diff --git a/lib/dns/dnssec.c b/lib/dns/dnssec.c index 9535f944c5c..c75a2410901 100644 --- a/lib/dns/dnssec.c +++ b/lib/dns/dnssec.c @@ -16,7 +16,7 @@ */ /* - * $Id: dnssec.c,v 1.73 2002/02/20 03:34:11 marka Exp $ + * $Id: dnssec.c,v 1.74 2002/07/22 02:49:14 marka Exp $ */ @@ -276,6 +276,12 @@ dns_dnssec_sign(dns_name_t *name, dns_rdataset_t *set, dst_key_t *key, isc_buffer_t lenbuf; isc_region_t lenr; + /* + * Skip duplicates. + */ + if (i > 0 && dns_rdata_compare(&rdatas[i], &rdatas[i-1]) == 0) + continue; + /* * Digest the envelope. */ @@ -435,6 +441,12 @@ dns_dnssec_verify(dns_name_t *name, dns_rdataset_t *set, dst_key_t *key, isc_buffer_t lenbuf; isc_region_t lenr; + /* + * Skip duplicates. + */ + if (i > 0 && dns_rdata_compare(&rdatas[i], &rdatas[i-1]) == 0) + continue; + /* * Digest the envelope. */