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:
loki5512344 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

@ -146,6 +146,41 @@ pub async fn handle(pid: u16, payload: &[u8], tx: &mpsc::Sender<NetEvent>) -> Re
_ => debug!("unhandled friend event: {}", p.event_type),
}
}
PID_E2EE_DM_KEY_EXCHANGE => {
let p: E2eeDmKeyExchangePayload = serde_json::from_slice(payload)?;
let _ = tx
.send(NetEvent::E2eeDmKeyExchange {
dm_id: p.dm_id,
e2ee_public_key: p.e2ee_public_key,
})
.await;
}
PID_E2EE_DM_KEY_EXCHANGE_ACK => {
let p: E2eeDmKeyExchangeAckPayload = serde_json::from_slice(payload)?;
let _ = tx
.send(NetEvent::E2eeDmKeyExchangeAck { dm_id: p.dm_id })
.await;
}
PID_E2EE_DM_MESSAGE => {
let p: E2eeDmMessagePayload = serde_json::from_slice(payload)?;
let _ = tx
.send(NetEvent::E2eeDmMessage {
dm_id: p.dm_id,
sender_id: p.sender_id,
ciphertext: p.ciphertext,
timestamp: p.timestamp,
})
.await;
}
PID_E2EE_DM_HISTORY => {
let p: E2eeDmHistoryPayload = serde_json::from_slice(payload)?;
let _ = tx
.send(NetEvent::E2eeDmHistory {
dm_id: p.dm_id,
messages: p.messages,
})
.await;
}
_ => {}
}
Ok(())