From 614e17d2d57d7b98324c1fa1739963a257e9ce96 Mon Sep 17 00:00:00 2001 From: Jett Chen Date: Fri, 10 Nov 2023 13:04:14 +0800 Subject: [PATCH] add more debug info --- burrow/src/daemon/mod.rs | 1 - burrow/src/wireguard/noise/handshake.rs | 1 + burrow/src/wireguard/pcb.rs | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/burrow/src/daemon/mod.rs b/burrow/src/daemon/mod.rs index 57e5837..112f48b 100644 --- a/burrow/src/daemon/mod.rs +++ b/burrow/src/daemon/mod.rs @@ -40,7 +40,6 @@ pub async fn daemon_main() -> Result<()> { let (commands_tx, commands_rx) = async_channel::unbounded(); let (response_tx, response_rx) = async_channel::unbounded(); let mut inst = DaemonInstance::new(commands_rx, response_tx); - // tokio::try_join!(inst.run(), listen(commands_tx, response_rx)).map(|_| ()) let mut _tun = tun::TunInterface::new()?; _tun.set_ipv4_addr(Ipv4Addr::from([192, 168, 1, 10]))?; diff --git a/burrow/src/wireguard/noise/handshake.rs b/burrow/src/wireguard/noise/handshake.rs index 86a4e28..92c456c 100755 --- a/burrow/src/wireguard/noise/handshake.rs +++ b/burrow/src/wireguard/noise/handshake.rs @@ -138,6 +138,7 @@ fn aead_chacha20_open( nonce[4..].copy_from_slice(&counter.to_le_bytes()); log::debug!("TAG A"); + log::debug!("{:?};{:?};{:?};{:?};{}", key, data, aad, nonce, counter); aead_chacha20_open_inner(buffer, key, nonce, data, aad) .map_err(|_| WireGuardError::InvalidAeadTag)?; diff --git a/burrow/src/wireguard/pcb.rs b/burrow/src/wireguard/pcb.rs index 426acc4..78bfad0 100755 --- a/burrow/src/wireguard/pcb.rs +++ b/burrow/src/wireguard/pcb.rs @@ -106,6 +106,7 @@ impl PeerPcb { } TunnResult::WriteToNetwork(packet) => { let socket = self.socket().await?; + tracing::debug!("Our Encapsulated packet: {:?}", packet); socket.send(packet).await?; } _ => panic!("Unexpected result from encapsulate"),