diff --git a/Cargo.toml b/Cargo.toml index e25ffe31e..9df46e583 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -284,7 +284,6 @@ uuid = "^1.11.0" webauthn-authenticator-rs = { version = "0.5.0", features = [ "softpasskey", "softtoken", - "mozilla", ] } webauthn-rs = { version = "0.5.0", features = ["preview-features"] } webauthn-rs-core = "0.5.0" diff --git a/tools/cli/Cargo.toml b/tools/cli/Cargo.toml index 959cdc4e7..b5ac95e20 100644 --- a/tools/cli/Cargo.toml +++ b/tools/cli/Cargo.toml @@ -78,9 +78,25 @@ url = { workspace = true } workspace = true features = ["win10"] -[target."cfg(not(any(target_os = \"windows\")))".dependencies.webauthn-authenticator-rs] +[target."cfg(target_os = \"linux\")".dependencies.webauthn-authenticator-rs] workspace = true -features = ["u2fhid"] +features = [ + "u2fhid", + "mozilla", +] + +[target."cfg(target_os = \"macos\")".dependencies.webauthn-authenticator-rs] +workspace = true +features = [ + "u2fhid", + "mozilla", +] + +[target."cfg(target_os = \"freebsd\")".dependencies.webauthn-authenticator-rs] +workspace = true +features = [ + "mozilla", +] ## Debian packaging [package.metadata.deb] diff --git a/tools/cli/src/cli/webauthn/mod.rs b/tools/cli/src/cli/webauthn/mod.rs index f3ae84e59..0af5641f1 100644 --- a/tools/cli/src/cli/webauthn/mod.rs +++ b/tools/cli/src/cli/webauthn/mod.rs @@ -1,6 +1,16 @@ -#[cfg(not(any(target_os = "windows")))] +#[cfg(target_os = "linux")] +mod u2fhid; +#[cfg(target_os = "linux")] +use u2fhid::get_authenticator_backend; + +#[cfg(target_os = "macos")] mod mozilla; -#[cfg(not(any(target_os = "windows")))] +#[cfg(target_os = "macos")] +use mozilla::get_authenticator_backend; + +#[cfg(target_os = "freebsd")] +mod mozilla; +#[cfg(target_os = "freebsd")] use mozilla::get_authenticator_backend; #[cfg(target_os = "windows")] diff --git a/tools/cli/src/cli/webauthn/mozilla.rs b/tools/cli/src/cli/webauthn/mozilla.rs index dfe0d3ca8..4e392d52c 100644 --- a/tools/cli/src/cli/webauthn/mozilla.rs +++ b/tools/cli/src/cli/webauthn/mozilla.rs @@ -1,5 +1,5 @@ -use webauthn_authenticator_rs::u2fhid::U2FHid; +use webauthn_authenticator_rs::mozilla::MozillaAuthenticator; -pub fn get_authenticator_backend() -> U2FHid { - U2FHid::new() +pub fn get_authenticator_backend() -> MozillaAuthenticator { + MozillaAuthenticator::default() } diff --git a/tools/cli/src/cli/webauthn/u2fhid.rs b/tools/cli/src/cli/webauthn/u2fhid.rs new file mode 100644 index 000000000..dfe0d3ca8 --- /dev/null +++ b/tools/cli/src/cli/webauthn/u2fhid.rs @@ -0,0 +1,5 @@ +use webauthn_authenticator_rs::u2fhid::U2FHid; + +pub fn get_authenticator_backend() -> U2FHid { + U2FHid::new() +}