zapret-wgobfs: optimize key cache

This commit is contained in:
bol-van committed 2025-11-23 19:06:24 +03:00
1 parent 3a66f86621
commit ed4eb043a2
1 file changed
+1 -3
+1 -3
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