From 0511b5df160c1276b59db8f57a27e289800d1915 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Oct 2005 05:56:44 +0000 Subject: r11298: Consolidate the 'short' samlogon tests, and move to using the credentials system for password -> NTLM translation. Andrew Bartlett (This used to be commit d22cbf1b0cae9ca211c916320754d5edfe360c30) --- source4/torture/rpc/schannel.c | 89 ------------------------------------------ 1 file changed, 89 deletions(-) (limited to 'source4/torture/rpc/schannel.c') diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c index 1010572003..4b9c4a8235 100644 --- a/source4/torture/rpc/schannel.c +++ b/source4/torture/rpc/schannel.c @@ -143,95 +143,6 @@ static BOOL test_lsa_ops(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) } -/* - try a netlogon SamLogon -*/ -static BOOL test_netlogon_ops(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, - struct cli_credentials *credentials, - struct creds_CredentialState *creds) -{ - NTSTATUS status; - struct netr_LogonSamLogon r; - struct netr_Authenticator auth, auth2; - struct netr_NetworkInfo ninfo; - DATA_BLOB names_blob, chal, lm_resp, nt_resp; - int i; - BOOL ret = True; - int flags = CLI_CRED_NTLM_AUTH; - if (lp_client_lanman_auth()) { - flags |= CLI_CRED_LANMAN_AUTH; - } - - if (lp_client_ntlmv2_auth()) { - flags |= CLI_CRED_NTLMv2_AUTH; - } - - cli_credentials_get_ntlm_username_domain(cmdline_credentials, mem_ctx, - &ninfo.identity_info.account_name.string, - &ninfo.identity_info.domain_name.string); - - generate_random_buffer(ninfo.challenge, - sizeof(ninfo.challenge)); - chal = data_blob_const(ninfo.challenge, - sizeof(ninfo.challenge)); - - names_blob = NTLMv2_generate_names_blob(mem_ctx, cli_credentials_get_workstation(credentials), - cli_credentials_get_domain(credentials)); - - status = cli_credentials_get_ntlm_response(cmdline_credentials, mem_ctx, - &flags, - chal, - names_blob, - &lm_resp, &nt_resp, - NULL, NULL); - if (!NT_STATUS_IS_OK(status)) { - printf("cli_credentials_get_ntlm_response failed: %s\n", - nt_errstr(status)); - return False; - } - - ninfo.lm.data = lm_resp.data; - ninfo.lm.length = lm_resp.length; - - ninfo.nt.data = nt_resp.data; - ninfo.nt.length = nt_resp.length; - - ninfo.identity_info.parameter_control = 0; - ninfo.identity_info.logon_id_low = 0; - ninfo.identity_info.logon_id_high = 0; - ninfo.identity_info.workstation.string = cli_credentials_get_workstation(credentials); - - r.in.server_name = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p)); - r.in.workstation = cli_credentials_get_workstation(credentials); - r.in.credential = &auth; - r.in.return_authenticator = &auth2; - r.in.logon_level = 2; - r.in.logon.network = &ninfo; - - printf("Testing LogonSamLogon with name %s\n", ninfo.identity_info.account_name.string); - - for (i=2;i<3;i++) { - ZERO_STRUCT(auth2); - creds_client_authenticator(creds, &auth); - - r.in.validation_level = i; - - status = dcerpc_netr_LogonSamLogon(p, mem_ctx, &r); - if (!NT_STATUS_IS_OK(status)) { - printf("LogonSamLogon failed: %s\n", - nt_errstr(status)); - return False; - } - - if (!creds_client_check(creds, &r.out.return_authenticator->cred)) { - printf("Credential chaining failed\n"); - ret = False; - } - - } - return ret; -} - /* test a schannel connection with the given flags */ -- cgit