aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tls.h
diff options
context:
space:
mode:
authorTianjia Zhang <tianjia.zhang@linux.alibaba.com>2021-09-28 14:28:43 +0800
committerDavid S. Miller <davem@davemloft.net>2021-09-28 13:26:23 +0100
commit128cfb882e23df297527d0bbd6bf948bd63fa621 (patch)
tree51faeb63c4c46e0566bddccd60731123dedf9176 /include/net/tls.h
parentnet: ipv6: use ipv6-y directly instead of ipv6-objs (diff)
downloadlinux-128cfb882e23df297527d0bbd6bf948bd63fa621.tar.xz
linux-128cfb882e23df297527d0bbd6bf948bd63fa621.zip
net/tls: support SM4 CCM algorithm
The IV of CCM mode has special requirements, this patch supports CCM mode of SM4 algorithm. Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tls.h')
-rw-r--r--include/net/tls.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/tls.h b/include/net/tls.h
index be4b3e1cac46..b6d40642afdd 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -66,7 +66,7 @@
#define MAX_IV_SIZE 16
#define TLS_MAX_REC_SEQ_SIZE 8
-/* For AES-CCM, the full 16-bytes of IV is made of '4' fields of given sizes.
+/* For CCM mode, the full 16-bytes of IV is made of '4' fields of given sizes.
*
* IV[16] = b0[1] || implicit nonce[4] || explicit nonce[8] || length[3]
*
@@ -74,6 +74,7 @@
* Hence b0 contains (3 - 1) = 2.
*/
#define TLS_AES_CCM_IV_B0_BYTE 2
+#define TLS_SM4_CCM_IV_B0_BYTE 2
#define __TLS_INC_STATS(net, field) \
__SNMP_INC_STATS((net)->mib.tls_statistics, field)