1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-02 08:58:33 +03:00

r100: remember the user session key during session setup so it can be used in various crypto

routines
(This used to be commit f6cf9020c8899e784385ea0e14fa465685441ee6)
This commit is contained in:
Andrew Tridgell 2004-04-07 07:18:37 +00:00 committed by Gerald (Jerry) Carter
parent 43caaa54e7
commit a8a42e7f53
3 changed files with 15 additions and 0 deletions

View File

@ -66,6 +66,10 @@ struct cli_negotiate {
unsigned int writebraw_supported:1;
const char *server_domain;
/* remember the session key for data encryption in various sub-protocols
such as LSA */
uint8 user_session_key[16];
};
/* this is the context for a SMB socket associated with the socket itself */

View File

@ -247,6 +247,8 @@ static void setup_nt1_signing(struct cli_transport *transport, const char *passw
SMBsesskeygen_ntv1(nt_hash, NULL, session_key);
nt_response = nt_blob(password, transport->negotiate.secblob);
cli_transport_set_session_key(transport, session_key);
cli_transport_simple_set_signing(transport, session_key, nt_response);
}

View File

@ -222,3 +222,12 @@ BOOL cli_transport_select(struct cli_transport *transport)
return True;
}
/*
store the user session key for a transport
*/
void cli_transport_set_session_key(struct cli_transport *transport,
const uint8 session_key[16])
{
memcpy(transport->negotiate.user_session_key, session_key, 16);
}