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 F26D045D16; Fri, 15 Nov 2024 21:08:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 526FB432BA; Fri, 15 Nov 2024 21:08:11 +0100 (CET) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mails.dpdk.org (Postfix) with ESMTP id 6157543289 for ; Fri, 15 Nov 2024 21:08:06 +0100 (CET) Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-7ae3d7222d4so767178a12.3 for ; Fri, 15 Nov 2024 12:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731701285; x=1732306085; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9LYeEaogBAc0vSyBtqoy7sP97FB+GnQO77RdZXSw6MM=; b=EF3c9E0leF1vc6vYGZJ12wGTDyKmq/TPSmtrTDko3IUBk8Q+PESQOL9nVs68gTBDuB TJAeBgwSuIhohr/qdOZIky5bBxYi8ZdPvGt2RyN52VvtJGLb0ndJlC4fAUqOhtC8yhV8 KUQqqZhR3Lg2+2MudqPdTejky/DDfA3FQujNypn2U0l8lrDQy+KRH2QwlshE9xuX6Ed7 +gm6ZZg6LgWz20JLQsmYB3N2hxy1ucDVEexxjheoGSt8+Mgf78s4U2aqmNNw/vAhf6PO s5uW8DlFi0XFQXq9Zl66Zx5N4lMWADFmj32cbN240xX3Ed8Rs0tlkbMQyKX6mgR1WWWW sCIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731701285; x=1732306085; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9LYeEaogBAc0vSyBtqoy7sP97FB+GnQO77RdZXSw6MM=; b=Soyckc6iJLLw0nkhiWnnc5nZRHj/fRR9bfdM6zYetu8fH3czGV4/gGxJO0KvIR/2oV aUWFJdDYj1jn9a/L1wcykkZ/gi1ymqazw7u/rh4aeJ80fShO0isnbFp5diwGoeridBAb YbvGQl+yLlf9qUWurR9MeZFT48jUahfs3g+BFKS36Rf0JwlCz5/LJ7bG5ygaggxYOBM8 sQk3VRME3ZwsU+8FHVTiir4NaEFB61Mk/8IWf4RzRgY5YpdtpCGWDc/II3Z6ra7fdss/ fA7J/puh1HiIh6ItQuXO4swvPSX4/VjJ+N18I8pRhjE36QjnNrtCP0kTbUJSAdQzpnVc FXGQ== X-Gm-Message-State: AOJu0YzVXpRwurk2ahzbh7vjfuy1E0CjG+brKNOHte6Zxfpucmw7uN64 StKPfGY6D0T4DBXUNz6mP9oO1TSOe+MSuWufYP5sLAcWFkmNzSX2jO4gQY2ujxjMvBFJabhmJfI B X-Google-Smtp-Source: AGHT+IE8ukZxrt8Fbiv3bX/v9ZXC5VGeu4rBZn4NkRR9a5kE6FFpmkD0Bue9U2VXnB+mDS6OJDA54A== X-Received: by 2002:a05:6a21:6d8a:b0:1db:e4c3:99f0 with SMTP id adf61e73a8af0-1dc90bc8e47mr5453822637.32.1731701285573; Fri, 15 Nov 2024 12:08:05 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724771e11f0sm1759686b3a.131.2024.11.15.12.08.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:08:05 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , vvelumuri@marvell.com, stable@dpdk.org, Akhil Goyal , Fan Zhang , Anoob Joseph Subject: [PATCH v3 05/10] app/test: fix TLS zero length record Date: Fri, 15 Nov 2024 12:06:49 -0800 Message-ID: <20241115200751.17141-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241115200751.17141-1-stephen@networkplumber.org> References: <20241114001403.147609-1-stephen@networkplumber.org> <20241115200751.17141-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 The code was duplicating the same condition three times? Reading the commit message, the intention was: Add unit tests to verify the zero len TLS records. Zero len packets are allowed when content type is app data while zero packet length with other content type (such as handshake) would result in an error. Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: 79a58624369a ("test/security: verify zero length TLS records") Cc: vvelumuri@marvell.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- app/test/test_cryptodev.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index c647baeee1..a33ef574cc 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -12253,10 +12253,7 @@ test_tls_record_proto_all(const struct tls_record_test_flags *flags) if (flags->skip_sess_destroy && sec_session_outb == NULL) sec_session_outb = ut_params->sec_session; - if (flags->zero_len && - ((flags->content_type == TLS_RECORD_TEST_CONTENT_TYPE_HANDSHAKE) || - (flags->content_type == TLS_RECORD_TEST_CONTENT_TYPE_HANDSHAKE) || - (flags->content_type == TLS_RECORD_TEST_CONTENT_TYPE_HANDSHAKE))) { + if (flags->zero_len && flags->content_type != TLS_RECORD_TEST_CONTENT_TYPE_APP) { if (ret == TEST_SUCCESS) return TEST_FAILED; goto skip_decrypt; -- 2.45.2