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
|
|
@ -75,6 +75,41 @@ pub fn process_net_events(state: &mut AppState) {
|
|||
});
|
||||
}
|
||||
}
|
||||
NetEvent::TrustProblem(problem) => {
|
||||
use crate::ui::state::{TrustPrompt, TrustPromptKind};
|
||||
use vnox_client::net::TrustProblem;
|
||||
state.ui.trust_prompt = Some(match problem {
|
||||
TrustProblem::Untrusted {
|
||||
address,
|
||||
fingerprint,
|
||||
} => TrustPrompt {
|
||||
kind: TrustPromptKind::FirstUse,
|
||||
address,
|
||||
received: fingerprint,
|
||||
expected: String::new(),
|
||||
},
|
||||
TrustProblem::FingerprintChanged {
|
||||
address,
|
||||
expected,
|
||||
actual,
|
||||
} => TrustPrompt {
|
||||
kind: TrustPromptKind::FingerprintChanged,
|
||||
address,
|
||||
received: actual,
|
||||
expected,
|
||||
},
|
||||
TrustProblem::IdentityChanged {
|
||||
address,
|
||||
expected,
|
||||
actual,
|
||||
} => TrustPrompt {
|
||||
kind: TrustPromptKind::IdentityChanged,
|
||||
address,
|
||||
received: actual,
|
||||
expected,
|
||||
},
|
||||
});
|
||||
}
|
||||
NetEvent::Disconnected { reason, will_retry } => {
|
||||
if let Some(ui) = &state.webhooks {
|
||||
ui.disconnected();
|
||||
|
|
@ -97,10 +132,14 @@ pub fn process_net_events(state: &mut AppState) {
|
|||
state.ui.active_channel = None;
|
||||
state.ui.user_names.clear();
|
||||
state.ui.rtt_ms = None;
|
||||
state.ui.status_msg = Some(crate::ui::i18n::Message::with(
|
||||
"Disconnected: {reason}",
|
||||
vec![("reason", reason.to_string())],
|
||||
));
|
||||
state.ui.status_msg = if state.ui.trust_prompt.is_some() {
|
||||
None
|
||||
} else {
|
||||
Some(crate::ui::i18n::Message::with(
|
||||
"Disconnected: {reason}",
|
||||
vec![("reason", reason.to_string())],
|
||||
))
|
||||
};
|
||||
}
|
||||
if !will_retry {
|
||||
state.ui.dm_conversations.clear();
|
||||
|
|
@ -348,6 +387,7 @@ fn process_net_event(ui: &mut UiState, net: &NetHandle, event: NetEvent) {
|
|||
| NetEvent::WebhookError(_) => unreachable!("handled before generic UI dispatch"),
|
||||
NetEvent::Connected { .. }
|
||||
| NetEvent::Disconnected { .. }
|
||||
| NetEvent::TrustProblem(_)
|
||||
| NetEvent::Reconnecting { .. }
|
||||
| NetEvent::VoicePacket { .. }
|
||||
| NetEvent::E2eeDmKeyExchange { .. }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue