From d68841d9f75636575cd778838a8ceea5fd5aada3 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Fri, 14 Apr 2023 11:59:32 +0000 Subject: Upload ui Issue-ID: PORTAL-1084 Signed-off-by: Fiete Ostkamp Change-Id: Id0c94859a775094e67b0bb9c91ca5e776a08c068 --- server/resty/openssl/include/rand.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 server/resty/openssl/include/rand.lua (limited to 'server/resty/openssl/include/rand.lua') diff --git a/server/resty/openssl/include/rand.lua b/server/resty/openssl/include/rand.lua new file mode 100644 index 0000000..90f44c1 --- /dev/null +++ b/server/resty/openssl/include/rand.lua @@ -0,0 +1,24 @@ +local ffi = require "ffi" + +require "resty.openssl.include.ossl_typ" +local OPENSSL_3X = require("resty.openssl.version").OPENSSL_3X +local BORINGSSL = require("resty.openssl.version").BORINGSSL + +if BORINGSSL then + ffi.cdef [[ + int RAND_bytes(uint8_t *buf, size_t num); + int RAND_priv_bytes(uint8_t *buf, size_t num); + ]] +elseif OPENSSL_3X then + ffi.cdef [[ + int RAND_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num, + unsigned int strength); + int RAND_priv_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num, + unsigned int strength); + ]] +else + ffi.cdef [[ + int RAND_bytes(unsigned char *buf, int num); + int RAND_priv_bytes(unsigned char *buf, int num); + ]] +end -- cgit 1.2.3-korg