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 0335245D6B; Thu, 21 Nov 2024 19:25:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 543AE4326A; Thu, 21 Nov 2024 19:25:05 +0100 (CET) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by mails.dpdk.org (Postfix) with ESMTP id 3FB2F40A6B for ; Thu, 21 Nov 2024 19:24:59 +0100 (CET) Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-7ae3d7222d4so1009620a12.3 for ; Thu, 21 Nov 2024 10:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1732213498; x=1732818298; 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=d+nZnl85cn00kvUg5irRhG+ZxIzZ7X2+vs466Uc26iEyTnDFt9VB02X+72Xw1UFVJf FMJ6oiEy2qUWSRf//5ANBXEPhV4U8H+P91kcsSUlnFaYquwj06FBceCggBLqI87DxBBe O+Lcm1vDGPS/guT27rGjH1LuayX95YJKbA15wOVB65wOCB3m55LKcQp9GfPsuoqEJmEG epMrqFRzHXn9Jby0HhT03lbyDPbG4cMN+yDGVuDtBLnzkxlycX1/IPM0bFERe+0artGG XYbYhzZ1DZQsdh4WSe1dnfFJgvILwznXXmEyE9BnJ0cz8N3mlDNZXa31qMG0o2MH6+O4 ZK1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732213498; x=1732818298; 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=dI2tbAYOZ4c/tAsTvsabBrzPk0TBeUn8SiqiKc7KysT/PxwmtQ2WNDXMizqquhBDu2 KAQICEhktPm8pTAxQOA/4pDFtCc30SlO9XHSeMLOOwFiY2pXsT54tRonCqQBH/t4w8F7 1ehNqa6ZfD7XaYcunTCN5ufgKlsN2+LenZZn4P7vjs3hUD4bQNRXA3azjnrONonqsuJY JGP+0BrA+wVMwVzyeQXY5ek1RYTXkgD43nrypcagjJ5qZT0EH3AVfhA1PMCd+Gf80dDm GiSCfZPmkWhag/PLICvdtHv74r/AMOEXnAbIMesYqCfE6nbL2VHxglZqjh/luuuxiC0x l4tA== X-Gm-Message-State: AOJu0YxdDYxx7keZ84WLKtaH2iFDi29fNG3DDE8erAy4JcrPY0H3cL8x w73B2TcaBMvq0nyCX7m1moQsn/6+/OO8Rl78k3xnXHHxL9B54Dtrdm7KJKE6keKi4ehpw4jD6F2 x9LA= X-Gm-Gg: ASbGncsH6ITQ5y6s89TBeIAKaOHn7sI4USYr9hW7enZUMEYRMAEfrw3ORsVQf2spuQu OMLeT5kmP1235iwJRATgDrQ6XR6n2Sp3Ymr4fdEFJXjrHm0Gh1rx9qenP1JU+KC2MjtgK9BYVJU OPlZQ+2pw8aTCZ71JSjUSf7k6jVN1l90hpK6zIfsvnThSe9djHMuyWuDarG272S4EteGKvj9a8F +2M5wCvINW/uliUj8QoQ7ZX66Rkvt2usA5t2Q690f2jBOvAuT0SeFdTJXbCsPd+JtcjTPisR3wg gswE6SLtoSXTdfAbb+Qf+hUOVFw= X-Google-Smtp-Source: AGHT+IH8ZyYKNPYwyLkraGAHJHYqhctHPYPlIwEzNzG7p+tzGzZzy2WgVEtPEnvGnG62d7OTnyK/WA== X-Received: by 2002:a05:6a20:9149:b0:1db:e1b0:b679 with SMTP id adf61e73a8af0-1ddaebce7c8mr11382371637.18.1732213498456; Thu, 21 Nov 2024 10:24:58 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724de454aa1sm70201b3a.4.2024.11.21.10.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2024 10:24:58 -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 v4 5/9] app/test: fix TLS zero length record Date: Thu, 21 Nov 2024 10:23:26 -0800 Message-ID: <20241121182443.68025-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241121182443.68025-1-stephen@networkplumber.org> References: <20241114001403.147609-1-stephen@networkplumber.org> <20241121182443.68025-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