DANE: Improper TLSA record validation (fixes #2328)

This commit is contained in:
Maurus Decimus
2026-06-19 17:14:26 +02:00
parent 88412f9540
commit ad47f03f48
14 changed files with 1025 additions and 277 deletions

View File

@@ -178,6 +178,10 @@ impl Caches {
((std::mem::size_of::<Ipv6Addr>() + 255) * 2) as u64,
),
dns_tlsa: CacheWithTtl::new(cache.dns_tlsa, (std::mem::size_of::<Tlsa>() + 255) as u64),
dns_dnssec: CacheWithTtl::new(
cache.dns_tlsa,
(std::mem::size_of::<bool>() + 255) as u64,
),
dns_mta_sts: CacheWithTtl::new(
cache.dns_mta_sts,
(std::mem::size_of::<Policy>() + 255) as u64,

View File

@@ -41,11 +41,18 @@ pub struct DnssecResolver {
pub resolver: TokioResolver,
}
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub enum TlsaMatching {
Full,
Sha256,
Sha512,
}
#[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct TlsaEntry {
pub is_end_entity: bool,
pub is_sha256: bool,
pub is_spki: bool,
pub matching: TlsaMatching,
pub data: Vec<u8>,
}

View File

@@ -201,6 +201,7 @@ pub struct Caches {
pub dns_ipv4: CacheWithTtl<Box<str>, Arc<[Ipv4Addr]>>,
pub dns_ipv6: CacheWithTtl<Box<str>, Arc<[Ipv6Addr]>>,
pub dns_tlsa: CacheWithTtl<Box<str>, Arc<Tlsa>>,
pub dns_dnssec: CacheWithTtl<Box<str>, bool>,
pub dns_mta_sts: CacheWithTtl<Box<str>, Arc<Policy>>,
pub dns_rbl: CacheWithTtl<Box<str>, Option<Arc<IpResolver>>>,