aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2017-01-16 16:35:13 +1100
committerLibravatarLibravatar daurnimator <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) {
} /* xc_getPublicKeyDigest() */
-#if 0
-/*
- * TODO: X509_get_signature_type always seems to return NID_undef. Are we
- * using it wrong or is it broken?
- */
static int xc_getSignatureName(lua_State *L) {
X509 *crt = checksimple(L, 1, X509_CERT_CLASS);
int nid;
- if (NID_undef == (nid = X509_get_signature_type(crt)))
+ if (NID_undef == (nid = X509_get_signature_nid(crt)))
return 0;
auxL_pushnid(L, nid);
return 1;
} /* xc_getSignatureName() */
-#endif
static int xc_sign(lua_State *L) {
@@ -6180,9 +6174,7 @@ static const auxL_Reg xc_methods[] = {
{ "getPublicKey", &xc_getPublicKey },
{ "setPublicKey", &xc_setPublicKey },
{ "getPublicKeyDigest", &xc_getPublicKeyDigest },
-#if 0
{ "getSignatureName", &xc_getSignatureName },
-#endif
{ "sign", &xc_sign },
{ "text", &xc_text },
{ "tostring", &xc__tostring },