diff options
author | Steve French <smfrench@gmail.com> | 2012-12-08 23:08:06 -0500 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-12-09 20:45:45 -0500 |
commit | 38107d45cf452761a74fe512190e23f36834d6dd (patch) | |
tree | bc0c08d21ba5b26b74b69edbe0ce27be951c10a2 /fs/cifs/smb2transport.c | |
parent | 1f6306806c1494bea51b93f96e105e93a96e3c22 (diff) |
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.c | 13 |
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 @@ | |||
39 | #include "smb2status.h" | 39 | #include "smb2status.h" |
40 | #include "smb2glob.h" | 40 | #include "smb2glob.h" |
41 | 41 | ||
42 | static int | 42 | int |
43 | smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) | 43 | smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) |
44 | { | 44 | { |
45 | int i, rc; | 45 | int i, rc; |
@@ -116,6 +116,13 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) | |||
116 | return rc; | 116 | return rc; |
117 | } | 117 | } |
118 | 118 | ||
119 | int | ||
120 | smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) | ||
121 | { | ||
122 | cFYI(1, "smb3 signatures not supported yet"); | ||
123 | return -EOPNOTSUPP; | ||
124 | } | ||
125 | |||
119 | /* must be called with server->srv_mutex held */ | 126 | /* must be called with server->srv_mutex held */ |
120 | static int | 127 | static int |
121 | smb2_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server) | 128 | 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) | |||
132 | return rc; | 139 | return rc; |
133 | } | 140 | } |
134 | 141 | ||
135 | rc = smb2_calc_signature(rqst, server); | 142 | rc = server->ops->calc_signature(rqst, server); |
136 | 143 | ||
137 | return rc; | 144 | return rc; |
138 | } | 145 | } |
@@ -168,7 +175,7 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) | |||
168 | memset(smb2_pdu->Signature, 0, SMB2_SIGNATURE_SIZE); | 175 | memset(smb2_pdu->Signature, 0, SMB2_SIGNATURE_SIZE); |
169 | 176 | ||
170 | mutex_lock(&server->srv_mutex); | 177 | mutex_lock(&server->srv_mutex); |
171 | rc = smb2_calc_signature(rqst, server); | 178 | rc = server->ops->calc_signature(rqst, server); |
172 | mutex_unlock(&server->srv_mutex); | 179 | mutex_unlock(&server->srv_mutex); |
173 | 180 | ||
174 | if (rc) | 181 | if (rc) |