2017-02-06 12:40:51 -05:00
|
|
|
<testcase>
|
|
|
|
<info>
|
|
|
|
<keywords>
|
|
|
|
HTTP
|
|
|
|
HTTP GET
|
|
|
|
HTTP Digest auth
|
|
|
|
followlocation
|
|
|
|
</keywords>
|
|
|
|
</info>
|
|
|
|
|
|
|
|
# Server-side
|
|
|
|
<reply>
|
|
|
|
<data>
|
|
|
|
HTTP/1.1 401 authentication please swsbounce
|
|
|
|
Server: Microsoft-IIS/6.0
|
|
|
|
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", qop="auth"
|
|
|
|
Content-Type: text/html; charset=iso-8859-1
|
|
|
|
Content-Length: 0
|
|
|
|
|
|
|
|
</data>
|
|
|
|
<data1000>
|
|
|
|
HTTP/1.1 302 Thanks for this, but we want to redir you!
|
|
|
|
Server: Microsoft-IIS/5.0
|
|
|
|
Content-Type: text/html; charset=iso-8859-1
|
2021-03-12 11:38:26 -05:00
|
|
|
Location: /%TESTNUMBER0001
|
2017-02-06 12:40:51 -05:00
|
|
|
Content-Length: 0
|
|
|
|
|
|
|
|
</data1000>
|
|
|
|
<data1001>
|
|
|
|
HTTP/1.1 404 Not Found
|
|
|
|
Server: Microsoft-IIS/5.0
|
|
|
|
Content-Type: text/html; charset=iso-8859-1
|
|
|
|
Content-Length: 0
|
|
|
|
|
|
|
|
</data1001>
|
|
|
|
|
|
|
|
<datacheck>
|
|
|
|
HTTP/1.1 401 authentication please swsbounce
|
|
|
|
Server: Microsoft-IIS/6.0
|
|
|
|
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", qop="auth"
|
|
|
|
Content-Type: text/html; charset=iso-8859-1
|
|
|
|
Content-Length: 0
|
|
|
|
|
|
|
|
HTTP/1.1 302 Thanks for this, but we want to redir you!
|
|
|
|
Server: Microsoft-IIS/5.0
|
|
|
|
Content-Type: text/html; charset=iso-8859-1
|
2021-03-12 11:38:26 -05:00
|
|
|
Location: /%TESTNUMBER0001
|
2017-02-06 12:40:51 -05:00
|
|
|
Content-Length: 0
|
|
|
|
|
|
|
|
HTTP/1.1 404 Not Found
|
|
|
|
Server: Microsoft-IIS/5.0
|
|
|
|
Content-Type: text/html; charset=iso-8859-1
|
|
|
|
Content-Length: 0
|
|
|
|
|
|
|
|
</datacheck>
|
|
|
|
|
|
|
|
</reply>
|
|
|
|
|
|
|
|
# Client-side
|
|
|
|
<client>
|
|
|
|
#
|
|
|
|
<server>
|
|
|
|
http
|
|
|
|
</server>
|
|
|
|
<features>
|
|
|
|
crypto
|
|
|
|
</features>
|
|
|
|
<name>
|
|
|
|
HTTP GET --digest increasing nonce-count
|
|
|
|
</name>
|
|
|
|
# This test is to ensure the nonce-count (nc) increases
|
|
|
|
# https://github.com/curl/curl/pull/1251
|
|
|
|
<command>
|
2021-03-12 11:38:26 -05:00
|
|
|
-u auser:apasswd --location --digest http://%HOSTIP:%HTTPPORT/%TESTNUMBER
|
2017-02-06 12:40:51 -05:00
|
|
|
</command>
|
|
|
|
</client>
|
|
|
|
|
|
|
|
# Verify data after the test has been "shot"
|
|
|
|
<verify>
|
2020-10-02 07:45:24 -04:00
|
|
|
|
2017-02-06 12:40:51 -05:00
|
|
|
# Reorder the fields in 'Authorization: Digest' header.
|
|
|
|
# Since regular and SSPI digest auth header fields may not have the same order
|
|
|
|
# or whitespace we homogenize so that both may be tested. Also:
|
|
|
|
# - Remove the unique value from cnonce if in RFC format
|
|
|
|
# - Remove the unique value from response if in RFC format
|
|
|
|
# - Remove quotes from qop="auth" used by SSPI
|
|
|
|
# The if statement is one line because runtests evaluates one line at a time.
|
|
|
|
<strippart>
|
|
|
|
if(s/^(Authorization: Digest )([^\r\n]+)(\r?\n)$//) { $_ = $1 . join(', ', map { s/^(cnonce=)"[a-zA-Z0-9+\/=]+"$/$1REMOVED/; s/^(response=)"[a-f0-9]{32}"$/$1REMOVED/; s/^qop="auth"$/qop=auth/; $_ } sort split(/, */, $2)) . $3; }
|
|
|
|
</strippart>
|
|
|
|
<protocol>
|
2021-03-12 11:38:26 -05:00
|
|
|
GET /%TESTNUMBER HTTP/1.1
|
2017-02-06 12:40:51 -05:00
|
|
|
Host: %HOSTIP:%HTTPPORT
|
2020-10-02 07:45:24 -04:00
|
|
|
User-Agent: curl/%VERSION
|
2017-02-06 12:40:51 -05:00
|
|
|
Accept: */*
|
|
|
|
|
2021-03-12 11:38:26 -05:00
|
|
|
GET /%TESTNUMBER HTTP/1.1
|
2017-02-06 12:40:51 -05:00
|
|
|
Host: %HOSTIP:%HTTPPORT
|
2021-03-12 11:38:26 -05:00
|
|
|
Authorization: Digest cnonce=REMOVED, nc=00000001, nonce="1053604144", qop=auth, realm="testrealm", response=REMOVED, uri="/%TESTNUMBER", username="auser"
|
2020-10-02 07:45:24 -04:00
|
|
|
User-Agent: curl/%VERSION
|
2017-02-06 12:40:51 -05:00
|
|
|
Accept: */*
|
|
|
|
|
2021-03-12 11:38:26 -05:00
|
|
|
GET /%TESTNUMBER0001 HTTP/1.1
|
2017-02-06 12:40:51 -05:00
|
|
|
Host: %HOSTIP:%HTTPPORT
|
2021-03-12 11:38:26 -05:00
|
|
|
Authorization: Digest cnonce=REMOVED, nc=00000002, nonce="1053604144", qop=auth, realm="testrealm", response=REMOVED, uri="/%TESTNUMBER0001", username="auser"
|
2020-10-02 07:45:24 -04:00
|
|
|
User-Agent: curl/%VERSION
|
2017-02-06 12:40:51 -05:00
|
|
|
Accept: */*
|
|
|
|
|
|
|
|
</protocol>
|
|
|
|
</verify>
|
|
|
|
</testcase>
|