Skip to content

Commit

Permalink
fix(crypto) use OPENSSL_free in BoringSSL (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
fffonion authored Apr 26, 2023
1 parent d2be2ae commit 7830212
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/resty/openssl/include/crypto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ local C = ffi.C

local OPENSSL_10 = require("resty.openssl.version").OPENSSL_10
local OPENSSL_11_OR_LATER = require("resty.openssl.version").OPENSSL_11_OR_LATER
local BORINGSSL = require("resty.openssl.version").BORINGSSL

local OPENSSL_free
if OPENSSL_10 then
ffi.cdef [[
void CRYPTO_free(void *ptr);
]]
OPENSSL_free = C.CRYPTO_free
elseif BORINGSSL then
ffi.cdef [[
void OPENSSL_free(void *ptr);
]]
OPENSSL_free = C.OPENSSL_free
elseif OPENSSL_11_OR_LATER then
ffi.cdef [[
void CRYPTO_free(void *ptr, const char *file, int line);
Expand Down

0 comments on commit 7830212

Please sign in to comment.