diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-05-09 14:42:20 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-05-09 14:42:20 +0000 |
commit | d06f95ca78834403a602e4c1d64e13e059f3017e (patch) | |
tree | 90149c08e79197a5f80ffa5f3dd1613dd30082ec /source3/libsmb/cliconnect.c | |
parent | 62c3744709c6c90584315b9863cbb2140a0c3d9b (diff) | |
download | samba-d06f95ca78834403a602e4c1d64e13e059f3017e.tar.gz samba-d06f95ca78834403a602e4c1d64e13e059f3017e.tar.bz2 samba-d06f95ca78834403a602e4c1d64e13e059f3017e.zip |
Finally get NTLMv2 working on the client!
With big thanks to tpot for the ethereal disector, and for the base code
behind this, we now fully support NTLMv2 as a client.
In particular, we support it with direct domain logons (tested with ntlm_auth
--diagnostics), with 'old style' session setups, and with NTLMSSP.
In fact, for NTLMSSP we recycle one of the parts of the server's reply directly...
(we might need to parse for unicode issues later).
In particular, a Win2k domain controller now supplies us with a session key
for this password, which means that doman joins, and non-spnego SMB signing
are now supported with NTLMv2!
Andrew Bartlett
(This used to be commit 9f6a26769d345d319ec167cd0e82a45e1207ed81)
Diffstat (limited to 'source3/libsmb/cliconnect.c')
-rw-r--r-- | source3/libsmb/cliconnect.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 982cbfff06..f58a458aba 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -257,14 +257,23 @@ static BOOL cli_session_setup_nt1(struct cli_state *cli, const char *user, if (passlen != 24) { if (lp_client_ntlmv2_auth()) { DATA_BLOB server_chal; - + DATA_BLOB names_blob; server_chal = data_blob(cli->secblob.data, MIN(cli->secblob.length, 8)); - if (!SMBNTLMv2encrypt(user, workgroup, pass, server_chal, - &lm_response, &nt_response, NULL, &session_key)) { + /* note that the 'workgroup' here is a best guess - we don't know + the server's domain at this point. The 'server name' is also + dodgy... + */ + names_blob = NTLMv2_generate_names_blob(cli->called.name, workgroup); + + if (!SMBNTLMv2encrypt(user, workgroup, pass, &server_chal, + &names_blob, + &lm_response, &nt_response, &session_key)) { + data_blob_free(&names_blob); data_blob_free(&server_chal); return False; } + data_blob_free(&names_blob); data_blob_free(&server_chal); } else { |