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 E548746A9C for ; Mon, 30 Jun 2025 14:26:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DCFEB40669; Mon, 30 Jun 2025 14:26:52 +0200 (CEST) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mails.dpdk.org (Postfix) with ESMTP id AD0CD40661 for ; Mon, 30 Jun 2025 14:26:50 +0200 (CEST) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-45377776935so23756395e9.3 for ; Mon, 30 Jun 2025 05:26:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751286410; x=1751891210; 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=PQF47o5bnlGGWt6wE7p+ZMG9TlV4YMPoXSTZWYhhkRI=; b=RaA/23p5lNbaUyouj40/Xqqv0IKMWCMyIm3BzfciWmbeAYMhF43ujHjp6cpzuQyqJs I0Wid1VC2Mu/NXbDE1VvPXtc6N8Cg2bHDPdN599DbiTs2NCOOTezeVTvPDgZoMIriyEi OFxTw9Dyg+PW/hb8ULKwR9MOihwx3YTZ1TfWJlNDcgVqvAfzIhdlEdaZZS+2XBpnP/nE R65J7lsb1EM+fwe1ypzO+jcojyU6vqyL9p0AP4vpj8c5nD7Hymt4kzDiV0BOY1ZrR6dq REMSr/pUl19zBB3An6xrYw0ef31dCqHTuvd9HMhRzr6zLNApHCmGJ121Fu0Ihr6kuXXN Wm0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751286410; x=1751891210; 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=PQF47o5bnlGGWt6wE7p+ZMG9TlV4YMPoXSTZWYhhkRI=; b=cXaf9FeloJeW4QfaQGloslTeDg6SxZ0t/lXJLJjxVmmO2KSsyMlYot9S2jjno8hbrp 7+KepnyR+2dFyLuwI6TkHJRulb3jkeUyOcPGSWQbO0NVjMLjcRyLgFaXIWzk3MdihGOB Xsi8OY43l2fEpHYfsVa7La2jinvTn2X1FnYNR9pCLcOyQVupoJkiqE1s21F9Zgokc+4j acedsNeRv5PXnhcfdkDLk89i9Or1L1EmcBtAbrGj7kQO+xhGPv9MrAbnGpEu8atdEuWl ZXrZfHqde3EjPRc3uQHR4fV9RtJXxux2Zg6WCrGveEsgUjQLW6oEFgRbGvuIGx+bNrqq aWGA== X-Gm-Message-State: AOJu0Yy+3zwEhjU6e1GNpO0/kwzJLXZWiaUeejTXLGGvufrYoAfSdTRP Ie+Du2QUzNzPUb7Cd5FoGnFseLc6ikZMHcB7rf3byAD3Hp/syHTaJjkeFdr/PWbA X-Gm-Gg: ASbGnctZJcbw2Lx5ixD53IXYewg4Wx7F2OuprMxGuxp4nLmb7PHCCf6LTuBvj3VhSnT 7Qrer+Twmr/Kyoz/2b7eY6hTy6bjZjhxwjbPbqpHaUFSFrAmK9EUeiff+MsvNwEzqFeRWACPujp SSfeZuAYTVuvkpwDUH2q3y0LnDae5+HZhb9BRyVp8m+vi8IwvQAnQjo0qIUnq+gN6eXLwA4zBFu ekr65jyUaE1IIZ3CNsSu3tKMtt/kQuKye3W3wd364ovFxECLij7W20gj63HsYRZ5ye5xU+J0ATa wAurtdY4wVxiryQ18K6HI5Tn78ers3WNi+lzbzuZOZbzB6NL2KonteR91UVawMMbksw= X-Google-Smtp-Source: AGHT+IHIzrDTrAbR0wY5XIhvCbux2ws/gaBgsLHYQIc1TSP/WE7uQMzhmeY8rZwVZGD19Fll05BtfA== X-Received: by 2002:a05:600c:1c82:b0:442:e109:3027 with SMTP id 5b1f17b1804b1-4538ff99773mr117468185e9.24.1751286410159; Mon, 30 Jun 2025 05:26:50 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:ded1:f637:68f:c2a6]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-4538a3b2fd7sm136134145e9.17.2025.06.30.05.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jun 2025 05:26:49 -0700 (PDT) From: luca.boccassi@gmail.com To: Gowrishankar Muthukrishnan Cc: dpdk stable Subject: patch 'test/crypto: fix RSA decrypt validation' has been queued to stable release 22.11.9 Date: Mon, 30 Jun 2025 13:25:48 +0100 Message-ID: <20250630122556.1133654-18-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250630122556.1133654-1-luca.boccassi@gmail.com> References: <20250612210733.2506558-72-luca.boccassi@gmail.com> <20250630122556.1133654-1-luca.boccassi@gmail.com> 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 Hi, FYI, your patch has been queued to stable release 22.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/02/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/a7791e525b02ca0343549971ccf43ce8c4472a94 Thanks. Luca Boccassi --- >From a7791e525b02ca0343549971ccf43ce8c4472a94 Mon Sep 17 00:00:00 2001 From: Gowrishankar Muthukrishnan Date: Fri, 20 Jun 2025 13:49:18 +0530 Subject: [PATCH] test/crypto: fix RSA decrypt validation [ upstream commit 9af3fa536ec23d254d15fea4ec0e58442e56409e ] Following RSA encrypt op, same plaintext buffer is used as output buffer for decrypt op, hence comparing plaintext buffer against same buffer pointer in crypto op always succeed irrespective of whether decrypt op succeeds or not. This patch fixes this issue with a local buffer for crypto op. Fixes: 5ae36995f10f ("test/crypto: move RSA enqueue/dequeue into functions") Signed-off-by: Gowrishankar Muthukrishnan --- app/test/test_cryptodev_asym.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c index 4c86a2bcec..cce7b48626 100644 --- a/app/test/test_cryptodev_asym.c +++ b/app/test/test_cryptodev_asym.c @@ -168,7 +168,10 @@ queue_ops_rsa_enc_dec(void *sess) struct rte_crypto_op *op, *result_op; struct rte_crypto_asym_op *asym_op; uint8_t cipher_buf[TEST_DATA_SIZE] = {0}; - int ret, status = TEST_SUCCESS; + uint8_t msg_buf[TEST_DATA_SIZE] = {0}; + int ret, status; + + memcpy(msg_buf, rsaplaintext.data, rsaplaintext.len); /* Set up crypto op data structure */ op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC); @@ -183,7 +186,7 @@ queue_ops_rsa_enc_dec(void *sess) /* Compute encryption on the test vector */ asym_op->rsa.op_type = RTE_CRYPTO_ASYM_OP_ENCRYPT; - asym_op->rsa.message.data = rsaplaintext.data; + asym_op->rsa.message.data = msg_buf; asym_op->rsa.cipher.data = cipher_buf; asym_op->rsa.cipher.length = 0; asym_op->rsa.message.length = rsaplaintext.len; @@ -220,6 +223,7 @@ queue_ops_rsa_enc_dec(void *sess) asym_op->rsa.message.length = 0; asym_op->rsa.op_type = RTE_CRYPTO_ASYM_OP_DECRYPT; asym_op->rsa.padding.type = RTE_CRYPTO_RSA_PADDING_PKCS1_5; + memset(asym_op->rsa.message.data, 0, asym_op->rsa.message.length); /* Process crypto operation */ if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) != 1) { @@ -236,11 +240,20 @@ queue_ops_rsa_enc_dec(void *sess) status = TEST_FAILED; goto error_exit; } - status = TEST_SUCCESS; + + if (result_op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { + RTE_LOG(ERR, USER1, "Expected crypto op to succeed\n"); + status = TEST_FAILED; + goto error_exit; + } + ret = rsa_verify(&rsaplaintext, result_op); - if (ret) + if (ret) { status = TEST_FAILED; + goto error_exit; + } + status = TEST_SUCCESS; error_exit: rte_crypto_op_free(op); -- 2.47.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-06-30 13:21:22.441684225 +0100 +++ 0018-test-crypto-fix-RSA-decrypt-validation.patch 2025-06-30 13:21:21.759057628 +0100 @@ -1 +1 @@ -From 9af3fa536ec23d254d15fea4ec0e58442e56409e Mon Sep 17 00:00:00 2001 +From a7791e525b02ca0343549971ccf43ce8c4472a94 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9af3fa536ec23d254d15fea4ec0e58442e56409e ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 87c26322d0..20afb5e98b 100644 +index 4c86a2bcec..cce7b48626 100644 @@ -24 +25 @@ -@@ -175,7 +175,10 @@ queue_ops_rsa_enc_dec(void *sess) +@@ -168,7 +168,10 @@ queue_ops_rsa_enc_dec(void *sess) @@ -36 +37 @@ -@@ -190,7 +193,7 @@ queue_ops_rsa_enc_dec(void *sess) +@@ -183,7 +186,7 @@ queue_ops_rsa_enc_dec(void *sess) @@ -43 +44 @@ - asym_op->rsa.cipher.length = RTE_DIM(rsa_n); + asym_op->rsa.cipher.length = 0; @@ -45,3 +46,2 @@ -@@ -225,6 +228,7 @@ queue_ops_rsa_enc_dec(void *sess) - asym_op = result_op->asym; - asym_op->rsa.message.length = RTE_DIM(rsa_n); +@@ -220,6 +223,7 @@ queue_ops_rsa_enc_dec(void *sess) + asym_op->rsa.message.length = 0; @@ -48,0 +49 @@ + asym_op->rsa.padding.type = RTE_CRYPTO_RSA_PADDING_PKCS1_5; @@ -53 +54 @@ -@@ -241,11 +245,20 @@ queue_ops_rsa_enc_dec(void *sess) +@@ -236,11 +240,20 @@ queue_ops_rsa_enc_dec(void *sess)