aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
authorShirish Pargaonkar <shirishpargaonkar@gmail.com>2010-10-13 19:15:00 -0400
committerSteve French <sfrench@us.ibm.com>2010-10-14 14:05:19 -0400
commit5d0d28824c76409f0d1a645bf0ae81318c8ffa42 (patch)
tree592838282fc891dc9a51424e0f57c0694ad31075 /fs/cifs/cifsglob.h
parentd7c86ff8cd00abc730fe5d031f43dc9138b6324e (diff)
NTLM authentication and signing - Calculate auth response per smb session
Start calculation auth response within a session. Move/Add pertinet data structures like session key, server challenge and ntlmv2_hash in a session structure. We should do the calculations within a session before copying session key and response over to server data structures because a session setup can fail. Only after a very first smb session succeeds, it copies/makes its session key, session key of smb connection. This key stays with the smb connection throughout its life. Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r--fs/cifs/cifsglob.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index e2b760ef22ff..6c69bd762498 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -179,12 +179,10 @@ struct TCP_Server_Info {
179 int capabilities; /* allow selective disabling of caps by smb sess */ 179 int capabilities; /* allow selective disabling of caps by smb sess */
180 int timeAdj; /* Adjust for difference in server time zone in sec */ 180 int timeAdj; /* Adjust for difference in server time zone in sec */
181 __u16 CurrentMid; /* multiplex id - rotating counter */ 181 __u16 CurrentMid; /* multiplex id - rotating counter */
182 char cryptKey[CIFS_CRYPTO_KEY_SIZE];
183 /* 16th byte of RFC1001 workstation name is always null */ 182 /* 16th byte of RFC1001 workstation name is always null */
184 char workstation_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL]; 183 char workstation_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL];
185 __u32 sequence_number; /* needed for CIFS PDU signature */ 184 __u32 sequence_number; /* needed for CIFS PDU signature */
186 struct session_key session_key; 185 struct session_key session_key;
187 char ntlmv2_hash[16];
188 unsigned long lstrp; /* when we got last response from this server */ 186 unsigned long lstrp; /* when we got last response from this server */
189 u16 dialect; /* dialect index that server chose */ 187 u16 dialect; /* dialect index that server chose */
190 /* extended security flavors that server supports */ 188 /* extended security flavors that server supports */
@@ -192,6 +190,7 @@ struct TCP_Server_Info {
192 bool sec_mskerberos; /* supports legacy MS Kerberos */ 190 bool sec_mskerberos; /* supports legacy MS Kerberos */
193 bool sec_kerberosu2u; /* supports U2U Kerberos */ 191 bool sec_kerberosu2u; /* supports U2U Kerberos */
194 bool sec_ntlmssp; /* supports NTLMSSP */ 192 bool sec_ntlmssp; /* supports NTLMSSP */
193 bool session_estab; /* mark when very first sess is established */
195#ifdef CONFIG_CIFS_FSCACHE 194#ifdef CONFIG_CIFS_FSCACHE
196 struct fscache_cookie *fscache; /* client index cache cookie */ 195 struct fscache_cookie *fscache; /* client index cache cookie */
197#endif 196#endif
@@ -223,6 +222,9 @@ struct cifsSesInfo {
223 char userName[MAX_USERNAME_SIZE + 1]; 222 char userName[MAX_USERNAME_SIZE + 1];
224 char *domainName; 223 char *domainName;
225 char *password; 224 char *password;
225 char cryptKey[CIFS_CRYPTO_KEY_SIZE];
226 struct session_key auth_key;
227 char ntlmv2_hash[16];
226 unsigned int tilen; /* length of the target info blob */ 228 unsigned int tilen; /* length of the target info blob */
227 unsigned char *tiblob; /* target info blob in challenge response */ 229 unsigned char *tiblob; /* target info blob in challenge response */
228 bool need_reconnect:1; /* connection reset, uid now invalid */ 230 bool need_reconnect:1; /* connection reset, uid now invalid */