1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-13 23:13:36 +00:00

Remove unused code

This commit is contained in:
Isaiah Inuwa
2025-12-18 12:11:04 -06:00
parent 68f3065b93
commit 98335db15c
6 changed files with 34 additions and 66 deletions

View File

@@ -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,

View File

@@ -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)]

View File

@@ -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<u8>,
second: Option<Vec<u8>>,
_first: Vec<u8>,
_second: Option<Vec<u8>>,
}
#[repr(C)]

View File

@@ -23,7 +23,6 @@ windows = { workspace = true, features = [
"Win32_Security",
"Win32_System_Com",
"Win32_System_LibraryLoader",
"Win32_UI_HiDpi",
] }
windows-core = { workspace = true }

View File

@@ -274,8 +274,8 @@ fn get_window_details(client: &WindowsProviderClient) -> Result<WindowDetails, S
#[derive(Debug)]
struct WindowDetails {
is_visible: bool,
is_focused: bool,
_is_visible: bool,
_is_focused: bool,
handle: HWND,
}
@@ -296,8 +296,8 @@ impl TryFrom<WindowHandleQueryResponse> 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,
})
}

View File

@@ -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)>;
}