summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-12-01 03:19:43 +0000
committerAndrew Tridgell <tridge@samba.org>2003-12-01 03:19:43 +0000
commit5b46116923fb7c2945db128736b7f8113ea1a160 (patch)
tree7a5fec775d4f7d9fe5e20bcd5a4d13e5104be620 /source4/torture
parentb0531a38cc7135538d251440ac4fc2c887d9f335 (diff)
downloadsamba-5b46116923fb7c2945db128736b7f8113ea1a160.tar.gz
samba-5b46116923fb7c2945db128736b7f8113ea1a160.tar.bz2
samba-5b46116923fb7c2945db128736b7f8113ea1a160.zip
added netr_ServerReqChallenge and cleaned up byte array printing
(This used to be commit bb42107dccf3a384a4a5c029b4d2752e0898d7cb)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/netlogon.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index 6ea51a9253..0f22b1a44b 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -32,6 +32,8 @@ static BOOL test_LogonUasLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
r.in.username = lp_parm_string(-1, "torture", "username");
r.in.workstation = lp_netbios_name();
+ printf("Testing LogonUasLogon");
+
status = dcerpc_netr_LogonUasLogon(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
printf("LogonUasLogon - %s\n", nt_errstr(status));
@@ -42,6 +44,54 @@ static BOOL test_LogonUasLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
}
+static BOOL test_LogonUasLogoff(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+{
+ NTSTATUS status;
+ struct netr_LogonUasLogoff r;
+
+ r.in.server_name = NULL;
+ r.in.username = lp_parm_string(-1, "torture", "username");
+ r.in.workstation = lp_netbios_name();
+
+ printf("Testing LogonUasLogoff");
+
+ status = dcerpc_netr_LogonUasLogoff(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("LogonUasLogoff - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ return True;
+
+}
+
+static BOOL test_Challenge(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+{
+ NTSTATUS status;
+ struct netr_ServerReqChallenge r;
+ struct netr_Credential creds;
+
+ printf("Testing ServerReqChallenge");
+
+ ZERO_STRUCT(creds);
+
+ generate_random_buffer(creds.cred, sizeof(creds.cred), False);
+
+ r.in.server_name = NULL;
+ r.in.computer_name = lp_netbios_name();
+ r.in.credential = &creds;
+ r.out.credential = &creds;
+
+ status = dcerpc_netr_ServerReqChallenge(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("ServerReqChallenge - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ return True;
+
+}
+
BOOL torture_rpc_netlogon(int dummy)
{
@@ -66,6 +116,14 @@ BOOL torture_rpc_netlogon(int dummy)
ret = False;
}
+ if (!test_LogonUasLogoff(p, mem_ctx)) {
+ ret = False;
+ }
+
+ if (!test_Challenge(p, mem_ctx)) {
+ ret = False;
+ }
+
torture_rpc_close(p);
return ret;