From: Brian Dooley <brian.dooley@intel.com>
To: Kai Ji <kai.ji@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org, gakhil@marvell.com,
david.coyle@intel.com, kevin.osullivan@intel.com,
Brian Dooley <brian.dooley@intel.com>
Subject: [PATCH v2] crypto/qat: fix reallocate OpenSSL version check
Date: Wed, 2 Nov 2022 09:54:08 +0000 [thread overview]
Message-ID: <20221102095408.327440-1-brian.dooley@intel.com> (raw)
In-Reply-To: <20221031174919.642522-1-brian.dooley@intel.com>
Move the ossl_legacy_provider_unload() into the right place for secure
protocol for QAT. Remove unnecessary unload from session destroy.
Fixes: 52d59b92b06d ("crypto/qat: enable OpenSSL legacy provider in session")
Cc: kai.ji@intel.com
CC: stable@dpdk.org
Signed-off-by: Brian Dooley <brian.dooley@intel.com>
---
v2:
- Use ossl legacy provider helper functions
- Cast session pointer to void
---
drivers/crypto/qat/qat_sym_session.c | 26 +++++++-------------------
1 file changed, 7 insertions(+), 19 deletions(-)
diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 71fa595031..0ebc66f89e 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -520,19 +520,7 @@ qat_sym_session_configure(struct rte_cryptodev *dev,
int ret;
#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
- OSSL_PROVIDER * legacy;
- OSSL_PROVIDER *deflt;
-
- /* Load Multiple providers into the default (NULL) library context */
- legacy = OSSL_PROVIDER_load(NULL, "legacy");
- if (legacy == NULL)
- return -EINVAL;
-
- deflt = OSSL_PROVIDER_load(NULL, "default");
- if (deflt == NULL) {
- OSSL_PROVIDER_unload(legacy);
- return -EINVAL;
- }
+ ossl_legacy_provider_load();
#endif
ret = qat_sym_session_set_parameters(dev, xform,
CRYPTODEV_GET_SYM_SESS_PRIV(sess),
@@ -545,8 +533,7 @@ qat_sym_session_configure(struct rte_cryptodev *dev,
}
# if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
- OSSL_PROVIDER_unload(legacy);
- OSSL_PROVIDER_unload(deflt);
+ ossl_legacy_provider_unload();
# endif
return 0;
}
@@ -2639,7 +2626,8 @@ qat_sec_session_set_docsis_parameters(struct rte_cryptodev *dev,
return ret;
qat_sym_session_finalize(session);
- return qat_sym_gen_dev_ops[qat_dev_gen].set_session((void *)cdev, session);
+ return qat_sym_gen_dev_ops[qat_dev_gen].set_session((void *)cdev,
+ (void *)session);
}
int
@@ -2668,6 +2656,9 @@ qat_security_session_create(void *dev,
return ret;
}
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+ ossl_legacy_provider_unload();
+#endif
return 0;
}
@@ -2684,9 +2675,6 @@ qat_security_session_destroy(void *dev __rte_unused,
memset(s, 0, qat_sym_session_get_private_size(dev));
}
-# if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
- ossl_legacy_provider_unload();
-# endif
return 0;
}
--
2.25.1
next prev parent reply other threads:[~2022-11-02 9:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-31 17:49 [PATCH v1] " Brian Dooley
2022-11-01 17:04 ` Ji, Kai
2022-11-02 9:54 ` Brian Dooley [this message]
2022-11-02 23:30 ` [PATCH v2] " Ji, Kai
2022-11-03 10:55 ` Akhil Goyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221102095408.327440-1-brian.dooley@intel.com \
--to=brian.dooley@intel.com \
--cc=david.coyle@intel.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=kai.ji@intel.com \
--cc=kevin.osullivan@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).