mirror of
https://github.com/brunoos/luasec.git
synced 2024-12-28 05:18:21 +01:00
Fix push_asn1_string().
This commit is contained in:
parent
6cc8e951d4
commit
172d324243
@ -86,10 +86,12 @@ static void push_asn1_objname(lua_State* L, ASN1_OBJECT *object, int no_name)
|
|||||||
*/
|
*/
|
||||||
static void push_asn1_string(lua_State* L, ASN1_STRING *string, int encode)
|
static void push_asn1_string(lua_State* L, ASN1_STRING *string, int encode)
|
||||||
{
|
{
|
||||||
size_t len;
|
int len;
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
if (!string)
|
if (!string) {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (encode) {
|
switch (encode) {
|
||||||
case LSEC_AI5_STRING:
|
case LSEC_AI5_STRING:
|
||||||
lua_pushlstring(L, (char*)ASN1_STRING_data(string),
|
lua_pushlstring(L, (char*)ASN1_STRING_data(string),
|
||||||
@ -101,6 +103,8 @@ static void push_asn1_string(lua_State* L, ASN1_STRING *string, int encode)
|
|||||||
lua_pushlstring(L, (char*)data, len);
|
lua_pushlstring(L, (char*)data, len);
|
||||||
OPENSSL_free(data);
|
OPENSSL_free(data);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user