aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2018-05-30 15:05:43 +1000
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2018-05-30 15:05:43 +1000
commit2d520232eaee5f27c31e8930b26d9d32fbcc858e (patch)
treed38f2a8c2fed825db82af1fd7598d3e46abafeee /src
parent1ad9aa61ebe99ae9f39b5ce3c3d1d5bf42a05e64 (diff)
downloadluaossl-2d520232eaee5f27c31e8930b26d9d32fbcc858e.tar.gz
luaossl-2d520232eaee5f27c31e8930b26d9d32fbcc858e.tar.bz2
luaossl-2d520232eaee5f27c31e8930b26d9d32fbcc858e.zip
src/openssl.c: X509_CRL only became more than an ASN1 wrapper in 1.0.0
Diffstat (limited to 'src')
-rw-r--r--src/openssl.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c
index 01f152e..6d349f1 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -397,6 +397,14 @@
#define HAVE_X509_CRL_GET0_NEXTUPDATE (OPENSSL_PREREQ(1,1,0) || LIBRESSL_PREREQ(2,7,0))
#endif
+#ifndef HAVE_X509_CRL_GET0_BY_CERT
+#define HAVE_X509_CRL_GET0_BY_CERT (OPENSSL_PREREQ(1,0,0) || LIBRESSL_PREREQ(2,0,0))
+#endif
+
+#ifndef HAVE_X509_CRL_GET0_BY_SERIAL
+#define HAVE_X509_CRL_GET0_BY_SERIAL (OPENSSL_PREREQ(1,0,0) || LIBRESSL_PREREQ(2,0,0))
+#endif
+
#ifndef HAVE_X509_CRL_SET1_LASTUPDATE
#define HAVE_X509_CRL_SET1_LASTUPDATE (OPENSSL_PREREQ(1,1,0) || LIBRESSL_PREREQ(2,7,0))
#endif
@@ -7424,6 +7432,7 @@ error:
} /* xx_add() */
+#if HAVE_X509_CRL_GET0_BY_SERIAL
static int xx_lookupSerial(lua_State *L) {
X509_CRL *crl = checksimple(L, 1, X509_CRL_CLASS);
ASN1_INTEGER *serial;
@@ -7450,8 +7459,10 @@ static int xx_lookupSerial(lua_State *L) {
return luaL_error(L, "x509.crl:lookupSerial: unexpected return value");
}
} /* xx_lookupSerial() */
+#endif
+#if HAVE_X509_CRL_GET0_BY_CERT
static int xx_lookupCertificate(lua_State *L) {
X509_CRL *crl = checksimple(L, 1, X509_CRL_CLASS);
X509 *crt = checksimple(L, 2, X509_CERT_CLASS);
@@ -7470,6 +7481,7 @@ static int xx_lookupCertificate(lua_State *L) {
return luaL_error(L, "x509.crl:lookupCertificate: unexpected return value");
}
} /* xx_lookupCertificate() */
+#endif
static int xx_addExtension(lua_State *L) {
@@ -7659,8 +7671,12 @@ static const auxL_Reg xx_methods[] = {
{ "getIssuer", &xx_getIssuer },
{ "setIssuer", &xx_setIssuer },
{ "add", &xx_add },
+#if HAVE_X509_CRL_GET0_BY_SERIAL
{ "lookupSerial", &xx_lookupSerial },
+#endif
+#if HAVE_X509_CRL_GET0_BY_CERT
{ "lookupCertificate", &xx_lookupCertificate },
+#endif
{ "addExtension", &xx_addExtension },
{ "setExtension", &xx_setExtension },
{ "getExtension", &xx_getExtension },