Repository navigation
Conversation
Lets credentialsd be tested without a security key (linux-credentials#107). The authenticator is a small CTAP2 implementation (getInfo, makeCredential, getAssertion, getNextAssertion; ES256, "none" attestation) plugged into the USB flow as a libwebauthn virtual HID device, so device selection and the UI work as with a real key. Keys live in memory only. It is offered only when all of these hold: - built with the `test-authenticator` cargo feature (meson: -Dtest_authenticator=true, which requires -Dprofile=development); - CREDSD_TEST_AUTHENTICATOR=1 is set; - the request comes from https://webauthn.io or https://demo.yubico.com. Without the feature the USB device list is unchanged.
kpanuragh
force-pushed
the
test-authenticator
branch
from
November 13, 2026 20:25
2b8f629 to
581fea2
Compare
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.
Closes #107.
Adds an optional in-memory authenticator so credentialsd can be tested without a security key, following the plan in #107 (comment).
What it is
credentialsd/src/credential_service/test_authenticator.rs: a small CTAP2 authenticator (getInfo, makeCredential, getAssertion, getNextAssertion; ES256 only, "none" attestation, no PIN). It is plugged into the existing USB flow as a libwebauthn virtual HID device (virtfeature:HidPipeBackend+virtual_device()), so device selection, credential selection and the UI work the same as with a real key. Keys only live in memory and are gone when credentialsd exits. ItsDebugoutput is hand-written so key material never reaches the logs.Guardrails
It is only offered when all of these hold:
test-authenticatorcargo feature. The meson option-Dtest_authenticator=trueenables it and errors unless-Dprofile=development. Off by default.CREDSD_TEST_AUTHENTICATOR=1is set when credentialsd starts handling the request.https://webauthn.ioorhttps://demo.yubico.com(exact origin match).Without the feature, the USB device list is unchanged.
Questions still open from the issue
Happy to change either before merge.
Known limitations (documented in BUILDING.md / code comments)
HidPipeBackend::recv()doesn't say which channel it is for, so replies assume one ceremony at a time, which is how credentialsd runs them.extra_deviceparameter inprocess_idle_waiting), so it may need a small rebase around Make security key selection more flexible #256.Testing
ring, discoverable credentials and getNextAssertion, exclude list, empty-pinUvAuthParamtouch probe, origin gating) plus one through libwebauthn's real channel (blink_and_wait_for_user_presenceselects the virtual device).cargo test --bins --features test-authenticator: 52 passed; without the feature: 38 passed (unchanged).cargo fmt --checkandcargo clippyclean both ways.CREDSD_TEST_AUTHENTICATOR=1.