From 810831434a03b68064476124828e607bd367d98d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 8 May 2004 02:48:24 +0000 Subject: r582: added the LMSessKey in SamInfo and SamInfo2, thanks to work by abartlet added test code for SamLogon validation level 2 and 3, so we test both SamInfo and SamInfo2 (This used to be commit 321dbb61cc0743379ceb6b8fff6a0ca37f308bc2) --- source4/torture/rpc/netlogon.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 26889e58c8..e06613a3d9 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -346,6 +346,8 @@ static BOOL test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) const char *username = lp_parm_string(-1, "torture", "username"); const char *password = lp_parm_string(-1, "torture", "password"); struct netr_CredentialState creds; + int i; + BOOL ret = True; if (!test_SetupCredentials2(p, mem_ctx, &creds)) { return False; @@ -366,31 +368,33 @@ static BOOL test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) ninfo.lm.data = talloc(mem_ctx, 24); SMBencrypt(password, ninfo.challenge, ninfo.lm.data); - ZERO_STRUCT(auth2); - - creds_client_authenticator(&creds, &auth); - r.in.server_name = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p)); r.in.workstation = TEST_MACHINE_NAME; r.in.credential = &auth; r.in.authenticator = &auth2; r.in.logon_level = 2; r.in.logon.network = &ninfo; - r.in.validation_level = 2; - printf("Testing SamLogon\n"); + for (i=2;i<=3;i++) { + ZERO_STRUCT(auth2); + creds_client_authenticator(&creds, &auth); - status = dcerpc_netr_LogonSamLogon(p, mem_ctx, &r); - if (!NT_STATUS_IS_OK(status)) { - printf("LogonSamLogon - %s\n", nt_errstr(status)); - return False; - } + r.in.validation_level = i; - if (!creds_client_check(&creds, &r.out.authenticator->cred)) { - printf("Credential chaining failed\n"); + printf("Testing SamLogon with validation level %d\n", i); + + status = dcerpc_netr_LogonSamLogon(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("LogonSamLogon - %s\n", nt_errstr(status)); + ret = False; + } + + if (!creds_client_check(&creds, &r.out.authenticator->cred)) { + printf("Credential chaining failed\n"); + } } - return True; + return ret; } -- cgit