summaryrefslogtreecommitdiffstats
path: root/crypto/crypto_user.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-07-12 01:17:49 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2016-07-18 05:35:44 -0400
commit6cf80a296575723aed6ce6c695581540202bfc6b (patch)
tree92c5b3f73a4b065b6359c5a84c99416eeddbc04e /crypto/crypto_user.c
parent0605c41cc53ca13775d202de0de33864a46162ba (diff)
crypto: user - Remove crypto_lookup_skcipher call
As there are no more kernel users of built-in IV generators we can remove the special lookup for skciphers. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/crypto_user.c')
-rw-r--r--crypto/crypto_user.c37
1 files changed, 1 insertions, 36 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index d28513fb5a90..c24a40c8a4bf 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -378,32 +378,6 @@ drop_alg:
378 return err; 378 return err;
379} 379}
380 380
381static struct crypto_alg *crypto_user_skcipher_alg(const char *name, u32 type,
382 u32 mask)
383{
384 int err;
385 struct crypto_alg *alg;
386
387 type = crypto_skcipher_type(type);
388 mask = crypto_skcipher_mask(mask);
389
390 for (;;) {
391 alg = crypto_lookup_skcipher(name, type, mask);
392 if (!IS_ERR(alg))
393 return alg;
394
395 err = PTR_ERR(alg);
396 if (err != -EAGAIN)
397 break;
398 if (fatal_signal_pending(current)) {
399 err = -EINTR;
400 break;
401 }
402 }
403
404 return ERR_PTR(err);
405}
406
407static int crypto_add_alg(struct sk_buff *skb, struct nlmsghdr *nlh, 381static int crypto_add_alg(struct sk_buff *skb, struct nlmsghdr *nlh,
408 struct nlattr **attrs) 382 struct nlattr **attrs)
409{ 383{
@@ -436,16 +410,7 @@ static int crypto_add_alg(struct sk_buff *skb, struct nlmsghdr *nlh,
436 else 410 else
437 name = p->cru_name; 411 name = p->cru_name;
438 412
439 switch (p->cru_type & p->cru_mask & CRYPTO_ALG_TYPE_MASK) { 413 alg = crypto_alg_mod_lookup(name, p->cru_type, p->cru_mask);
440 case CRYPTO_ALG_TYPE_GIVCIPHER:
441 case CRYPTO_ALG_TYPE_BLKCIPHER:
442 case CRYPTO_ALG_TYPE_ABLKCIPHER:
443 alg = crypto_user_skcipher_alg(name, p->cru_type, p->cru_mask);
444 break;
445 default:
446 alg = crypto_alg_mod_lookup(name, p->cru_type, p->cru_mask);
447 }
448
449 if (IS_ERR(alg)) 414 if (IS_ERR(alg))
450 return PTR_ERR(alg); 415 return PTR_ERR(alg);
451 416