KTLS: enable the CCM mode of ktls
authorTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Mon, 6 Dec 2021 09:50:50 +0000 (17:50 +0800)
committerTomas Mraz <tomas@openssl.org>
Wed, 16 Nov 2022 15:46:46 +0000 (16:46 +0100)
The latest kernel (including stable kernel) has fixed the issue
of decryption failure in CCM mode in TLS 1.3. It is necessary to
reenable CCM mode for KTLS.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17207)

CHANGES.md
ssl/record/methods/ktls_meth.c

index f0ecb25483a3761717c512ea28dd5d73f2e2985e..a55a6c47aaa6a8d6e3d084d63e982847c21fd69a 100644 (file)
@@ -223,6 +223,14 @@ OpenSSL 3.2
 
    *Hugo Landau*
 
+ * Enable KTLS with the TLS 1.3 CCM mode ciphersuites. Note that some linux
+   kernel versions that support KTLS have a known bug in CCM processing. That
+   has been fixed in stable releases starting from 5.4.164, 5.10.84, 5.15.7,
+   and all releases since 5.16. KTLS with CCM ciphersuites should be only used
+   on these releases.
+
+   *Tianjia Zhang*
+
 OpenSSL 3.0
 -----------
 
index 1fd83c94f226aa40b7443368b3d1c9bd7bf2fe2e..5c94837dc0b98787beba1b9cc184ed43d9d17e7c 100644 (file)
@@ -147,8 +147,7 @@ static int ktls_int_check_supported_cipher(OSSL_RECORD_LAYER *rl,
      */
 # ifdef OPENSSL_KTLS_AES_CCM_128
     if (EVP_CIPHER_is_a(c, "AES-128-CCM")) {
-        if (rl->version == TLS_1_3_VERSION /* broken on 5.x kernels */
-            || taglen != EVP_CCM_TLS_TAG_LEN)
+        if (taglen != EVP_CCM_TLS_TAG_LEN)
             return 0;
         return 1;
     } else