]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Ensure we pass the user SSL object for the SSL_set_verify callback
authorMatt Caswell <matt@openssl.org>
Mon, 16 Jun 2025 15:00:13 +0000 (16:00 +0100)
committerNeil Horman <nhorman@openssl.org>
Tue, 17 Jun 2025 20:27:30 +0000 (16:27 -0400)
When calling the verify callback we need to ensure we supply the user SSL
object, and not any internal SSL object.

Fixes #27830

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27838)

(cherry picked from commit 4b148ebb66cdac8a095f22cbdfa475d68c947f7a)

ssl/ssl_cert.c

index ae0f98044929ed9e52e0eef302176aeaf5b8863b..1be6cd7dbc99569ad211ad0038eb30207f6cdd10 100644 (file)
@@ -478,9 +478,9 @@ static int ssl_verify_internal(SSL_CONNECTION *s, STACK_OF(X509) *sk, EVP_PKEY *
     /* Set suite B flags if needed */
     X509_STORE_CTX_set_flags(ctx, tls1_suiteb(s));
     if (!X509_STORE_CTX_set_ex_data(ctx,
-            SSL_get_ex_data_X509_STORE_CTX_idx(), s)) {
+            SSL_get_ex_data_X509_STORE_CTX_idx(),
+            SSL_CONNECTION_GET_USER_SSL(s)))
         goto end;
-    }
 
     /* Verify via DANE if enabled */
     if (DANETLS_ENABLED(&s->dane))