From c366e459c0bc83ec749efb6bf5bd36da25c48105 Mon Sep 17 00:00:00 2001 From: william Date: Thu, 4 Jun 2015 12:28:42 -0700 Subject: use X509_get0_pubkey_bitstr to get reference to public key ASN.1 bit string object --- src/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/openssl.c b/src/openssl.c index 646e2ae..3c4a237 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -3722,7 +3722,7 @@ static int xc_setPublicKey(lua_State *L) { static int xc_getPublicKeyDigest(lua_State *L) { - ASN1_BIT_STRING *pk = ((X509 *)checksimple(L, 1, X509_CERT_CLASS))->cert_info->key->public_key; + ASN1_BIT_STRING *pk = X509_get0_pubkey_bitstr(checksimple(L, 1, X509_CERT_CLASS)); const char *id = luaL_optstring(L, 2, "sha1"); const EVP_MD *md; unsigned char digest[EVP_MAX_MD_SIZE]; -- cgit v1.2.3-59-g8ed1b