feat(client): TLS 1.3 control connection with SPKI pinning and LNEx v3
Replace the custom X25519/HKDF/ChaCha20 TCP layer with rustls (TLS 1.3 only, ALPN vnox-lnex/3, no plaintext or fallback). Add a trust store (pin, trust on first use, public CA), block changed fingerprints and identities, bind the Ed25519 auth signature to the TLS exporter, add RU/EN trust dialog and update the interop test and e2e voice tool.
This commit is contained in:
parent
5f594046a6
commit
29883a3187
31 changed files with 2085 additions and 567 deletions
54
src/main.rs
54
src/main.rs
|
|
@ -353,6 +353,60 @@ fn wire_signals(window: &MainWindow, state: &Rc<RefCell<AppState>>) {
|
|||
});
|
||||
}
|
||||
|
||||
{
|
||||
// First trust: remember the confirmed fingerprint, then connect again.
|
||||
let state = state.clone();
|
||||
window.on_trust_accept(move || {
|
||||
let mut s = state.borrow_mut();
|
||||
let Some(prompt) = s.ui.trust_prompt.take() else {
|
||||
return;
|
||||
};
|
||||
if prompt.kind != ui::state::TrustPromptKind::FirstUse {
|
||||
return;
|
||||
}
|
||||
if let Err(error) = s.net.trust().pin(&prompt.address, &prompt.received) {
|
||||
tracing::warn!(%error, "could not save the trusted fingerprint");
|
||||
s.ui.status_msg = Some("Could not save the trusted fingerprint".into());
|
||||
return;
|
||||
}
|
||||
s.ui.conn = ConnState::Connecting;
|
||||
s.ui.status_msg = Some("Connecting…".into());
|
||||
let auto_reconnect = s.ui.auto_reconnect;
|
||||
let net = s.net.clone();
|
||||
drop(s);
|
||||
tokio::spawn(async move {
|
||||
net.send(NetCommand::Connect {
|
||||
address: prompt.address,
|
||||
auto_reconnect,
|
||||
})
|
||||
.await;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
// A blocked change: forgetting is the only way forward and needs a new decision.
|
||||
let state = state.clone();
|
||||
window.on_trust_forget(move || {
|
||||
let mut s = state.borrow_mut();
|
||||
let Some(prompt) = s.ui.trust_prompt.take() else {
|
||||
return;
|
||||
};
|
||||
if let Err(error) = s.net.trust().forget(&prompt.address) {
|
||||
tracing::warn!(%error, "could not forget the server");
|
||||
}
|
||||
s.ui.status_msg =
|
||||
Some("Server forgotten. Connect again to review its fingerprint.".into());
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let state = state.clone();
|
||||
window.on_trust_dismiss(move || {
|
||||
state.borrow_mut().ui.trust_prompt = None;
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let state = state.clone();
|
||||
window.on_disconnect(move || {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue