[Spice-commits] common/ssl_verify.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 1 11:31:38 UTC 2022


 common/ssl_verify.c |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 58d375e5eadc6fb9e587e99fd81adcb95d01e8d6
Author: Frediano Ziglio <freddy77 at gmail.com>
Date:   Wed May 18 12:57:06 2022 +0100

    Replace EVP_PKEY_cmp with EVP_PKEY_eq
    
    EVP_PKEY_cmp was made obsolete in OpenSSL.
    The main reason is that the return value is not coherent with
    other *_cmp functions.
    So it was replaced by EVP_PKEY_eq, which does the same.
    Rename to avoid a deprecation warning on newer OpenSSL releases.
    
    Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>

diff --git a/common/ssl_verify.c b/common/ssl_verify.c
index 9ee8059..f12628a 100644
--- a/common/ssl_verify.c
+++ b/common/ssl_verify.c
@@ -72,7 +72,11 @@ static int verify_pubkey(X509* cert, const char *key, size_t key_size)
         goto finish;
     }
 
+#if OPENSSL_VERSION_NUMBER >= 0x30000000
+    ret = EVP_PKEY_eq(orig_pubkey, cert_pubkey);
+#else
     ret = EVP_PKEY_cmp(orig_pubkey, cert_pubkey);
+#endif
 
     if (ret == 1) {
         spice_debug("public keys match");


More information about the Spice-commits mailing list