OSDN Git Service

net/tls: Fix authentication failure in CCM mode
authorTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Mon, 29 Nov 2021 09:32:12 +0000 (17:32 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Nov 2021 12:48:28 +0000 (12:48 +0000)
commit5961060692f8b17cd2080620a3d27b95d2ae05ca
tree62e480923a500499c1a9297164ab5260da08f637
parentef56b64001625c84e80ff7e061ccb0f28e606abb
net/tls: Fix authentication failure in CCM mode

When the TLS cipher suite uses CCM mode, including AES CCM and
SM4 CCM, the first byte of the B0 block is flags, and the real
IV starts from the second byte. The XOR operation of the IV and
rec_seq should be skip this byte, that is, add the iv_offset.

Fixes: f295b3ae9f59 ("net/tls: Add support of AES128-CCM based ciphers")
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Cc: Vakul Garg <vakul.garg@nxp.com>
Cc: stable@vger.kernel.org # v5.2+
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c