From 81a59f000e1d4a60a03081a1fc64aee46d6f0c3e Mon Sep 17 00:00:00 2001 From: Tom Lendacky Date: Mon, 6 Jan 2014 13:34:17 -0600 Subject: crypto: ccp - Change data length declarations to u64 When performing a hash operation if the amount of data buffered and a request at or near the maximum data length is received then the length calcuation could wrap causing an error in executing the hash operation. Fix this by using a u64 type for the input and output data lengths in all CCP operations. Signed-off-by: Tom Lendacky Signed-off-by: Herbert Xu --- drivers/crypto/ccp/ccp-crypto.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'drivers/crypto/ccp/ccp-crypto.h') diff --git a/drivers/crypto/ccp/ccp-crypto.h b/drivers/crypto/ccp/ccp-crypto.h index 13ea6ea4b45d..b222231b6169 100644 --- a/drivers/crypto/ccp/ccp-crypto.h +++ b/drivers/crypto/ccp/ccp-crypto.h @@ -110,7 +110,10 @@ struct ccp_aes_cmac_req_ctx { unsigned int null_msg; unsigned int final; - unsigned int hash_cnt; + struct scatterlist *src; + unsigned int nbytes; + + u64 hash_cnt; unsigned int hash_rem; struct sg_table data_sg; @@ -149,7 +152,10 @@ struct ccp_sha_req_ctx { unsigned int first; unsigned int final; - unsigned int hash_cnt; + struct scatterlist *src; + unsigned int nbytes; + + u64 hash_cnt; unsigned int hash_rem; struct sg_table data_sg; -- cgit