summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2transport.c
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2012-12-09 05:08:06 +0100
committerSteve French <smfrench@gmail.com>2012-12-10 02:45:45 +0100
commit38107d45cf452761a74fe512190e23f36834d6dd (patch)
treebc0c08d21ba5b26b74b69edbe0ce27be951c10a2 /fs/cifs/smb2transport.c
parentcifs: deal with id_to_sid embedded sid reply corner case (diff)
downloadlinux-38107d45cf452761a74fe512190e23f36834d6dd.tar.xz
linux-38107d45cf452761a74fe512190e23f36834d6dd.zip
Do not send SMB2 signatures for SMB3 frames
Restructure code to make SMB2 vs. SMB3 signing a protocol specific op. SMB3 signing (AES_CMAC) is not enabled yet, but this restructuring at least makes sure we don't send an smb2 signature on an smb3 signed connection. A followon patch will add AES_CMAC and enable smb3 signing. Signed-off-by: Steve French <smfrench@gmail.com> Acked-by: Jeff Layton <jlayton@samba.org>
Diffstat (limited to 'fs/cifs/smb2transport.c')
-rw-r--r--fs/cifs/smb2transport.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
index 2a5fdf26f79f..8dd73e61d762 100644
--- a/fs/cifs/smb2transport.c
+++ b/fs/cifs/smb2transport.c
@@ -39,7 +39,7 @@
#include "smb2status.h"
#include "smb2glob.h"
-static int
+int
smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
{
int i, rc;
@@ -116,6 +116,13 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
return rc;
}
+int
+smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
+{
+ cFYI(1, "smb3 signatures not supported yet");
+ return -EOPNOTSUPP;
+}
+
/* must be called with server->srv_mutex held */
static int
smb2_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server)
@@ -132,7 +139,7 @@ smb2_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server)
return rc;
}
- rc = smb2_calc_signature(rqst, server);
+ rc = server->ops->calc_signature(rqst, server);
return rc;
}
@@ -168,7 +175,7 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
memset(smb2_pdu->Signature, 0, SMB2_SIGNATURE_SIZE);
mutex_lock(&server->srv_mutex);
- rc = smb2_calc_signature(rqst, server);
+ rc = server->ops->calc_signature(rqst, server);
mutex_unlock(&server->srv_mutex);
if (rc)