diff --git a/apps/desktop/desktop_native/win_webauthn/src/plugin/com.rs b/apps/desktop/desktop_native/win_webauthn/src/plugin/com.rs index fb309865924..bedfc7dd462 100644 --- a/apps/desktop/desktop_native/win_webauthn/src/plugin/com.rs +++ b/apps/desktop/desktop_native/win_webauthn/src/plugin/com.rs @@ -10,27 +10,27 @@ use std::{ }; use windows::{ - core::{implement, interface, ComObjectInterface, IUnknown, GUID, HRESULT}, Win32::{ Foundation::{E_FAIL, E_INVALIDARG, S_FALSE, S_OK}, System::Com::*, }, + core::{ComObjectInterface, GUID, HRESULT, IUnknown, implement, interface}, }; use windows_core::{IInspectable, Interface}; use super::{ + PluginAuthenticator, types::{ PluginLockStatus, WEBAUTHN_PLUGIN_CANCEL_OPERATION_REQUEST, WEBAUTHN_PLUGIN_OPERATION_REQUEST, WEBAUTHN_PLUGIN_OPERATION_RESPONSE, }, - PluginAuthenticator, }; use crate::{ - plugin::{ - crypto::{self, OwnedRequestHash}, - PluginGetAssertionRequest, PluginMakeCredentialRequest, - }, ErrorKind, WinWebAuthnError, + plugin::{ + PluginGetAssertionRequest, PluginMakeCredentialRequest, + crypto::{self, OwnedRequestHash}, + }, }; static HANDLER: OnceLock<(GUID, Arc)> = OnceLock::new(); @@ -212,6 +212,8 @@ impl IPluginAuthenticator_Impl for PluginAuthenticatorComObject_Impl { request: *const WEBAUTHN_PLUGIN_CANCEL_OPERATION_REQUEST, ) -> HRESULT { tracing::debug!("CancelOperation called"); + // WEBAUTHN_PLUGIN_CANCEL_OPERATION_REQUEST has a signature, but the + // payload is undocumented and is not referenced in the sample, so we're not verifying it here. let request = match NonNull::new(request as *mut WEBAUTHN_PLUGIN_CANCEL_OPERATION_REQUEST) { Some(request) => request, None => { diff --git a/apps/desktop/desktop_native/win_webauthn/src/plugin/mod.rs b/apps/desktop/desktop_native/win_webauthn/src/plugin/mod.rs index ccc020bad34..4acdf644497 100644 --- a/apps/desktop/desktop_native/win_webauthn/src/plugin/mod.rs +++ b/apps/desktop/desktop_native/win_webauthn/src/plugin/mod.rs @@ -321,10 +321,13 @@ impl WebAuthnPlugin { match result { Ok(hresult) => { if let Err(err) = hresult.ok() { - let err = - WinWebAuthnError::with_cause(ErrorKind::WindowsInternal, "failed", err); + let err = WinWebAuthnError::with_cause( + ErrorKind::WindowsInternal, + "Failed to add credentials to Windows autofill list. Credentials list is now empty", + err, + ); tracing::error!( - "Failed to add credentials to Windows: credentials list is now empty" + "Failed to add credentials to Windows autofill list. Credentials list is now empty" ); Err(err) } else {