certificate: openssl3: switch to EVP_PKEY_eq
In OpenSSL3, the EVP_PKEY_cmp has become EVP_PKEY_eq and the
EVP_PKEY_cmp is deprecated.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: If23318c862b760cff6ae9810ff929ec1a9d1a1a4
diff --git a/certificate.cpp b/certificate.cpp
index 4e6defc..8bdd858 100644
--- a/certificate.cpp
+++ b/certificate.cpp
@@ -711,7 +711,11 @@
elog<InvalidCertificate>(Reason("Failed to get private key info"));
}
+#if (OPENSSL_VERSION_NUMBER < 0x30000000L)
int32_t rc = EVP_PKEY_cmp(priKey.get(), pubKey.get());
+#else
+ int32_t rc = EVP_PKEY_eq(priKey.get(), pubKey.get());
+#endif
if (rc != 1)
{
log<level::ERR>("Private key is not matching with Certificate",