From f9afada3d1100cfb2fe498cac28ad75e228a2c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B5=D1=80=D1=85=D0=B0=D1=80=D0=B4=20PICCORO=20Len?= =?UTF-8?q?z=20McKAY?= Date: Fri, 24 Jun 2022 01:09:44 -0400 Subject: [PATCH] backguard compat for openssl on providers, like LTS linuxes * The commit https://github.com/brunoos/luasec/commit/de393417b7c7566caf1e0a0ad54132942ac4f049 introduces high dependency due raices requirement to openssl 1.1.0l+ * The X509_REQ_get0_signature(), X509_REQ_get_signature_nid(), X509_CRL_get0_signature() and X509_CRL_get_signature_nid() were added in OpenSSL 1.1.0. * This patch makes luasec runs on all kind of embebed systems that cannot be upgraded due vendors limitations --- src/x509.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/x509.c b/src/x509.c index 5221bef..f82c5a0 100644 --- a/src/x509.c +++ b/src/x509.c @@ -655,6 +655,7 @@ static int meth_set_encode(lua_State* L) return 1; } +#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL) /** * Get signature name. */ @@ -669,6 +670,7 @@ static int meth_get_signature_name(lua_State* L) lua_pushstring(L, name); return 1; } +#endif /*---------------------------------------------------------------------------*/ @@ -698,7 +700,9 @@ static luaL_Reg methods[] = { {"digest", meth_digest}, {"setencode", meth_set_encode}, {"extensions", meth_extensions}, +#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL) {"getsignaturename", meth_get_signature_name}, +#endif {"issuer", meth_issuer}, {"notbefore", meth_notbefore}, {"notafter", meth_notafter},