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 0B87E45CC3 for ; Thu, 14 Nov 2024 20:26:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0029C42F19; Thu, 14 Nov 2024 20:26:25 +0100 (CET) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mails.dpdk.org (Postfix) with ESMTP id 56CFC42EE3 for ; Thu, 14 Nov 2024 20:26:20 +0100 (CET) Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-7f3e30a43f1so698064a12.1 for ; Thu, 14 Nov 2024 11:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731612379; x=1732217179; 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=tWGHzH8gQ8skoUvuuVsrjhb5NaOAW2qyaGytrWwx81IyU4Z46y2w9bEm7XMnYKkOpn QwRIg1iloOhiemAhwV9cagTKnOY4S0mFMeGnrfsWXFN6YcOvNNLh+nHpOBg69fGn07BP Y+MkVL7Xf5FW1/IZk3XZ9IP8hnPMdUnUOF/wnBdp+bhKcmkvbl/3dMwcT0ew5LAUMiBR aril4lxN58F62qd1UxZ+lsEqQJPccYrWKt15UOP6rLtvqV7Qt9Kx0k7dpmhyuodEMMDx rzE9HEKqk0GaswXhaVYlImpagoFJpmKJB5vMsjmhdrsm/96iWh4bswuh3W1SiFgPjzLI 4miA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731612379; x=1732217179; 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=vhWDaFCLbbn2/g0Xb50cw0q2seCJPg8hKc6oTEQ51bCjfPbFm6nUzsDk/E2WNLhniP g1IxvzxCKBNA1KKoTM192TPssgUjumpBGbW52+sJTukn9UmTSpCkkzyD1CKPFj2G5BLQ OlZACBiGYb9YTDmc/0ZgV3ojdlN/Nh02qTgDJjb99T6/eanSGJEYYNFrg/P3TJR4TASw QP2ninp3EqpZ0TPGhuifcsM8jXyWrbi3JMnjGsnWjpgpQs9t0APp3U9c04tXIGTZ9pLm awqRLBvY9oIqu9GKPKHHfigHjynNDsgHjFcRCP6PHlauF16Yq8L3HZJ/vqyR09+Pw5ES 6riA== X-Forwarded-Encrypted: i=1; AJvYcCVMO8/F1EoVKLmcUdns6eNuPIDVawBU9RHiVDaaiH21oQMyWaGjmePR0KVE4t1H601tWHfSruI=@dpdk.org X-Gm-Message-State: AOJu0YzhfKgSUlN5yMrhVYPxVFHc1Vg0oqex0OnsGyQsc9WXlXXYBcMa vHKFMmiQvuZLp8ZbBQfa3kmOV9kzxEmk2+hmQEI1BIOAm2ZQJXwCvdyPYc1ar5Q= X-Google-Smtp-Source: AGHT+IHo7w5jXdHydw7VGJR2PnPxFyZkcGz0MPpvDpCwGd+Ei3IUBxv9LDJ2mV+Vsk6oWvEdOSzZsg== X-Received: by 2002:a05:6a21:66c5:b0:1db:e9cf:aa39 with SMTP id adf61e73a8af0-1dc834f005bmr3714844637.32.1731612379550; Thu, 14 Nov 2024 11:26:19 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7f8b37f3466sm1461632a12.35.2024.11.14.11.26.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 11:26:19 -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 v2 05/10] app/test: fix TLS zero length record Date: Thu, 14 Nov 2024 11:25:03 -0800 Message-ID: <20241114192603.41145-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114192603.41145-1-stephen@networkplumber.org> References: <20241114001403.147609-1-stephen@networkplumber.org> <20241114192603.41145-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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