Skip to content

Commit

Permalink
Merge pull request #13 from santiagorodriguez96/sr--specify-jwt-decod…
Browse files Browse the repository at this point in the history
…e-algorithm

Add capability of specifying JWT decode algorithm
  • Loading branch information
bdewater committed Mar 1, 2024
2 parents 31f3f67 + f8d60e9 commit 9c0da5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/fido_metadata/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class UnverifiedSigningKeyError < DataIntegrityError; end
File.read(File.join(__dir__, "..", "Root.cer"))
)].freeze

def download_toc(uri, trusted_certs: FIDO_ROOT_CERTIFICATES)
def download_toc(uri, algorithms: ["RS256"], trusted_certs: FIDO_ROOT_CERTIFICATES)
response = get(uri)
payload, _ = JWT.decode(response, nil, true, algorithms: ["RS256"]) do |headers|
payload, _ = JWT.decode(response, nil, true, algorithms: algorithms) do |headers|
jwt_certificates = headers["x5c"].map do |encoded|
OpenSSL::X509::Certificate.new(Base64.strict_decode64(encoded))
end
Expand Down

0 comments on commit 9c0da5b

Please sign in to comment.