diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2015-05-21 03:11:06 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-05-21 23:25:53 -0400 |
commit | 6da9c2335e5f7124521a701e2a883b46e3d6a215 (patch) | |
tree | ccd90db0de723b82bea6ad6cc8bfa86ab1d02c7c /drivers/crypto | |
parent | f569525911d3dce024ff2b1908e16a20e9052338 (diff) |
crypto: ixp4xx - Use crypto_aead_maxauthsize
This patch uses the helper crypto_aead_maxauthsize instead of
directly dereferencing aead_alg.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/ixp4xx_crypto.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 46cd6966dc45..7ba495f75370 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c | |||
@@ -1097,7 +1097,7 @@ static int aead_setup(struct crypto_aead *tfm, unsigned int authsize) | |||
1097 | { | 1097 | { |
1098 | struct ixp_ctx *ctx = crypto_aead_ctx(tfm); | 1098 | struct ixp_ctx *ctx = crypto_aead_ctx(tfm); |
1099 | u32 *flags = &tfm->base.crt_flags; | 1099 | u32 *flags = &tfm->base.crt_flags; |
1100 | unsigned digest_len = crypto_aead_alg(tfm)->maxauthsize; | 1100 | unsigned digest_len = crypto_aead_maxauthsize(tfm); |
1101 | int ret; | 1101 | int ret; |
1102 | 1102 | ||
1103 | if (!ctx->enckey_len && !ctx->authkey_len) | 1103 | if (!ctx->enckey_len && !ctx->authkey_len) |
@@ -1139,7 +1139,7 @@ out: | |||
1139 | 1139 | ||
1140 | static int aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) | 1140 | static int aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) |
1141 | { | 1141 | { |
1142 | int max = crypto_aead_alg(tfm)->maxauthsize >> 2; | 1142 | int max = crypto_aead_maxauthsize(tfm) >> 2; |
1143 | 1143 | ||
1144 | if ((authsize>>2) < 1 || (authsize>>2) > max || (authsize & 3)) | 1144 | if ((authsize>>2) < 1 || (authsize>>2) > max || (authsize & 3)) |
1145 | return -EINVAL; | 1145 | return -EINVAL; |