From 9c2be15399e2026849529cd7bc79df2b0bfff4a9 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 3 Apr 2017 16:58:06 +1000 Subject: Add compat with openssl < 1.0.2 for X509_get_signature_nid --- src/openssl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/openssl.c b/src/openssl.c index a640ed6..dd406bc 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -302,6 +302,10 @@ #define HAVE_SSLV2_SERVER_METHOD (!OPENSSL_PREREQ(1,1,0) && !defined OPENSSL_NO_SSL2) #endif +#ifndef HAVE_X509_GET_SIGNATURE_NID +#define HAVE_X509_GET_SIGNATURE_NID (OPENSSL_PREREQ(1,0,2)) +#endif + #ifndef HAVE_X509_STORE_REFERENCES #define HAVE_X509_STORE_REFERENCES (!OPENSSL_PREREQ(1,1,0)) #endif @@ -1615,6 +1619,10 @@ static int compat_SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm) { #define X509_get0_ext(crt, i) X509_get_ext((crt), (i)) #endif +#if !HAVE_X509_GET_SIGNATURE_NID +#define X509_get_signature_nid(crt) OBJ_obj2nid((crt)->sig_alg->algorithm) +#endif + #if !HAVE_X509_CRL_GET0_EXT #define X509_CRL_get0_ext(crt, i) X509_CRL_get_ext((crt), (i)) #endif -- cgit v1.2.3-59-g8ed1b