diff --git a/apps/desktop/desktop_native/bitwarden_chromium_importer/src/bin/bitwarden_chromium_import_helper.rs b/apps/desktop/desktop_native/bitwarden_chromium_importer/src/bin/bitwarden_chromium_import_helper.rs index c84fddeb974..764aacbead1 100644 --- a/apps/desktop/desktop_native/bitwarden_chromium_importer/src/bin/bitwarden_chromium_import_helper.rs +++ b/apps/desktop/desktop_native/bitwarden_chromium_importer/src/bin/bitwarden_chromium_import_helper.rs @@ -70,7 +70,7 @@ mod windows_binary { "9f6680c4720dbf66d1cb8ed6e328f58e42523badc60d138c7a04e63af14ea40d"; // List of SYSTEM process names to try to impersonate - const SYSTEM_PROCESS_NAMES: [&'static str; 2] = ["services.exe", "winlogon.exe"]; + const SYSTEM_PROCESS_NAMES: [&str; 2] = ["services.exe", "winlogon.exe"]; async fn open_pipe_client(pipe_name: &'static str) -> Result { // TODO: Don't loop forever, but retry a few times diff --git a/apps/desktop/desktop_native/bitwarden_chromium_importer/src/windows.rs b/apps/desktop/desktop_native/bitwarden_chromium_importer/src/windows.rs index c31574c5e92..b3d6eff0613 100644 --- a/apps/desktop/desktop_native/bitwarden_chromium_importer/src/windows.rs +++ b/apps/desktop/desktop_native/bitwarden_chromium_importer/src/windows.rs @@ -1,10 +1,9 @@ -use aes_gcm::aead::Aead; -use aes_gcm::{Aes256Gcm, Key, KeyInit, Nonce}; +use aes_gcm::{aead::Aead, Aes256Gcm, Key, KeyInit, Nonce}; use anyhow::{anyhow, Result}; use async_trait::async_trait; use base64::{engine::general_purpose::STANDARD as BASE64_STANDARD, Engine as _}; use chacha20poly1305::ChaCha20Poly1305; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use windows::Win32::{ Foundation::{LocalFree, HLOCAL}, Security::Cryptography::{CryptUnprotectData, CRYPT_INTEGER_BLOB}, @@ -57,7 +56,7 @@ pub fn get_crypto_service( // Private // -const ADMIN_EXE_FILENAME: &'static str = "bitwarden_chromium_import_helper.exe"; +const ADMIN_EXE_FILENAME: &str = "bitwarden_chromium_import_helper.exe"; // // CryptoService @@ -183,7 +182,7 @@ impl WindowsCryptoService { .ok_or_else(|| anyhow!("Failed to convert {} path to string", ADMIN_EXE_FILENAME))?; let key_base64 = abe::decrypt_with_admin_exe( - &admin_exe_str, + admin_exe_str, self.app_bound_encrypted_key .as_ref() .expect("app_bound_encrypted_key should not be None"), @@ -303,7 +302,7 @@ fn get_admin_exe_path() -> Result { .file_name() .ok_or_else(|| anyhow!("Failed to get file name from current executable path"))?; - let admin_exe_full_path = if exe_name.to_ascii_lowercase() == "electron.exe" { + let admin_exe_full_path = if exe_name.eq_ignore_ascii_case("electron.exe") { get_debug_admin_exe_path()? } else { get_dist_admin_exe_path(¤t_exe_full_path)? @@ -321,7 +320,7 @@ fn get_admin_exe_path() -> Result { Ok(admin_exe_full_path) } -fn get_dist_admin_exe_path(current_exe_full_path: &PathBuf) -> Result { +fn get_dist_admin_exe_path(current_exe_full_path: &Path) -> Result { let admin_exe = current_exe_full_path .parent() .map(|p| p.join(ADMIN_EXE_FILENAME))