From c4c93166f1b797b939e56c92f83614d9239810f0 Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 2 Aug 2016 11:55:04 +0000 Subject: [PATCH] Correct usage of RSA_get0_key according to OpenSSL version --- nse_ssl_cert.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nse_ssl_cert.cc b/nse_ssl_cert.cc index 3867a88f1..09ac69d61 100644 --- a/nse_ssl_cert.cc +++ b/nse_ssl_cert.cc @@ -569,10 +569,14 @@ static int parse_ssl_cert(lua_State *L, X509 *cert) lua_setmetatable( L, -2 ); #if OPENSSL_VERSION_NUMBER < 0x10100000L data->bn = rsa->e; - #else + #elif OPENSSL_VERSION_NUMBER < 0x10100006L BIGNUM *n, *e, *d; RSA_get0_key(rsa, &n, &e, &d); data->bn = e; + #else + const BIGNUM *n, *e, *d; + RSA_get0_key(rsa, &n, &e, &d); + data->bn = (BIGNUM*) e; #endif lua_setfield(L, -2, "exponent"); }