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 ACD3F45CFB; Thu, 14 Nov 2024 01:14:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6060D4278E; Thu, 14 Nov 2024 01:14:24 +0100 (CET) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mails.dpdk.org (Postfix) with ESMTP id 2983142708 for ; Thu, 14 Nov 2024 01:14:21 +0100 (CET) Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-71ec997ad06so90497b3a.3 for ; Wed, 13 Nov 2024 16:14:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731543260; x=1732148060; 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=XFLxxAM0e6/jTwXpuxg433N6YTqtA/GmLNAexZixN9Q=; b=h/KmI6+hvTaFGCJxw2ipy/XDh0Nz1LCHCeUUM888KBnpUFDosG31l0uZQrVmhigggd /8pdp+hOto2AEaplwvJwLw4n90Y/sa/BZ2aDRhIXex9BmSbDXzPbrS+39OwFkvaWzUjN lQpaPLqlsR4HdjkRqoecJZ88EXifUM/lhIo9rMBgJBmQKnqwt+FlyJW8D9fOKNjnLaHX 6w+48Pmb39AszivKMixAz42UXPD8n6TNXXZnYBATwfMg4HAqymAQJfyy9l+az9vhuSDc PRckR8Mdmoa2Id6mcgic676lNfcSK61Ua5fd92yc3duOaTYQTcEygcgGEekme40QxoZ1 yqmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731543260; x=1732148060; 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=XFLxxAM0e6/jTwXpuxg433N6YTqtA/GmLNAexZixN9Q=; b=BQ7CmFnIhTL95nUWQywu8CrVpwvqEWyeDp0Z0Qpn/Ccop8Gw+3VIZdw+0MZwdDFs9A 4hQ6rq/gEA9OmO/xOnN7eo/CeKRI7l8tkGY676b+E5r6uRxrSsDznYzyQ7Lt8W+K9NLH CmmGlfuwMwtAy6o6GWyIeqEf8dBgK727MJdtZdk+7Cf59ImNcLNm9uWajd8Ja/vL763j f0Rr6vkIWrIYciVAgIbhaZoO/RQoYHX3P4USEJ3hIT2UrhFTOvJVfdldVJaYtTvhWCC6 IHYxWCr1thFsPGTQvfBmeiH7vKk0ABE7gkk3QvlltaVb6NSmawlf4iLmvbKN2dI+xw6h y5UA== X-Gm-Message-State: AOJu0YzoDnENJgbUsChwwhK8uMSG0x89PW0x3l2al1b/9rN9tq2L21r1 ExkJEjMm35nsHoh1U5Erf7+5Vn0CEINS32MH6quf5FrJ1XMXl1w2GXuhD+HphfOQxJD5tzEP+gD O X-Google-Smtp-Source: AGHT+IEqqe+19TkhTpkdCUfGcChMBAFuxG3qm34cSss0f+yX5L3H10qyrb8g8dB8V12hk3IxSC3nmw== X-Received: by 2002:a05:6a00:2e06:b0:724:631a:3eb7 with SMTP id d2e1a72fcca58-724631a4bbbmr3559084b3a.14.1731543260226; Wed, 13 Nov 2024 16:14:20 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7246a9a81a9sm9280b3a.99.2024.11.13.16.14.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2024 16:14:19 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , vvelumuri@marvell.com, Akhil Goyal , Fan Zhang , Anoob Joseph Subject: [RFC 05/10] app/test: fix TLS zero length record Date: Wed, 13 Nov 2024 16:12:17 -0800 Message-ID: <20241114001403.147609-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114001403.147609-1-stephen@networkplumber.org> References: <20241114001403.147609-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 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