diff options
-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: | |||
4318 | } /* xx_add() */ | 4318 | } /* xx_add() */ |
4319 | 4319 | ||
4320 | 4320 | ||
4321 | static int xx_addExtension(lua_State *L) { | ||
4322 | X509_CRL *crl = checksimple(L, 1, X509_CRL_CLASS); | ||
4323 | X509_EXTENSION *ext = checksimple(L, 2, X509_EXT_CLASS); | ||
4324 | |||
4325 | if (!X509_CRL_add_ext(crl, ext, -1)) | ||
4326 | return auxL_error(L, auxL_EOPENSSL, "x509.crl:addExtension"); | ||
4327 | |||
4328 | lua_pushboolean(L, 1); | ||
4329 | |||
4330 | return 1; | ||
4331 | } /* xx_addExtension() */ | ||
4332 | |||
4321 | static int xx_sign(lua_State *L) { | 4333 | static int xx_sign(lua_State *L) { |
4322 | X509_CRL *crl = checksimple(L, 1, X509_CRL_CLASS); | 4334 | X509_CRL *crl = checksimple(L, 1, X509_CRL_CLASS); |
4323 | EVP_PKEY *key = checksimple(L, 2, PKEY_CLASS); | 4335 | EVP_PKEY *key = checksimple(L, 2, PKEY_CLASS); |
@@ -4396,6 +4408,7 @@ static const luaL_Reg xx_methods[] = { | |||
4396 | { "getIssuer", &xx_getIssuer }, | 4408 | { "getIssuer", &xx_getIssuer }, |
4397 | { "setIssuer", &xx_setIssuer }, | 4409 | { "setIssuer", &xx_setIssuer }, |
4398 | { "add", &xx_add }, | 4410 | { "add", &xx_add }, |
4411 | { "addExtension", &xx_addExtension }, | ||
4399 | { "sign", &xx_sign }, | 4412 | { "sign", &xx_sign }, |
4400 | { "text", &xx_text }, | 4413 | { "text", &xx_text }, |
4401 | { "tostring", &xx__tostring }, | 4414 | { "tostring", &xx__tostring }, |