Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/lcrypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ static int verify_fverify(lua_State *L)

static int rand_do_bytes(lua_State *L, int (*bytes)(unsigned char *, int))
{
size_t count = (size_t)luaL_checkint(L, 1);
size_t count = (size_t)luaL_checkinteger(L, 1);
unsigned char tmp[256], *buf = tmp;
if (count > sizeof tmp)
buf = (unsigned char *)malloc(count);
Expand Down Expand Up @@ -1157,7 +1157,7 @@ static int pkey_to_pem(lua_State *L)
struct evp_pkey_st *pkey_st = *pkey;
int ret;

long len;
//long len;
BUF_MEM *buf;
BIO *mem = BIO_new(BIO_s_mem());

Expand All @@ -1176,7 +1176,8 @@ static int pkey_to_pem(lua_State *L)
goto error;
}

len = BIO_get_mem_ptr(mem, &buf);
//len = BIO_get_mem_ptr(mem, &buf);
BIO_get_mem_ptr(mem, &buf);
lua_pushlstring(L, buf->data, buf->length);
ret = 1;

Expand Down