summaryrefslogtreecommitdiff
path: root/fs/cifs/transport.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-09-18 16:20:30 -0700
committerSteve French <smfrench@gmail.com>2012-09-24 21:46:28 -0500
commit3c1bf7e48e9e463b65b1b90da4500a93dd2b27a7 (patch)
treec16caed7a01a5b1438b5acd8aa45929889da10ad /fs/cifs/transport.c
parent009d344398bb3e844b31eb9e6a7860748c6f6dd3 (diff)
CIFS: Enable signing in SMB2
Use hmac-sha256 and rather than hmac-md5 that is used for CIFS/SMB. Signature field in SMB2 header is 16 bytes instead of 8 bytes. Automatically enable signing by client when requested by the server when signing ability is available to the client. Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r--fs/cifs/transport.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index d9b639b95fa8..c4d7825dfc0a 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -109,8 +109,8 @@ DeleteMidQEntry(struct mid_q_entry *midEntry)
mempool_free(midEntry, cifs_mid_poolp);
}
-static void
-delete_mid(struct mid_q_entry *mid)
+void
+cifs_delete_mid(struct mid_q_entry *mid)
{
spin_lock(&GlobalMid_Lock);
list_del(&mid->qhead);
@@ -419,7 +419,7 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
if (rc == 0)
return 0;
- delete_mid(mid);
+ cifs_delete_mid(mid);
add_credits(server, 1, optype);
wake_up(&server->request_q);
return rc;
@@ -532,7 +532,7 @@ cifs_setup_request(struct cifs_ses *ses, struct kvec *iov,
return rc;
rc = cifs_sign_smbv(iov, nvec, ses->server, &mid->sequence_number);
if (rc)
- delete_mid(mid);
+ cifs_delete_mid(mid);
*ret_mid = mid;
return rc;
}
@@ -652,11 +652,11 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
rc = ses->server->ops->check_receive(midQ, ses->server,
flags & CIFS_LOG_ERROR);
- /* mark it so buf will not be freed by delete_mid */
+ /* mark it so buf will not be freed by cifs_delete_mid */
if ((flags & CIFS_NO_RESP) == 0)
midQ->resp_buf = NULL;
out:
- delete_mid(midQ);
+ cifs_delete_mid(midQ);
add_credits(ses->server, credits, optype);
return rc;
@@ -762,7 +762,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
memcpy(out_buf, midQ->resp_buf, *pbytes_returned + 4);
rc = cifs_check_receive(midQ, ses->server, 0);
out:
- delete_mid(midQ);
+ cifs_delete_mid(midQ);
add_credits(ses->server, 1, 0);
return rc;
@@ -846,7 +846,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number);
if (rc) {
- delete_mid(midQ);
+ cifs_delete_mid(midQ);
mutex_unlock(&ses->server->srv_mutex);
return rc;
}
@@ -859,7 +859,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
mutex_unlock(&ses->server->srv_mutex);
if (rc < 0) {
- delete_mid(midQ);
+ cifs_delete_mid(midQ);
return rc;
}
@@ -880,7 +880,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
blocking lock to return. */
rc = send_cancel(ses->server, in_buf, midQ);
if (rc) {
- delete_mid(midQ);
+ cifs_delete_mid(midQ);
return rc;
}
} else {
@@ -892,7 +892,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
/* If we get -ENOLCK back the lock may have
already been removed. Don't exit in this case. */
if (rc && rc != -ENOLCK) {
- delete_mid(midQ);
+ cifs_delete_mid(midQ);
return rc;
}
}
@@ -929,7 +929,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
memcpy(out_buf, midQ->resp_buf, *pbytes_returned + 4);
rc = cifs_check_receive(midQ, ses->server, 0);
out:
- delete_mid(midQ);
+ cifs_delete_mid(midQ);
if (rstart && rc == -EACCES)
return -ERESTARTSYS;
return rc;