Commit caf0b8cbee for bind

commit caf0b8cbee4e87cbe2211128bb384c0390d5f342
Author: OndÅ™ej Surý <ondrej@isc.org>
Date:   Wed Nov 25 11:15:50 2026 +0100

    Remove the unreachable empty key checks from the fromdns functions

    The only caller of the fromdns functions, frombuffer(), handles a key
    without any key data itself and calls them only when there is some, so
    the checks for an empty region in the RSA, ECDSA and EdDSA code could
    never be true.  The length checks that follow reject an empty region
    anyway.

    Assisted-by: Claude:claude-mythos-5-2

diff --git a/lib/dns/opensslecdsa_link.c b/lib/dns/opensslecdsa_link.c
index 47fd18d9c9..e15f12d75f 100644
--- a/lib/dns/opensslecdsa_link.c
+++ b/lib/dns/opensslecdsa_link.c
@@ -413,9 +413,6 @@ opensslecdsa_fromdns(dst_key_t *key, isc_buffer_t *data) {
 	len = opensslecdsa_key_alg_to_publickey_size(key->key_alg);

 	isc_buffer_remainingregion(data, &r);
-	if (r.length == 0) {
-		return ISC_R_SUCCESS;
-	}
 	if (r.length != len) {
 		return DST_R_INVALIDPUBLICKEY;
 	}
diff --git a/lib/dns/openssleddsa_link.c b/lib/dns/openssleddsa_link.c
index 88afcfda36..5ee568ca0f 100644
--- a/lib/dns/openssleddsa_link.c
+++ b/lib/dns/openssleddsa_link.c
@@ -336,9 +336,6 @@ openssleddsa_fromdns(dst_key_t *key, isc_buffer_t *data) {
 	REQUIRE(alginfo != NULL);

 	isc_buffer_remainingregion(data, &r);
-	if (r.length == 0) {
-		return ISC_R_SUCCESS;
-	}

 	RETERR(raw_key_to_ossl(alginfo, 0, r.base, r.length, &pkey));

diff --git a/lib/dns/opensslrsa_link.c b/lib/dns/opensslrsa_link.c
index 1d23251d4f..fa9d199f4d 100644
--- a/lib/dns/opensslrsa_link.c
+++ b/lib/dns/opensslrsa_link.c
@@ -442,9 +442,6 @@ opensslrsa_fromdns(dst_key_t *key, isc_buffer_t *data) {
 	REQUIRE(opensslrsa_valid_key_alg(key->key_alg));

 	isc_buffer_remainingregion(data, &r);
-	if (r.length == 0) {
-		CLEANUP(ISC_R_SUCCESS);
-	}

 	/*
 	 * Check identifying OID in front of public key material.