From 3eb2a7b80bdecf24fcf4c7fbb3fa94c0b981ef85 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 16 Jun 2004 02:08:30 +0000 Subject: r1161: Include a few more self-check NTLMSSP examples. Andrew Bartlett (This used to be commit 81678f8dc6fc7ef7218c7fad2b2766355927f21c) --- source4/torture/auth/ntlmssp.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'source4') 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; } -- cgit