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 <redacted>
Cc: Vakul Garg <redacted>
Cc: stable@vger.kernel.org # v5.2+
---
net/tls/tls_sw.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller [off-list ref]:
On Mon, 29 Nov 2021 17:32:12 +0800 you wrote:
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 <redacted>
Cc: Vakul Garg <redacted>
Cc: stable@vger.kernel.org # v5.2+
[...]
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 <redacted>
Nice catch, thanks!
This is what I was talking about last time.
Tested-by: Vadim Fedorenko <redacted>
Hi Vadim,
On 11/30/21 6:39 AM, Vadim Fedorenko wrote:
On 29.11.2021 09:32, Tianjia Zhang wrote:
quoted
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 <redacted>
Nice catch, thanks!
This is what I was talking about last time.
Tested-by: Vadim Fedorenko <redacted>
David has applied this patch, the tested tag may not be added, still
thanks for your test.
Kind regards,
Tianjia