Skip to content

Commit

Permalink
Add DAITA Windows client and updated tuncfg
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon authored and Serock3 committed Apr 25, 2024
1 parent 2865a03 commit 1f8073e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
10 changes: 5 additions & 5 deletions talpid-tunnel-config-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,18 @@ pub async fn request_ephemeral_peer(
actual: ciphertexts.len(),
})?;

// Store the PSK data on the heap. So it can be passed around and then zeroized on drop without
// being stored in a bunch of places on the stack.
// Store the PSK data on the heap. So it can be passed around and then zeroized on drop
// without being stored in a bunch of places on the stack.
let mut psk_data = Box::new([0u8; 32]);

// Decapsulate Classic McEliece and mix into PSK
{
let mut shared_secret = classic_mceliece::decapsulate(&cme_kem_secret, cme_ciphertext)?;
xor_assign(&mut psk_data, shared_secret.as_array());

// This should happen automatically due to `SharedSecret` implementing ZeroizeOnDrop. But
// doing it explicitly provides a stronger guarantee that it's not accidentally
// removed.
// This should happen automatically due to `SharedSecret` implementing ZeroizeOnDrop.
// But doing it explicitly provides a stronger guarantee that it's not
// accidentally removed.
shared_secret.zeroize();
}
// Decapsulate Kyber and mix into PSK
Expand Down
12 changes: 7 additions & 5 deletions talpid-wireguard/src/wireguard_nt/daita.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
use super::WIREGUARD_KEY_LENGTH;
use maybenot::framework::MachineId;
use once_cell::sync::OnceCell;
use std::{collections::HashMap, fs, io, path::Path, time::Duration};
use std::{os::windows::prelude::RawHandle, sync::Arc};
use std::{
collections::HashMap, fs, io, os::windows::prelude::RawHandle, path::Path, sync::Arc,
time::Duration,
};
use talpid_types::net::wireguard::PublicKey;
use tokio::task::JoinHandle;
use windows_sys::Win32::Foundation::BOOLEAN;
use windows_sys::Win32::{
Foundation::ERROR_NO_MORE_ITEMS,
Foundation::{BOOLEAN, ERROR_NO_MORE_ITEMS},
System::Threading::{WaitForMultipleObjects, WaitForSingleObject, INFINITE},
};

Expand Down Expand Up @@ -238,7 +239,8 @@ impl MachineMap {
}

impl Machinist {
/// Spawn an actor that handles scheduling of Maybenot actions and forwards DAITA events to the framework.
/// Spawn an actor that handles scheduling of Maybenot actions and forwards DAITA events to the
/// framework.
pub fn spawn(
resource_dir: &Path,
daita: Session,
Expand Down

0 comments on commit 1f8073e

Please sign in to comment.