aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar William Ahern <william@25thandclement.com> 2016-12-09 18:29:31 -0800
committerLibravatarLibravatar William Ahern <william@25thandclement.com> 2016-12-09 18:29:31 -0800
commit670a1123a04deb4195e137a8a504b34d18e2fff8 (patch)
tree6c627541a730bd8bc9da93ff30abb574f2f6daaf
parent66326ec384bfde94a999c12a696aa6e5402b6ff4 (diff)
downloadluaossl-670a1123a04deb4195e137a8a504b34d18e2fff8.tar.gz
luaossl-670a1123a04deb4195e137a8a504b34d18e2fff8.tar.bz2
luaossl-670a1123a04deb4195e137a8a504b34d18e2fff8.zip
apply patch recommended by daurnimator in issue #75
-rw-r--r--src/openssl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c
index ef0c6a6..112a4c8 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -8098,6 +8098,15 @@ static int ssl_getParam(lua_State *L) {
} /* ssl_getParam() */
+static int ssl_getVerifyResult(lua_State *L) {
+ SSL *ssl = checksimple(L, 1, SSL_CLASS);
+ long res = SSL_get_verify_result(ssl);
+ lua_pushinteger(L, res);
+ lua_pushstring(L, X509_verify_cert_error_string(res));
+ return 2;
+} /* ssl_getVerifyResult() */
+
+
static int ssl_getPeerCertificate(lua_State *L) {
SSL *ssl = checksimple(L, 1, SSL_CLASS);
X509 **x509 = prepsimple(L, X509_CERT_CLASS);
@@ -8287,6 +8296,7 @@ static const auxL_Reg ssl_methods[] = {
{ "clearOptions", &ssl_clearOptions },
{ "setParam", &ssl_setParam },
{ "getParam", &ssl_getParam },
+ { "getVerifyResult", &ssl_getVerifyResult },
{ "getPeerCertificate", &ssl_getPeerCertificate },
{ "getPeerChain", &ssl_getPeerChain },
{ "getCipherInfo", &ssl_getCipherInfo },