Skip to content

Commit

Permalink
ipsec: Use skcipher and ahash when probing algorithms
Browse files Browse the repository at this point in the history
This patch removes the last reference to hash and ablkcipher from
IPsec and replaces them with ahash and skcipher respectively.  For
skcipher there is currently no difference at all, while for ahash
the current code is actually buggy and would prevent asynchronous
algorithms from being discovered.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu committed Jan 27, 2016
1 parent 1afe593 commit 17bc197
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/xfrm/xfrm_algo.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* any later version.
*/

#include <crypto/hash.h>
#include <crypto/skcipher.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/pfkeyv2.h>
Expand Down Expand Up @@ -782,14 +784,13 @@ void xfrm_probe_algs(void)
BUG_ON(in_softirq());

for (i = 0; i < aalg_entries(); i++) {
status = crypto_has_hash(aalg_list[i].name, 0,
CRYPTO_ALG_ASYNC);
status = crypto_has_ahash(aalg_list[i].name, 0, 0);
if (aalg_list[i].available != status)
aalg_list[i].available = status;
}

for (i = 0; i < ealg_entries(); i++) {
status = crypto_has_ablkcipher(ealg_list[i].name, 0, 0);
status = crypto_has_skcipher(ealg_list[i].name, 0, 0);
if (ealg_list[i].available != status)
ealg_list[i].available = status;
}
Expand Down

0 comments on commit 17bc197

Please sign in to comment.