aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm
diff options
context:
space:
mode:
authorXu Jia <xujia39@huawei.com>2021-12-22 17:06:58 +0800
committerSteffen Klassert <steffen.klassert@secunet.com>2021-12-23 09:32:51 +0100
commite6911affa416dc4e0c0b3f04cbe6b02ce13277f1 (patch)
tree96eb7b2e86cdf1ea3ccc0c87ba735222e5bd0481 /net/xfrm
parentxfrm: update SA curlft.use_time (diff)
downloadlinux-dev-e6911affa416dc4e0c0b3f04cbe6b02ce13277f1.tar.xz
linux-dev-e6911affa416dc4e0c0b3f04cbe6b02ce13277f1.zip
xfrm: Add support for SM3 secure hash
This patch allows IPsec to use SM3 HMAC authentication algorithm. Signed-off-by: Xu Jia <xujia39@huawei.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_algo.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index 4dae3ab8d030..00b5444a4d86 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -341,6 +341,26 @@ static struct xfrm_algo_desc aalg_list[] = {
.pfkey_supported = 0,
},
+{
+ .name = "hmac(sm3)",
+ .compat = "sm3",
+
+ .uinfo = {
+ .auth = {
+ .icv_truncbits = 256,
+ .icv_fullbits = 256,
+ }
+ },
+
+ .pfkey_supported = 1,
+
+ .desc = {
+ .sadb_alg_id = SADB_X_AALG_SM3_256HMAC,
+ .sadb_alg_ivlen = 0,
+ .sadb_alg_minbits = 256,
+ .sadb_alg_maxbits = 256
+ }
+},
};
static struct xfrm_algo_desc ealg_list[] = {