feat: Retry WebAuthn operations when PUAT is required#500
Merged
DennisDyallo merged 6 commits intoJul 1, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the WebAuthn client flow to handle CTAP PuatRequired responses by retrying MakeCredential/GetAssertion once with UV forced to Required, and refactors shared helper logic (token acquisition, retry/error mapping, and memory zeroing). It also consolidates and extends unit-test support to cover the new retry paths and exclude-list preflight behavior.
Changes:
- Add “retry once with UV required” behavior for MakeCredential/GetAssertion when CTAP returns
PuatRequiredand UV was not already required. - Refactor WebAuthnClient internals (token acquisition helper, retry helpers, and pinUvAuthParam zeroing wrappers).
- Add/adjust unit tests and shared test helpers for PUAT retry and exclude-list preflight/remint behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/WebAuthn/src/Client/WebAuthnClient.cs | Implements PUAT retry behavior, refactors token acquisition and adds request wrappers that zero pinUvAuthParam. |
| src/WebAuthn/src/Internal/ExcludeListPreflight.cs | Zeros the computed pinUvAuthParam after exclude-list probing. |
| src/WebAuthn/src/Client/FidoSessionWebAuthnBackend.cs | Ensures up option is mapped into FIDO2 options and zeroes copied pinUvAuthParam after session calls. |
| src/WebAuthn/tests/Yubico.YubiKit.WebAuthn.UnitTests/TestSupport/TestPinUvAuthProtocol.cs | Adds reusable test protocol implementation for Span-based protocol calls. |
| src/WebAuthn/tests/Yubico.YubiKit.WebAuthn.UnitTests/Internal/ExcludeListPreflightTests.cs | Switches to shared TestSupport protocol helper. |
| src/WebAuthn/tests/Yubico.YubiKit.WebAuthn.UnitTests/Client/WebAuthnClientMakeCredentialTests.cs | Adds unit tests validating MakeCredential PUAT retry and exclude-list remint permission behavior. |
| src/WebAuthn/tests/Yubico.YubiKit.WebAuthn.UnitTests/Client/WebAuthnClientGetAssertionTests.cs | Adds unit tests validating GetAssertion PUAT retry and “retry then no-credentials” behavior. |
Base automatically changed from
yubikit-ctap-status-22-alignment
to
yubikit-performance
June 29, 2026 21:29
Base automatically changed from
yubikit-performance
to
yubikit-composite-device-new
July 1, 2026 10:46
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.
Summary
Verification