Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-14 06:13:09 +00:00

zapret-wgobfs: optimize key cache

This commit is contained in:
bol-van
2025-11-23 19:06:24 +03:00
parent 3a66f86621
commit ed4eb043a2

View File

@@ -13,9 +13,7 @@ function wgobfs(ctx, desync)
local function genkey()
-- cache key in a global var bound to instance name
local key_cache_name = desync.func_instance.."_key"
if _G[key_cache_name] then
key = _G[key_cache_name]
end
key = _G[key_cache_name]
if not key then
key = hkdf("sha256", "wgobfs_salt", desync.arg.secret, nil, 16)
_G[key_cache_name] = key