mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-18 22:16:18 -05:00
fix: improve authentication recovery and diagnostics
Recognize real GTK Wayland crash messages and keep remote authentication prompts readable. Preserve device identifiers without initializing OpenSSL, validate diagnostic executable paths, and improve release automation. Fixes #669
This commit is contained in:
15 files changed
+294
-15
No files matched your search
@@ -14,7 +14,9 @@ impl AuthServer {
|
||||
let server = Server::http(addr).map_err(|err| anyhow::anyhow!(err))?;
|
||||
let auth_id = Uuid::new_v4().to_string();
|
||||
|
||||
Ok(Self { server, auth_id })
|
||||
let auth_server = Self { server, auth_id };
|
||||
info!("auth server started at: {}", auth_server.auth_url());
|
||||
Ok(auth_server)
|
||||
}
|
||||
|
||||
pub fn auth_url(&self) -> String {
|
||||
@@ -22,8 +24,6 @@ impl AuthServer {
|
||||
}
|
||||
|
||||
pub fn serve_request(&self, auth_request: &str) {
|
||||
info!("auth server started at: {}", self.auth_url());
|
||||
|
||||
for req in self.server.incoming_requests() {
|
||||
info!("received request, method: {}, url: {}", req.method(), req.url());
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
use std::net::{IpAddr, SocketAddr};
|
||||
use std::{
|
||||
io::Write,
|
||||
net::{IpAddr, SocketAddr},
|
||||
};
|
||||
|
||||
use browser_launcher::Browser as LaunchBrowser;
|
||||
use gpapi::auth::SamlAuthData;
|
||||
@@ -34,7 +37,7 @@ impl<'a> BrowserAuthenticator<'a> {
|
||||
let auth_url = auth_server.auth_url();
|
||||
|
||||
let auth_request = self.auth_request.to_string();
|
||||
tokio::spawn(async move {
|
||||
let auth_server_task = tokio::task::spawn_blocking(move || {
|
||||
auth_server.serve_request(&auth_request);
|
||||
});
|
||||
|
||||
@@ -55,6 +58,7 @@ Note that the URL is only valid for a single use.
|
||||
"#,
|
||||
auth_url
|
||||
);
|
||||
auth_server_task.await?;
|
||||
return read_auth_data_from_stdin();
|
||||
}
|
||||
|
||||
@@ -95,6 +99,9 @@ async fn detect_local_ip() -> anyhow::Result<IpAddr> {
|
||||
}
|
||||
|
||||
fn read_auth_data_from_stdin() -> anyhow::Result<SamlAuthData> {
|
||||
eprint!("\nAuthentication callback (paste and press Enter): ");
|
||||
std::io::stderr().flush()?;
|
||||
|
||||
let mut data = String::new();
|
||||
std::io::stdin().read_line(&mut data)?;
|
||||
|
||||
|
||||
Reference in new issue
Block a user