aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/ccp/ccp-crypto-sha.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-15 01:30:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-15 01:30:52 -0400
commit6929c358972facf2999f8768815c40dd88514fc2 (patch)
treeb7180709c0d16ef5f2e7344b94b1ca6cfa7461bb /drivers/crypto/ccp/ccp-crypto-sha.c
parent23971bdffff5f7c904131dfb41c186711dc2c418 (diff)
parent4c5c30249452aaebf258751ea4222eba3dd3da4c (diff)
Merge tag 'llvmlinux-for-v3.18' of git://git.linuxfoundation.org/llvmlinux/kernel
Pull LLVM updates from Behan Webster: "These patches remove the use of VLAIS using a new SHASH_DESC_ON_STACK macro. Some of the previously accepted VLAIS removal patches haven't used this macro. I will push new patches to consistently use this macro in all those older cases for 3.19" [ More LLVM patches coming in through subsystem trees, and LLVM itself needs some fixes that are already in many distributions but not in released versions of LLVM. Some day this will all "just work" - Linus ] * tag 'llvmlinux-for-v3.18' of git://git.linuxfoundation.org/llvmlinux/kernel: crypto: LLVMLinux: Remove VLAIS usage from crypto/testmgr.c security, crypto: LLVMLinux: Remove VLAIS from ima_crypto.c crypto: LLVMLinux: Remove VLAIS usage from libcrc32c.c crypto: LLVMLinux: Remove VLAIS usage from crypto/hmac.c crypto, dm: LLVMLinux: Remove VLAIS usage from dm-crypt crypto: LLVMLinux: Remove VLAIS from crypto/.../qat_algs.c crypto: LLVMLinux: Remove VLAIS from crypto/omap_sham.c crypto: LLVMLinux: Remove VLAIS from crypto/n2_core.c crypto: LLVMLinux: Remove VLAIS from crypto/mv_cesa.c crypto: LLVMLinux: Remove VLAIS from crypto/ccp/ccp-crypto-sha.c btrfs: LLVMLinux: Remove VLAIS crypto: LLVMLinux: Add macro to remove use of VLAIS in crypto code
Diffstat (limited to 'drivers/crypto/ccp/ccp-crypto-sha.c')
-rw-r--r--drivers/crypto/ccp/ccp-crypto-sha.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c
index 873f23425245..96531571f7cf 100644
--- a/drivers/crypto/ccp/ccp-crypto-sha.c
+++ b/drivers/crypto/ccp/ccp-crypto-sha.c
@@ -198,10 +198,9 @@ static int ccp_sha_setkey(struct crypto_ahash *tfm, const u8 *key,
198{ 198{
199 struct ccp_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); 199 struct ccp_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm));
200 struct crypto_shash *shash = ctx->u.sha.hmac_tfm; 200 struct crypto_shash *shash = ctx->u.sha.hmac_tfm;
201 struct { 201
202 struct shash_desc sdesc; 202 SHASH_DESC_ON_STACK(sdesc, shash);
203 char ctx[crypto_shash_descsize(shash)]; 203
204 } desc;
205 unsigned int block_size = crypto_shash_blocksize(shash); 204 unsigned int block_size = crypto_shash_blocksize(shash);
206 unsigned int digest_size = crypto_shash_digestsize(shash); 205 unsigned int digest_size = crypto_shash_digestsize(shash);
207 int i, ret; 206 int i, ret;
@@ -216,11 +215,11 @@ static int ccp_sha_setkey(struct crypto_ahash *tfm, const u8 *key,
216 215
217 if (key_len > block_size) { 216 if (key_len > block_size) {
218 /* Must hash the input key */ 217 /* Must hash the input key */
219 desc.sdesc.tfm = shash; 218 sdesc->tfm = shash;
220 desc.sdesc.flags = crypto_ahash_get_flags(tfm) & 219 sdesc->flags = crypto_ahash_get_flags(tfm) &
221 CRYPTO_TFM_REQ_MAY_SLEEP; 220 CRYPTO_TFM_REQ_MAY_SLEEP;
222 221
223 ret = crypto_shash_digest(&desc.sdesc, key, key_len, 222 ret = crypto_shash_digest(sdesc, key, key_len,
224 ctx->u.sha.key); 223 ctx->u.sha.key);
225 if (ret) { 224 if (ret) {
226 crypto_ahash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); 225 crypto_ahash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);