diff --git a/apps/desktop/desktop_native/core/src/autofill/windows.rs b/apps/desktop/desktop_native/core/src/autofill/windows.rs index 5dd804097a0..d88c2121b23 100644 --- a/apps/desktop/desktop_native/core/src/autofill/windows.rs +++ b/apps/desktop/desktop_native/core/src/autofill/windows.rs @@ -206,15 +206,15 @@ enum SyncCredential { #[serde(rename = "login")] Login { #[serde(rename = "cipherId")] - cipher_id: String, - password: String, - uri: String, - username: String, + _cipher_id: String, + _password: String, + _uri: String, + _username: String, }, #[serde(rename = "fido2")] Fido2 { #[serde(rename = "cipherId")] - cipher_id: String, + _cipher_id: String, #[serde(rename = "rpId")] rp_id: String, 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 8dd9521f9ce..4854d43f6a8 100644 --- a/apps/desktop/desktop_native/win_webauthn/src/plugin/types.rs +++ b/apps/desktop/desktop_native/win_webauthn/src/plugin/types.rs @@ -369,6 +369,9 @@ pub(crate) struct WEBAUTHN_PLUGIN_OPERATION_RESPONSE { #[repr(u32)] #[derive(Debug, Copy, Clone)] pub enum WebAuthnPluginRequestType { + // This is being used to check the value that Windows gives us, but it isn't + // ever constructed by our library. + #[allow(unused)] CTAP2_CBOR = 0x01, } @@ -780,42 +783,42 @@ webauthn_call!("WebAuthNEncodeMakeCredentialResponse" as fn webauthn_encode_make pub(super) struct WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY { /// Version of this structure, to allow for modifications in the future. - pub dwVersion: u32, + pub _dwVersion: u32, /// Key type - pub lKty: i32, + pub _lKty: i32, /// Hash Algorithm: ES256, ES384, ES512 - pub lAlg: i32, + pub _lAlg: i32, /// Curve - pub lCrv: i32, + pub _lCrv: i32, /// Size of "x" (X Coordinate) - pub cbX: u32, + pub _cbX: u32, /// "x" (X Coordinate) data. Big Endian. - pub pbX: *const u8, + pub _pbX: *const u8, /// Size of "y" (Y Coordinate) - pub cbY: u32, + pub _cbY: u32, /// "y" (Y Coordinate) data. Big Endian. - pub pbY: *const u8, + pub _pbY: *const u8, } pub(super) struct WEBAUTHN_CTAPCBOR_HMAC_SALT_EXTENSION { /// Version of this structure, to allow for modifications in the future. - pub dwVersion: u32, + pub _dwVersion: u32, // Platform's key agreement public key - pub pKeyAgreement: *const WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY, + pub _pKeyAgreement: *const WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY, - pub cbEncryptedSalt: u32, - pub pbEncryptedSalt: *const u8, + pub _cbEncryptedSalt: u32, + pub _pbEncryptedSalt: *const u8, - pub cbSaltAuth: u32, - pub pbSaltAuth: *const u8, + pub _cbSaltAuth: u32, + pub _pbSaltAuth: *const u8, } #[repr(C)] diff --git a/apps/desktop/desktop_native/win_webauthn/src/types/mod.rs b/apps/desktop/desktop_native/win_webauthn/src/types/mod.rs index b8213f4a643..1fc9c3b29fd 100644 --- a/apps/desktop/desktop_native/win_webauthn/src/types/mod.rs +++ b/apps/desktop/desktop_native/win_webauthn/src/types/mod.rs @@ -3,7 +3,7 @@ #![allow(non_snake_case)] #![allow(non_camel_case_types)] -use std::{collections::HashSet, fmt::Display, marker::PhantomData, num::NonZeroU32, ptr::NonNull}; +use std::{collections::HashSet, marker::PhantomData, num::NonZeroU32, ptr::NonNull}; use ciborium::Value; use windows_core::PCWSTR; @@ -465,51 +465,22 @@ pub(crate) struct WEBAUTHN_CREDENTIAL_ATTESTATION { pub(crate) pbRegistrationResponseJSON: *const u8, } -pub enum AttestationFormat { - Packed, - Tpm, - AndroidKey, - FidoU2f, - None, - Compound, - Apple, -} - -impl Display for AttestationFormat { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_str(match self { - Self::Packed => "packed", - Self::Tpm => "tpm", - Self::AndroidKey => "android-key", - Self::FidoU2f => "fido-u2f", - Self::None => "none", - Self::Compound => "compound", - Self::Apple => "apple", - }) - } -} - -pub enum AttestationDecodeType { - None, - Common(), -} - pub(crate) struct WEBAUTHN_HMAC_SECRET_SALT { /// Size of pbFirst. - cbFirst: u32, + _cbFirst: u32, // _Field_size_bytes_(cbFirst) /// Required - pbFirst: *mut u8, + _pbFirst: *mut u8, /// Size of pbSecond. - cbSecond: u32, + _cbSecond: u32, // _Field_size_bytes_(cbSecond) - pbSecond: *mut u8, + _pbSecond: *mut u8, } pub struct HmacSecretSalt { - first: Vec, - second: Option>, + _first: Vec, + _second: Option>, } #[repr(C)] diff --git a/apps/desktop/desktop_native/windows_plugin_authenticator/Cargo.toml b/apps/desktop/desktop_native/windows_plugin_authenticator/Cargo.toml index feeafebe06b..8d12712c996 100644 --- a/apps/desktop/desktop_native/windows_plugin_authenticator/Cargo.toml +++ b/apps/desktop/desktop_native/windows_plugin_authenticator/Cargo.toml @@ -23,7 +23,6 @@ windows = { workspace = true, features = [ "Win32_Security", "Win32_System_Com", "Win32_System_LibraryLoader", - "Win32_UI_HiDpi", ] } windows-core = { workspace = true } diff --git a/apps/desktop/desktop_native/windows_plugin_authenticator/src/process.rs b/apps/desktop/desktop_native/windows_plugin_authenticator/src/process.rs index 59ca7be020a..d817df32ba2 100644 --- a/apps/desktop/desktop_native/windows_plugin_authenticator/src/process.rs +++ b/apps/desktop/desktop_native/windows_plugin_authenticator/src/process.rs @@ -274,8 +274,8 @@ fn get_window_details(client: &WindowsProviderClient) -> Result for WindowDetails { )); }; Ok(Self { - is_visible: value.is_visible, - is_focused: value.is_focused, + _is_visible: value.is_visible, + _is_focused: value.is_focused, handle, }) } diff --git a/apps/desktop/desktop_native/windows_plugin_authenticator/src/util.rs b/apps/desktop/desktop_native/windows_plugin_authenticator/src/util.rs index d563cb9baae..033cec1be64 100644 --- a/apps/desktop/desktop_native/windows_plugin_authenticator/src/util.rs +++ b/apps/desktop/desktop_native/windows_plugin_authenticator/src/util.rs @@ -2,14 +2,9 @@ use base64::engine::{general_purpose::STANDARD, Engine as _}; use serde::{de::Visitor, Deserializer}; use windows::{ core::GUID, - Win32::{ - Foundation::*, - UI::{HiDpi::GetDpiForWindow, WindowsAndMessaging::GetWindowRect}, - }, + Win32::{Foundation::*, UI::WindowsAndMessaging::GetWindowRect}, }; -const BASE_DPI: u32 = 96; - pub trait HwndExt { fn center_position(&self) -> windows::core::Result<(i32, i32)>; }