summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-06-16 02:08:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:42 -0500
commit3eb2a7b80bdecf24fcf4c7fbb3fa94c0b981ef85 (patch)
tree5baee80286f93b130eee02949b0f51a10230dbeb /source4
parentc8e74106c49d66d73aa249e34daf8c9d1d408b00 (diff)
downloadsamba-3eb2a7b80bdecf24fcf4c7fbb3fa94c0b981ef85.tar.gz
samba-3eb2a7b80bdecf24fcf4c7fbb3fa94c0b981ef85.tar.bz2
samba-3eb2a7b80bdecf24fcf4c7fbb3fa94c0b981ef85.zip
r1161: Include a few more self-check NTLMSSP examples.
Andrew Bartlett (This used to be commit 81678f8dc6fc7ef7218c7fad2b2766355927f21c)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/auth/ntlmssp.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source4/torture/auth/ntlmssp.c b/source4/torture/auth/ntlmssp.c
index 2e1e1da145..c6415b05c7 100644
--- a/source4/torture/auth/ntlmssp.c
+++ b/source4/torture/auth/ntlmssp.c
@@ -53,5 +53,33 @@ BOOL torture_ntlmssp_self_check(int dummy)
dump_data_pw("NTLMSSP sig: ", sig.data, sig.length);
dump_data_pw("NTLMSSP sig: ", expected_sig.data, expected_sig.length);
+ ntlmssp_end(&ntlmssp_state);
+
+ if (!NT_STATUS_IS_OK(ntlmssp_client_start(&ntlmssp_state))) {
+ return False;
+ }
+
+ ntlmssp_state->session_key = strhex_to_data_blob("0102030405e538b0");
+ dump_data_pw("NTLMSSP session key: \n",
+ ntlmssp_state->session_key.data,
+ ntlmssp_state->session_key.length);
+
+ ntlmssp_state->server_use_session_keys = True;
+ ntlmssp_state->neg_flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_KEY_EXCH;
+
+ if (!NT_STATUS_IS_OK(status = ntlmssp_sign_init(ntlmssp_state))) {
+ printf("Failed to sign_init: %s\n", nt_errstr(status));
+ return False;
+ }
+
+ data = strhex_to_data_blob("6a43494653");
+ ntlmssp_sign_packet(ntlmssp_state, ntlmssp_state->mem_ctx,
+ data.data, data.length, &sig);
+
+ expected_sig = strhex_to_data_blob("0100000078010900397420fe0e5a0f89");
+
+ dump_data_pw("NTLMSSP sig: ", sig.data, sig.length);
+ dump_data_pw("NTLMSSP sig: ", expected_sig.data, expected_sig.length);
+
return True;
}