mirror of
https://github.com/bitwarden/browser
synced 2026-02-02 17:53:41 +00:00
clean up lib.rs
This commit is contained in:
@@ -149,17 +149,6 @@ impl EXPERIMENTAL_IPluginAuthenticator_Impl for PluginAuthenticatorComObject_Imp
|
||||
let req = &*request;
|
||||
let transaction_id = format!("{:?}", req.transaction_id);
|
||||
|
||||
debug_log(&format!("Transaction ID: {}", transaction_id));
|
||||
debug_log(&format!("Window Handle: {:?}", req.window_handle));
|
||||
debug_log(&format!(
|
||||
"Request Signature Byte Count: {}",
|
||||
req.request_signature_byte_count
|
||||
));
|
||||
debug_log(&format!(
|
||||
"Encoded Request Byte Count: {}",
|
||||
req.encoded_request_byte_count
|
||||
));
|
||||
|
||||
if req.encoded_request_byte_count == 0 || req.encoded_request_pointer.is_null() {
|
||||
debug_log("ERROR: No encoded request data provided");
|
||||
return HRESULT(-1);
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
#![allow(non_snake_case)]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
use std::{thread, time::Duration};
|
||||
|
||||
// New modular structure
|
||||
mod assert;
|
||||
mod com_buffer;
|
||||
@@ -29,56 +27,19 @@ pub use types::{
|
||||
|
||||
use crate::util::debug_log;
|
||||
|
||||
// Re-export utilities
|
||||
|
||||
/// Handles initialization and registration for the Bitwarden desktop app as a
|
||||
/// plugin authenticator with Windows.
|
||||
/// For now, also adds the authenticator
|
||||
pub fn register() -> std::result::Result<(), String> {
|
||||
debug_log("register() called");
|
||||
debug_log("register() called...");
|
||||
|
||||
debug_log("About to call initialize_com_library()");
|
||||
let r = com_registration::initialize_com_library();
|
||||
debug_log(&format!("initialized the com library: {:?}", r));
|
||||
debug_log(&format!("Initialized the com library: {:?}", r));
|
||||
|
||||
debug_log("About to call register_com_library()");
|
||||
let r = com_registration::register_com_library();
|
||||
debug_log(&format!("registered the com library: {:?}", r));
|
||||
debug_log(&format!("Registered the com library: {:?}", r));
|
||||
|
||||
debug_log("About to call add_authenticator()");
|
||||
let r = com_registration::add_authenticator();
|
||||
//let r = add_authenticator_using_wide_encoding();
|
||||
debug_log(&format!("added the authenticator: {:?}", r));
|
||||
|
||||
debug_log("sleeping for 5 seconds...");
|
||||
thread::sleep(Duration::from_millis(5000));
|
||||
debug_log("sleeping done");
|
||||
|
||||
//let r = syncCredentials();
|
||||
//util::message(&format!("sync credentials: {:?}", r));
|
||||
|
||||
//if let Err(e) = r {
|
||||
// util::message(&format!("syncCredentials failed: {}", e));
|
||||
//}
|
||||
debug_log(&format!("Added the authenticator: {:?}", r));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// fn syncCredentials() -> std::result::Result<(), String> {
|
||||
// // Create a test credential using the new sync module with more realistic data
|
||||
// let test_credential = types::SyncedCredential {
|
||||
// credential_id: vec![
|
||||
// 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
|
||||
// 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04,
|
||||
// 0x05, 0x06, 0x07, 0x08,
|
||||
// ], // 32 byte credential ID
|
||||
// rp_id: "webauthn.io".to_string(),
|
||||
// user_name: "testuser".to_string(),
|
||||
// user_handle: vec![0x75, 0x73, 0x65, 0x72, 0x31, 0x32, 0x33, 0x34], // "user1234" as bytes
|
||||
// };
|
||||
|
||||
// let credentials = vec![test_credential];
|
||||
|
||||
// // Use the sync module to sync credentials
|
||||
// sync_credentials_to_windows(credentials, CLSID)
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user