diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2015-05-14 14:50:22 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2015-05-18 01:04:55 +0300 |
commit | 057aefa60887b4599edba7f32b9bcd83d926c3af (patch) | |
tree | 9c59104693524fe9346b7eef948da67cc777026b /src | |
parent | 4ca7cbf40e85f79f4864d462d7defd5469d282e5 (diff) | |
download | luaossl-057aefa60887b4599edba7f32b9bcd83d926c3af.tar.gz luaossl-057aefa60887b4599edba7f32b9bcd83d926c3af.tar.bz2 luaossl-057aefa60887b4599edba7f32b9bcd83d926c3af.zip |
get extension data in DER format
Diffstat (limited to 'src')
-rw-r--r-- | src/openssl.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/openssl.c b/src/openssl.c index 1c0dfbd..c3b9145 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[] = { |