libseckey: Fix length check in sk_cca_get_public_from_rsa_key()

Check for the size of struct cca_rsa_pub_key_section, instead of
struct cca_ec_pub_key_section.

Assisted-by: IBM Bob:2.0.0
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Ingo Franzki
2026-06-30 15:28:34 +02:00
committed by Jan Höppner
parent cf51aa1421
commit 5ab3473442

View File

@@ -1394,7 +1394,7 @@ static int sk_cca_get_public_from_rsa_key(const unsigned char *key_token,
return -EINVAL;
}
if (rsa_pub_section->section_header.section_length <
sizeof(struct cca_ec_pub_key_section)) {
sizeof(struct cca_rsa_pub_key_section)) {
sk_debug(debug, "ERROR: invalid RSA public key section length");
return -EINVAL;
}