diff options
author | Andrew Bartlett <abartlet@samba.org> | 2004-11-10 10:58:15 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:42 -0500 |
commit | 5805c780dc6d78c2cc4a86d07155db807a80bac7 (patch) | |
tree | 54101126806edf9f1fa3fe8df8c0f891c4d89688 /source4/libcli/util | |
parent | cb700e90c22d9e301a05142699df7b64402a08d8 (diff) | |
download | samba-5805c780dc6d78c2cc4a86d07155db807a80bac7.tar.gz samba-5805c780dc6d78c2cc4a86d07155db807a80bac7.tar.bz2 samba-5805c780dc6d78c2cc4a86d07155db807a80bac7.zip |
r3655: As required by the new torture test, add the LM session key output
parameter to SMBNTLMv2encrypt().
Andrew Bartlett
(This used to be commit 75ff351faf0a3231e17f000b006beb9cb545d905)
Diffstat (limited to 'source4/libcli/util')
-rw-r--r-- | source4/libcli/util/smbencrypt.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/libcli/util/smbencrypt.c b/source4/libcli/util/smbencrypt.c index 6034c0e327..d327b53f9d 100644 --- a/source4/libcli/util/smbencrypt.c +++ b/source4/libcli/util/smbencrypt.c @@ -378,7 +378,7 @@ BOOL SMBNTLMv2encrypt(const char *user, const char *domain, const char *password const DATA_BLOB *server_chal, const DATA_BLOB *names_blob, DATA_BLOB *lm_response, DATA_BLOB *nt_response, - DATA_BLOB *user_session_key) + DATA_BLOB *lm_session_key, DATA_BLOB *user_session_key) { uint8_t nt_hash[16]; uint8_t ntlm_v2_hash[16]; @@ -408,6 +408,13 @@ BOOL SMBNTLMv2encrypt(const char *user, const char *domain, const char *password if (lm_response) { *lm_response = LMv2_generate_response(ntlm_v2_hash, server_chal); + if (lm_session_key) { + *lm_session_key = data_blob(NULL, 16); + + /* The NTLMv2 calculations also provide a session key, for signing etc later */ + /* use only the first 16 bytes of lm_response for session key */ + SMBsesskeygen_ntv2(ntlm_v2_hash, lm_response->data, lm_session_key->data); + } } return True; |