]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
wolfssl: fix error check in shutdown
authorStefan Eissing <stefan@eissing.org>
Thu, 25 Sep 2025 11:11:58 +0000 (13:11 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 Sep 2025 12:16:56 +0000 (14:16 +0200)
When trying to send the TLS shutdown, use the return code
to check for the cause.

Reported in Joshua's sarif data

Closes #18729

lib/vtls/wolfssl.c

index 0cf6e0e4a57a68c80010b1b9a4de3b7c3218f707..ed024356766e79607a7089452c9d64448e4fafcd 100644 (file)
@@ -1921,7 +1921,8 @@ static CURLcode wssl_shutdown(struct Curl_cfilter *cf,
    * was not complete, we are lacking the close notify from the server. */
   if(send_shutdown) {
     wolfSSL_ERR_clear_error();
-    if(wolfSSL_shutdown(wctx->ssl) == 1) {
+    nread = wolfSSL_shutdown(wctx->ssl);
+    if(nread == 1) {
       CURL_TRC_CF(data, cf, "SSL shutdown finished");
       *done = TRUE;
       goto out;