Skip to content

windows: enable winapi std for RawHandle interop - #366

Open
iiTONELOC wants to merge 1 commit into
mozilla:ctap2-2021from
iiTONELOC:fix/windows-winapi-std
Open

windows: enable winapi std for RawHandle interop#366
iiTONELOC wants to merge 1 commit into
mozilla:ctap2-2021from
iiTONELOC:fix/windows-winapi-std

Conversation

@iiTONELOC

Copy link
Copy Markdown

Cargo resolver 2 keeps features enabled only by dev-dependencies out of normal dependencies.

Under resolver 2, a Windows consumer fails at DeviceCapabilities::new(self.file.as_raw_handle()) because core::ffi::c_void and winapi::ctypes::c_void are different types. The package's legacy-resolver dev build hides this because rpassword enables winapi/std.

Enabling std on the direct Windows winapi dependency makes the raw-handle types compatible without relying on feature unification from an unrelated dev-dependency.

A minimal resolver-2 consumer on Rust 1.97 targeting x86_64-pc-windows-msvc fails before this patch and passes afterward. cargo test --features crypto_dummy --no-default-features also passes.

@micolous

micolous commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

A minimal resolver-2 consumer on Rust 1.97 targeting x86_64-pc-windows-msvc fails before this patch and passes afterward.

Your change seems reasonable, but can this be tested in CI? Maybe using the ctap2 example?

Just as a PSA, as this is marked as a blocker by other projects: since Windows 10 v1903 (released in 2019), user-space applications can't directly communicate with USB authenticators unless running as Administrator. This breaks the library on Windows for most users.

Firefox uses Windows' platform WebAuthn APIs directly where they're available, and has similar wrappers for Android and macOS. These won't be supported by authenticator-rs.

Applications that support Windows should migrate to the Windows WebAuthn APIs, and shouldn't depend on authenticator-rs on Windows. Windows' APIs also support BLE, caBLE, NFC, smart card and TPM transports, running over RDP and credential manager plugins.

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