]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vtls: remove the Curl_cft_ssl_proxy object if CURL_DISABLE_PROXY
authorMAntoniak <47522782+MAntoniak@users.noreply.github.com>
Tue, 5 Dec 2023 22:49:12 +0000 (23:49 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 7 Dec 2023 08:31:05 +0000 (09:31 +0100)
Closes #12459

lib/curl_trc.c
lib/vtls/vtls.c
lib/vtls/vtls.h

index 0ebe40b8f72dd437113cb1a10c68ac9dce70b405..b8dccc41937763baa1b6c8dce3f355f6f3358efa 100644 (file)
@@ -157,8 +157,10 @@ static struct Curl_cftype *cf_types[] = {
 #endif
 #ifdef USE_SSL
   &Curl_cft_ssl,
+#ifndef CURL_DISABLE_PROXY
   &Curl_cft_ssl_proxy,
 #endif
+#endif
 #if !defined(CURL_DISABLE_PROXY)
 #if !defined(CURL_DISABLE_HTTP)
   &Curl_cft_h1_proxy,
index 9980d4405b19fdf77bc8638ab322217598deb2a9..dd68a066367ce5e2661b0001413d6567a422a630 100644 (file)
@@ -1846,6 +1846,8 @@ struct Curl_cftype Curl_cft_ssl = {
   ssl_cf_query,
 };
 
+#ifndef CURL_DISABLE_PROXY
+
 struct Curl_cftype Curl_cft_ssl_proxy = {
   "SSL-PROXY",
   CF_TYPE_SSL,
@@ -1864,6 +1866,8 @@ struct Curl_cftype Curl_cft_ssl_proxy = {
   Curl_cf_def_query,
 };
 
+#endif /* !CURL_DISABLE_PROXY */
+
 static CURLcode cf_ssl_create(struct Curl_cfilter **pcf,
                               struct Curl_easy *data,
                               struct connectdata *conn)
@@ -1971,8 +1975,12 @@ bool Curl_ssl_supports(struct Curl_easy *data, int option)
 static struct Curl_cfilter *get_ssl_filter(struct Curl_cfilter *cf)
 {
   for(; cf; cf = cf->next) {
-    if(cf->cft == &Curl_cft_ssl || cf->cft == &Curl_cft_ssl_proxy)
+    if(cf->cft == &Curl_cft_ssl)
+      return cf;
+#ifndef CURL_DISABLE_PROXY
+    if(cf->cft == &Curl_cft_ssl_proxy)
       return cf;
+#endif
   }
   return NULL;
 }
@@ -2018,7 +2026,12 @@ CURLcode Curl_ssl_cfilter_remove(struct Curl_easy *data,
 
 bool Curl_ssl_cf_is_proxy(struct Curl_cfilter *cf)
 {
+#ifndef CURL_DISABLE_PROXY
   return (cf->cft == &Curl_cft_ssl_proxy);
+#else
+  (void)cf;
+  return FALSE;
+#endif
 }
 
 struct ssl_config_data *
index f1856bd333bb03075f5ba2a58d192529f2eac366..744bbf8fd9eecda8c4ea4c59c2fc805251dc8c65 100644 (file)
@@ -228,7 +228,9 @@ struct ssl_primary_config *
   Curl_ssl_cf_get_primary_config(struct Curl_cfilter *cf);
 
 extern struct Curl_cftype Curl_cft_ssl;
+#ifndef CURL_DISABLE_PROXY
 extern struct Curl_cftype Curl_cft_ssl_proxy;
+#endif
 
 #else /* if not USE_SSL */