diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2015-05-14 11:59:20 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2015-05-18 01:04:55 +0300 |
commit | bfd750138c8c970cade9ad40dd525acd1ca88276 (patch) | |
tree | b29d7d86372a14a6990074e0224fb45c16179e92 | |
parent | 91eb47726cb3b8d487f21a17b3c2b8c5e9fb1024 (diff) | |
download | luaossl-bfd750138c8c970cade9ad40dd525acd1ca88276.tar.gz luaossl-bfd750138c8c970cade9ad40dd525acd1ca88276.tar.bz2 luaossl-bfd750138c8c970cade9ad40dd525acd1ca88276.zip |
CRL extensions
-rw-r--r-- | src/openssl.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c index 99a1ec0..086b4fa 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -4318,6 +4318,18 @@ error: } /* xx_add() */ +static int xx_addExtension(lua_State *L) { + X509_CRL *crl = checksimple(L, 1, X509_CRL_CLASS); + X509_EXTENSION *ext = checksimple(L, 2, X509_EXT_CLASS); + + if (!X509_CRL_add_ext(crl, ext, -1)) + return auxL_error(L, auxL_EOPENSSL, "x509.crl:addExtension"); + + lua_pushboolean(L, 1); + + return 1; +} /* xx_addExtension() */ + static int xx_sign(lua_State *L) { X509_CRL *crl = checksimple(L, 1, X509_CRL_CLASS); EVP_PKEY *key = checksimple(L, 2, PKEY_CLASS); @@ -4396,6 +4408,7 @@ static const luaL_Reg xx_methods[] = { { "getIssuer", &xx_getIssuer }, { "setIssuer", &xx_setIssuer }, { "add", &xx_add }, + { "addExtension", &xx_addExtension }, { "sign", &xx_sign }, { "text", &xx_text }, { "tostring", &xx__tostring }, |