Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: do not try to parse a rsa key if algo is hmac #32

Merged
merged 1 commit into from
Sep 29, 2020
Merged

Conversation

malud
Copy link
Collaborator

@malud malud commented Sep 29, 2020

No description provided.

@malud malud added the bug Something isn't working label Sep 29, 2020
@malud malud requested a review from johakoch September 29, 2020 14:09
Copy link
Contributor

@filex filex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review ok

tested with HS256 and plain (i.e. binary) and base64 encoded keys from jwt.io.

@filex
Copy link
Contributor

filex commented Sep 29, 2020

example config:

definitions {
  jwt "JWTToken" {
    header = "Authorization"
    signature_algorithm = "HS256"
    key = "asdf"
  }
}

before:

panic: loading jwt "JWTToken" definition failed: asn1: syntax error: truncated tag or length

(or different messages depending on length of the key).

after: couper starts and can validate tokens from jwt.io with that key.

@filex filex merged commit f2e979c into master Sep 29, 2020
@filex filex deleted the jwt-hmac-fix branch September 29, 2020 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants