diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-02-16 22:10:48 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-02-16 22:10:48 +0000 |
commit | b7868582413a346a71997b23587450588d59b9d0 (patch) | |
tree | ef04fab435f60ebc833c0f2bcddb1c843c062236 /source3/libsmb | |
parent | 12074e79796a0e861825b748edc59c7af454ff79 (diff) | |
download | samba-b7868582413a346a71997b23587450588d59b9d0.tar.gz samba-b7868582413a346a71997b23587450588d59b9d0.tar.bz2 samba-b7868582413a346a71997b23587450588d59b9d0.zip |
Add the 'session key' output of the NTLMSSP exchange to the cli struct, so
it can be used for 'net rpc join'.
Also fix a bug in our server-side NTLMSSP code - a client without any domain
trust links to us may calculate the NTLMv2 response with "" as the domain.
Andrew Bartlett
(This used to be commit ddaa42423bc952e59b95362f5f5aa7cca10d1ad4)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/cliconnect.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 2b0b9abc9d..487b184dd6 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -248,6 +248,12 @@ static void set_signing_on_cli (struct cli_state *cli, uint8 user_session_key[16 } } +static void set_cli_session_key (struct cli_state *cli, DATA_BLOB session_key) +{ + memcpy(cli->user_session_key, session_key.data, MIN(session_key.length, sizeof(cli->user_session_key))); +} + + static void set_temp_signing_on_cli(struct cli_state *cli) { if (cli->sign_info.negotiated_smb_signing) @@ -367,6 +373,7 @@ static BOOL cli_session_setup_nt1(struct cli_state *cli, const char *user, if (session_key.data) { /* Have plaintext orginal */ + set_cli_session_key(cli, session_key); set_signing_on_cli(cli, session_key.data, nt_response); } @@ -559,6 +566,10 @@ static BOOL cli_session_setup_ntlmssp(struct cli_state *cli, const char *user, turn++; } while (NT_STATUS_EQUAL(nt_status, NT_STATUS_MORE_PROCESSING_REQUIRED)); + if (NT_STATUS_IS_OK(nt_status)) { + set_cli_session_key(cli, ntlmssp_state->session_key); + } + if (!NT_STATUS_IS_OK(ntlmssp_client_end(&ntlmssp_state))) { return False; } |