]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OpenSSL: Replace EVP_PKEY_cmp() with EVP_PKEY_eq() when available
authorJouni Malinen <j@w1.fi>
Sat, 12 Mar 2022 08:54:48 +0000 (10:54 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 12 Mar 2022 08:54:48 +0000 (10:54 +0200)
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 <j@w1.fi>
src/crypto/crypto_openssl.c

index 82c85762d84f04852ef9715a2a708f630f92d858..b54da5e429ce42f3f5ac0ae46f57c93eaabc3711 100644 (file)
@@ -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;
 }