svn commit: samba r3655 - in branches/SAMBA_4_0/source/libcli: auth
util
abartlet at samba.org
abartlet at samba.org
Wed Nov 10 10:58:15 GMT 2004
Author: abartlet
Date: 2004-11-10 10:58:15 +0000 (Wed, 10 Nov 2004)
New Revision: 3655
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3655
Log:
As required by the new torture test, add the LM session key output
parameter to SMBNTLMv2encrypt().
Andrew Bartlett
Modified:
branches/SAMBA_4_0/source/libcli/auth/ntlmssp.c
branches/SAMBA_4_0/source/libcli/util/smbencrypt.c
Changeset:
Modified: branches/SAMBA_4_0/source/libcli/auth/ntlmssp.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/auth/ntlmssp.c 2004-11-10 10:56:43 UTC (rev 3654)
+++ branches/SAMBA_4_0/source/libcli/auth/ntlmssp.c 2004-11-10 10:58:15 UTC (rev 3655)
@@ -1104,7 +1104,8 @@
ntlmssp_state->domain,
ntlmssp_state->password, &challenge_blob,
&struct_blob,
- &lm_response, &nt_response, &session_key)) {
+ &lm_response, &nt_response,
+ NULL, &session_key)) {
data_blob_free(&challenge_blob);
data_blob_free(&struct_blob);
return NT_STATUS_NO_MEMORY;
Modified: branches/SAMBA_4_0/source/libcli/util/smbencrypt.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/util/smbencrypt.c 2004-11-10 10:56:43 UTC (rev 3654)
+++ branches/SAMBA_4_0/source/libcli/util/smbencrypt.c 2004-11-10 10:58:15 UTC (rev 3655)
@@ -378,7 +378,7 @@
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 @@
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;
More information about the samba-cvs
mailing list