Skip to content

Commit

Permalink
Merge pull request #1 from CybrQ/sanitize-reason
Browse files Browse the repository at this point in the history
do not store secret key information in reason
  • Loading branch information
cdbattags committed Jun 25, 2018
2 parents eabe54d + 1555c2c commit f17d7c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/resty/jwt.lua
Expand Up @@ -199,7 +199,7 @@ local function derive_keys(enc, secret_key)
end

if #secret_key ~= secret_key_len then
error({reason="The pre-shared content key must be ".. secret_key_len})
error({reason="invalid pre-shared key"})
end

local mac_key = string_sub(secret_key, 1, mac_key_len)
Expand Down Expand Up @@ -779,7 +779,7 @@ function _M.verify_jwt_obj(self, secret, jwt_obj, ...)
cert, err = evp.PublicKey:new(secret)
end
if not cert then
jwt_obj[str_const.reason] = "Decode secret is not a valid cert/public key: " .. (err and err or secret)
jwt_obj[str_const.reason] = "Decode secret is not a valid cert/public key"
return jwt_obj
end
else
Expand Down
2 changes: 1 addition & 1 deletion t/load-verify.t
Expand Up @@ -604,7 +604,7 @@ R0FSQkFHRQo=
GET /t
--- response_body
false
Decode secret is not a valid cert/public key: ASN1 lib: nested asn1 error: bad object header: too long
Decode secret is not a valid cert/public key
test
--- no_error_log
[error]

0 comments on commit f17d7c6

Please sign in to comment.