From 48eef5213f0fe92e6912591d9b52f2baa1fc3ba1 Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 31 Aug 2022 13:43:37 +0000 Subject: [PATCH] Fix incorrect constness for some OpenSSL versions --- nse_ssl_cert.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nse_ssl_cert.cc b/nse_ssl_cert.cc index d2a30be90..d0646cced 100644 --- a/nse_ssl_cert.cc +++ b/nse_ssl_cert.cc @@ -643,11 +643,12 @@ static int parse_ssl_cert(lua_State *L, X509 *cert) luaL_getmetatable( L, "BIGNUM" ); lua_setmetatable( L, -2 ); #if HAVE_OPAQUE_STRUCTS - BIGNUM *n = NULL, *e = NULL; #if OPENSSL_API_LEVEL < 30000 + const BIGNUM *n = NULL, *e = NULL; data->should_free = false; RSA_get0_key(rsa, &n, &e, NULL); #else + BIGNUM *n = NULL, *e = NULL; data->should_free = true; EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_RSA_E, &e); EVP_PKEY_get_bn_param(pubkey, OSSL_PKEY_PARAM_RSA_N, &n);