summaryrefslogtreecommitdiff
path: root/usr/src/lib/libkmf/plugins/kmf_openssl
diff options
context:
space:
mode:
authorAndy Fiddaman <omnios@citrus-it.co.uk>2021-07-30 15:27:54 +0000
committerAndy Fiddaman <omnios@citrus-it.co.uk>2021-08-04 08:48:42 +0000
commit6ff4183c538023f1acb277f9d3b05296bb816e66 (patch)
tree8c252afe6d0d66af2c820b2300431dd6aade1179 /usr/src/lib/libkmf/plugins/kmf_openssl
parent575694f6d7409fab127e6f2f326e13a764cc9a00 (diff)
downloadillumos-gate-6ff4183c538023f1acb277f9d3b05296bb816e66.tar.gz
13985 Support building with OpenSSL 3.0
Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Robert Mustacchi <rm@fingolfin.org> Reviewed by: Jason King <jason.brian.king@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/lib/libkmf/plugins/kmf_openssl')
-rw-r--r--usr/src/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/usr/src/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c b/usr/src/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c
index 142fa13f4a..1ef0000651 100644
--- a/usr/src/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c
+++ b/usr/src/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c
@@ -140,7 +140,9 @@ static uchar_t G[] = { 0x00, 0x62, 0x6d, 0x02, 0x78, 0x39, 0xea, 0x0a,
* Declare some new macros for managing stacks of EVP_PKEYS.
*/
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+/* BEGIN CSTYLED */
DECLARE_STACK_OF(EVP_PKEY)
+/* END CSTYLED */
#define sk_EVP_PKEY_new_null() SKM_sk_new_null(EVP_PKEY)
#define sk_EVP_PKEY_free(st) SKM_sk_free(EVP_PKEY, (st))
@@ -151,7 +153,9 @@ DECLARE_STACK_OF(EVP_PKEY)
(free_func))
#else
+/* BEGIN CSTYLED */
DEFINE_STACK_OF(EVP_PKEY)
+/* END CSTYLED */
#endif
mutex_t init_lock = DEFAULTMUTEX;
@@ -1388,8 +1392,13 @@ ssl_write_key(KMF_HANDLE *kmfh, KMF_ENCODE_FORMAT format, BIO *out,
KMF_CREDENTIAL *cred, EVP_PKEY *pkey, boolean_t private)
{
int rv = 0;
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ const RSA *rsa;
+ const DSA *dsa;
+#else
RSA *rsa;
DSA *dsa;
+#endif
if (pkey == NULL || out == NULL)
return (KMF_ERR_BAD_PARAMETER);
@@ -2066,8 +2075,13 @@ OpenSSL_CertGetPrintable(KMF_HANDLE_T handle, const KMF_DATA *pcert,
case KMF_CERT_PUBKEY_DATA:
{
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ const RSA *rsa;
+ const DSA *dsa;
+#else
RSA *rsa;
DSA *dsa;
+#endif
EVP_PKEY *pkey = X509_get_pubkey(xcert);
if (pkey == NULL) {