| 1 |
<testcase> |
| 2 |
<info> |
| 3 |
<keywords> |
| 4 |
HTTP |
| 5 |
HTTP GET |
| 6 |
HTTP Digest auth |
| 7 |
followlocation |
| 8 |
</keywords> |
| 9 |
</info> |
| 10 |
|
| 11 |
# Server-side |
| 12 |
<reply> |
| 13 |
<data> |
| 14 |
HTTP/1.1 401 authentication please swsbounce |
| 15 |
Server: Microsoft-IIS/6.0 |
| 16 |
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", qop="auth" |
| 17 |
Content-Type: text/html; charset=iso-8859-1 |
| 18 |
Content-Length: 0 |
| 19 |
|
| 20 |
</data> |
| 21 |
<data1000> |
| 22 |
HTTP/1.1 302 Thanks for this, but we want to redir you! |
| 23 |
Server: Microsoft-IIS/5.0 |
| 24 |
Content-Type: text/html; charset=iso-8859-1 |
| 25 |
Location: /12860001 |
| 26 |
Content-Length: 0 |
| 27 |
|
| 28 |
</data1000> |
| 29 |
<data1001> |
| 30 |
HTTP/1.1 404 Not Found |
| 31 |
Server: Microsoft-IIS/5.0 |
| 32 |
Content-Type: text/html; charset=iso-8859-1 |
| 33 |
Content-Length: 0 |
| 34 |
|
| 35 |
</data1001> |
| 36 |
|
| 37 |
<datacheck> |
| 38 |
HTTP/1.1 401 authentication please swsbounce |
| 39 |
Server: Microsoft-IIS/6.0 |
| 40 |
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", qop="auth" |
| 41 |
Content-Type: text/html; charset=iso-8859-1 |
| 42 |
Content-Length: 0 |
| 43 |
|
| 44 |
HTTP/1.1 302 Thanks for this, but we want to redir you! |
| 45 |
Server: Microsoft-IIS/5.0 |
| 46 |
Content-Type: text/html; charset=iso-8859-1 |
| 47 |
Location: /12860001 |
| 48 |
Content-Length: 0 |
| 49 |
|
| 50 |
HTTP/1.1 404 Not Found |
| 51 |
Server: Microsoft-IIS/5.0 |
| 52 |
Content-Type: text/html; charset=iso-8859-1 |
| 53 |
Content-Length: 0 |
| 54 |
|
| 55 |
</datacheck> |
| 56 |
|
| 57 |
</reply> |
| 58 |
|
| 59 |
# Client-side |
| 60 |
<client> |
| 61 |
# |
| 62 |
<server> |
| 63 |
http |
| 64 |
</server> |
| 65 |
<features> |
| 66 |
crypto |
| 67 |
</features> |
| 68 |
<name> |
| 69 |
HTTP GET --digest increasing nonce-count |
| 70 |
</name> |
| 71 |
# This test is to ensure the nonce-count (nc) increases |
| 72 |
# https://github.com/curl/curl/pull/1251 |
| 73 |
<command> |
| 74 |
-u auser:apasswd --location --digest http://%HOSTIP:%HTTPPORT/1286 |
| 75 |
</command> |
| 76 |
</client> |
| 77 |
|
| 78 |
# Verify data after the test has been "shot" |
| 79 |
<verify> |
| 80 |
<strip> |
| 81 |
^User-Agent:.* |
| 82 |
</strip> |
| 83 |
# Reorder the fields in 'Authorization: Digest' header. |
| 84 |
# Since regular and SSPI digest auth header fields may not have the same order |
| 85 |
# or whitespace we homogenize so that both may be tested. Also: |
| 86 |
# - Remove the unique value from cnonce if in RFC format |
| 87 |
# - Remove the unique value from response if in RFC format |
| 88 |
# - Remove quotes from qop="auth" used by SSPI |
| 89 |
# The if statement is one line because runtests evaluates one line at a time. |
| 90 |
<strippart> |
| 91 |
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; } |
| 92 |
</strippart> |
| 93 |
<protocol> |
| 94 |
GET /1286 HTTP/1.1 |
| 95 |
Host: %HOSTIP:%HTTPPORT |
| 96 |
Accept: */* |
| 97 |
|
| 98 |
GET /1286 HTTP/1.1 |
| 99 |
Host: %HOSTIP:%HTTPPORT |
| 100 |
Authorization: Digest cnonce=REMOVED, nc=00000001, nonce="1053604144", qop=auth, realm="testrealm", response=REMOVED, uri="/1286", username="auser" |
| 101 |
Accept: */* |
| 102 |
|
| 103 |
GET /12860001 HTTP/1.1 |
| 104 |
Host: %HOSTIP:%HTTPPORT |
| 105 |
Authorization: Digest cnonce=REMOVED, nc=00000002, nonce="1053604144", qop=auth, realm="testrealm", response=REMOVED, uri="/12860001", username="auser" |
| 106 |
Accept: */* |
| 107 |
|
| 108 |
</protocol> |
| 109 |
</verify> |
| 110 |
</testcase> |