From: Jouni Malinen Date: Sat, 12 Mar 2022 08:54:48 +0000 (+0200) Subject: OpenSSL: Replace EVP_PKEY_cmp() with EVP_PKEY_eq() when available X-Git-Tag: hostap_2_11~2160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6a53f64af13eff59c85e584a0fd9ac28a592db8;p=thirdparty%2Fhostap.git OpenSSL: Replace EVP_PKEY_cmp() with EVP_PKEY_eq() when available OpenSSL 3.0 deprecated EVP_PKEY_cmp() and replaced it with EVP_PKEY_eq() which is not available in older versions. Signed-off-by: Jouni Malinen --- diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c index 82c85762d..b54da5e42 100644 --- a/src/crypto/crypto_openssl.c +++ b/src/crypto/crypto_openssl.c @@ -2932,8 +2932,13 @@ int crypto_ec_key_group(struct crypto_ec_key *key) int crypto_ec_key_cmp(struct crypto_ec_key *key1, struct crypto_ec_key *key2) { +#if OPENSSL_VERSION_NUMBER >= 0x30000000L + if (EVP_PKEY_eq((EVP_PKEY *) key1, (EVP_PKEY *) key2) != 1) + return -1; +#else if (EVP_PKEY_cmp((EVP_PKEY *) key1, (EVP_PKEY *) key2) != 1) return -1; +#endif return 0; }