]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: fix building against no-ocsp openssl with Apple SecTrust
authorViktor Szakats <commit@vsz.me>
Wed, 31 Dec 2025 13:35:20 +0000 (14:35 +0100)
committerViktor Szakats <commit@vsz.me>
Wed, 31 Dec 2025 14:51:02 +0000 (15:51 +0100)
(Not tested in CI. Regression in 8.17.0.)

Fixing:
```
lib/vtls/openssl.c:4750:8: error: variable 'sectrust_verified' set but not used [-Werror,-Wunused-but-set-variable]
 4750 |   bool sectrust_verified = FALSE;
      |        ^
1 error generated.
```

Follow-up to b4630ed8faef1834e2b64f30acc24e5101d4d2fb #19308

Closes #20128

lib/vtls/openssl.c

index 8a39d513d457c3974474dfa92fea9aea10d1c1d7..f33d1e9a2705d7738ca30ebb5b1a96864475fe09 100644 (file)
@@ -4746,7 +4746,8 @@ CURLcode Curl_ossl_check_peer_cert(struct Curl_cfilter *cf,
   long ossl_verify;
   X509 *server_cert;
   bool verified = FALSE;
-#ifdef USE_APPLE_SECTRUST
+#if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_OCSP) && \
+  defined(USE_APPLE_SECTRUST)
   bool sectrust_verified = FALSE;
 #endif
 
@@ -4801,7 +4802,9 @@ CURLcode Curl_ossl_check_peer_cert(struct Curl_cfilter *cf,
     if(verified) {
       infof(data, "SSL certificate verified via Apple SecTrust.");
       ssl_config->certverifyresult = X509_V_OK;
+#if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_OCSP)
       sectrust_verified = TRUE;
+#endif
     }
   }
 #endif