Skip to content

Commit b841056

Browse files
committed
curl(schannel): increase renegotiation timeout to 60 seconds
As reported by Tim Omta in curl/curl#21270, the renegotiation timeout of 7 seconds caused serious problems in some scenarios, and was already increased to 60 seconds in cURL's main branch, in time for their v8.20.0 release on April 29th. Unfortunately, this is too late for the patch to make it into Git for Windows v2.54.0, which is currently scheduled for April 20th (see https://gh.io/gitCal for details). So let's backport the patch. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent ebf5c46 commit b841056

2 files changed

Lines changed: 43 additions & 4 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From 70bb0db76720c152f6a55bbe12cf162b55cb105b Mon Sep 17 00:00:00 2001
2+
From: Jay Satiro <raysatiro@yahoo.com>
3+
Date: Fri, 10 Apr 2026 14:02:55 -0400
4+
Subject: [PATCH] schannel: increase renegotiation timeout to 60 seconds
5+
6+
Prior to this change the timeout was 7 seconds but that is too short for
7+
enhanced-security users that have to fill out an interactive prompt on
8+
Schannel renegotiation (PIN, smart card, etc).
9+
10+
Reported-by: Tim Omta
11+
12+
Fixes https://github.com/curl/curl/issues/21270
13+
Closes https://github.com/curl/curl/pull/21291
14+
---
15+
lib/vtls/schannel.c | 8 +++++++-
16+
1 file changed, 7 insertions(+), 1 deletion(-)
17+
18+
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c
19+
index a2b76da98200..7bfbbcf04c85 100644
20+
--- a/lib/vtls/schannel.c
21+
+++ b/lib/vtls/schannel.c
22+
@@ -1757,7 +1757,13 @@ enum schannel_renegotiate_caller_t {
23+
SCH_RENEG_CALLER_IS_SEND
24+
};
25+
26+
-#define MAX_RENEG_BLOCK_TIME (7 * 1000) /* 7 seconds in milliseconds */
27+
+/* The maximum time we allow for Schannel renegotiation which may in some
28+
+ rare cases block either due to libcurl (waiting on the socket) or Windows
29+
+ (waiting on an interactive security prompt). Note Schannel "renegotiation"
30+
+ is not necessarily literal TLS renegotiation, but means DecryptMessage
31+
+ returned SEC_I_RENEGOTIATE which means at least the security context needs
32+
+ to be re-established. */
33+
+#define MAX_RENEG_BLOCK_TIME (60 * 1000) /* 60 seconds in milliseconds */
34+
35+
/* This function renegotiates the connection due to a server request received
36+
by schannel_recv. This function returns CURLE_AGAIN if the renegotiation is

mingw-w64-curl/PKGBUILD

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
66
"${MINGW_PACKAGE_PREFIX}-${_realname}-gnutls"
77
"${MINGW_PACKAGE_PREFIX}-${_realname}-winssl")
88
pkgver=8.19.0
9-
pkgrel=1
9+
pkgrel=2
1010
pkgdesc="Command line tool and library for transferring data with URLs (mingw-w64)"
1111
arch=('any')
1212
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
@@ -35,13 +35,15 @@ source=("https://github.com/curl/curl/releases/download/${_realname}-${pkgver//.
3535
"pathtools.c"
3636
"pathtools.h"
3737
"0001-Make-cURL-relocatable.patch"
38-
"0002-Hack-make-relocation-work-inside-libexec-git-core-an.patch")
38+
"0002-Hack-make-relocation-work-inside-libexec-git-core-an.patch"
39+
"70bb0db76720c152f6a55bbe12cf162b55cb105b.patch")
3940
sha256sums=('eba3230c1b659211a7afa0fbf475978cbf99c412e4d72d9aa92d020c460742d4'
4041
'SKIP'
4142
'08209cbf1633fa92eae7e5d28f95f8df9d6184cc20fa878c99aec4709bb257fd'
4243
'965d3921ec4fdeec94a2718bc2c85ce5e1a00ea0e499330a554074a7ae15dfc6'
4344
'bb03c858d9322d005c414b2b6713200eb82df32ee00fb7507ed9896c026aab2a'
44-
'089a62a2e389c70dd40c5fdf80ee69d46f083b105101123b9f5a07dc24411bb4')
45+
'089a62a2e389c70dd40c5fdf80ee69d46f083b105101123b9f5a07dc24411bb4'
46+
'ffaadb16a5f1aaa4e0a33473b905a6650e6291afecb39f56805eaffc26a20932')
4547
validpgpkeys=('27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2') # Daniel Stenberg
4648

4749
if test -z "$WITHOUT_ALTERNATES"
@@ -91,7 +93,8 @@ prepare() {
9193

9294
apply_patch_with_msg \
9395
0001-Make-cURL-relocatable.patch \
94-
0002-Hack-make-relocation-work-inside-libexec-git-core-an.patch
96+
0002-Hack-make-relocation-work-inside-libexec-git-core-an.patch \
97+
70bb0db76720c152f6a55bbe12cf162b55cb105b.patch
9598

9699
autoreconf -vfi
97100
}

0 commit comments

Comments
 (0)