test2030 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. HTTP Digest auth
  7. HTTP NTLM auth
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. <!-- Alternate the order that Digest and NTLM headers appear in responses to
  13. ensure that the order doesn't matter. -->
  14. <!--
  15. Explanation for the duplicate 400 requests:
  16. libcurl doesn't detect that a given Digest password is wrong already on the
  17. first 401 response (as the data400 gives). libcurl will instead consider the
  18. new response just as a duplicate and it sends another and detects the auth
  19. problem on the second 401 response!
  20. -->
  21. <!-- First request has NTLM auth, wrong password -->
  22. <data100>
  23. HTTP/1.1 401 Need Digest or NTLM auth
  24. Server: Microsoft-IIS/5.0
  25. Content-Type: text/html; charset=iso-8859-1
  26. Content-Length: 27
  27. WWW-Authenticate: NTLM
  28. WWW-Authenticate: Digest realm="testrealm", nonce="1"
  29. This is not the real page!
  30. </data100>
  31. <data1101>
  32. HTTP/1.1 401 NTLM intermediate
  33. Server: Microsoft-IIS/5.0
  34. Content-Type: text/html; charset=iso-8859-1
  35. Content-Length: 33
  36. WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
  37. This is still not the real page!
  38. </data1101>
  39. <data1102>
  40. HTTP/1.1 401 Sorry wrong password
  41. Server: Microsoft-IIS/5.0
  42. Content-Type: text/html; charset=iso-8859-1
  43. Content-Length: 29
  44. WWW-Authenticate: Digest realm="testrealm", nonce="2"
  45. WWW-Authenticate: NTLM
  46. This is a bad password page!
  47. </data1102>
  48. <!-- Second request has Digest auth, right password -->
  49. <data200>
  50. HTTP/1.1 401 Need Digest or NTLM auth (2)
  51. Server: Microsoft-IIS/5.0
  52. Content-Type: text/html; charset=iso-8859-1
  53. Content-Length: 27
  54. WWW-Authenticate: NTLM
  55. WWW-Authenticate: Digest realm="testrealm", nonce="3"
  56. This is not the real page!
  57. </data200>
  58. <data1200>
  59. HTTP/1.1 200 Things are fine in server land
  60. Server: Microsoft-IIS/5.0
  61. Content-Type: text/html; charset=iso-8859-1
  62. Content-Length: 32
  63. Finally, this is the real page!
  64. </data1200>
  65. <!-- Third request has NTLM auth, wrong password -->
  66. <data300>
  67. HTTP/1.1 401 Need Digest or NTLM auth (3)
  68. Server: Microsoft-IIS/5.0
  69. Content-Type: text/html; charset=iso-8859-1
  70. Content-Length: 27
  71. WWW-Authenticate: Digest realm="testrealm", nonce="4"
  72. WWW-Authenticate: NTLM
  73. This is not the real page!
  74. </data300>
  75. <data1301>
  76. HTTP/1.1 401 NTLM intermediate (2)
  77. Server: Microsoft-IIS/5.0
  78. Content-Type: text/html; charset=iso-8859-1
  79. Content-Length: 33
  80. WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
  81. This is still not the real page!
  82. </data1301>
  83. <data1302>
  84. HTTP/1.1 401 Sorry wrong password (2)
  85. Server: Microsoft-IIS/5.0
  86. Content-Type: text/html; charset=iso-8859-1
  87. Content-Length: 29
  88. WWW-Authenticate: NTLM
  89. WWW-Authenticate: Digest realm="testrealm", nonce="5"
  90. This is a bad password page!
  91. </data1302>
  92. <!-- Fourth request has Digest auth, wrong password -->
  93. <data400>
  94. HTTP/1.1 401 Need Digest or NTLM auth (4)
  95. Server: Microsoft-IIS/5.0
  96. Content-Type: text/html; charset=iso-8859-1
  97. Content-Length: 27
  98. WWW-Authenticate: Digest realm="testrealm", nonce="6"
  99. WWW-Authenticate: NTLM
  100. This is not the real page!
  101. </data400>
  102. <data1400>
  103. HTTP/1.1 401 Sorry wrong password (3)
  104. Server: Microsoft-IIS/5.0
  105. Content-Type: text/html; charset=iso-8859-1
  106. Content-Length: 29
  107. WWW-Authenticate: NTLM
  108. WWW-Authenticate: Digest realm="testrealm", nonce="7"
  109. This is a bad password page!
  110. </data1400>
  111. <!-- Fifth request has Digest auth, right password -->
  112. <data500>
  113. HTTP/1.1 401 Need Digest or NTLM auth (5)
  114. Server: Microsoft-IIS/5.0
  115. Content-Type: text/html; charset=iso-8859-1
  116. Content-Length: 27
  117. WWW-Authenticate: Digest realm="testrealm", nonce="8"
  118. WWW-Authenticate: NTLM
  119. This is not the real page!
  120. </data500>
  121. <data1500>
  122. HTTP/1.1 200 Things are fine in server land (2)
  123. Server: Microsoft-IIS/5.0
  124. Content-Type: text/html; charset=iso-8859-1
  125. Content-Length: 32
  126. Finally, this is the real page!
  127. </data1500>
  128. <datacheck>
  129. HTTP/1.1 401 NTLM intermediate
  130. Server: Microsoft-IIS/5.0
  131. Content-Type: text/html; charset=iso-8859-1
  132. Content-Length: 33
  133. WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
  134. HTTP/1.1 401 Sorry wrong password
  135. Server: Microsoft-IIS/5.0
  136. Content-Type: text/html; charset=iso-8859-1
  137. Content-Length: 29
  138. WWW-Authenticate: Digest realm="testrealm", nonce="2"
  139. WWW-Authenticate: NTLM
  140. This is a bad password page!
  141. HTTP/1.1 200 Things are fine in server land
  142. Server: Microsoft-IIS/5.0
  143. Content-Type: text/html; charset=iso-8859-1
  144. Content-Length: 32
  145. Finally, this is the real page!
  146. HTTP/1.1 401 NTLM intermediate (2)
  147. Server: Microsoft-IIS/5.0
  148. Content-Type: text/html; charset=iso-8859-1
  149. Content-Length: 33
  150. WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
  151. HTTP/1.1 401 Sorry wrong password (2)
  152. Server: Microsoft-IIS/5.0
  153. Content-Type: text/html; charset=iso-8859-1
  154. Content-Length: 29
  155. WWW-Authenticate: NTLM
  156. WWW-Authenticate: Digest realm="testrealm", nonce="5"
  157. This is a bad password page!
  158. HTTP/1.1 401 Sorry wrong password (3)
  159. Server: Microsoft-IIS/5.0
  160. Content-Type: text/html; charset=iso-8859-1
  161. Content-Length: 29
  162. WWW-Authenticate: NTLM
  163. WWW-Authenticate: Digest realm="testrealm", nonce="7"
  164. HTTP/1.1 401 Sorry wrong password (3)
  165. Server: Microsoft-IIS/5.0
  166. Content-Type: text/html; charset=iso-8859-1
  167. Content-Length: 29
  168. WWW-Authenticate: NTLM
  169. WWW-Authenticate: Digest realm="testrealm", nonce="7"
  170. This is a bad password page!
  171. HTTP/1.1 200 Things are fine in server land (2)
  172. Server: Microsoft-IIS/5.0
  173. Content-Type: text/html; charset=iso-8859-1
  174. Content-Length: 32
  175. Finally, this is the real page!
  176. </datacheck>
  177. </reply>
  178. # Client-side
  179. <client>
  180. <features>
  181. NTLM
  182. </features>
  183. <server>
  184. http
  185. </server>
  186. <tool>
  187. libauthretry
  188. </tool>
  189. <name>
  190. HTTP authorization retry (NTLM switching to Digest)
  191. </name>
  192. <setenv>
  193. # we force our own host name, in order to make the test machine independent
  194. CURL_GETHOSTNAME=curlhost
  195. # we try to use the LD_PRELOAD hack, if not a debug build
  196. LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
  197. </setenv>
  198. <command>
  199. http://%HOSTIP:%HTTPPORT/2030 ntlm digest
  200. </command>
  201. <precheck>
  202. chkhostname curlhost
  203. </precheck>
  204. </client>
  205. # Verify data after the test has been "shot"
  206. <verify>
  207. <strip>
  208. ^User-Agent:.*
  209. </strip>
  210. <protocol>
  211. GET /20300100 HTTP/1.1
  212. Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
  213. Host: %HOSTIP:%HTTPPORT
  214. Accept: */*
  215. GET /20300100 HTTP/1.1
  216. Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=
  217. Host: %HOSTIP:%HTTPPORT
  218. Accept: */*
  219. GET /20300200 HTTP/1.1
  220. Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/20300200", response="2f2d784ba53a0a307758a90e98d25c27"
  221. Host: %HOSTIP:%HTTPPORT
  222. Accept: */*
  223. GET /20300300 HTTP/1.1
  224. Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
  225. Host: %HOSTIP:%HTTPPORT
  226. Accept: */*
  227. GET /20300300 HTTP/1.1
  228. Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=
  229. Host: %HOSTIP:%HTTPPORT
  230. Accept: */*
  231. GET /20300400 HTTP/1.1
  232. Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/20300400", response="d6262e9147db08c62ff2f53b515861e8"
  233. Host: %HOSTIP:%HTTPPORT
  234. Accept: */*
  235. GET /20300400 HTTP/1.1
  236. Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/20300400", response="d6262e9147db08c62ff2f53b515861e8"
  237. Host: %HOSTIP:%HTTPPORT
  238. Accept: */*
  239. GET /20300500 HTTP/1.1
  240. Authorization: Digest username="testuser", realm="testrealm", nonce="7", uri="/20300500", response="198757e61163a779cf24ed4c49c1ad7d"
  241. Host: %HOSTIP:%HTTPPORT
  242. Accept: */*
  243. </protocol>
  244. </verify>
  245. </testcase>