summaryrefslogtreecommitdiff
path: root/net/xfrm
diff options
context:
space:
mode:
authorXu Jia <xujia39@huawei.com>2021-12-22 17:06:59 +0800
committerSteffen Klassert <steffen.klassert@secunet.com>2021-12-23 09:32:51 +0100
commit23b6a6df94c6ce434e7947cfad14b1640fb9f794 (patch)
treec1d2ac7f857846175fb2a425eaf89fbbd1b15b81 /net/xfrm
parente6911affa416dc4e0c0b3f04cbe6b02ce13277f1 (diff)
xfrm: Add support for SM4 symmetric cipher algorithm
This patch adds SM4 encryption algorithm entry to ealg_list. 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.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index 00b5444a4d86..094734fbec96 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -572,6 +572,27 @@ static struct xfrm_algo_desc ealg_list[] = {
.sadb_alg_maxbits = 288
}
},
+{
+ .name = "cbc(sm4)",
+ .compat = "sm4",
+
+ .uinfo = {
+ .encr = {
+ .geniv = "echainiv",
+ .blockbits = 128,
+ .defkeybits = 128,
+ }
+ },
+
+ .pfkey_supported = 1,
+
+ .desc = {
+ .sadb_alg_id = SADB_X_EALG_SM4CBC,
+ .sadb_alg_ivlen = 16,
+ .sadb_alg_minbits = 128,
+ .sadb_alg_maxbits = 256
+ }
+},
};
static struct xfrm_algo_desc calg_list[] = {