From: Ondřej Surý Date: Mon, 10 Aug 2026 14:39:06 +0000 (+0200) Subject: Require exact EdDSA key lengths X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f66840acaa99c5d32346e1be79d87832cecdca41;p=thirdparty%2Fbind9.git Require exact EdDSA key lengths A key blob longer than the fixed key size was accepted: the key was imported from the expected-length prefix and the trailing bytes were silently ignored. For a DNSKEY this means two different RDATAs (with two different key tags) could yield the same key, because nothing after the import ever looks at the leftover bytes. Treat any length mismatch as an invalid key instead. --- diff --git a/lib/dns/openssleddsa_link.c b/lib/dns/openssleddsa_link.c index 72c0d02cd5b..796975f1f63 100644 --- a/lib/dns/openssleddsa_link.c +++ b/lib/dns/openssleddsa_link.c @@ -83,7 +83,7 @@ raw_key_to_ossl(const eddsa_alginfo_t *alginfo, int private, size_t len = alginfo->key_size; result = (private ? DST_R_INVALIDPRIVATEKEY : DST_R_INVALIDPUBLICKEY); - if (*key_len < len) { + if (*key_len != len) { return result; }