Phase 2: E2EE for DM + Slint migration + dead code cleanup

- E2EE crypto (src/e2ee.rs) with X25519 key derivation from Ed25519,
  HKDF shared secret, ChaCha20-Poly1305 encrypt/decrypt
- E2EE net layer: PID 0x0071-0x0074, JSON payloads, dispatch, session handlers
- E2EE UI: lock icons in DM header and sidebar
- Slint migration: all .slint files, bridge.rs, update.rs, main.rs
- Removed egui UI (~50 files), cleaned all dead code
- Clean cargo clippy -- -D warnings
This commit is contained in:
Loki 2026-07-14 13:25:15 +02:00
parent f361b037cb
commit 03d94e0465
Signed by: boba
GPG key ID: 253067914055423B
83 changed files with 5055 additions and 9202 deletions

View file

@ -140,6 +140,53 @@ pub async fn handle_cmd(
})?;
framing::io::write_encrypted(stream, PID_DM_HISTORY, seq, &payload, crypto).await?;
}
NetCommand::E2eeDmKeyExchange {
dm_id,
e2ee_public_key,
} => {
let payload = serde_json::to_vec(&E2eeDmKeyExchangePayload {
dm_id,
e2ee_public_key,
})?;
framing::io::write_encrypted(stream, PID_E2EE_DM_KEY_EXCHANGE, seq, &payload, crypto)
.await?;
}
NetCommand::E2eeDmKeyExchangeAck { dm_id } => {
let payload = serde_json::to_vec(&E2eeDmKeyExchangeAckPayload { dm_id })?;
framing::io::write_encrypted(
stream,
PID_E2EE_DM_KEY_EXCHANGE_ACK,
seq,
&payload,
crypto,
)
.await?;
}
NetCommand::E2eeDmSend { dm_id, ciphertext } => {
let msg = E2eeDmMessagePayload {
dm_id,
sender_id: identity.pubkey_hex.clone(),
ciphertext,
timestamp: now_ms(),
};
framing::io::write_encrypted(
stream,
PID_E2EE_DM_MESSAGE,
seq,
&serde_json::to_vec(&msg)?,
crypto,
)
.await?;
}
NetCommand::E2eeDmHistory { dm_id, limit } => {
let payload = serde_json::to_vec(&E2eeDmHistoryPayload {
dm_id,
messages: vec![],
limit,
})?;
framing::io::write_encrypted(stream, PID_E2EE_DM_HISTORY, seq, &payload, crypto)
.await?;
}
_ => {}
}
Ok(())