Skip to content

Commit 6fd9aa3

Browse files
committed
x5c is not base64url encoded, see RFC7517 Section 4.7
closes #460 Signed-off-by: Stefan Bodewig <[email protected]>
1 parent a488e08 commit 6fd9aa3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
01/13/2023
2+
- when parsing JWKs with an x5c claim the claim was wronly assumed to
3+
be base64url encoded instead of base64 encoded;
4+
see #460
5+
16
11/06/2022
27
- a new option local_redirect_path can be used is situations where the
38
redirect_uri as is visible to lua-resty-openidc is not simply the path

Diff for: lib/resty/openidc.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ end
844844

845845
local function openidc_pem_from_x5c(x5c)
846846
log(DEBUG, "Found x5c, getting PEM public key from x5c entry of json public key")
847-
local chunks = split_by_chunk(b64(openidc_base64_url_decode(x5c[1])), 64)
847+
local chunks = split_by_chunk(x5c[1], 64)
848848
local pem = "-----BEGIN CERTIFICATE-----\n" ..
849849
table.concat(chunks, "\n") ..
850850
"\n-----END CERTIFICATE-----"

0 commit comments

Comments
 (0)