Skip to content

Commit

Permalink
Remove NAMED_CURVES from DefaultOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilioCristalli committed Feb 13, 2017
1 parent 8fc8592 commit 8ed32d7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions lib/jwt/default_options.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module JWT
module DefaultOptions
NAMED_CURVES = { 'prime256v1' => 'ES256', 'secp384r1' => 'ES384', 'secp521r1' => 'ES512' }.freeze

DEFAULT_OPTIONS = {
verify_expiration: true,
verify_not_before: true,
Expand Down
2 changes: 1 addition & 1 deletion lib/jwt/signature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def verify_rsa(algorithm, public_key, signing_input, signature)
end

def verify_ecdsa(algorithm, public_key, signing_input, signature)
key_algorithm = Signature::NAMED_CURVES[public_key.group.curve_name]
key_algorithm = NAMED_CURVES[public_key.group.curve_name]
if algorithm != key_algorithm
raise IncorrectAlgorithm, "payload algorithm is #{algorithm} but #{key_algorithm} verification key was provided"
end
Expand Down

0 comments on commit 8ed32d7

Please sign in to comment.