From 07f99b72d5527ef0ffd38f203dbeb6624a47096a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 7 Mar 2025 04:40:08 +0100 Subject: [PATCH] wolfssl: fix unused variable warning E.g. when building against msys2-mingw wolfssl: https://packages.msys2.org/base/mingw-w64-wolfssl ``` lib/vtls/wolfssl.c: In function 'wssl_verify_pinned': lib/vtls/wolfssl.c:1534:20: error: unused variable 'wssl' [-Werror=unused-variable] struct wssl_ctx *wssl = (struct wssl_ctx *)connssl->backend; ^~~~ ``` Ref: https://github.com/curl/curl/actions/runs/13713131802/job/38353245932#step:10:78 Building with the MSYS2 wolfssl is broken due to further issues. Closes #16608 --- lib/vtls/wolfssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 7da83b1201..7a16b8238b 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -1531,7 +1531,6 @@ static CURLcode wssl_verify_pinned(struct Curl_cfilter *cf, struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; - struct wssl_ctx *wssl = (struct wssl_ctx *)connssl->backend; #ifndef CURL_DISABLE_PROXY const char * const pinnedpubkey = Curl_ssl_cf_is_proxy(cf) ? data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] : @@ -1542,6 +1541,7 @@ static CURLcode wssl_verify_pinned(struct Curl_cfilter *cf, if(pinnedpubkey) { #ifdef KEEP_PEER_CERT + struct wssl_ctx *wssl = (struct wssl_ctx *)connssl->backend; WOLFSSL_X509 *x509; const char *x509_der; int x509_der_len; -- 2.47.3