summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Fellerich <Pascal.Fellerich@ses.com>2017-04-03 14:46:36 +1000
committerdaurnimator <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.
693 693
694Signs the instance CRL using the \module{openssl.pkey} $key$. 694Signs the instance CRL using the \module{openssl.pkey} $key$.
695 695
696\subsubsection[\fn{crl:verify}]{\fn{crl:verify($publickey$)}}
697
698Verifies the instance CRL using a public key.
699
696\subsubsection[\fn{crl:text}]{\fn{crl:text()}} 700\subsubsection[\fn{crl:text}]{\fn{crl:text()}}
697 701
698Returns a human-readable textual representation of the instance CRL. 702Returns 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) {
6838} /* xx_sign() */ 6838} /* xx_sign() */
6839 6839
6840 6840
6841static int xx_verify(lua_State *L) {
6842 X509_CRL *crl = checksimple(L, 1, X509_CRL_CLASS);
6843 EVP_PKEY *key = checksimple(L, 2, PKEY_CLASS);
6844
6845 if (!X509_CRL_verify(crl, key))
6846 return auxL_error(L, auxL_EOPENSSL, "x509.crl:verify");
6847
6848 lua_pushboolean(L, 1);
6849
6850 return 1;
6851} /* xx_verify() */
6852
6853
6841static int xx_text(lua_State *L) { 6854static int xx_text(lua_State *L) {
6842 X509_CRL *crl = checksimple(L, 1, X509_CRL_CLASS); 6855 X509_CRL *crl = checksimple(L, 1, X509_CRL_CLASS);
6843 6856
@@ -6907,6 +6920,7 @@ static const auxL_Reg xx_methods[] = {
6907 { "getExtension", &xx_getExtension }, 6920 { "getExtension", &xx_getExtension },
6908 { "getExtensionCount", &xx_getExtensionCount }, 6921 { "getExtensionCount", &xx_getExtensionCount },
6909 { "sign", &xx_sign }, 6922 { "sign", &xx_sign },
6923 { "verify", &xx_verify },
6910 { "text", &xx_text }, 6924 { "text", &xx_text },
6911 { "tostring", &xx__tostring }, 6925 { "tostring", &xx__tostring },
6912 { NULL, NULL }, 6926 { NULL, NULL },