aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2transport.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-09-18 19:20:35 -0400
committerSteve French <smfrench@gmail.com>2012-09-24 22:46:31 -0400
commitfb308a6f22f7f4f3574dab6b36c4a3598e50cf05 (patch)
treefa948996f96a226db3ec0a8b3175bdc877115458 /fs/cifs/smb2transport.c
parent97bc00b39408a4180eeeaa976d02d37121488997 (diff)
cifs: teach signing routines how to deal with arrays of pages in a smb_rqst
Use the smb_send_rqst helper function to kmap each page in the array and update the hash for that chunk. Reviewed-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2transport.c')
-rw-r--r--fs/cifs/smb2transport.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
index 1850d9ec3c90..9ca4bcfb34c6 100644
--- a/fs/cifs/smb2transport.c
+++ b/fs/cifs/smb2transport.c
@@ -30,6 +30,7 @@
30#include <linux/uaccess.h> 30#include <linux/uaccess.h>
31#include <asm/processor.h> 31#include <asm/processor.h>
32#include <linux/mempool.h> 32#include <linux/mempool.h>
33#include <linux/highmem.h>
33#include "smb2pdu.h" 34#include "smb2pdu.h"
34#include "cifsglob.h" 35#include "cifsglob.h"
35#include "cifsproto.h" 36#include "cifsproto.h"
@@ -95,6 +96,16 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
95 } 96 }
96 } 97 }
97 98
99 /* now hash over the rq_pages array */
100 for (i = 0; i < rqst->rq_npages; i++) {
101 struct kvec p_iov;
102
103 cifs_rqst_page_to_kvec(rqst, i, &p_iov);
104 crypto_shash_update(&server->secmech.sdeschmacsha256->shash,
105 p_iov.iov_base, p_iov.iov_len);
106 kunmap(rqst->rq_pages[i]);
107 }
108
98 rc = crypto_shash_final(&server->secmech.sdeschmacsha256->shash, 109 rc = crypto_shash_final(&server->secmech.sdeschmacsha256->shash,
99 sigptr); 110 sigptr);
100 if (rc) 111 if (rc)