aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/crypto/talitos.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 521244e08fb1..8a0bb417aa11 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -1378,22 +1378,11 @@ static int ablkcipher_setkey(struct crypto_ablkcipher *cipher,
1378 const u8 *key, unsigned int keylen) 1378 const u8 *key, unsigned int keylen)
1379{ 1379{
1380 struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher); 1380 struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher);
1381 struct ablkcipher_alg *alg = crypto_ablkcipher_alg(cipher);
1382
1383 if (keylen > TALITOS_MAX_KEY_SIZE)
1384 goto badkey;
1385
1386 if (keylen < alg->min_keysize || keylen > alg->max_keysize)
1387 goto badkey;
1388 1381
1389 memcpy(&ctx->key, key, keylen); 1382 memcpy(&ctx->key, key, keylen);
1390 ctx->keylen = keylen; 1383 ctx->keylen = keylen;
1391 1384
1392 return 0; 1385 return 0;
1393
1394badkey:
1395 crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN);
1396 return -EINVAL;
1397} 1386}
1398 1387
1399static void common_nonsnoop_unmap(struct device *dev, 1388static void common_nonsnoop_unmap(struct device *dev,