From fffa343f2f2d8d32f7f41a1247e0cf3ec30bbcd9 Mon Sep 17 00:00:00 2001 From: Isaiah Inuwa Date: Fri, 20 Feb 2026 08:18:27 -0600 Subject: [PATCH] Address feedback --- apps/desktop/desktop_native/win_webauthn/src/plugin/com.rs | 2 +- .../desktop_native/win_webauthn/src/plugin/crypto.rs | 1 - apps/desktop/desktop_native/win_webauthn/src/plugin/mod.rs | 6 +++--- .../desktop/desktop_native/win_webauthn/src/plugin/types.rs | 4 +++- 4 files changed, 7 insertions(+), 6 deletions(-) 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 c3825f7d7d0..ca25649a304 100644 --- a/apps/desktop/desktop_native/win_webauthn/src/plugin/com.rs +++ b/apps/desktop/desktop_native/win_webauthn/src/plugin/com.rs @@ -239,7 +239,7 @@ impl IPluginAuthenticator_Impl for PluginAuthenticatorComObject_Impl { std::thread::current().id() ); if lock_status.is_null() { - return HRESULT(-2147024809); // E_INVALIDARG + return E_INVALIDARG; } match self.handler.lock_status() { diff --git a/apps/desktop/desktop_native/win_webauthn/src/plugin/crypto.rs b/apps/desktop/desktop_native/win_webauthn/src/plugin/crypto.rs index 46056119e1b..10352d78215 100644 --- a/apps/desktop/desktop_native/win_webauthn/src/plugin/crypto.rs +++ b/apps/desktop/desktop_native/win_webauthn/src/plugin/crypto.rs @@ -691,7 +691,6 @@ mod tests { .to_vec(); public_key_bytes.extend_from_slice(x); public_key_bytes.extend_from_slice(y); - println!("{:?}", public_key_bytes); let verify_key = VerifyingKey { cbPublicKey: public_key_bytes.len() as u32, pbPublicKey: NonNull::new(public_key_bytes.as_mut_ptr().cast()).unwrap(), 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 202f2826072..72af12a1a13 100644 --- a/apps/desktop/desktop_native/win_webauthn/src/plugin/mod.rs +++ b/apps/desktop/desktop_native/win_webauthn/src/plugin/mod.rs @@ -20,7 +20,7 @@ use super::{ErrorKind, WinWebAuthnError}; use crate::{ plugin::{ com::{ComBuffer, ComBufferExt}, - crypto::{RequestHash, Signature, VerifyingKey}, + crypto::{RequestHash, Signature}, }, util::WindowsString, }; @@ -272,8 +272,8 @@ impl WebAuthnPlugin { // buffers here. let mut win_credentials = Vec::new(); for (i, cred) in credentials.iter().enumerate() { - tracing::debug!("[SYNC_TO_WIN] Converting credential {}: RP ID: {}, User: {}, Credential ID: {:?} ({} bytes), User ID: {:?} ({} bytes)", - i + 1, cred.rp_id, cred.user_name, &cred.credential_id, cred.credential_id.len(), &cred.user_id, cred.user_id.len()); + tracing::debug!("[SYNC_TO_WIN] Converting credential {}: RP ID: {}, Credential ID: {:?} ({} bytes), User ID: **** ({} bytes)", + i + 1, cred.rp_id, &cred.credential_id, cred.credential_id.len(), cred.user_id.len()); // Allocate credential_id bytes with COM let credential_id_buf = cred.credential_id.as_ref().to_com_buffer(); diff --git a/apps/desktop/desktop_native/win_webauthn/src/plugin/types.rs b/apps/desktop/desktop_native/win_webauthn/src/plugin/types.rs index f3c80f151c6..dd47b3f6b37 100644 --- a/apps/desktop/desktop_native/win_webauthn/src/plugin/types.rs +++ b/apps/desktop/desktop_native/win_webauthn/src/plugin/types.rs @@ -616,7 +616,7 @@ impl PluginMakeCredentialRequest { .map_err(|err| { WinWebAuthnError::with_cause( ErrorKind::WindowsInternal, - "Failed to decode get assertion request", + "Failed to decode make credential request", err, ) })?; @@ -916,6 +916,7 @@ fn webauthn_encode_make_credential_response( // GetAssertion types +#[repr(C)] pub(super) struct WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY { /// Version of this structure, to allow for modifications in the future. pub _dwVersion: u32, @@ -942,6 +943,7 @@ pub(super) struct WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY { pub _pbY: *const u8, } +#[repr(C)] pub(super) struct WEBAUTHN_CTAPCBOR_HMAC_SALT_EXTENSION { /// Version of this structure, to allow for modifications in the future. pub _dwVersion: u32,