From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C19374547B; Mon, 17 Jun 2024 07:59:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3890C402CE; Mon, 17 Jun 2024 07:59:30 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id C876E4021E for ; Mon, 17 Jun 2024 07:58:49 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45GNcl7B023206; Sun, 16 Jun 2024 22:58:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=g NcpsFYP3y4Ei7Gbho/cX/N22ZGKsoOc2uHkfOTnSa8=; b=DF/sB72LDyvAyHrQt mDwJ1ykSz4w0x8RZCX9LsjlPXPlb8RWbn9tVRZZGeVa4Smv9NCzZ8d3nrk10IvQL v4WI730zqwaos9BSzN+tMAnZYULw98c4z+RMlpJMzfzD5StLCJNkwNhjiOpfV7Nk TpfP8FRC3ed13VrzS84mi+AYGt+4luR6hToJQohx+8HO/YREfaZq8kzBaWFaPdOh KKqIjMX51UL09of+ISo84VmkPn/H6HefkLFVVD7vNIXHsYyf21TotDA4d3ijVcdL jekgwJC1je6a0iMzpPD1Dyptp6fV8Za1uw1GKGn6jsAYHIcXY7/xgcrCbrUnzkj/ 8Bsog== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3ys8ajv2q1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 16 Jun 2024 22:58:48 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 16 Jun 2024 22:58:47 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Sun, 16 Jun 2024 22:58:47 -0700 Received: from localhost.localdomain (unknown [10.28.36.177]) by maili.marvell.com (Postfix) with ESMTP id D79F13F704E; Sun, 16 Jun 2024 22:58:44 -0700 (PDT) From: Aakash Sasidharan To: Akhil Goyal , Fan Zhang CC: , , , , Subject: [PATCH 1/7] test/crypto: unit tests for padding for TLS-1.3 Date: Mon, 17 Jun 2024 11:28:35 +0530 Message-ID: <20240617055841.2359729-2-asasidharan@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240617055841.2359729-1-asasidharan@marvell.com> References: <20240617055841.2359729-1-asasidharan@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: 93RfZz3cB0Gl9t5ZInOsu0MyjnleXgns X-Proofpoint-ORIG-GUID: 93RfZz3cB0Gl9t5ZInOsu0MyjnleXgns X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-17_04,2024-06-14_03,2024-05-17_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Vidya Sagar Velumuri Add unit tests to verify the padding for TLS-1.3. Signed-off-by: Vidya Sagar Velumuri --- app/test/test_cryptodev.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 94438c587a..61ee43327a 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -12740,6 +12740,25 @@ test_tls_1_3_record_proto_zero_len_non_app(void) return test_tls_record_proto_all(&flags); } + +static int +test_tls_1_3_record_proto_dm_opt_padding(void) +{ + return test_tls_record_proto_opt_padding(6, 0, RTE_SECURITY_VERSION_TLS_1_3); +} + +static int +test_tls_1_3_record_proto_sg_opt_padding(void) +{ + return test_tls_record_proto_opt_padding(25, 5, RTE_SECURITY_VERSION_TLS_1_3); +} + +static int +test_tls_1_3_record_proto_sg_opt_padding_1(void) +{ + return test_tls_record_proto_opt_padding(25, 4, RTE_SECURITY_VERSION_TLS_1_3); +} + #endif static int @@ -18168,6 +18187,18 @@ static struct unit_test_suite tls13_record_proto_testsuite = { "TLS-1.3 record with zero len and content type as ctrl", ut_setup_security, ut_teardown, test_tls_1_3_record_proto_zero_len_non_app), + TEST_CASE_NAMED_ST( + "TLS-1.3 record DM mode with optional padding", + ut_setup_security, ut_teardown, + test_tls_1_3_record_proto_dm_opt_padding), + TEST_CASE_NAMED_ST( + "TLS-1.3 record SG mode with optional padding - 1", + ut_setup_security, ut_teardown, + test_tls_1_3_record_proto_sg_opt_padding), + TEST_CASE_NAMED_ST( + "TLS-1.3 record SG mode with optional padding", + ut_setup_security, ut_teardown, + test_tls_1_3_record_proto_sg_opt_padding_1), TEST_CASES_END() /**< NULL terminate unit test array */ } }; -- 2.25.1