From 24c43e9d34615236489bde4797ce50de4bb56a84 Mon Sep 17 00:00:00 2001 From: Joe Mason Date: Thu, 19 Jul 2012 13:58:10 -0400 Subject: Add tests of auth retries --- tests/data/Makefile.am | 5 +- tests/data/test2023 | 162 +++++++++++++++++++++++++ tests/data/test2024 | 172 +++++++++++++++++++++++++++ tests/data/test2025 | 268 +++++++++++++++++++++++++++++++++++++++++ tests/data/test2026 | 216 +++++++++++++++++++++++++++++++++ tests/data/test2027 | 232 ++++++++++++++++++++++++++++++++++++ tests/data/test2028 | 312 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test2029 | 236 ++++++++++++++++++++++++++++++++++++ tests/data/test2030 | 269 +++++++++++++++++++++++++++++++++++++++++ tests/data/test2031 | 317 +++++++++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 2188 insertions(+), 1 deletion(-) create mode 100644 tests/data/test2023 create mode 100644 tests/data/test2024 create mode 100644 tests/data/test2025 create mode 100644 tests/data/test2026 create mode 100644 tests/data/test2027 create mode 100644 tests/data/test2028 create mode 100644 tests/data/test2029 create mode 100644 tests/data/test2030 create mode 100644 tests/data/test2031 (limited to 'tests/data') diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 372f127d8..fa1a7d7b3 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -95,7 +95,10 @@ test1400 test1401 test1402 test1403 test1404 test1405 test1406 test1407 \ test1408 test1409 test1410 \ test2000 test2001 test2002 test2003 test2004 test2005 test2006 test2007 \ test2008 test2009 test2010 test2011 test2012 test2013 test2014 test2015 \ -test2016 test2017 test2018 test2019 test2020 test2021 test2022 +test2016 test2017 test2018 test2019 test2020 test2021 test2022 \ +test2023 test2024 test2025 \ +test2026 test2027 test2028 \ +test2029 test2030 test2031 EXTRA_DIST = $(TESTCASES) DISABLED diff --git a/tests/data/test2023 b/tests/data/test2023 new file mode 100644 index 000000000..9b04ff3dd --- /dev/null +++ b/tests/data/test2023 @@ -0,0 +1,162 @@ + + + +HTTP +HTTP GET +HTTP Basic auth + + +# Server-side + + + + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! + + + + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! + + + + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! + + + + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +# Client-side + + +http + + +libauthretry + + + +HTTP authorization retry (Basic) + + +# we force our own host name, in order to make the test machine independent +CURL_GETHOSTNAME=curlhost +# we try to use the LD_PRELOAD hack, if not a debug build +LD_PRELOAD=%PWD/libtest/.libs/libhostname.so + + +http://%HOSTIP:%HTTPPORT/2023 basic basic + + +chkhostname curlhost + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /20230100 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20230200 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20230300 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20230400 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20230500 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M= +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + diff --git a/tests/data/test2024 b/tests/data/test2024 new file mode 100644 index 000000000..1fbb2047b --- /dev/null +++ b/tests/data/test2024 @@ -0,0 +1,172 @@ + + + +HTTP +HTTP GET +HTTP Basic auth +HTTP Digest auth + + +# Server-side + + + + + + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="1" +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! + + + + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! + + + + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="3" +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! + + + + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="1" +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="3" +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +# Client-side + + +http + + +libauthretry + + + +HTTP authorization retry (Basic switching to Digest) + + +# we force our own host name, in order to make the test machine independent +CURL_GETHOSTNAME=curlhost +# we try to use the LD_PRELOAD hack, if not a debug build +LD_PRELOAD=%PWD/libtest/.libs/libhostname.so + + +http://%HOSTIP:%HTTPPORT/2024 basic digest + + +chkhostname curlhost + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /20240100 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20240200 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/20240200", response="ed646c565f79e2dd9fa37cb5a621213c" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20240300 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20240400 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/20240400", response="9741ced8caacc6124770187b36f007c5" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20240500 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="3", uri="/20240500", response="5bc77ec8c2d443b27a1b55f1fd8fbb13" +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + diff --git a/tests/data/test2025 b/tests/data/test2025 new file mode 100644 index 000000000..f46bb9f9d --- /dev/null +++ b/tests/data/test2025 @@ -0,0 +1,268 @@ + + + +HTTP +HTTP GET +HTTP Basic auth +HTTP NTLM auth + + +# Server-side + + + + + + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! + + + + +HTTP/1.1 401 Need Basic or NTLM auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! + + + + +HTTP/1.1 401 Need Basic or NTLM auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! + + + + +HTTP/1.1 401 Need Basic or NTLM auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! +HTTP/1.1 401 NTLM intermediate (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +# Client-side + + +http + + +libauthretry + + + +HTTP authorization retry (Basic switching to NTLM) + + +# we force our own host name, in order to make the test machine independent +CURL_GETHOSTNAME=curlhost +# we try to use the LD_PRELOAD hack, if not a debug build +LD_PRELOAD=%PWD/libtest/.libs/libhostname.so + + +http://%HOSTIP:%HTTPPORT/2025 basic ntlm + + +chkhostname curlhost + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /20250100 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20250200 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20250200 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20250300 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20250400 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20250400 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20250500 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20250500 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + diff --git a/tests/data/test2026 b/tests/data/test2026 new file mode 100644 index 000000000..c940b6f94 --- /dev/null +++ b/tests/data/test2026 @@ -0,0 +1,216 @@ + + + +HTTP +HTTP GET +HTTP Basic auth +HTTP Digest auth + + +# Server-side + + + + + + +HTTP/1.1 401 Need Basic or Digest auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="1" +WWW-Authenticate: Basic realm="testrealm" + +This is not the real page! + + + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: Digest realm="testrealm", nonce="2" + +This is a bad password page! + + + + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +HTTP/1.1 401 Need Basic or Digest auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="3" +WWW-Authenticate: Basic realm="testrealm" + +This is not the real page! + + + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: Digest realm="testrealm", nonce="4" + +This is a bad password page! + + + + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="5" +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! + + + + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + +HTTP/1.1 401 Need Basic or Digest auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="1" +WWW-Authenticate: Basic realm="testrealm" + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: Digest realm="testrealm", nonce="2" + +This is a bad password page! +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! +HTTP/1.1 401 Need Basic or Digest auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="3" +WWW-Authenticate: Basic realm="testrealm" + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: Digest realm="testrealm", nonce="4" + +This is a bad password page! +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="5" +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +# Client-side + + +http + + +libauthretry + + + +HTTP authorization retry (Digest switching to Basic) + + +# we force our own host name, in order to make the test machine independent +CURL_GETHOSTNAME=curlhost +# we try to use the LD_PRELOAD hack, if not a debug build +LD_PRELOAD=%PWD/libtest/.libs/libhostname.so + + +http://%HOSTIP:%HTTPPORT/2026 digest basic + + +chkhostname curlhost + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /20260100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20260100 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/20260100", response="5f992a2e761ab926256419f7c685f85b" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20260200 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20260300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20260300 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="3", uri="/20260300", response="132242e602882251929be93228c830ae" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20260400 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20260500 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M= +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + diff --git a/tests/data/test2027 b/tests/data/test2027 new file mode 100644 index 000000000..cd2ead5a2 --- /dev/null +++ b/tests/data/test2027 @@ -0,0 +1,232 @@ + + + +HTTP +HTTP GET +HTTP Digest auth + + +# Server-side + + + + +HTTP/1.1 401 Need Digest auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="1" + +This is not the real page! + + + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" + +This is a bad password page! + + + + +HTTP/1.1 401 Need Digest auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="3" + +This is not the real page! + + + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +HTTP/1.1 401 Need Digest auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="4" + +This is not the real page! + + + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="5" + +This is a bad password page! + + + + +HTTP/1.1 401 Need Digest auth (4) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="6" + +This is not the real page! + + + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="7" + +This is a bad password page! + + + + +HTTP/1.1 401 Need Digest auth (5) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="8" + +This is not the real page! + + + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + +HTTP/1.1 401 Need Digest auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="1" + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" + +This is a bad password page! +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! +HTTP/1.1 401 Need Digest auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="4" + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="5" + +This is a bad password page! +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="7" + +This is a bad password page! +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +# Client-side + + +http + + +libauthretry + + + +HTTP authorization retry (Digest) + + +# we force our own host name, in order to make the test machine independent +CURL_GETHOSTNAME=curlhost +# we try to use the LD_PRELOAD hack, if not a debug build +LD_PRELOAD=%PWD/libtest/.libs/libhostname.so + + +http://%HOSTIP:%HTTPPORT/2027 digest digest + + +chkhostname curlhost + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /20270100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20270100 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/20270100", response="f7fd60eefaff5225971bf9b3d80d6ba6" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20270200 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/20270200", response="785ca3ef511999f7e9c178195f5b388c" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20270300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20270300 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="4", uri="/20270300", response="4c735d2360fd6848e7cb32a11ae3612b" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20270400 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/20270400", response="f5906785511fb60a2af8b1cd53008ead" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20270500 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="7", uri="/20270500", response="8ef4d935fd964a46c3965c0863b52cf1" +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + diff --git a/tests/data/test2028 b/tests/data/test2028 new file mode 100644 index 000000000..125dfee22 --- /dev/null +++ b/tests/data/test2028 @@ -0,0 +1,312 @@ + + + +HTTP +HTTP GET +HTTP Digest auth +HTTP NTLM auth + + +# Server-side + + + + + + +HTTP/1.1 401 Need Digest or NTLM auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="1" + +This is not the real page! + + + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" +WWW-Authenticate: NTLM + +This is a bad password page! + + + + +HTTP/1.1 401 Need Digest or NTLM auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="3" + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +HTTP/1.1 401 Need Digest or NTLM auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="4" +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="5" + +This is a bad password page! + + + + +HTTP/1.1 401 Need Digest or NTLM auth (4) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="6" +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="7" + +This is a bad password page! + + + + +HTTP/1.1 401 Need Digest or NTLM auth (5) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="8" +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + +HTTP/1.1 401 Need Digest or NTLM auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="1" + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" +WWW-Authenticate: NTLM + +This is a bad password page! +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! +HTTP/1.1 401 Need Digest or NTLM auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="4" +WWW-Authenticate: NTLM + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="5" + +This is a bad password page! +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="7" + +This is a bad password page! +HTTP/1.1 401 NTLM intermediate (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +# Client-side + + +http + + +libauthretry + + + +HTTP authorization retry (Digest switching to NTLM) + + +# we force our own host name, in order to make the test machine independent +CURL_GETHOSTNAME=curlhost +# we try to use the LD_PRELOAD hack, if not a debug build +LD_PRELOAD=%PWD/libtest/.libs/libhostname.so + + +http://%HOSTIP:%HTTPPORT/2028 digest ntlm + + +chkhostname curlhost + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /20280100 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20280100 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/20280100", response="53c80666f5e3a4a55f92a66aaf0078bb" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20280200 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20280200 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20280300 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20280300 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="4", uri="/20280300", response="1aa5d90da9803ca12d04b24e0f19476e" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20280400 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20280400 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20280500 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20280500 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + diff --git a/tests/data/test2029 b/tests/data/test2029 new file mode 100644 index 000000000..c71fe1dd7 --- /dev/null +++ b/tests/data/test2029 @@ -0,0 +1,236 @@ + + + +HTTP +HTTP GET +HTTP Basic auth +HTTP NTLM auth + + +# Server-side + + + + + + +HTTP/1.1 401 Need Basic or NTLM auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + +This is a bad password page! + + + + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +HTTP/1.1 401 Need Basic or NTLM auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + +This is a bad password page! + + + + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! + + + + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + +This is a bad password page! +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Basic realm="testrealm" +WWW-Authenticate: NTLM + +This is a bad password page! +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Basic realm="testrealm" + +This is a bad password page! +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +# Client-side + + +http + + +libauthretry + + + +HTTP authorization retry (NTLM switching to Basic) + + +# we force our own host name, in order to make the test machine independent +CURL_GETHOSTNAME=curlhost +# we try to use the LD_PRELOAD hack, if not a debug build +LD_PRELOAD=%PWD/libtest/.libs/libhostname.so + + +http://%HOSTIP:%HTTPPORT/2029 ntlm basic + + +chkhostname curlhost + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /20290100 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20290100 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20290200 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20290300 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20290300 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20290400 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20290500 HTTP/1.1 +Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M= +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + diff --git a/tests/data/test2030 b/tests/data/test2030 new file mode 100644 index 000000000..18659e8d2 --- /dev/null +++ b/tests/data/test2030 @@ -0,0 +1,269 @@ + + + +HTTP +HTTP GET +HTTP Digest auth +HTTP NTLM auth + + +# Server-side + + + + + + +HTTP/1.1 401 Need Digest or NTLM auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="1" + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" +WWW-Authenticate: NTLM + +This is a bad password page! + + + + +HTTP/1.1 401 Need Digest or NTLM auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="3" + +This is not the real page! + + + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +HTTP/1.1 401 Need Digest or NTLM auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="4" +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="5" + +This is a bad password page! + + + + +HTTP/1.1 401 Need Digest or NTLM auth (4) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="6" +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="7" + +This is a bad password page! + + + + +HTTP/1.1 401 Need Digest or NTLM auth (5) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: Digest realm="testrealm", nonce="8" +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: Digest realm="testrealm", nonce="2" +WWW-Authenticate: NTLM + +This is a bad password page! +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="5" + +This is a bad password page! +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM +WWW-Authenticate: Digest realm="testrealm", nonce="7" + +This is a bad password page! +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +# Client-side + + +http + + +libauthretry + + + +HTTP authorization retry (NTLM switching to Digest) + + +# we force our own host name, in order to make the test machine independent +CURL_GETHOSTNAME=curlhost +# we try to use the LD_PRELOAD hack, if not a debug build +LD_PRELOAD=%PWD/libtest/.libs/libhostname.so + + +http://%HOSTIP:%HTTPPORT/2030 ntlm digest + + +chkhostname curlhost + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /20300100 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20300100 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20300200 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/20300200", response="2f2d784ba53a0a307758a90e98d25c27" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20300300 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20300300 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20300400 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/20300400", response="d6262e9147db08c62ff2f53b515861e8" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20300500 HTTP/1.1 +Authorization: Digest username="testuser", realm="testrealm", nonce="7", uri="/20300500", response="198757e61163a779cf24ed4c49c1ad7d" +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + diff --git a/tests/data/test2031 b/tests/data/test2031 new file mode 100644 index 000000000..67b1deeaa --- /dev/null +++ b/tests/data/test2031 @@ -0,0 +1,317 @@ + + + +HTTP +HTTP GET +HTTP NTLM auth + + +# Server-side + + + + +HTTP/1.1 401 Need NTLM auth +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM + +This is a bad password page! + + + + +HTTP/1.1 401 Need NTLM auth (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +HTTP/1.1 401 Need NTLM auth (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM + +This is a bad password page! + + + + +HTTP/1.1 401 Need NTLM auth (4) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate (4) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM + +This is a bad password page! + + + + +HTTP/1.1 401 Need NTLM auth (5) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 27 +WWW-Authenticate: NTLM + +This is not the real page! + + + +HTTP/1.1 401 NTLM intermediate (5) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +This is still not the real page! + + + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + +HTTP/1.1 401 NTLM intermediate +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM + +This is a bad password page! +HTTP/1.1 401 NTLM intermediate (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! +HTTP/1.1 401 NTLM intermediate (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM + +This is a bad password page! +HTTP/1.1 401 NTLM intermediate (4) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 401 Sorry wrong password (3) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 29 +WWW-Authenticate: NTLM + +This is a bad password page! +HTTP/1.1 401 NTLM intermediate (5) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 33 +WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= + +HTTP/1.1 200 Things are fine in server land (2) +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 32 + +Finally, this is the real page! + + + + +# Client-side + + +http + + +libauthretry + + + +HTTP authorization retry (NTLM) + + +# we force our own host name, in order to make the test machine independent +CURL_GETHOSTNAME=curlhost +# we try to use the LD_PRELOAD hack, if not a debug build +LD_PRELOAD=%PWD/libtest/.libs/libhostname.so + + +http://%HOSTIP:%HTTPPORT/2031 ntlm ntlm + + +chkhostname curlhost + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /20310100 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20310100 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20310200 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20310200 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20310300 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20310300 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20310400 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20310400 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20310500 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /20310500 HTTP/1.1 +Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q= +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + -- cgit v1.2.3