diff options
author | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2018-03-07 13:57:24 +0100 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2018-03-07 13:57:24 +0100 |
commit | 249b6bae56fc18f4512fe5bc085f71cc235c0735 (patch) | |
tree | 89cf28b0e13c85f0a04d216121cbdafdf9668ba0 /crypto/chacha20poly1305.c | |
parent | 59d9ddb192bc424cc53e52180478001af4fb99a4 (diff) | |
parent | c7ee969dff58a7f5e447e27fe064e2d1ce81d574 (diff) | |
download | linux-crypto-249b6bae56fc18f4512fe5bc085f71cc235c0735.tar.gz linux-crypto-249b6bae56fc18f4512fe5bc085f71cc235c0735.zip |
Merge tag 'v4.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into fbdev-for-next
Linux 4.16-rc4
Diffstat (limited to '')
-rw-r--r-- | crypto/chacha20poly1305.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/chacha20poly1305.c b/crypto/chacha20poly1305.c index db1bc314..600afa99 100644 --- a/crypto/chacha20poly1305.c +++ b/crypto/chacha20poly1305.c @@ -610,6 +610,11 @@ static int chachapoly_create(struct crypto_template *tmpl, struct rtattr **tb, algt->mask)); if (IS_ERR(poly)) return PTR_ERR(poly); + poly_hash = __crypto_hash_alg_common(poly); + + err = -EINVAL; + if (poly_hash->digestsize != POLY1305_DIGEST_SIZE) + goto out_put_poly; err = -ENOMEM; inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); @@ -618,7 +623,6 @@ static int chachapoly_create(struct crypto_template *tmpl, struct rtattr **tb, ctx = aead_instance_ctx(inst); ctx->saltlen = CHACHAPOLY_IV_SIZE - ivsize; - poly_hash = __crypto_hash_alg_common(poly); err = crypto_init_ahash_spawn(&ctx->poly, poly_hash, aead_crypto_instance(inst)); if (err) |