libseckey: Fix error checking in SK_OPENSSL_init() (OpenSSL 1.1.1 only)

Fix the NULL-checks to test the variable that was just assigned.

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 14:54:45 +02:00
committed by Jan Höppner
parent 71503c0e7d
commit 6c729fba9e

View File

@@ -796,13 +796,13 @@ int SK_OPENSSL_init(bool debug)
return -EIO;
}
sk_pkey_meth_default_method_rsa = EVP_PKEY_meth_find(EVP_PKEY_RSA);
if (sk_pkey_meth_default_method_ec == NULL) {
if (sk_pkey_meth_default_method_rsa == NULL) {
sk_debug(debug, "ERROR: EVP_PKEY_meth_find(RSA) failed");
return -EIO;
}
sk_pkey_meth_default_method_rsa_pss =
EVP_PKEY_meth_find(EVP_PKEY_RSA_PSS);
if (sk_pkey_meth_default_method_ec == NULL) {
if (sk_pkey_meth_default_method_rsa_pss == NULL) {
sk_debug(debug, "ERROR: EVP_PKEY_meth_find(RSA-PSS) failed");
return -EIO;
}