diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2015-05-21 13:33:49 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2015-05-21 13:33:49 +0300 |
commit | 3681f34c0d3bd9b6d30a7817989a862e29ab4fe4 (patch) | |
tree | 37c7682cc82c2aeb40dbae3f254d0443098adf34 /main/lua-ossl/0004-get-extension-data-in-DER-format.patch | |
parent | 4612138ae56728c821ba01850d8e0f36aa5ce2a3 (diff) | |
download | aports-3681f34c0d3bd9b6d30a7817989a862e29ab4fe4.tar.bz2 aports-3681f34c0d3bd9b6d30a7817989a862e29ab4fe4.tar.xz |
main/lua-ossl: various extension-related improvements
Diffstat (limited to 'main/lua-ossl/0004-get-extension-data-in-DER-format.patch')
-rw-r--r-- | main/lua-ossl/0004-get-extension-data-in-DER-format.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/main/lua-ossl/0004-get-extension-data-in-DER-format.patch b/main/lua-ossl/0004-get-extension-data-in-DER-format.patch new file mode 100644 index 0000000000..0a2df91b6f --- /dev/null +++ b/main/lua-ossl/0004-get-extension-data-in-DER-format.patch @@ -0,0 +1,40 @@ +From 38d2781a958901109eef34abc5826d2d25fb42b5 Mon Sep 17 00:00:00 2001 +From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> +Date: Thu, 14 May 2015 14:50:22 +0300 +Subject: [PATCH 4/5] get extension data in DER format + +--- + src/openssl.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/src/openssl.c b/src/openssl.c +index 8564ce1..89be6b5 100644 +--- a/src/openssl.c ++++ b/src/openssl.c +@@ -2889,6 +2889,13 @@ static int xe_interpose(lua_State *L) { + } /* xe_interpose() */ + + ++static int xe_getData(lua_State *L) { ++ ASN1_STRING *data = X509_EXTENSION_get_data(checksimple(L, 1, X509_EXT_CLASS)); ++ lua_pushlstring(L, (char *) ASN1_STRING_data(data), ASN1_STRING_length(data)); ++ return 1; ++} /* xe_getData() */ ++ ++ + static int xe__gc(lua_State *L) { + X509_EXTENSION **ud = luaL_checkudata(L, 1, X509_EXT_CLASS); + +@@ -2902,7 +2909,8 @@ static int xe__gc(lua_State *L) { + + + static const luaL_Reg xe_methods[] = { +- { NULL, NULL }, ++ { "getData", &xe_getData }, ++ { NULL, NULL }, + }; + + static const luaL_Reg xe_metatable[] = { +-- +2.1.0 + |