diff options
author | daurnimator <quae@daurnimator.com> | 2017-04-03 16:58:38 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-04-03 16:58:38 +1000 |
commit | 51a4b348321bb0b2594bbaaca2487f16c3dfcd34 (patch) | |
tree | 2f5f43d6f565cb8206f64e86a475deec369b6361 | |
parent | 91a652f1d977bb98d8baee0ba0a2df4eba7ca191 (diff) | |
parent | 9c2be15399e2026849529cd7bc79df2b0bfff4a9 (diff) | |
download | luaossl-51a4b348321bb0b2594bbaaca2487f16c3dfcd34.tar.gz luaossl-51a4b348321bb0b2594bbaaca2487f16c3dfcd34.tar.bz2 luaossl-51a4b348321bb0b2594bbaaca2487f16c3dfcd34.zip |
Merge branch 'xc_getSignatureName'
-rw-r--r-- | src/openssl.c | 18 |
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 | */ | ||
6105 | static int xc_getSignatureName(lua_State *L) { | 6108 | static 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 | ||
6119 | static int xc_sign(lua_State *L) { | 6121 | static 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 }, |