aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorShirish Pargaonkar <shirishpargaonkar@gmail.com>2010-10-28 10:53:07 -0400
committerSteve French <sfrench@us.ibm.com>2010-10-28 21:47:33 -0400
commitd3686d54c7902a303bd65d751226aa1647319863 (patch)
treeb4acd7dfc6c5ec2f254608a2f0ef11ef274861b8 /fs/cifs/connect.c
parentd3ba50b17aa7a391bb5b3dcd8d6ba7a02c4f031c (diff)
cifs: Cleanup and thus reduce smb session structure and fields used during authentication
Removed following fields from smb session structure cryptkey, ntlmv2_hash, tilen, tiblob and ntlmssp_auth structure is allocated dynamically only if the auth mech in NTLMSSP. response field within a session_key structure is used to initially store the target info (either plucked from type 2 challenge packet in case of NTLMSSP or fabricated in case of NTLMv2 without extended security) and then to store Message Authentication Key (mak) (session key + client response). Server challenge or cryptkey needed during a NTLMSSP authentication is now part of ntlmssp_auth structure which gets allocated and freed once authenticaiton process is done. Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 4d8004ce5834..9eb327defa1d 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1818,8 +1818,6 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
1818 if (ses == NULL) 1818 if (ses == NULL)
1819 goto get_ses_fail; 1819 goto get_ses_fail;
1820 1820
1821 ses->tilen = 0;
1822 ses->tiblob = NULL;
1823 /* new SMB session uses our server ref */ 1821 /* new SMB session uses our server ref */
1824 ses->server = server; 1822 ses->server = server;
1825 if (server->addr.sockAddr6.sin6_family == AF_INET6) 1823 if (server->addr.sockAddr6.sin6_family == AF_INET6)
@@ -1840,10 +1838,9 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
1840 goto get_ses_fail; 1838 goto get_ses_fail;
1841 } 1839 }
1842 if (volume_info->domainname) { 1840 if (volume_info->domainname) {
1843 int len = strlen(volume_info->domainname); 1841 ses->domainName = kstrdup(volume_info->domainname, GFP_KERNEL);
1844 ses->domainName = kmalloc(len + 1, GFP_KERNEL); 1842 if (!ses->domainName)
1845 if (ses->domainName) 1843 goto get_ses_fail;
1846 strcpy(ses->domainName, volume_info->domainname);
1847 } 1844 }
1848 ses->cred_uid = volume_info->cred_uid; 1845 ses->cred_uid = volume_info->cred_uid;
1849 ses->linux_uid = volume_info->linux_uid; 1846 ses->linux_uid = volume_info->linux_uid;
@@ -3213,6 +3210,8 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *ses,
3213 kfree(ses->auth_key.response); 3210 kfree(ses->auth_key.response);
3214 ses->auth_key.response = NULL; 3211 ses->auth_key.response = NULL;
3215 ses->auth_key.len = 0; 3212 ses->auth_key.len = 0;
3213 kfree(ses->ntlmssp);
3214 ses->ntlmssp = NULL;
3216 3215
3217 return rc; 3216 return rc;
3218} 3217}