mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-28 20:41:18 -05:00
sort RRSIG(SOA) to be last of RRSIGs with a common re-resign time
This commit is contained in:
parent
660dc3eba7
commit
a24fd55836
2 changed files with 18 additions and 14 deletions
|
|
@ -282,14 +282,10 @@ ret=0
|
|||
# almost right away, this should trigger 10 zsk and 1 ksk sign operations.
|
||||
# However, the DNSSEC maintenance assumes when we see the SOA record we have
|
||||
# walked the whole zone, since the SOA record should always have the most
|
||||
# recent signature. This however is not always the case, for example when
|
||||
# the signature expiration is the same, `dns_db_getsigningtime could return
|
||||
# the SOA RRset before a competing RRset. This happens here and so the
|
||||
# SOA RRset is updated and resigned twice at startup, that explains the
|
||||
# additional zsk sign operation (11 instead of 10).
|
||||
echo "${refresh_prefix} ${zsk_id}: 11" > zones.expect
|
||||
# recent signature.
|
||||
echo "${refresh_prefix} ${zsk_id}: 10" > zones.expect
|
||||
echo "${refresh_prefix} ${ksk_id}: 1" >> zones.expect
|
||||
echo "${sign_prefix} ${zsk_id}: 11" >> zones.expect
|
||||
echo "${sign_prefix} ${zsk_id}: 10" >> zones.expect
|
||||
echo "${sign_prefix} ${ksk_id}: 1" >> zones.expect
|
||||
cat zones.expect | sort > zones.expect.$n
|
||||
rm -f zones.expect
|
||||
|
|
@ -317,9 +313,9 @@ echo update add $zone. 300 in txt "nsupdate added me"
|
|||
echo send
|
||||
) | $NSUPDATE
|
||||
# This should trigger the resign of SOA, TXT and NSEC (+3 zsk).
|
||||
echo "${refresh_prefix} ${zsk_id}: 11" > zones.expect
|
||||
echo "${refresh_prefix} ${zsk_id}: 10" > zones.expect
|
||||
echo "${refresh_prefix} ${ksk_id}: 1" >> zones.expect
|
||||
echo "${sign_prefix} ${zsk_id}: 14" >> zones.expect
|
||||
echo "${sign_prefix} ${zsk_id}: 13" >> zones.expect
|
||||
echo "${sign_prefix} ${ksk_id}: 1" >> zones.expect
|
||||
cat zones.expect | sort > zones.expect.$n
|
||||
rm -f zones.expect
|
||||
|
|
@ -345,9 +341,9 @@ zsk=$("$KEYGEN" -K ns2 -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" "$zone")
|
|||
$SETTIME -K ns2 -P now -A never $zsk.key > /dev/null
|
||||
loadkeys_on 2 $zone || ret=1
|
||||
# This should trigger the resign of SOA (+1 zsk) and DNSKEY (+1 ksk).
|
||||
echo "${refresh_prefix} ${zsk_id}: 12" > zones.expect
|
||||
echo "${refresh_prefix} ${zsk_id}: 11" > zones.expect
|
||||
echo "${refresh_prefix} ${ksk_id}: 2" >> zones.expect
|
||||
echo "${sign_prefix} ${zsk_id}: 15" >> zones.expect
|
||||
echo "${sign_prefix} ${zsk_id}: 14" >> zones.expect
|
||||
echo "${sign_prefix} ${ksk_id}: 2" >> zones.expect
|
||||
cat zones.expect | sort > zones.expect.$n
|
||||
rm -f zones.expect
|
||||
|
|
|
|||
|
|
@ -131,8 +131,10 @@ typedef uint32_t rbtdb_rdatatype_t;
|
|||
RBTDB_RDATATYPE_VALUE(dns_rdatatype_rrsig, dns_rdatatype_cname)
|
||||
#define RBTDB_RDATATYPE_SIGDNAME \
|
||||
RBTDB_RDATATYPE_VALUE(dns_rdatatype_rrsig, dns_rdatatype_dname)
|
||||
#define RBTDB_RDATATYPE_SIGDDS \
|
||||
#define RBTDB_RDATATYPE_SIGDS \
|
||||
RBTDB_RDATATYPE_VALUE(dns_rdatatype_rrsig, dns_rdatatype_ds)
|
||||
#define RBTDB_RDATATYPE_SIGSOA \
|
||||
RBTDB_RDATATYPE_VALUE(dns_rdatatype_rrsig, dns_rdatatype_soa)
|
||||
#define RBTDB_RDATATYPE_NCACHEANY RBTDB_RDATATYPE_VALUE(0, dns_rdatatype_any)
|
||||
|
||||
#define RBTDB_INITLOCK(l) isc_rwlock_init((l), 0, 0)
|
||||
|
|
@ -903,13 +905,19 @@ ttl_sooner(void *v1, void *v2) {
|
|||
return (h1->rdh_ttl < h2->rdh_ttl);
|
||||
}
|
||||
|
||||
/*%
|
||||
* Return which RRset should be resigned sooner. If the RRsets have the
|
||||
* same signing time, prefer the other RRset over the SOA RRset.
|
||||
*/
|
||||
static bool
|
||||
resign_sooner(void *v1, void *v2) {
|
||||
rdatasetheader_t *h1 = v1;
|
||||
rdatasetheader_t *h2 = v2;
|
||||
|
||||
return (h1->resign < h2->resign ||
|
||||
(h1->resign == h2->resign && h1->resign_lsb < h2->resign_lsb));
|
||||
(h1->resign == h2->resign && h1->resign_lsb < h2->resign_lsb) ||
|
||||
(h1->resign == h2->resign && h1->resign_lsb == h2->resign_lsb &&
|
||||
h2->type == RBTDB_RDATATYPE_SIGSOA));
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -6250,7 +6258,7 @@ find_header:
|
|||
(header->type == dns_rdatatype_a ||
|
||||
header->type == dns_rdatatype_aaaa ||
|
||||
header->type == dns_rdatatype_ds ||
|
||||
header->type == RBTDB_RDATATYPE_SIGDDS) &&
|
||||
header->type == RBTDB_RDATATYPE_SIGDS) &&
|
||||
!header_nx && !newheader_nx &&
|
||||
header->trust >= newheader->trust &&
|
||||
dns_rdataslab_equal((unsigned char *)header,
|
||||
|
|
|
|||
Loading…
Reference in a new issue