summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-06-15 22:27:05 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2016-06-20 19:24:37 +0800
commit4cdf2b0415e486ca89f94d4e65dba93af2be6a5b (patch)
tree89e19c02ce08ce4371c8169c9e16d0c835148e4d
parente67b2e6dea5cd453d5b43dc6bc8338c6b78da814 (diff)
downloadlinux-crypto-4cdf2b0415e486ca89f94d4e65dba93af2be6a5b.tar.gz
linux-crypto-4cdf2b0415e486ca89f94d4e65dba93af2be6a5b.zip
crypto: gcm - Filter out async ghash if necessary
As it is if you ask for a sync gcm you may actually end up with an async one because it does not filter out async implementations of ghash. This patch fixes this by adding the necessary filter when looking for ghash. Cc: stable@vger.kernel.org Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/gcm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/gcm.c b/crypto/gcm.c
index bec329b3..d9ea5f9c 100644
--- a/crypto/gcm.c
+++ b/crypto/gcm.c
@@ -639,7 +639,9 @@ static int crypto_gcm_create_common(struct crypto_template *tmpl,
ghash_alg = crypto_find_alg(ghash_name, &crypto_ahash_type,
CRYPTO_ALG_TYPE_HASH,
- CRYPTO_ALG_TYPE_AHASH_MASK);
+ CRYPTO_ALG_TYPE_AHASH_MASK |
+ crypto_requires_sync(algt->type,
+ algt->mask));
if (IS_ERR(ghash_alg))
return PTR_ERR(ghash_alg);