aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar Pascal Fellerich <Pascal.Fellerich@ses.com> 2017-04-03 14:46:36 +1000
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2017-04-03 15:52:26 +1000
commitd77caf28ae5af5cd4b759d436c4c94870d8d26a3 (patch)
treea62e7b08dc381dea688ff51d9f3951db24a3a511
parent159354a58afda90f213f0858db89dfbd87ae74eb (diff)
downloadluaossl-d77caf28ae5af5cd4b759d436c4c94870d8d26a3.tar.gz
luaossl-d77caf28ae5af5cd4b759d436c4c94870d8d26a3.tar.bz2
luaossl-d77caf28ae5af5cd4b759d436c4c94870d8d26a3.zip
New: method crl:verify(publickey) added, documentation updated.
-rw-r--r--doc/luaossl.tex4
-rw-r--r--src/openssl.c14
2 files changed, 18 insertions, 0 deletions
diff --git a/doc/luaossl.tex b/doc/luaossl.tex
index 4f06ecf..0675e62 100644
--- a/doc/luaossl.tex
+++ b/doc/luaossl.tex
@@ -693,6 +693,10 @@ Returns the integer count of the number of extensions.
Signs the instance CRL using the \module{openssl.pkey} $key$.
+\subsubsection[\fn{crl:verify}]{\fn{crl:verify($publickey$)}}
+
+Verifies the instance CRL using a public key.
+
\subsubsection[\fn{crl:text}]{\fn{crl:text()}}
Returns a human-readable textual representation of the instance CRL.
diff --git a/src/openssl.c b/src/openssl.c
index 5a8e03f..0910bb3 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -6838,6 +6838,19 @@ static int xx_sign(lua_State *L) {
} /* xx_sign() */
+static int xx_verify(lua_State *L) {
+ X509_CRL *crl = checksimple(L, 1, X509_CRL_CLASS);
+ EVP_PKEY *key = checksimple(L, 2, PKEY_CLASS);
+
+ if (!X509_CRL_verify(crl, key))
+ return auxL_error(L, auxL_EOPENSSL, "x509.crl:verify");
+
+ lua_pushboolean(L, 1);
+
+ return 1;
+} /* xx_verify() */
+
+
static int xx_text(lua_State *L) {
X509_CRL *crl = checksimple(L, 1, X509_CRL_CLASS);
@@ -6907,6 +6920,7 @@ static const auxL_Reg xx_methods[] = {
{ "getExtension", &xx_getExtension },
{ "getExtensionCount", &xx_getExtensionCount },
{ "sign", &xx_sign },
+ { "verify", &xx_verify },
{ "text", &xx_text },
{ "tostring", &xx__tostring },
{ NULL, NULL },