OSDN Git Service

net/tls: Add support of AES128-CCM based ciphers
authorVakul Garg <vakul.garg@nxp.com>
Wed, 20 Mar 2019 02:03:36 +0000 (02:03 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Mar 2019 18:02:05 +0000 (11:02 -0700)
commitf295b3ae9f5927e084bd5decdff82390e3471801
tree787496d890b276c25f9df4df497c9c5eb1a4f9fd
parent6a23c0a6af98c927f387353a219c1f5664bb3d5b
net/tls: Add support of AES128-CCM based ciphers

Added support for AES128-CCM based record encryption. AES128-CCM is
similar to AES128-GCM. Both of them have same salt/iv/mac size. The
notable difference between the two is that while invoking AES128-CCM
operation, the salt||nonce (which is passed as IV) has to be prefixed
with a hardcoded value '2'. Further, CCM implementation in kernel
requires IV passed in crypto_aead_request() to be full '16' bytes.
Therefore, the record structure 'struct tls_rec' has been modified to
reserve '16' bytes for IV. This works for both GCM and CCM based cipher.

Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/tls.h
include/uapi/linux/tls.h
net/tls/tls_main.c
net/tls/tls_sw.c