mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
openssl: fix compiler warning with OpenSSL master
vtls/openssl.c:469:15: error: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] X509_get_X509_PUBKEY() now returns a const pointer - but only on OpenSSL 3, we must keep the non-const version for all forks. Closes #20681
This commit is contained in:
parent
e8415ad3c7
commit
3877db7bcf
@ -389,6 +389,13 @@ static CURLcode get_pkey_dh(struct Curl_easy *data,
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENSSL3
|
||||
/* from OpenSSL commit fc756e594ed5a27af378 */
|
||||
typedef const X509_PUBKEY pubkeytype_t;
|
||||
#else
|
||||
typedef X509_PUBKEY pubkeytype_t;
|
||||
#endif
|
||||
|
||||
static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl)
|
||||
{
|
||||
CURLcode result;
|
||||
@ -453,7 +460,7 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl)
|
||||
|
||||
{
|
||||
const X509_ALGOR *sigalg = NULL;
|
||||
X509_PUBKEY *xpubkey = NULL;
|
||||
pubkeytype_t *xpubkey = NULL;
|
||||
ASN1_OBJECT *pubkeyoid = NULL;
|
||||
|
||||
X509_get0_signature(&psig, &sigalg, x);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user