summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-04-06 08:11:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:06 -0500
commitd17425ed52b086b7046708a207e849271cedc804 (patch)
tree2b36b39f0332bed0281c30cfd75c47050a37704b /source3/libsmb
parent90b168bfc8bbbac3f96a82911260c8aa2d2e6a09 (diff)
downloadsamba-d17425ed52b086b7046708a207e849271cedc804.tar.gz
samba-d17425ed52b086b7046708a207e849271cedc804.tar.bz2
samba-d17425ed52b086b7046708a207e849271cedc804.zip
r69: Global rename of 'nt_session_key' -> 'user_session_key'. The session key could
be anything, and may not be based on anything 'NT'. This is also what microsoft calls it. (This used to be commit 724e8d3f33719543146280062435c69a835c491e)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/ntlmssp.c20
-rw-r--r--source3/libsmb/smbencrypt.c8
2 files changed, 14 insertions, 14 deletions
diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c
index ddc2e0325f..7f451176ec 100644
--- a/source3/libsmb/ntlmssp.c
+++ b/source3/libsmb/ntlmssp.c
@@ -500,7 +500,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
const DATA_BLOB request, DATA_BLOB *reply)
{
DATA_BLOB encrypted_session_key = data_blob(NULL, 0);
- DATA_BLOB nt_session_key = data_blob(NULL, 0);
+ DATA_BLOB user_session_key = data_blob(NULL, 0);
DATA_BLOB lm_session_key = data_blob(NULL, 0);
DATA_BLOB session_key = data_blob(NULL, 0);
uint32 ntlmssp_command, auth_flags;
@@ -663,19 +663,19 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
/* Finally, actually ask if the password is OK */
if (!NT_STATUS_IS_OK(nt_status = ntlmssp_state->check_password(ntlmssp_state,
- &nt_session_key, &lm_session_key))) {
+ &user_session_key, &lm_session_key))) {
data_blob_free(&encrypted_session_key);
return nt_status;
}
- dump_data_pw("NT session key:\n", nt_session_key.data, nt_session_key.length);
+ dump_data_pw("NT session key:\n", user_session_key.data, user_session_key.length);
dump_data_pw("LM first-8:\n", lm_session_key.data, lm_session_key.length);
/* Handle the different session key derivation for NTLM2 */
if (doing_ntlm2) {
- if (nt_session_key.data && nt_session_key.length == 16) {
+ if (user_session_key.data && user_session_key.length == 16) {
session_key = data_blob_talloc(ntlmssp_state->mem_ctx, NULL, 16);
- hmac_md5(nt_session_key.data, session_nonce,
+ hmac_md5(user_session_key.data, session_nonce,
sizeof(session_nonce), session_key.data);
DEBUG(10,("ntlmssp_server_auth: Created NTLM2 session key.\n"));
dump_data_pw("NTLM2 session key:\n", session_key.data, session_key.length);
@@ -702,8 +702,8 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
DEBUG(10,("ntlmssp_server_auth: Failed to create NTLM session key.\n"));
session_key = data_blob(NULL, 0);
}
- } else if (nt_session_key.data) {
- session_key = nt_session_key;
+ } else if (user_session_key.data) {
+ session_key = user_session_key;
DEBUG(10,("ntlmssp_server_auth: Using unmodified nt session key.\n"));
dump_data_pw("unmodified session key:\n", session_key.data, session_key.length);
} else if (lm_session_key.data) {
@@ -958,7 +958,7 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
uchar nt_hash[16];
uchar session_nonce[16];
uchar session_nonce_hash[16];
- uchar nt_session_key[16];
+ uchar user_session_key[16];
E_md4hash(ntlmssp_state->password, nt_hash);
lm_response = data_blob_talloc(ntlmssp_state->mem_ctx, NULL, 24);
@@ -984,8 +984,8 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
session_key = data_blob_talloc(ntlmssp_state->mem_ctx, NULL, 16);
- SMBsesskeygen_ntv1(nt_hash, NULL, nt_session_key);
- hmac_md5(nt_session_key, session_nonce, sizeof(session_nonce), session_key.data);
+ SMBsesskeygen_ntv1(nt_hash, NULL, user_session_key);
+ hmac_md5(user_session_key, session_nonce, sizeof(session_nonce), session_key.data);
dump_data_pw("NTLM2 session key:\n", session_key.data, session_key.length);
} else {
diff --git a/source3/libsmb/smbencrypt.c b/source3/libsmb/smbencrypt.c
index 270a659e57..3b8a375bea 100644
--- a/source3/libsmb/smbencrypt.c
+++ b/source3/libsmb/smbencrypt.c
@@ -420,7 +420,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 *nt_session_key)
+ DATA_BLOB *user_session_key)
{
uchar nt_hash[16];
uchar ntlm_v2_hash[16];
@@ -437,12 +437,12 @@ BOOL SMBNTLMv2encrypt(const char *user, const char *domain, const char *password
if (nt_response) {
*nt_response = NTLMv2_generate_response(ntlm_v2_hash, server_chal,
names_blob);
- if (nt_session_key) {
- *nt_session_key = data_blob(NULL, 16);
+ if (user_session_key) {
+ *user_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 nt_response for session key */
- SMBsesskeygen_ntv2(ntlm_v2_hash, nt_response->data, nt_session_key->data);
+ SMBsesskeygen_ntv2(ntlm_v2_hash, nt_response->data, user_session_key->data);
}
}