summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-03-08 23:11:19 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-03-09 08:15:36 +0100
commitb7e01382d65b4ba6b5b14b24e6ba4319fd9abe20 (patch)
tree01502c8b22f92e35ae697e4bb76fd8b3a2c49b5b
parentec549aa6254b4f1b8bd612f973a5c44d20a4d20b (diff)
downloadcurl-b7e01382d65b4ba6b5b14b24e6ba4319fd9abe20.tar.gz
openssl: adapt to v3's new const for a few API calls
Closes #6703
-rw-r--r--lib/vtls/openssl.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index e14368ee8..9989ca460 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -3492,6 +3492,12 @@ typedef size_t numcert_t;
typedef int numcert_t;
#endif
+#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3)
+#define OSSL3_CONST const
+#else
+#define OSSL3_CONST
+#endif
+
static CURLcode get_cert_chain(struct Curl_easy *data,
struct ssl_connect_data *connssl)
{
@@ -3599,7 +3605,7 @@ static CURLcode get_cert_chain(struct Curl_easy *data,
switch(pktype) {
case EVP_PKEY_RSA:
{
- RSA *rsa;
+ OSSL3_CONST RSA *rsa;
#ifdef HAVE_OPAQUE_EVP_PKEY
rsa = EVP_PKEY_get0_RSA(pubkey);
#else
@@ -3629,7 +3635,7 @@ static CURLcode get_cert_chain(struct Curl_easy *data,
case EVP_PKEY_DSA:
{
#ifndef OPENSSL_NO_DSA
- DSA *dsa;
+ OSSL3_CONST DSA *dsa;
#ifdef HAVE_OPAQUE_EVP_PKEY
dsa = EVP_PKEY_get0_DSA(pubkey);
#else
@@ -3661,7 +3667,7 @@ static CURLcode get_cert_chain(struct Curl_easy *data,
}
case EVP_PKEY_DH:
{
- DH *dh;
+ OSSL3_CONST DH *dh;
#ifdef HAVE_OPAQUE_EVP_PKEY
dh = EVP_PKEY_get0_DH(pubkey);
#else