diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-14 12:47:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-14 12:47:01 -0500 |
commit | fee5429e028c414d80d036198db30454cfd91b7a (patch) | |
tree | 485f37a974e4ab85339021c794d1782e2d761c5b /crypto/seqiv.c | |
parent | 83e047c104aa95a8a683d6bd421df1551c17dbd2 (diff) | |
parent | 96692a7305c49845e3cbf5a60cfcb207c5dc4030 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto update from Herbert Xu:
"Here is the crypto update for 3.20:
- Added 192/256-bit key support to aesni GCM.
- Added MIPS OCTEON MD5 support.
- Fixed hwrng starvation and race conditions.
- Added note that memzero_explicit is not a subsitute for memset.
- Added user-space interface for crypto_rng.
- Misc fixes"
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (71 commits)
crypto: tcrypt - do not allocate iv on stack for aead speed tests
crypto: testmgr - limit IV copy length in aead tests
crypto: tcrypt - fix buflen reminder calculation
crypto: testmgr - mark rfc4106(gcm(aes)) as fips_allowed
crypto: caam - fix resource clean-up on error path for caam_jr_init
crypto: caam - pair irq map and dispose in the same function
crypto: ccp - terminate ccp_support array with empty element
crypto: caam - remove unused local variable
crypto: caam - remove dead code
crypto: caam - don't emit ICV check failures to dmesg
hwrng: virtio - drop extra empty line
crypto: replace scatterwalk_sg_next with sg_next
crypto: atmel - Free memory in error path
crypto: doc - remove colons in comments
crypto: seqiv - Ensure that IV size is at least 8 bytes
crypto: cts - Weed out non-CBC algorithms
MAINTAINERS: add linux-crypto to hw random
crypto: cts - Remove bogus use of seqiv
crypto: qat - don't need qat_auth_state struct
crypto: algif_rng - fix sparse non static symbol warning
...
Diffstat (limited to 'crypto/seqiv.c')
-rw-r--r-- | crypto/seqiv.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/seqiv.c b/crypto/seqiv.c index 9daa854cc485..b7bb9a2f4a31 100644 --- a/crypto/seqiv.c +++ b/crypto/seqiv.c | |||
@@ -267,6 +267,12 @@ static struct crypto_instance *seqiv_ablkcipher_alloc(struct rtattr **tb) | |||
267 | if (IS_ERR(inst)) | 267 | if (IS_ERR(inst)) |
268 | goto out; | 268 | goto out; |
269 | 269 | ||
270 | if (inst->alg.cra_ablkcipher.ivsize < sizeof(u64)) { | ||
271 | skcipher_geniv_free(inst); | ||
272 | inst = ERR_PTR(-EINVAL); | ||
273 | goto out; | ||
274 | } | ||
275 | |||
270 | inst->alg.cra_ablkcipher.givencrypt = seqiv_givencrypt_first; | 276 | inst->alg.cra_ablkcipher.givencrypt = seqiv_givencrypt_first; |
271 | 277 | ||
272 | inst->alg.cra_init = seqiv_init; | 278 | inst->alg.cra_init = seqiv_init; |
@@ -287,6 +293,12 @@ static struct crypto_instance *seqiv_aead_alloc(struct rtattr **tb) | |||
287 | if (IS_ERR(inst)) | 293 | if (IS_ERR(inst)) |
288 | goto out; | 294 | goto out; |
289 | 295 | ||
296 | if (inst->alg.cra_aead.ivsize < sizeof(u64)) { | ||
297 | aead_geniv_free(inst); | ||
298 | inst = ERR_PTR(-EINVAL); | ||
299 | goto out; | ||
300 | } | ||
301 | |||
290 | inst->alg.cra_aead.givencrypt = seqiv_aead_givencrypt_first; | 302 | inst->alg.cra_aead.givencrypt = seqiv_aead_givencrypt_first; |
291 | 303 | ||
292 | inst->alg.cra_init = seqiv_aead_init; | 304 | inst->alg.cra_init = seqiv_aead_init; |