summaryrefslogtreecommitdiff
path: root/net/xfrm/xfrm_algo.c
diff options
context:
space:
mode:
authorXu Jia <xujia39@huawei.com>2021-12-22 12:06:58 +0300
committerSteffen Klassert <steffen.klassert@secunet.com>2021-12-23 11:32:51 +0300
commite6911affa416dc4e0c0b3f04cbe6b02ce13277f1 (patch)
tree96eb7b2e86cdf1ea3ccc0c87ba735222e5bd0481 /net/xfrm/xfrm_algo.c
parentaf734a26a1a95a9fda51f2abb0c22a7efcafd5ca (diff)
downloadlinux-e6911affa416dc4e0c0b3f04cbe6b02ce13277f1.tar.xz
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/xfrm_algo.c')
-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[] = {