Skip to content

Make TestAuthenticator.createAuthenticatorData harder to call incorrectly - #482

Merged
emlun merged 4 commits into
mainfrom
regenerate-rs1
Aug 19, 2026
Merged

Make TestAuthenticator.createAuthenticatorData harder to call incorrectly#482
emlun merged 4 commits into
mainfrom
regenerate-rs1

Conversation

@emlun

@emlun emlun commented Aug 14, 2026

Copy link
Copy Markdown
Member

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.

…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.
@emlun
emlun requested a review from fdennis August 14, 2026 11:39
@emlun
emlun requested a review from fdennis August 14, 2026 13:31
@emlun
emlun force-pushed the regenerate-rs1 branch 2 times, most recently from 1373eb9 to 499d614 Compare August 14, 2026 13:36
@github-actions

Copy link
Copy Markdown

Test Results

2 426 tests   2 418 ✅  53s ⏱️
   48 suites      8 💤
   48 files        0 ❌

Results for commit 499d614.

@emlun
emlun merged commit 0a6e32f into main Aug 19, 2026
13 of 15 checks passed
@emlun
emlun deleted the regenerate-rs1 branch August 19, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants