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.

Claude-Session: https://claude.ai/code/session_01GDjxLvBcnJqniFQGUGb1V4
This commit is contained in:
Loki 2026-10-24 22:05:19 +02:00
parent 5f594046a6
commit 9a20ace6e6
Signed by: boba
GPG key ID: 253067914055423B
31 changed files with 2085 additions and 567 deletions

View file

@ -3,6 +3,7 @@ use tokio::time::sleep;
use tracing::{error, info};
use crate::identity::Identity;
use crate::net::trust::{TransportError, TrustStore};
use crate::net::types::{NetCommand, NetEvent};
use super::{
@ -13,6 +14,7 @@ use super::{
pub async fn net_task(
identity: Identity,
trust: TrustStore,
mut cmd_rx: mpsc::Receiver<NetCommand>,
event_tx: mpsc::Sender<NetEvent>,
) {
@ -71,6 +73,7 @@ pub async fn net_task(
match session_loop(
&identity,
&session.address,
&trust,
&mut session.channels,
restored,
&mut cmd_rx,
@ -97,7 +100,12 @@ pub async fn net_task(
continue;
}
error!("session ended: {e}");
let retry = session.auto_reconnect;
// Trust failures and protocol mismatches never improve by retrying.
let transport = e.downcast_ref::<TransportError>();
if let Some(problem) = transport.and_then(TransportError::trust_problem) {
let _ = event_tx.send(NetEvent::TrustProblem(problem)).await;
}
let retry = session.auto_reconnect && transport.is_none();
let _ = event_tx
.send(NetEvent::Disconnected {
reason: e.to_string(),