summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-01-16 16:35:13 +1100
committerdaurnimator <quae@daurnimator.com>2017-01-16 16:35:36 +1100
commite9f16fa7037f72c02f4dc82a93f852d08d08ca39 (patch)
tree08f9e28e6b6bcadffa47b6ee654e1cf798376d5a
parentb4bf06dcb61dbd735b328f47d8a36afb856d5d16 (diff)
downloadluaossl-e9f16fa7037f72c02f4dc82a93f852d08d08ca39.tar.gz
luaossl-e9f16fa7037f72c02f4dc82a93f852d08d08ca39.tar.bz2
luaossl-e9f16fa7037f72c02f4dc82a93f852d08d08ca39.zip
Use X509_get_signature_nid instead of X509_get_signature_type to implement cert:getSignatureName()
Fixes #79
-rw-r--r--src/openssl.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/openssl.c b/src/openssl.c
index fa7dd79..a640ed6 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -6017,23 +6017,17 @@ static int xc_getPublicKeyDigest(lua_State *L) {
6017} /* xc_getPublicKeyDigest() */ 6017} /* xc_getPublicKeyDigest() */
6018 6018
6019 6019
6020#if 0
6021/*
6022 * TODO: X509_get_signature_type always seems to return NID_undef. Are we
6023 * using it wrong or is it broken?
6024 */
6025static int xc_getSignatureName(lua_State *L) { 6020static int xc_getSignatureName(lua_State *L) {
6026 X509 *crt = checksimple(L, 1, X509_CERT_CLASS); 6021 X509 *crt = checksimple(L, 1, X509_CERT_CLASS);
6027 int nid; 6022 int nid;
6028 6023
6029 if (NID_undef == (nid = X509_get_signature_type(crt))) 6024 if (NID_undef == (nid = X509_get_signature_nid(crt)))
6030 return 0; 6025 return 0;
6031 6026
6032 auxL_pushnid(L, nid); 6027 auxL_pushnid(L, nid);
6033 6028
6034 return 1; 6029 return 1;
6035} /* xc_getSignatureName() */ 6030} /* xc_getSignatureName() */
6036#endif
6037 6031
6038 6032
6039static int xc_sign(lua_State *L) { 6033static int xc_sign(lua_State *L) {
@@ -6180,9 +6174,7 @@ static const auxL_Reg xc_methods[] = {
6180 { "getPublicKey", &xc_getPublicKey }, 6174 { "getPublicKey", &xc_getPublicKey },
6181 { "setPublicKey", &xc_setPublicKey }, 6175 { "setPublicKey", &xc_setPublicKey },
6182 { "getPublicKeyDigest", &xc_getPublicKeyDigest }, 6176 { "getPublicKeyDigest", &xc_getPublicKeyDigest },
6183#if 0
6184 { "getSignatureName", &xc_getSignatureName }, 6177 { "getSignatureName", &xc_getSignatureName },
6185#endif
6186 { "sign", &xc_sign }, 6178 { "sign", &xc_sign },
6187 { "text", &xc_text }, 6179 { "text", &xc_text },
6188 { "tostring", &xc__tostring }, 6180 { "tostring", &xc__tostring },