diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-03-01 13:03:12 +0100 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-03-01 13:03:12 +0100 |
commit | 97d7de9af2cb6cc3bbbcae18ada738ace7771903 (patch) | |
tree | a7c6221348272e82406bba446b6b00b1d1b8e608 /server/resty/openssl/rand.lua | |
parent | bf25efd6d3ed28266ed916c0ebe9dd3a45a4affb (diff) |
portal-ng pods run under root user
- switch base image from openresty to nginx-unprivileged
- remove custom lua plugin code
- dynamically determine dns resolver ip during container startup
Issue-ID: PORTALNG-67
Change-Id: I23fb5e684dbb98a326afb00911a1f5ae78e2536d
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'server/resty/openssl/rand.lua')
-rw-r--r-- | server/resty/openssl/rand.lua | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/server/resty/openssl/rand.lua b/server/resty/openssl/rand.lua deleted file mode 100644 index be54da9..0000000 --- a/server/resty/openssl/rand.lua +++ /dev/null @@ -1,51 +0,0 @@ -local ffi = require "ffi" -local C = ffi.C -local ffi_str = ffi.string - -require "resty.openssl.include.rand" -local ctx_lib = require "resty.openssl.ctx" -local ctypes = require "resty.openssl.auxiliary.ctypes" -local format_error = require("resty.openssl.err").format_error -local OPENSSL_3X = require("resty.openssl.version").OPENSSL_3X - -local buf -local buf_size = 0 -local function bytes(length, private, strength) - if type(length) ~= "number" then - return nil, "rand.bytes: expect a number at #1" - elseif strength and type(strength) ~= "number" then - return nil, "rand.bytes: expect a number at #3" - end - -- generally we don't need manually reseed rng - -- https://www.openssl.org/docs/man1.1.1/man3/RAND_seed.html - - -- initialize or resize buffer - if not buf or buf_size < length then - buf = ctypes.uchar_array(length) - buf_size = length - end - - local code - if OPENSSL_3X then - if private then - code = C.RAND_priv_bytes_ex(ctx_lib.get_libctx(), buf, length, strength or 0) - else - code = C.RAND_bytes_ex(ctx_lib.get_libctx(), buf, length, strength or 0) - end - else - if private then - code = C.RAND_priv_bytes(buf, length) - else - code = C.RAND_bytes(buf, length) - end - end - if code ~= 1 then - return nil, format_error("rand.bytes", code) - end - - return ffi_str(buf, length) -end - -return { - bytes = bytes, -} |