[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 190/222: conn-reuse: requests wanting NTLM can reuse non-NTLM co
From: |
gnunet |
Subject: |
[gnurl] 190/222: conn-reuse: requests wanting NTLM can reuse non-NTLM connections |
Date: |
Thu, 07 Nov 2019 00:11:26 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 807c056c08bd6314e27148c348d027a808e3a632
Author: Daniel Stenberg <address@hidden>
AuthorDate: Mon Oct 21 10:43:03 2019 +0200
conn-reuse: requests wanting NTLM can reuse non-NTLM connections
Added test case 338 to verify.
Reported-by: Daniel Silverstone
Fixes #4499
Closes #4514
---
lib/url.c | 8 ++++++-
tests/data/Makefile.inc | 2 +-
tests/data/test338 | 63 +++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/lib/url.c b/lib/url.c
index 1b3c15c2f..660d24141 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1282,8 +1282,14 @@ ConnectionExists(struct Curl_easy *data,
partway through a handshake!) */
if(wantNTLMhttp) {
if(strcmp(needle->user, check->user) ||
- strcmp(needle->passwd, check->passwd))
+ strcmp(needle->passwd, check->passwd)) {
+
+ /* we prefer a credential match, but this is at least a connection
+ that can be reused and "upgraded" to NTLM */
+ if(check->http_ntlm_state == NTLMSTATE_NONE)
+ chosen = check;
continue;
+ }
}
else if(check->http_ntlm_state != NTLMSTATE_NONE) {
/* Connection is using NTLM auth but we don't want NTLM */
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index ba6dfcf73..557f92891 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -57,7 +57,7 @@ test298 test299 test300 test301 test302 test303 test304
test305 test306 \
test307 test308 test309 test310 test311 test312 test313 test314 test315 \
test316 test317 test318 test319 test320 test321 test322 test323 test324 \
test325 test326 test327 test328 test329 test330 test331 test332 test333 \
-test334 test335 test336 test337 \
+test334 test335 test336 test337 test338 \
test340 \
\
test350 test351 test352 test353 test354 test355 test356 \
diff --git a/tests/data/test338 b/tests/data/test338
new file mode 100644
index 000000000..f8dab6528
--- /dev/null
+++ b/tests/data/test338
@@ -0,0 +1,63 @@
+# See https://github.com/curl/curl/issues/4499
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+<servercmd>
+connection-monitor
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+ANYAUTH connection reuse of non-authed connection
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/338 --next http://%HOSTIP:%HTTPPORT/338 --anyauth -u
foo:moo
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /338 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /338 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+[DISCONNECT]
+</protocol>
+</verify>
+</testcase>
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 180/222: examples/sslbackend: fix -Wchar-subscripts warning, (continued)
- [gnurl] 180/222: examples/sslbackend: fix -Wchar-subscripts warning, gnunet, 2019/11/06
- [gnurl] 197/222: RELEASE-NOTES: synced, gnunet, 2019/11/06
- [gnurl] 203/222: url: make Curl_close() NULLify the pointer too, gnunet, 2019/11/06
- [gnurl] 205/222: gtls: make gnutls_bye() not wait for response on shutdown, gnunet, 2019/11/06
- [gnurl] 207/222: mbedtls: add error message for cert validity starting in the future, gnunet, 2019/11/06
- [gnurl] 210/222: configure: only say ipv6 enabled when the variable is set, gnunet, 2019/11/06
- [gnurl] 216/222: awk, gnunet, 2019/11/06
- [gnurl] 161/222: asyn-thread: make use of Curl_socketpair() where available, gnunet, 2019/11/06
- [gnurl] 174/222: url: normalize CURLINFO_EFFECTIVE_URL, gnunet, 2019/11/06
- [gnurl] 167/222: KNOWN_BUGS: remove "CURLFORM_CONTENTLEN in an array", gnunet, 2019/11/06
- [gnurl] 190/222: conn-reuse: requests wanting NTLM can reuse non-NTLM connections,
gnunet <=
- [gnurl] 185/222: runtests: get textaware info from curl instead of perl, gnunet, 2019/11/06
- [gnurl] 198/222: HTTP3: fix invalid use of sendto for connected UDP socket, gnunet, 2019/11/06
- [gnurl] 169/222: connect: silence sign-compare warning, gnunet, 2019/11/06
- [gnurl] 201/222: url: Curl_free_request_state() should also free doh handles, gnunet, 2019/11/06
- [gnurl] 214/222: awk scripts., gnunet, 2019/11/06
- [gnurl] 217/222: awk., gnunet, 2019/11/06
- [gnurl] 219/222: include., gnunet, 2019/11/06
- [gnurl] 212/222: RELEASE-NOTES: synced, gnunet, 2019/11/06
- [gnurl] 222/222: minor, gnunet, 2019/11/06
- [gnurl] 215/222: awk, gnunet, 2019/11/06