There's no reason to include an `RRSig` signing `DNSKEY`s with a
ZSK - validators only care about the KSK signing `DNSKEY`s, hence
*Key*-Signing Key. However, OVH appears to include such signatures
anyway, which we must ignore.
Here we do so by pre-filtering the `RRSig`s we try to validate by
key tag before calling `verify_rrsig`. This causes us to calculate
the key tag a few extra times, but that's not a huge deal.
let mut found_unsupported_alg = false;
for sig in sigs {
+ if !validated_dnskeys.iter().any(|key| key.key_tag() == sig.key_tag) {
+ // Some DNS servers include spurious RRSig records signed by the ZSK covering the
+ // DNSKEY set (looking at you OVH). This is harmless (but wasteful) and we should
+ // ignore such signatures rather than immediately failing.
+ continue;
+ }
match verify_rrsig(sig, validated_dnskeys.iter().copied(), records.clone()) {
Ok(()) => return Ok(sig),
Err(ValidationError::UnsupportedAlgorithm) => {