DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] crypto/qat: fix uncleared cookies in asym
@ 2022-09-28 15:58 Arek Kusztal
  2022-09-28 15:58 ` [PATCH 2/2] crypto/qat: fix not set rsa lengths Arek Kusztal
  0 siblings, 1 reply; 3+ messages in thread
From: Arek Kusztal @ 2022-09-28 15:58 UTC (permalink / raw)
  To: dev; +Cc: gakhil, kai.ji, Arek Kusztal

Fixed incorrectly placed clean function in asym response.

Fixes: 002486db239e ("crypto/qat: refactor asymmetric session")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/crypto/qat/qat_asym.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c
index 19931791c4..4b0538eea8 100644
--- a/drivers/crypto/qat/qat_asym.c
+++ b/drivers/crypto/qat/qat_asym.c
@@ -906,6 +906,8 @@ qat_asym_process_response(void **out_op, uint8_t *resp,
 					" returned error");
 		}
 	}
+	if (op->status == RTE_CRYPTO_OP_STATUS_ERROR)
+		goto finalize;
 
 	switch (op->sess_type) {
 	case RTE_CRYPTO_OP_WITH_SESSION:
@@ -923,9 +925,10 @@ qat_asym_process_response(void **out_op, uint8_t *resp,
 	if (op->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED) {
 		op->status = qat_asym_collect_response(op,
 					cookie, xform);
-		cleanup(cookie, xform, cookie->alg_bytesize);
 	}
 
+finalize:
+	cleanup(cookie, xform, cookie->alg_bytesize);
 	*out_op = op;
 	HEXDUMP("resp_msg:", resp_msg, sizeof(struct icp_qat_fw_pke_resp));
 
-- 
2.13.6


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] crypto/qat: fix not set rsa lengths
  2022-09-28 15:58 [PATCH 1/2] crypto/qat: fix uncleared cookies in asym Arek Kusztal
@ 2022-09-28 15:58 ` Arek Kusztal
  2022-10-07 10:56   ` [EXT] " Akhil Goyal
  0 siblings, 1 reply; 3+ messages in thread
From: Arek Kusztal @ 2022-09-28 15:58 UTC (permalink / raw)
  To: dev; +Cc: gakhil, kai.ji, Arek Kusztal

Fixed not set output length in asym pmd
when doing RSA.

Fixes: 002486db239e ("crypto/qat: refactor asymmetric session")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/crypto/qat/qat_asym.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c
index 4b0538eea8..78e18dfc1a 100644
--- a/drivers/crypto/qat/qat_asym.c
+++ b/drivers/crypto/qat/qat_asym.c
@@ -505,21 +505,19 @@ rsa_collect(struct rte_crypto_asym_op *asym_op,
 
 		if (asym_op->rsa.op_type ==
 				RTE_CRYPTO_ASYM_OP_ENCRYPT) {
-			uint8_t *rsa_result = asym_op->rsa.cipher.data;
-
-			rte_memcpy(rsa_result,
+			rte_memcpy(asym_op->rsa.cipher.data,
 					cookie->output_array[0],
 					alg_bytesize);
+			asym_op->rsa.cipher.length = alg_bytesize;
 			HEXDUMP("RSA Encrypted data", cookie->output_array[0],
 				alg_bytesize);
 		} else {
-			uint8_t *rsa_result = asym_op->rsa.cipher.data;
-
 			switch (asym_op->rsa.padding.type) {
 			case RTE_CRYPTO_RSA_PADDING_NONE:
-				rte_memcpy(rsa_result,
+				rte_memcpy(asym_op->rsa.cipher.data,
 						cookie->output_array[0],
 						alg_bytesize);
+				asym_op->rsa.cipher.length = alg_bytesize;
 				HEXDUMP("RSA signature",
 					cookie->output_array[0],
 					alg_bytesize);
@@ -531,13 +529,12 @@ rsa_collect(struct rte_crypto_asym_op *asym_op,
 		}
 	} else {
 		if (asym_op->rsa.op_type == RTE_CRYPTO_ASYM_OP_DECRYPT) {
-			uint8_t *rsa_result = asym_op->rsa.message.data;
-
 			switch (asym_op->rsa.padding.type) {
 			case RTE_CRYPTO_RSA_PADDING_NONE:
-				rte_memcpy(rsa_result,
+				rte_memcpy(asym_op->rsa.message.data,
 					cookie->output_array[0],
 					alg_bytesize);
+				asym_op->rsa.message.length = alg_bytesize;
 				HEXDUMP("RSA Decrypted Message",
 					cookie->output_array[0],
 					alg_bytesize);
@@ -547,11 +544,10 @@ rsa_collect(struct rte_crypto_asym_op *asym_op,
 				return RTE_CRYPTO_OP_STATUS_ERROR;
 			}
 		} else {
-			uint8_t *rsa_result = asym_op->rsa.sign.data;
-
-			rte_memcpy(rsa_result,
-					cookie->output_array[0],
-					alg_bytesize);
+			rte_memcpy(asym_op->rsa.sign.data,
+				cookie->output_array[0],
+				alg_bytesize);
+			asym_op->rsa.sign.length = alg_bytesize;
 			HEXDUMP("RSA Signature", cookie->output_array[0],
 				alg_bytesize);
 		}
-- 
2.13.6


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [EXT] [PATCH 2/2] crypto/qat: fix not set rsa lengths
  2022-09-28 15:58 ` [PATCH 2/2] crypto/qat: fix not set rsa lengths Arek Kusztal
@ 2022-10-07 10:56   ` Akhil Goyal
  0 siblings, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2022-10-07 10:56 UTC (permalink / raw)
  To: Arek Kusztal, dev; +Cc: kai.ji

> Fixed not set output length in asym pmd
> when doing RSA.
> 
> Fixes: 002486db239e ("crypto/qat: refactor asymmetric session")
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Please fix compilation

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-07 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28 15:58 [PATCH 1/2] crypto/qat: fix uncleared cookies in asym Arek Kusztal
2022-09-28 15:58 ` [PATCH 2/2] crypto/qat: fix not set rsa lengths Arek Kusztal
2022-10-07 10:56   ` [EXT] " Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).