aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
authorShirish Pargaonkar <shirishpargaonkar@gmail.com>2013-08-29 09:35:11 -0400
committerSteve French <smfrench@gmail.com>2013-09-08 15:47:50 -0400
commit32811d242ff6f28da2ab18c90a15e32fd958e774 (patch)
treef267608208809072de59ac7d1bb073fc03d1d26f /fs/cifs/cifsglob.h
parent5c234aa5e33ed9037354a4c94d0d3e0350abe5eb (diff)
cifs: Start using per session key for smb2/3 for signature generation
Switch smb2 code to use per session session key and smb3 code to use per session signing key instead of per connection key to generate signatures. For that, we need to find a session to fetch the session key to generate signature to match for every request and response packet. We also forgo checking signature for a session setup response from the server. Acked-by: Jeff Layton <jlayton@samba.org> Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r--fs/cifs/cifsglob.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 20c7f8f4fba8..92798f74f0c3 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -366,8 +366,7 @@ struct smb_version_operations {
366 void (*set_lease_key)(struct inode *, struct cifs_fid *fid); 366 void (*set_lease_key)(struct inode *, struct cifs_fid *fid);
367 /* generate new lease key */ 367 /* generate new lease key */
368 void (*new_lease_key)(struct cifs_fid *fid); 368 void (*new_lease_key)(struct cifs_fid *fid);
369 /* The next two functions will need to be changed to per smb session */ 369 int (*generate_signingkey)(struct cifs_ses *);
370 void (*generate_signingkey)(struct TCP_Server_Info *server);
371 int (*calc_signature)(struct smb_rqst *rqst, 370 int (*calc_signature)(struct smb_rqst *rqst,
372 struct TCP_Server_Info *server); 371 struct TCP_Server_Info *server);
373 int (*query_mf_symlink)(const unsigned char *path, char *pbuf, 372 int (*query_mf_symlink)(const unsigned char *path, char *pbuf,
@@ -548,7 +547,6 @@ struct TCP_Server_Info {
548 int timeAdj; /* Adjust for difference in server time zone in sec */ 547 int timeAdj; /* Adjust for difference in server time zone in sec */
549 __u64 CurrentMid; /* multiplex id - rotating counter */ 548 __u64 CurrentMid; /* multiplex id - rotating counter */
550 char cryptkey[CIFS_CRYPTO_KEY_SIZE]; /* used by ntlm, ntlmv2 etc */ 549 char cryptkey[CIFS_CRYPTO_KEY_SIZE]; /* used by ntlm, ntlmv2 etc */
551 char smb3signingkey[SMB3_SIGN_KEY_SIZE]; /* for signing smb3 packets */
552 /* 16th byte of RFC1001 workstation name is always null */ 550 /* 16th byte of RFC1001 workstation name is always null */
553 char workstation_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL]; 551 char workstation_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL];
554 __u32 sequence_number; /* for signing, protected by srv_mutex */ 552 __u32 sequence_number; /* for signing, protected by srv_mutex */
@@ -731,6 +729,7 @@ struct cifs_ses {
731 bool need_reconnect:1; /* connection reset, uid now invalid */ 729 bool need_reconnect:1; /* connection reset, uid now invalid */
732#ifdef CONFIG_CIFS_SMB2 730#ifdef CONFIG_CIFS_SMB2
733 __u16 session_flags; 731 __u16 session_flags;
732 char smb3signingkey[SMB3_SIGN_KEY_SIZE]; /* for signing smb3 packets */
734#endif /* CONFIG_CIFS_SMB2 */ 733#endif /* CONFIG_CIFS_SMB2 */
735}; 734};
736 735