]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
wolfssl: fix unused variable warning
authorViktor Szakats <commit@vsz.me>
Fri, 7 Mar 2025 03:40:08 +0000 (04:40 +0100)
committerViktor Szakats <commit@vsz.me>
Fri, 7 Mar 2025 12:48:07 +0000 (13:48 +0100)
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

index 7da83b1201fc7a061b296322113df9f81c1cb93e..7a16b8238bee8d40424391aadeae36a205fca20d 100644 (file)
@@ -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;