mirror of
https://github.com/bitwarden/browser
synced 2025-12-31 15:43:28 +00:00
@@ -51,7 +51,7 @@ impl ssh_agent::Agent<peerinfo::models::PeerInfo> for BitwardenDesktopAgent {
|
||||
let request_data = match request_parser::parse_request(data) {
|
||||
Ok(data) => data,
|
||||
Err(e) => {
|
||||
println!("[SSH Agent] Error while parsing request: {}", e);
|
||||
println!("[SSH Agent] Error while parsing request: {e}");
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -178,7 +178,7 @@ impl BitwardenDesktopAgent {
|
||||
);
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("[SSH Agent Native Module] Error while parsing key: {}", e);
|
||||
eprintln!("[SSH Agent Native Module] Error while parsing key: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -234,10 +234,9 @@ fn parse_key_safe(pem: &str) -> Result<ssh_key::private::PrivateKey, anyhow::Err
|
||||
Ok(key) => match key.public_key().to_bytes() {
|
||||
Ok(_) => Ok(key),
|
||||
Err(e) => Err(anyhow::Error::msg(format!(
|
||||
"Failed to parse public key: {}",
|
||||
e
|
||||
"Failed to parse public key: {e}"
|
||||
))),
|
||||
},
|
||||
Err(e) => Err(anyhow::Error::msg(format!("Failed to parse key: {}", e))),
|
||||
Err(e) => Err(anyhow::Error::msg(format!("Failed to parse key: {e}"))),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,16 +65,10 @@ impl BitwardenDesktopAgent {
|
||||
}
|
||||
};
|
||||
|
||||
println!(
|
||||
"[SSH Agent Native Module] Starting SSH Agent server on {:?}",
|
||||
ssh_path
|
||||
);
|
||||
println!("[SSH Agent Native Module] Starting SSH Agent server on {ssh_path:?}");
|
||||
let sockname = std::path::Path::new(&ssh_path);
|
||||
if let Err(e) = std::fs::remove_file(sockname) {
|
||||
println!(
|
||||
"[SSH Agent Native Module] Could not remove existing socket file: {}",
|
||||
e
|
||||
);
|
||||
println!("[SSH Agent Native Module] Could not remove existing socket file: {e}");
|
||||
if e.kind() != std::io::ErrorKind::NotFound {
|
||||
return;
|
||||
}
|
||||
@@ -85,10 +79,7 @@ impl BitwardenDesktopAgent {
|
||||
// Only the current user should be able to access the socket
|
||||
if let Err(e) = fs::set_permissions(sockname, fs::Permissions::from_mode(0o600))
|
||||
{
|
||||
println!(
|
||||
"[SSH Agent Native Module] Could not set socket permissions: {}",
|
||||
e
|
||||
);
|
||||
println!("[SSH Agent Native Module] Could not set socket permissions: {e}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -112,10 +103,7 @@ impl BitwardenDesktopAgent {
|
||||
println!("[SSH Agent Native Module] SSH Agent server exited");
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!(
|
||||
"[SSH Agent Native Module] Error while starting agent server: {}",
|
||||
e
|
||||
);
|
||||
eprintln!("[SSH Agent Native Module] Error while starting agent server: {e}");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user