crypto: authenc - Use crypto_aead_set_reqsize helper
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 11 May 2015 09:47:53 +0000 (17:47 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 13 May 2015 02:31:37 +0000 (10:31 +0800)
This patch uses the crypto_aead_set_reqsize helper to avoid directly
touching the internals of aead.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/authenc.c

index 325f37abd339632d180b2945a4a8b94d66332b61..3e852299afb434de793afedc5bc6d570150d8ae5 100644 (file)
@@ -570,13 +570,14 @@ static int crypto_authenc_init_tfm(struct crypto_tfm *tfm)
                            crypto_ahash_alignmask(auth) + 1) +
                      crypto_ablkcipher_ivsize(enc);
 
-       tfm->crt_aead.reqsize = sizeof(struct authenc_request_ctx) +
-                               ctx->reqoff +
-                               max_t(unsigned int,
-                               crypto_ahash_reqsize(auth) +
-                               sizeof(struct ahash_request),
-                               sizeof(struct skcipher_givcrypt_request) +
-                               crypto_ablkcipher_reqsize(enc));
+       crypto_aead_set_reqsize(__crypto_aead_cast(tfm),
+               sizeof(struct authenc_request_ctx) +
+               ctx->reqoff +
+               max_t(unsigned int,
+                       crypto_ahash_reqsize(auth) +
+                       sizeof(struct ahash_request),
+                       sizeof(struct skcipher_givcrypt_request) +
+                       crypto_ablkcipher_reqsize(enc)));
 
        return 0;