diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-09-18 19:20:35 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-09-24 22:46:31 -0400 |
commit | fb308a6f22f7f4f3574dab6b36c4a3598e50cf05 (patch) | |
tree | fa948996f96a226db3ec0a8b3175bdc877115458 /fs/cifs/cifsencrypt.c | |
parent | 97bc00b39408a4180eeeaa976d02d37121488997 (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/cifsencrypt.c')
-rw-r--r-- | fs/cifs/cifsencrypt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index af520522ef20..652f5051be09 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "ntlmssp.h" | 29 | #include "ntlmssp.h" |
30 | #include <linux/ctype.h> | 30 | #include <linux/ctype.h> |
31 | #include <linux/random.h> | 31 | #include <linux/random.h> |
32 | #include <linux/highmem.h> | ||
32 | 33 | ||
33 | /* | 34 | /* |
34 | * Calculate and return the CIFS signature based on the mac key and SMB PDU. | 35 | * Calculate and return the CIFS signature based on the mac key and SMB PDU. |
@@ -93,6 +94,16 @@ static int cifs_calc_signature(struct smb_rqst *rqst, | |||
93 | } | 94 | } |
94 | } | 95 | } |
95 | 96 | ||
97 | /* now hash over the rq_pages array */ | ||
98 | for (i = 0; i < rqst->rq_npages; i++) { | ||
99 | struct kvec p_iov; | ||
100 | |||
101 | cifs_rqst_page_to_kvec(rqst, i, &p_iov); | ||
102 | crypto_shash_update(&server->secmech.sdescmd5->shash, | ||
103 | p_iov.iov_base, p_iov.iov_len); | ||
104 | kunmap(rqst->rq_pages[i]); | ||
105 | } | ||
106 | |||
96 | rc = crypto_shash_final(&server->secmech.sdescmd5->shash, signature); | 107 | rc = crypto_shash_final(&server->secmech.sdescmd5->shash, signature); |
97 | if (rc) | 108 | if (rc) |
98 | cERROR(1, "%s: Could not generate md5 hash", __func__); | 109 | cERROR(1, "%s: Could not generate md5 hash", __func__); |