From 79c17cf0be27c38e7c5b356d650fa7a0d600258b Mon Sep 17 00:00:00 2001 From: Wangchong Zhou Date: Wed, 26 Apr 2023 18:03:59 +0800 Subject: [PATCH] fix(crypto) use OPENSSL_free in BoringSSL --- lib/resty/openssl/include/crypto.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/resty/openssl/include/crypto.lua b/lib/resty/openssl/include/crypto.lua index 6ca1f080..29a6a227 100644 --- a/lib/resty/openssl/include/crypto.lua +++ b/lib/resty/openssl/include/crypto.lua @@ -3,6 +3,7 @@ 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 @@ -10,6 +11,11 @@ if OPENSSL_10 then 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);