aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsencrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifsencrypt.c')
-rw-r--r--fs/cifs/cifsencrypt.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index 17d603ad5e34..ef95a272f73d 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -249,7 +249,7 @@ int setup_ntlm_response(struct cifsSesInfo *ses)
249 } 249 }
250 ses->auth_key.len = temp_len; 250 ses->auth_key.len = temp_len;
251 251
252 SMBNTencrypt(ses->password, ses->cryptKey, 252 SMBNTencrypt(ses->password, ses->server->cryptkey,
253 ses->auth_key.response + CIFS_SESS_KEY_SIZE); 253 ses->auth_key.response + CIFS_SESS_KEY_SIZE);
254 254
255 E_md4hash(ses->password, temp_key); 255 E_md4hash(ses->password, temp_key);
@@ -537,8 +537,12 @@ CalcNTLMv2_response(const struct cifsSesInfo *ses)
537 return rc; 537 return rc;
538 } 538 }
539 539
540 memcpy(ses->auth_key.response + offset, 540 if (ses->server->secType == RawNTLMSSP)
541 ses->cryptKey, CIFS_SERVER_CHALLENGE_SIZE); 541 memcpy(ses->auth_key.response + offset,
542 ses->cryptkey, CIFS_SERVER_CHALLENGE_SIZE);
543 else
544 memcpy(ses->auth_key.response + offset,
545 ses->server->cryptkey, CIFS_SERVER_CHALLENGE_SIZE);
542 crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash, 546 crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash,
543 ses->auth_key.response + offset, ses->auth_key.len - offset); 547 ses->auth_key.response + offset, ses->auth_key.len - offset);
544 548