--------------------- PatchSet 1974 Date: 2005/10/23 11:23:25 Author: hno Branch: negotiate Tag: (none) Log: Some simple scripts for verifying stateful authentication schemes Members: test-suite/negotiate_test.sh:1.1->1.1.2.1 test-suite/ntlm_test.sh:1.1->1.1.2.1 test-suite/run_negotiate_test.sh:1.1->1.1.2.1 test-suite/run_ntlm_test.sh:1.1->1.1.2.1 --- /dev/null Wed Feb 14 13:33:00 2007 +++ squid3/test-suite/negotiate_test.sh Wed Feb 14 13:35:24 2007 @@ -0,0 +1,31 @@ +#!/bin/sh +while read request; do +data="`echo $request | cut -c4-`" +blob="$$.$data-$challenge.`date +%s`" +case $request in + +??" USER="*) + echo "AF Success-$blob `echo $request|cut -d= -f2-`" + ;; + +??" BAD"*) + echo "BH `echo $request|cut -c7-`" + ;; + +??" ERR"*) + echo "NA Invalid-$blob `echo $request|cut -c7-`" + ;; + +"YR"*) + challenge="$data.`date +%s`" + echo "TT Challenge-$$.$challenge *" + ;; + +"KK"*) + echo "TT Negotiate-$$.$data-$challenge.`date +%s` *" + ;; +*) + echo "BH Invalid request" + ;; +esac +done --- /dev/null Wed Feb 14 13:33:00 2007 +++ squid3/test-suite/ntlm_test.sh Wed Feb 14 13:35:24 2007 @@ -0,0 +1,31 @@ +#!/bin/sh +while read request; do +data="`echo $request | cut -c4-`" +blob="$$.$data-$challenge.`date +%s`" +case $request in + +??" USER="*) + echo "AF `echo $request|cut -d= -f2-`" + ;; + +??" BAD"*) + echo "BH `echo $request|cut -c7-`" + ;; + +??" ERR"*) + echo "NA `echo $request|cut -c7-`" + ;; + +"YR"*) + challenge="$data.`date +%s`" + echo "TT Challenge-$$.$challenge" + ;; + +"KK"*) + echo "TT Negotiate-$$.$data-$challenge.`date +%s`" + ;; +*) + echo "BH Invalid request" + ;; +esac +done --- /dev/null Wed Feb 14 13:33:00 2007 +++ squid3/test-suite/run_negotiate_test.sh Wed Feb 14 13:35:24 2007 @@ -0,0 +1,9 @@ +#!/bin/sh +while read auth; do + echo "GET http://home.localdomain/~henrik/test.txt HTTP/1.0" + if [ -n "$auth" ]; then + echo "Proxy-Authorization: Negotiate $auth" + fi + echo "Proxy-Connection: keep-alive" + echo +done | tee -a /dev/fd/2 | nc localhost 3128 --- /dev/null Wed Feb 14 13:33:00 2007 +++ squid3/test-suite/run_ntlm_test.sh Wed Feb 14 13:35:24 2007 @@ -0,0 +1,9 @@ +#!/bin/sh +while read auth; do + echo "GET http://home.localdomain/~henrik/test.txt HTTP/1.0" + if [ -n "$auth" ]; then + echo "Proxy-Authorization: NTLM $auth" + fi + echo "Proxy-Connection: keep-alive" + echo +done | tee -a /dev/fd/2 | nc localhost 3128