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 B2B9746BAE for ; Fri, 18 Jul 2025 21:37:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD8E540611; Fri, 18 Jul 2025 21:37:20 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 6C2AC40E4D for ; Fri, 18 Jul 2025 21:37:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752867438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yiNORGBL1BOW5cVuyQfr6DMl0GnYpKFY7DuS8UENAWc=; b=RJDTRpgA7ZbNti3rUYxi+xydcDbwP+ewV6Hk/C76ZCyKOXc+k7V7ZG0d8fbi8iA9MSASa9 DnY406EW8qMm3Nxg8Agaj7bFe7J7KPSM0wM4Knz4oye8fUIRUWinxPSPZ6zx5uwLlaTLxO 53pVH46wNABMyj3DFe/VtfANjElAkuM= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-133-MysE_NFxNcCG9mImtKkmqA-1; Fri, 18 Jul 2025 15:37:16 -0400 X-MC-Unique: MysE_NFxNcCG9mImtKkmqA-1 X-Mimecast-MFC-AGG-ID: MysE_NFxNcCG9mImtKkmqA_1752867434 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B7AD818004A7; Fri, 18 Jul 2025 19:37:14 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.40]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7B722180045B; Fri, 18 Jul 2025 19:37:13 +0000 (UTC) From: Kevin Traynor To: Gowrishankar Muthukrishnan Cc: dpdk stable Subject: patch 'test/crypto: fix RSA vector as per RFC 8017' has been queued to stable release 24.11.3 Date: Fri, 18 Jul 2025 20:30:59 +0100 Message-ID: <20250718193247.1008129-125-ktraynor@redhat.com> In-Reply-To: <20250718193247.1008129-1-ktraynor@redhat.com> References: <20250718193247.1008129-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: oIlpx6qR_Y3l2niMNPcXeI5ZDsnRPgG3J4TGoh03M0g_1752867434 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 24.11.3 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/23/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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/6fe3cdedf18322a99b80382feb009586b5376be8 Thanks. Kevin --- >From 6fe3cdedf18322a99b80382feb009586b5376be8 Mon Sep 17 00:00:00 2001 From: Gowrishankar Muthukrishnan Date: Fri, 20 Jun 2025 13:49:17 +0530 Subject: [PATCH] test/crypto: fix RSA vector as per RFC 8017 [ upstream commit 653ef76297342061b51c208412cedd46d9c71907 ] As per RFC 8017 (A.1.2), RSA private key should be represented with both exponent and CRT forms of data for inter operability. Fixes: a379799cbaaf ("test/crypto: add RSA key type CRT") Signed-off-by: Gowrishankar Muthukrishnan --- app/test/test_cryptodev_asym.c | 16 ++++++++--- app/test/test_cryptodev_rsa_test_vectors.h | 32 +++++----------------- 2 files changed, 19 insertions(+), 29 deletions(-) diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c index e2f74702ad..0d47b7b299 100644 --- a/app/test/test_cryptodev_asym.c +++ b/app/test/test_cryptodev_asym.c @@ -236,4 +236,5 @@ test_rsa_sign_verify(void) struct rte_mempool *sess_mpool = ts_params->session_mpool; uint8_t dev_id = ts_params->valid_devs[0]; + struct rte_crypto_asym_xform xform; void *sess = NULL; struct rte_cryptodev_info dev_info; @@ -251,5 +252,8 @@ test_rsa_sign_verify(void) } - ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess); + memcpy(&xform, &rsa_xform, sizeof(rsa_xform)); + xform.rsa.key_type = RTE_RSA_KEY_TYPE_EXP; + + ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess); if (ret < 0) { @@ -276,4 +280,5 @@ test_rsa_enc_dec(void) struct rte_mempool *sess_mpool = ts_params->session_mpool; uint8_t dev_id = ts_params->valid_devs[0]; + struct rte_crypto_asym_xform xform; void *sess = NULL; struct rte_cryptodev_info dev_info; @@ -291,5 +296,8 @@ test_rsa_enc_dec(void) } - ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess); + memcpy(&xform, &rsa_xform, sizeof(rsa_xform)); + xform.rsa.key_type = RTE_RSA_KEY_TYPE_EXP; + + ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess); if (ret < 0) { @@ -330,5 +338,5 @@ test_rsa_sign_verify_crt(void) } - ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess); + ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess); if (ret < 0) { @@ -370,5 +378,5 @@ test_rsa_enc_dec_crt(void) } - ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess); + ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess); if (ret < 0) { diff --git a/app/test/test_cryptodev_rsa_test_vectors.h b/app/test/test_cryptodev_rsa_test_vectors.h index 1b7b451387..9652b0d43a 100644 --- a/app/test/test_cryptodev_rsa_test_vectors.h +++ b/app/test/test_cryptodev_rsa_test_vectors.h @@ -341,5 +341,5 @@ uint8_t rsa_qInv[] = { }; -/** rsa xform using exponent key */ +/** rsa xform (of QT private key type by default) */ struct rte_crypto_asym_xform rsa_xform = { .next = NULL, @@ -355,27 +355,4 @@ struct rte_crypto_asym_xform rsa_xform = { .length = sizeof(rsa_e) }, - .key_type = RTE_RSA_KEY_TYPE_EXP, - .d = { - .data = rsa_d, - .length = sizeof(rsa_d) - } - } -}; - -/** rsa xform using quintuple key */ -struct rte_crypto_asym_xform rsa_xform_crt = { - .next = NULL, - .xform_type = RTE_CRYPTO_ASYM_XFORM_RSA, - .rsa = { - .padding.type = RTE_CRYPTO_RSA_PADDING_PKCS1_5, - .n = { - .data = rsa_n, - .length = sizeof(rsa_n) - }, - .e = { - .data = rsa_e, - .length = sizeof(rsa_e) - }, - .key_type = RTE_RSA_KEY_TYPE_QT, .qt = { .p = { @@ -399,5 +376,10 @@ struct rte_crypto_asym_xform rsa_xform_crt = { .length = sizeof(rsa_qInv) }, - } + }, + .d = { + .data = rsa_d, + .length = sizeof(rsa_d) + }, + .key_type = RTE_RSA_KEY_TYPE_QT } }; -- 2.50.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-07-18 20:29:15.391901810 +0100 +++ 0125-test-crypto-fix-RSA-vector-as-per-RFC-8017.patch 2025-07-18 20:29:11.072907766 +0100 @@ -1 +1 @@ -From 653ef76297342061b51c208412cedd46d9c71907 Mon Sep 17 00:00:00 2001 +From 6fe3cdedf18322a99b80382feb009586b5376be8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 653ef76297342061b51c208412cedd46d9c71907 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index 46bbc520e6..87c26322d0 100644 +index e2f74702ad..0d47b7b299 100644 @@ -22,2 +23,2 @@ -@@ -261,4 +261,5 @@ test_rsa_sign_verify(void) - struct rte_cryptodev_asym_capability_idx idx; +@@ -236,4 +236,5 @@ test_rsa_sign_verify(void) + struct rte_mempool *sess_mpool = ts_params->session_mpool; @@ -28 +29 @@ -@@ -281,5 +282,8 @@ test_rsa_sign_verify(void) +@@ -251,5 +252,8 @@ test_rsa_sign_verify(void) @@ -38,2 +39,2 @@ -@@ -307,4 +311,5 @@ test_rsa_enc_dec(void) - struct rte_cryptodev_asym_capability_idx idx; +@@ -276,4 +280,5 @@ test_rsa_enc_dec(void) + struct rte_mempool *sess_mpool = ts_params->session_mpool; @@ -44 +45 @@ -@@ -327,5 +332,8 @@ test_rsa_enc_dec(void) +@@ -291,5 +296,8 @@ test_rsa_enc_dec(void) @@ -54 +55 @@ -@@ -372,5 +380,5 @@ test_rsa_sign_verify_crt(void) +@@ -330,5 +338,5 @@ test_rsa_sign_verify_crt(void) @@ -61 +62 @@ -@@ -418,5 +426,5 @@ test_rsa_enc_dec_crt(void) +@@ -370,5 +378,5 @@ test_rsa_enc_dec_crt(void)