Skip to content

Commit

Permalink
fix(w3c): šŸ› public key is not mandatory under the jwk field in jws heā€¦
Browse files Browse the repository at this point in the history
ā€¦ader
  • Loading branch information
matteo-cristino authored and jaromil committed Apr 8, 2024
1 parent e5f7816 commit 9b91e24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lua/zencode_w3c.lua
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ local function jws_octet_to_signature(o_jws, o_payload)
elseif alg ~= alg_from_crv then
error('JWS public key curve '..header.jwk.crv..' does not match the alg '..alg, 2)
end
pk = O.from_url64(header.jwk.x) .. O.from_url64(header.jwk.y)
if header.jwk.x and header.jwk.y then
pk = O.from_url64(header.jwk.x) .. O.from_url64(header.jwk.y)
end
end
-- header.payload is what should be signed
if not o_payload and toks[2] == "" then
Expand Down

0 comments on commit 9b91e24

Please sign in to comment.