diff options
-rw-r--r-- | doc/luaossl.tex | 4 | ||||
-rw-r--r-- | src/openssl.c | 14 |
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 | ||
694 | Signs the instance CRL using the \module{openssl.pkey} $key$. | 694 | Signs the instance CRL using the \module{openssl.pkey} $key$. |
695 | 695 | ||
696 | \subsubsection[\fn{crl:verify}]{\fn{crl:verify($publickey$)}} | ||
697 | |||
698 | Verifies 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 | ||
698 | Returns a human-readable textual representation of the instance CRL. | 702 | 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) { | |||
6838 | } /* xx_sign() */ | 6838 | } /* xx_sign() */ |
6839 | 6839 | ||
6840 | 6840 | ||
6841 | static 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 | |||
6841 | static int xx_text(lua_State *L) { | 6854 | static 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 }, |