From patchwork Mon Dec 6 21:39:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Fedorenko X-Patchwork-Id: 12659731 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 947CCC433F5 for ; Mon, 6 Dec 2021 21:39:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352154AbhLFVnN (ORCPT ); Mon, 6 Dec 2021 16:43:13 -0500 Received: from novek.ru ([213.148.174.62]:39374 "EHLO novek.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352148AbhLFVnK (ORCPT ); Mon, 6 Dec 2021 16:43:10 -0500 Received: from nat1.ooonet.ru (gw.zelenaya.net [91.207.137.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by novek.ru (Postfix) with ESMTPSA id 2FE51501050; Tue, 7 Dec 2021 00:34:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 novek.ru 2FE51501050 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=novek.ru; s=mail; t=1638826497; bh=ZlLVRzc3mPfTQe2uz/D7ccxZSwpQjvrPGYNWIip7wG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GtTNVEBDYDftfxiJJ6p//RM6XSP+5tpl90EAOF5aWjn9bKqUw8ODiZ+4zYABvZtlQ lTOZPipTeytt6zz/oMR9EhXMjeqxHiA40pP/qrgQX0X4nc949f3M8lTSbJgt7msAS6 eB324ImCVsKGYQLNlW+g4XVEE1MC0L6wgH7TPMoo= From: Vadim Fedorenko To: "David S. Miller" , Jakub Kicinski Cc: Vadim Fedorenko , netdev@vger.kernel.org Subject: [PATCH net 1/2] selftests: tls: add missing AES-CCM cipher tests Date: Tue, 7 Dec 2021 00:39:31 +0300 Message-Id: <20211206213932.7508-2-vfedorenko@novek.ru> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20211206213932.7508-1-vfedorenko@novek.ru> References: <20211206213932.7508-1-vfedorenko@novek.ru> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add tests for TLSv1.2 and TLSv1.3 with AES-CCM cipher. Signed-off-by: Vadim Fedorenko --- tools/testing/selftests/net/tls.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c index 8a22db0cca49..fb1bb402ee10 100644 --- a/tools/testing/selftests/net/tls.c +++ b/tools/testing/selftests/net/tls.c @@ -31,6 +31,7 @@ struct tls_crypto_info_keys { struct tls12_crypto_info_chacha20_poly1305 chacha20; struct tls12_crypto_info_sm4_gcm sm4gcm; struct tls12_crypto_info_sm4_ccm sm4ccm; + struct tls12_crypto_info_aes_ccm_128 aesccm128; }; size_t len; }; @@ -61,6 +62,11 @@ static void tls_crypto_info_init(uint16_t tls_version, uint16_t cipher_type, tls12->sm4ccm.info.version = tls_version; tls12->sm4ccm.info.cipher_type = cipher_type; break; + case TLS_CIPHER_AES_CCM_128: + tls12->len = sizeof(struct tls12_crypto_info_aes_ccm_128); + tls12->aesccm128.info.version = tls_version; + tls12->aesccm128.info.cipher_type = cipher_type; + break; default: break; } @@ -261,6 +267,18 @@ FIXTURE_VARIANT_ADD(tls, 13_sm4_ccm) .cipher_type = TLS_CIPHER_SM4_CCM, }; +FIXTURE_VARIANT_ADD(tls, 12_aes_ccm) +{ + .tls_version = TLS_1_2_VERSION, + .cipher_type = TLS_CIPHER_AES_CCM_128, +}; + +FIXTURE_VARIANT_ADD(tls, 13_aes_ccm) +{ + .tls_version = TLS_1_3_VERSION, + .cipher_type = TLS_CIPHER_AES_CCM_128, +}; + FIXTURE_SETUP(tls) { struct tls_crypto_info_keys tls12; From patchwork Mon Dec 6 21:39:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Fedorenko X-Patchwork-Id: 12659733 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E70FC4332F for ; Mon, 6 Dec 2021 21:39:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352155AbhLFVnO (ORCPT ); Mon, 6 Dec 2021 16:43:14 -0500 Received: from novek.ru ([213.148.174.62]:39384 "EHLO novek.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236606AbhLFVnM (ORCPT ); Mon, 6 Dec 2021 16:43:12 -0500 Received: from nat1.ooonet.ru (gw.zelenaya.net [91.207.137.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by novek.ru (Postfix) with ESMTPSA id 559B750130B; Tue, 7 Dec 2021 00:34:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 novek.ru 559B750130B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=novek.ru; s=mail; t=1638826498; bh=k59tG2edr70tWcYrX1TXkQS/I+2eac+8fhzrxlpRx50=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K1a9N9FvZQ+8cXdrHv5gnJMbm94Z3LwzgOJ82b2M7e/ypKXrFOgnTNyVejlZHZ/DG EAto8WI3fuoDgRRZYvydDpP4GEzqCtcju3y5JqUVum10PA65iYc1FFrMZhWX4Et44z AhVVRIZuDKS2ddQTf/um3GEHYR4UxRJn+XpfN5gI= From: Vadim Fedorenko To: "David S. Miller" , Jakub Kicinski Cc: Vadim Fedorenko , netdev@vger.kernel.org Subject: [PATCH net 2/2] selftests: tls: add missing AES256-GCM cipher Date: Tue, 7 Dec 2021 00:39:32 +0300 Message-Id: <20211206213932.7508-3-vfedorenko@novek.ru> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20211206213932.7508-1-vfedorenko@novek.ru> References: <20211206213932.7508-1-vfedorenko@novek.ru> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add tests for TLSv1.2 and TLSv1.3 with AES256-GCM cipher Signed-off-by: Vadim Fedorenko --- tools/testing/selftests/net/tls.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c index fb1bb402ee10..6e468e0f42f7 100644 --- a/tools/testing/selftests/net/tls.c +++ b/tools/testing/selftests/net/tls.c @@ -32,6 +32,7 @@ struct tls_crypto_info_keys { struct tls12_crypto_info_sm4_gcm sm4gcm; struct tls12_crypto_info_sm4_ccm sm4ccm; struct tls12_crypto_info_aes_ccm_128 aesccm128; + struct tls12_crypto_info_aes_gcm_256 aesgcm256; }; size_t len; }; @@ -67,6 +68,11 @@ static void tls_crypto_info_init(uint16_t tls_version, uint16_t cipher_type, tls12->aesccm128.info.version = tls_version; tls12->aesccm128.info.cipher_type = cipher_type; break; + case TLS_CIPHER_AES_GCM_256: + tls12->len = sizeof(struct tls12_crypto_info_aes_gcm_256); + tls12->aesgcm256.info.version = tls_version; + tls12->aesgcm256.info.cipher_type = cipher_type; + break; default: break; } @@ -279,6 +285,18 @@ FIXTURE_VARIANT_ADD(tls, 13_aes_ccm) .cipher_type = TLS_CIPHER_AES_CCM_128, }; +FIXTURE_VARIANT_ADD(tls, 12_aes_gcm_256) +{ + .tls_version = TLS_1_2_VERSION, + .cipher_type = TLS_CIPHER_AES_GCM_256, +}; + +FIXTURE_VARIANT_ADD(tls, 13_aes_gcm_256) +{ + .tls_version = TLS_1_3_VERSION, + .cipher_type = TLS_CIPHER_AES_GCM_256, +}; + FIXTURE_SETUP(tls) { struct tls_crypto_info_keys tls12;