]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Require exact EdDSA key lengths
authorOndřej Surý <ondrej@isc.org>
Mon, 10 Aug 2026 14:39:06 +0000 (16:39 +0200)
committerOndřej Surý <ondrej@sury.org>
Wed, 12 Aug 2026 10:59:33 +0000 (12:59 +0200)
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.

lib/dns/openssleddsa_link.c

index 72c0d02cd5bedfe9bf5d7f07b2ae7bd2774a114e..796975f1f633d5462de48198d6802f9665eda831 100644 (file)
@@ -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;
        }