diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b85256b..406bd146 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - ui: Display restart reason in case of premature failure - daemon: Stop retrying a transport after 5 consecutive failures before user interaction; other transports keep running. +- daemon: Treat Debian's Firefox ESR (app ID `firefox-esr`) as a privileged client, like the other Firefox builds - daemon: Build the list of devices offered to the user from libwebauthn's `available_transports()`, the same source discovery uses (#32) - ui: Pass the caller's activation token to the compositor when showing the dialog, so it can take focus when the requesting window is in the background (#152) - ui: Disable core dumps for the UI process, which handles typed PINs. Build with `-Denable_core_dumps=true` to allow them for debugging (#209) diff --git a/credentialsd/src/gateway/mod.rs b/credentialsd/src/gateway/mod.rs index 644591ec..e88c5ffd 100644 --- a/credentialsd/src/gateway/mod.rs +++ b/credentialsd/src/gateway/mod.rs @@ -348,6 +348,8 @@ fn check_origin_from_app( "org.mozilla.firefox", "firefox", "firefox-developer-edition", + // Debian's Firefox ESR, launched from firefox-esr.desktop + "firefox-esr", "xyz.iinuwa.credentialsd.DemoCredentialsUi", ]; let mut privileged = trusted_clients.contains(&app_id.as_ref()); @@ -537,9 +539,11 @@ impl Display for WebAuthnError { #[cfg(test)] mod test { - use crate::webauthn::{NavigationContext, Origin}; + use crate::webauthn::{AppId, NavigationContext, Origin}; - use super::{WebAuthnError, check_origin_from_privileged_client}; + use super::{ + RequestKind, WebAuthnError, check_origin_from_app, check_origin_from_privileged_client, + }; fn check_same_origin(origin: &str) -> Result { let origin = origin.parse().unwrap(); @@ -561,4 +565,26 @@ mod test { Err(WebAuthnError::SecurityError) )) } + + fn request_kind_for_app(app_id: &str) -> RequestKind { + let app_id: AppId = app_id.parse().unwrap(); + let origin = "https://example.com".parse().unwrap(); + check_origin_from_app(&app_id, origin, None).unwrap() + } + + #[test] + fn test_firefox_esr_is_privileged() { + assert!(matches!( + request_kind_for_app("firefox-esr"), + RequestKind::Privileged { .. } + )) + } + + #[test] + fn test_unknown_app_is_unprivileged() { + assert!(matches!( + request_kind_for_app("com.example.App"), + RequestKind::Unprivileged(_) + )) + } }