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 <[email protected]>
---
net/xfrm/xfrm_algo.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index f07224d..250e567 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -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>
@@ -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;
}
Hi Herbert,
[auto build test ERROR on net/master]
[also build test ERROR on v4.4 next-20160122]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Herbert-Xu/crypto-Use-skcipher-and-ahash-shash-where-possible/20160124-212323
config: x86_64-randconfig-x014-201604 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
net/xfrm/xfrm_algo.c: In function 'xfrm_probe_algs':
>> net/xfrm/xfrm_algo.c:787:12: error: implicit declaration of function 'crypto_has_ahash' [-Werror=implicit-function-declaration]
status = crypto_has_ahash(aalg_list[i].name, 0, 0);
^
cc1: some warnings being treated as errors
vim +/crypto_has_ahash +787 net/xfrm/xfrm_algo.c
781 {
782 int i, status;
783
784 BUG_ON(in_softirq());
785
786 for (i = 0; i < aalg_entries(); i++) {
> 787 status = crypto_has_ahash(aalg_list[i].name, 0, 0);
788 if (aalg_list[i].available != status)
789 aalg_list[i].available = status;
790 }
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
From: Herbert Xu <[email protected]>
Date: Sun, 24 Jan 2016 21:19:11 +0800
> 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 <[email protected]>
Acked-by: David S. Miller <[email protected]>