summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/openssl.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/openssl.c b/src/openssl.c
index f5c851d..ab729d4 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -300,6 +300,10 @@
300#define HAVE_SSLV2_SERVER_METHOD (!OPENSSL_PREREQ(1,1,0) && !defined OPENSSL_NO_SSL2) 300#define HAVE_SSLV2_SERVER_METHOD (!OPENSSL_PREREQ(1,1,0) && !defined OPENSSL_NO_SSL2)
301#endif 301#endif
302 302
303#ifndef HAVE_X509_GET_SIGNATURE_NID
304#define HAVE_X509_GET_SIGNATURE_NID (OPENSSL_PREREQ(1,0,2))
305#endif
306
303#ifndef HAVE_X509_STORE_REFERENCES 307#ifndef HAVE_X509_STORE_REFERENCES
304#define HAVE_X509_STORE_REFERENCES (!OPENSSL_PREREQ(1,1,0)) 308#define HAVE_X509_STORE_REFERENCES (!OPENSSL_PREREQ(1,1,0))
305#endif 309#endif
@@ -1613,6 +1617,10 @@ static int compat_SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm) {
1613#define X509_get0_ext(crt, i) X509_get_ext((crt), (i)) 1617#define X509_get0_ext(crt, i) X509_get_ext((crt), (i))
1614#endif 1618#endif
1615 1619
1620#if !HAVE_X509_GET_SIGNATURE_NID
1621#define X509_get_signature_nid(crt) OBJ_obj2nid((crt)->sig_alg->algorithm)
1622#endif
1623
1616#if !HAVE_X509_CRL_GET0_EXT 1624#if !HAVE_X509_CRL_GET0_EXT
1617#define X509_CRL_get0_ext(crt, i) X509_CRL_get_ext((crt), (i)) 1625#define X509_CRL_get0_ext(crt, i) X509_CRL_get_ext((crt), (i))
1618#endif 1626#endif
@@ -6097,23 +6105,17 @@ static int xc_getPublicKeyDigest(lua_State *L) {
6097} /* xc_getPublicKeyDigest() */ 6105} /* xc_getPublicKeyDigest() */
6098 6106
6099 6107
6100#if 0
6101/*
6102 * TODO: X509_get_signature_type always seems to return NID_undef. Are we
6103 * using it wrong or is it broken?
6104 */
6105static int xc_getSignatureName(lua_State *L) { 6108static int xc_getSignatureName(lua_State *L) {
6106 X509 *crt = checksimple(L, 1, X509_CERT_CLASS); 6109 X509 *crt = checksimple(L, 1, X509_CERT_CLASS);
6107 int nid; 6110 int nid;
6108 6111
6109 if (NID_undef == (nid = X509_get_signature_type(crt))) 6112 if (NID_undef == (nid = X509_get_signature_nid(crt)))
6110 return 0; 6113 return 0;
6111 6114
6112 auxL_pushnid(L, nid); 6115 auxL_pushnid(L, nid);
6113 6116
6114 return 1; 6117 return 1;
6115} /* xc_getSignatureName() */ 6118} /* xc_getSignatureName() */
6116#endif
6117 6119
6118 6120
6119static int xc_sign(lua_State *L) { 6121static int xc_sign(lua_State *L) {
@@ -6260,9 +6262,7 @@ static const auxL_Reg xc_methods[] = {
6260 { "getPublicKey", &xc_getPublicKey }, 6262 { "getPublicKey", &xc_getPublicKey },
6261 { "setPublicKey", &xc_setPublicKey }, 6263 { "setPublicKey", &xc_setPublicKey },
6262 { "getPublicKeyDigest", &xc_getPublicKeyDigest }, 6264 { "getPublicKeyDigest", &xc_getPublicKeyDigest },
6263#if 0
6264 { "getSignatureName", &xc_getSignatureName }, 6265 { "getSignatureName", &xc_getSignatureName },
6265#endif
6266 { "sign", &xc_sign }, 6266 { "sign", &xc_sign },
6267 { "text", &xc_text }, 6267 { "text", &xc_text },
6268 { "tostring", &xc__tostring }, 6268 { "tostring", &xc__tostring },