From 3c729284714706f324752509d050bab9095afeb2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 28 Mar 2026 02:41:40 +0100 Subject: [PATCH] build: drop redundant `USE_QUICHE` guards When used together with `USE_OPENSSL`. `USE_QUICHE` always implies `USE_OPENSSL`. Also: merge two (now identical) `#if` blocks in `openssl.c`. Closes #21135 --- lib/vtls/keylog.c | 5 +---- lib/vtls/openssl.c | 6 +----- src/curlinfo.c | 5 ++--- tests/libtest/cli_hx_download.c | 9 ++++----- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/lib/vtls/keylog.c b/lib/vtls/keylog.c index fe2e2868b0..2b4c5a200c 100644 --- a/lib/vtls/keylog.c +++ b/lib/vtls/keylog.c @@ -23,10 +23,7 @@ ***************************************************************************/ #include "curl_setup.h" -#if defined(USE_OPENSSL) || \ - defined(USE_GNUTLS) || \ - defined(USE_WOLFSSL) || \ - defined(USE_QUICHE) || \ +#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_WOLFSSL) || \ defined(USE_RUSTLS) #include "vtls/keylog.h" diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 9fe12bba20..bb66edf013 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -27,7 +27,7 @@ */ #include "curl_setup.h" -#if defined(USE_QUICHE) || defined(USE_OPENSSL) +#ifdef USE_OPENSSL #include "urldata.h" #include "curl_trc.h" @@ -514,10 +514,6 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) return result; } -#endif /* USE_QUICHE || USE_OPENSSL */ - -#ifdef USE_OPENSSL - static int ossl_bio_cf_create(BIO *bio) { BIO_set_shutdown(bio, 1); diff --git a/src/curlinfo.c b/src/curlinfo.c index b34e27fb88..722e4ff44e 100644 --- a/src/curlinfo.c +++ b/src/curlinfo.c @@ -39,7 +39,7 @@ #include -#if defined(USE_QUICHE) || defined(USE_OPENSSL) +#ifdef USE_OPENSSL #include /* for OPENSSL_NO_OCSP */ #endif @@ -249,8 +249,7 @@ static const char *disabled[] = { #endif , "cert-status: " -#if defined(USE_GNUTLS) || \ - ((defined(USE_QUICHE) || defined(USE_OPENSSL)) && !defined(OPENSSL_NO_OCSP)) +#if defined(USE_GNUTLS) || (defined(USE_OPENSSL) && !defined(OPENSSL_NO_OCSP)) "ON" #else "OFF" diff --git a/tests/libtest/cli_hx_download.c b/tests/libtest/cli_hx_download.c index b180b57b2a..fca5a7dec1 100644 --- a/tests/libtest/cli_hx_download.c +++ b/tests/libtest/cli_hx_download.c @@ -25,7 +25,7 @@ #include "testtrace.h" -#if defined(USE_QUICHE) || defined(USE_OPENSSL) +#ifdef USE_OPENSSL #include #endif #ifdef USE_WOLFSSL @@ -137,9 +137,8 @@ static int my_progress_d_cb(void *userdata, return 1; } -#if defined(USE_QUICHE) || defined(USE_OPENSSL) || defined(USE_WOLFSSL) || \ - defined(USE_GNUTLS) || defined(USE_MBEDTLS) || defined(USE_RUSTLS) || \ - defined(USE_SCHANNEL) +#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_WOLFSSL) || \ + defined(USE_MBEDTLS) || defined(USE_RUSTLS) || defined(USE_SCHANNEL) if(!t->checked_ssl && dlnow > 0) { struct curl_tlssessioninfo *tls; CURLcode result; @@ -153,7 +152,7 @@ static int my_progress_d_cb(void *userdata, } else { switch(tls->backend) { -#if defined(USE_QUICHE) || defined(USE_OPENSSL) +#ifdef USE_OPENSSL case CURLSSLBACKEND_OPENSSL: { const char *version = SSL_get_version((SSL *)tls->internals); assert(version);