summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-03-01 16:57:46 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-03-01 22:04:46 +1100
commiteca3a14870f6632957a0ffeba1309d5da67cb9a1 (patch)
treead566461c77a0549a6b5c0172299055405495717 /source3/torture
parent74c6d2bcf44acfe3d275be0f96bd0026cdeeab8c (diff)
downloadsamba-eca3a14870f6632957a0ffeba1309d5da67cb9a1.tar.gz
samba-eca3a14870f6632957a0ffeba1309d5da67cb9a1.tar.bz2
samba-eca3a14870f6632957a0ffeba1309d5da67cb9a1.zip
s3-selftest: Add more tests for ntlm_auth
Diffstat (limited to 'source3/torture')
-rwxr-xr-xsource3/torture/test_ntlm_auth.py95
1 files changed, 76 insertions, 19 deletions
diff --git a/source3/torture/test_ntlm_auth.py b/source3/torture/test_ntlm_auth.py
index be725485a0..386bfb7f0c 100755
--- a/source3/torture/test_ntlm_auth.py
+++ b/source3/torture/test_ntlm_auth.py
@@ -181,33 +181,90 @@ def main():
server_out = server_out_w
os.close(server_out_r)
- # We're in the parent
- writeLine(client_out, "YR")
- buf = readLine(client_in)
+ if opts.client_helper == "ntlmssp-client-1" and opts.server_helper == "squid-2.5-ntlmssp":
- if buf.count("YR ", 0, 3) != 1:
- sys.exit(1)
+ # We're in the parent
+ writeLine(client_out, "YR")
+ buf = readLine(client_in)
+
+ if buf.count("YR ", 0, 3) != 1:
+ sys.exit(1)
+
+ writeLine(server_out, buf)
+ buf = readLine(server_in)
- writeLine(server_out, buf)
- buf = readLine(server_in)
+ if buf.count("TT ", 0, 3) != 1:
+ sys.exit(2)
- if buf.count("TT ", 0, 3) != 1:
- sys.exit(2)
+ writeLine(client_out, buf)
+ buf = readLine(client_in)
+
+ if buf.count("AF ", 0, 3) != 1:
+ sys.exit(3)
- writeLine(client_out, buf)
- buf = readLine(client_in)
+ # Client sends 'AF <base64 blob>' but server expects 'KK <abse64 blob>'
+ buf = buf.replace("AF", "KK", 1)
+
+ writeLine(server_out, buf)
+ buf = readLine(server_in)
+
+ if buf.count("AF ", 0, 3) != 1:
+ sys.exit(4)
+
+
+ if opts.client_helper == "ntlmssp-client-1" and opts.server_helper == "gss-spnego":
+ # We're in the parent
+ writeLine(client_out, "YR")
+ buf = readLine(client_in)
+
+ if buf.count("YR ", 0, 3) != 1:
+ sys.exit(1)
+
+ writeLine(server_out, buf)
+ buf = readLine(server_in)
+
+ if buf.count("TT ", 0, 3) != 1:
+ sys.exit(2)
+
+ writeLine(client_out, buf)
+ buf = readLine(client_in)
+
+ if buf.count("AF ", 0, 3) != 1:
+ sys.exit(3)
+
+ # Client sends 'AF <base64 blob>' but server expects 'KK <abse64 blob>'
+ buf = buf.replace("AF", "KK", 1)
+
+ writeLine(server_out, buf)
+ buf = readLine(server_in)
+
+ if buf.count("AF * ", 0, 5) != 1:
+ sys.exit(4)
+
+
+ if opts.client_helper == "gss-spnego-client" and opts.server_helper == "gss-spnego":
+ # We're in the parent
+ writeLine(server_out, "YR")
+ buf = readLine(server_in)
+
+ while True:
+ if buf.count("AF ", 0, 3) != 1 and buf.count("TT ", 0, 3) != 1:
+ sys.exit(1)
- if buf.count("AF ", 0, 3) != 1:
- sys.exit(3)
+ writeLine(client_out, buf)
+ buf = readLine(client_in)
+
+ if buf.count("AF", 0, 2) == 1:
+ break
- # Client sends 'AF <base64 blob>' but server expects 'KK <abse64 blob>'
- buf = buf.replace("AF", "KK", 1)
+ if buf.count("AF ", 0, 5) != 1 and buf.count("KK ", 0, 3) != 1 and buf.count("TT ", 0, 3) != 1:
+ sys.exit(2)
- writeLine(server_out, buf)
- buf = readLine(server_in)
+ writeLine(server_out, buf)
+ buf = readLine(server_in)
- if buf.count("AF ", 0, 3) != 1:
- sys.exit(4)
+ if buf.count("AF * ", 0, 5) == 1:
+ break
if opts.client_helper == "ntlmssp-client-1":
writeLine(client_out, "GK")