Make TestAuthenticator.createAuthenticatorData harder to call incorrectly - #482
Merged
Conversation
…ctly This makes it harder to call `TestAuthenticator.createAuthenticatorData` with an incorrect combination of `credentialKeypair` and `keyAlgorithm`. Previously `keyAlgorithm` would default to ES256 regardless of the `credentialKeypair` type, which for example fails if `credentialKeypair` is an RSA key and `keyAlgorithm` is not set to an RSA algorithm. This would cause the function to "successfully" return an incorrect result. Now it will instead throw an exception if `keyAlgorithm` is required but not provided. In particular, case index 19 (`Packed.SelfAttestationRs1`) in `RegistrationTestDataGenerator` fails before this change because the regeneration incorrectly passes ES256 (the default) as the `keyAlgorithm` to `TestAuthenticator.createAuthenticatorData` even though the `credentialKeypair` argument is an RSA key pair.
fdennis
approved these changes
Aug 14, 2026
emlun
force-pushed
the
regenerate-rs1
branch
2 times, most recently
from
August 14, 2026 13:36
1373eb9 to
499d614
Compare
Test Results2 426 tests 2 418 ✅ 53s ⏱️ Results for commit 499d614. |
fdennis
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes it harder to call
TestAuthenticator.createAuthenticatorDatawith an incorrect combination ofcredentialKeypairandkeyAlgorithm. PreviouslykeyAlgorithmwould default to ES256 regardless of thecredentialKeypairtype, which for example fails ifcredentialKeypairis an RSA key andkeyAlgorithmis not set to an RSA algorithm. This would cause the function to "successfully" return an incorrect result. Now it will instead throw an exception ifkeyAlgorithmis required but not provided.In particular, case index 19 (
Packed.SelfAttestationRs1) inRegistrationTestDataGeneratorfails before this change because the regeneration incorrectly passes ES256 (the default) as thekeyAlgorithmtoTestAuthenticator.createAuthenticatorDataeven though thecredentialKeypairargument is an RSA key pair.