Skip to content

Do not 500 when verifying webauthn key#6144

Merged
mitchellhenke merged 1 commit intomainfrom
mitchellhenke/webauthn-500-2
Apr 4, 2022
Merged

Do not 500 when verifying webauthn key#6144
mitchellhenke merged 1 commit intomainfrom
mitchellhenke/webauthn-500-2

Conversation

@mitchellhenke
Copy link
Contributor

When verifying a WebAuthn signature, we sometimes get an exception from within OpenSSL, which causes a 500 (NR Link)

Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Would it be possible to create a spec for this?

changelog: Bug Fixes, Authentication, Fix error when unable to validate WebAuthn signature
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/webauthn-500-2 branch from dba20d5 to 31a3bf0 Compare April 4, 2022 15:29
@mitchellhenke
Copy link
Contributor Author

Would it be possible to create a spec for this?

I dug into it, and it's not clear how it happens other than when this line is called with empty strings. It doesn't fail when giving it empty strings from where we call it, so it seems to be something much deeper.

verify_key.verify(hash_function, "", "")
# => OpenSSL::PKey::PKeyError: EVP_VerifyFinal: nested asn1 error

I added a spec to mock the calling method raising the exception, but it doesn't feel like it captures the root cause very well

@mitchellhenke mitchellhenke merged commit 89db55f into main Apr 4, 2022
@mitchellhenke mitchellhenke deleted the mitchellhenke/webauthn-500-2 branch April 4, 2022 15:40
mitchellhenke pushed a commit that referenced this pull request Apr 4, 2022
changelog: Bug Fixes, Authentication, Fix error when unable to validate WebAuthn signature
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.

2 participants