DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] crypto/openssl: fix inproper freeing of asymmetric crypto keys in rsa
@ 2019-07-01 14:57 Arek Kusztal
  2019-07-02  9:44 ` Trahe, Fiona
  0 siblings, 1 reply; 3+ messages in thread
From: Arek Kusztal @ 2019-07-01 14:57 UTC (permalink / raw)
  To: dev; +Cc: akhil.goyal, fiona.trahe, declan.doherty, Arek Kusztal

In case big number need to be freed, data it contains should be cleared
before especially if it is critical data like private keys.

Fixes: 3e9d6bd447fb ("crypto/openssl: add RSA and mod asym operations")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
v2:
- removed unnecessary config lines

 drivers/crypto/openssl/rte_openssl_pmd_ops.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index 40217cf..a307c91 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -912,14 +912,14 @@ static int openssl_set_asym_session_parameters(
 		asym_session->xfrm_type = RTE_CRYPTO_ASYM_XFORM_RSA;
 		break;
 err_rsa:
-		BN_free(n);
-		BN_free(e);
-		BN_free(d);
-		BN_free(p);
-		BN_free(q);
-		BN_free(dmp1);
-		BN_free(dmq1);
-		BN_free(iqmp);
+		BN_clear_free(n);
+		BN_clear_free(e);
+		BN_clear_free(d);
+		BN_clear_free(p);
+		BN_clear_free(q);
+		BN_clear_free(dmp1);
+		BN_clear_free(dmq1);
+		BN_clear_free(iqmp);
 
 		return -1;
 	}
-- 
2.1.0


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

* Re: [dpdk-dev] [PATCH v2] crypto/openssl: fix inproper freeing of asymmetric crypto keys in rsa
  2019-07-01 14:57 [dpdk-dev] [PATCH v2] crypto/openssl: fix inproper freeing of asymmetric crypto keys in rsa Arek Kusztal
@ 2019-07-02  9:44 ` Trahe, Fiona
  2019-07-03  9:45   ` Akhil Goyal
  0 siblings, 1 reply; 3+ messages in thread
From: Trahe, Fiona @ 2019-07-02  9:44 UTC (permalink / raw)
  To: Kusztal, ArkadiuszX, dev; +Cc: akhil.goyal, Doherty, Declan, Trahe, Fiona



> -----Original Message-----
> From: Kusztal, ArkadiuszX
> Sent: Monday, July 1, 2019 3:57 PM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; Trahe, Fiona <fiona.trahe@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>; Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Subject: [PATCH v2] crypto/openssl: fix inproper freeing of asymmetric crypto keys in rsa
> 
> In case big number need to be freed, data it contains should be cleared
> before especially if it is critical data like private keys.
> 
> Fixes: 3e9d6bd447fb ("crypto/openssl: add RSA and mod asym operations")
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>

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

* Re: [dpdk-dev] [PATCH v2] crypto/openssl: fix inproper freeing of asymmetric crypto keys in rsa
  2019-07-02  9:44 ` Trahe, Fiona
@ 2019-07-03  9:45   ` Akhil Goyal
  0 siblings, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2019-07-03  9:45 UTC (permalink / raw)
  To: Trahe, Fiona, Kusztal, ArkadiuszX, dev; +Cc: Doherty, Declan



> >
> > In case big number need to be freed, data it contains should be cleared
> > before especially if it is critical data like private keys.
> >
> > Fixes: 3e9d6bd447fb ("crypto/openssl: add RSA and mod asym operations")
> >
> > Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> Acked-by: Fiona Trahe <fiona.trahe@intel.com>

Applied to dpdk-next-crypto

Thanks.


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

end of thread, other threads:[~2019-07-03  9:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-01 14:57 [dpdk-dev] [PATCH v2] crypto/openssl: fix inproper freeing of asymmetric crypto keys in rsa Arek Kusztal
2019-07-02  9:44 ` Trahe, Fiona
2019-07-03  9:45   ` 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).