Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare "_" as local #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/resty/jwt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ local function parse_jwe(self, preshared_key, encoded_header, encoded_encrypted_
error({reason="invalid algorithm: " .. alg})
end

local key, enc_key
local key, enc_key, _
if alg == str_const.DIR then
if not preshared_key then
error({reason="preshared key must not be null"})
Expand Down Expand Up @@ -437,7 +437,7 @@ local function sign_jwe(self, secret_key, jwt_obj)
end

-- TODO: implement logic for creating enc key and mac key and then encrypt key
local key, encrypted_key, mac_key, enc_key
local key, encrypted_key, mac_key, enc_key, _
if alg == str_const.DIR then
_, mac_key, enc_key = derive_keys(enc, secret_key)
encrypted_key = ""
Expand Down