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

feat: verify credential public key algorithm #307

Merged
merged 2 commits into from
Feb 6, 2020

Conversation

grzuy
Copy link
Contributor

@grzuy grzuy commented Feb 5, 2020

closes #275

Copy link
Member

@brauliomartinezlm brauliomartinezlm left a comment

Choose a reason for hiding this comment

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

Left you a comment/question in case you think it's valuable

@@ -62,7 +62,7 @@ def length
def valid_credential_public_key?
cose_key = COSE::Key.deserialize(public_key)

!!cose_key.alg
!!cose_key.alg && WebAuthn.configuration.algorithms.include?(COSE::Algorithm.find(cose_key.alg).name)
Copy link
Member

@brauliomartinezlm brauliomartinezlm Feb 6, 2020

Choose a reason for hiding this comment

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

I've tried removing the right side of the && and none of the existing test fail (nor the ones you had to add the algorightm to the configuration). Do you think it would be worth to write a test that fails in case the algorithm used in the key is not among the ones configured?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call.

Thank you.

@grzuy grzuy merged commit 2cf99ed into master Feb 6, 2020
@grzuy grzuy deleted the validate_credential_algorithm branch February 6, 2020 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate credential key algorithm
2 participants