summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/ccm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/ccm.c b/crypto/ccm.c
index 0a083342ec8c..b242fd0d3262 100644
--- a/crypto/ccm.c
+++ b/crypto/ccm.c
@@ -50,7 +50,10 @@ struct crypto_ccm_req_priv_ctx {
50 u32 flags; 50 u32 flags;
51 struct scatterlist src[3]; 51 struct scatterlist src[3];
52 struct scatterlist dst[3]; 52 struct scatterlist dst[3];
53 struct skcipher_request skreq; 53 union {
54 struct ahash_request ahreq;
55 struct skcipher_request skreq;
56 };
54}; 57};
55 58
56struct cbcmac_tfm_ctx { 59struct cbcmac_tfm_ctx {
@@ -181,7 +184,7 @@ static int crypto_ccm_auth(struct aead_request *req, struct scatterlist *plain,
181 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); 184 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req);
182 struct crypto_aead *aead = crypto_aead_reqtfm(req); 185 struct crypto_aead *aead = crypto_aead_reqtfm(req);
183 struct crypto_ccm_ctx *ctx = crypto_aead_ctx(aead); 186 struct crypto_ccm_ctx *ctx = crypto_aead_ctx(aead);
184 AHASH_REQUEST_ON_STACK(ahreq, ctx->mac); 187 struct ahash_request *ahreq = &pctx->ahreq;
185 unsigned int assoclen = req->assoclen; 188 unsigned int assoclen = req->assoclen;
186 struct scatterlist sg[3]; 189 struct scatterlist sg[3];
187 u8 *odata = pctx->odata; 190 u8 *odata = pctx->odata;
@@ -427,7 +430,7 @@ static int crypto_ccm_init_tfm(struct crypto_aead *tfm)
427 crypto_aead_set_reqsize( 430 crypto_aead_set_reqsize(
428 tfm, 431 tfm,
429 align + sizeof(struct crypto_ccm_req_priv_ctx) + 432 align + sizeof(struct crypto_ccm_req_priv_ctx) +
430 crypto_skcipher_reqsize(ctr)); 433 max(crypto_ahash_reqsize(mac), crypto_skcipher_reqsize(ctr)));
431 434
432 return 0; 435 return 0;
433 436