0
0
mirror of https://github.com/OpenVPN/openvpn.git synced 2024-09-20 12:02:28 +02:00

Ensure using const variables with EVP_PKEY_get0_*

These functions return const pointers in OpenSSL 3.0.0alpha14, so
our pointers should be also const to avoid casting the const away.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20210408133626.29232-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22081.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
Arne Schwabe 2021-04-08 15:36:26 +02:00 committed by Gert Doering
parent 8d109f68fd
commit 6fc292d2ed

View File

@ -1248,12 +1248,11 @@ static int
tls_ctx_use_external_rsa_key(struct tls_root_ctx *ctx, EVP_PKEY *pkey)
{
RSA *rsa = NULL;
RSA *pub_rsa;
RSA_METHOD *rsa_meth;
ASSERT(NULL != ctx);
pub_rsa = EVP_PKEY_get0_RSA(pkey);
const RSA *pub_rsa = EVP_PKEY_get0_RSA(pkey);
ASSERT(NULL != pub_rsa);
/* allocate custom RSA method object */
@ -2027,7 +2026,7 @@ print_cert_details(X509 *cert, char *buf, size_t buflen)
#ifndef OPENSSL_NO_EC
if (typeid == EVP_PKEY_EC && EVP_PKEY_get0_EC_KEY(pkey) != NULL)
{
EC_KEY *ec = EVP_PKEY_get0_EC_KEY(pkey);
const EC_KEY *ec = EVP_PKEY_get0_EC_KEY(pkey);
const EC_GROUP *group = EC_KEY_get0_group(ec);
int nid = EC_GROUP_get_curve_name(group);