From 6e22167bfe3d17be5f6c3813d26db7e23bda9361 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Mon, 19 Jan 2026 10:35:59 +0000 Subject: [PATCH] crypto/noise: Fix connection negotiation logic on partial writes Signed-off-by: Alexandru Vasile --- src/crypto/noise/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/crypto/noise/mod.rs b/src/crypto/noise/mod.rs index 3727a6073..709ab0824 100644 --- a/src/crypto/noise/mod.rs +++ b/src/crypto/noise/mod.rs @@ -797,7 +797,7 @@ pub async fn handshake( Role::Dialer => { // write initial message let first_message = noise.first_message(Role::Dialer)?; - let _ = io.write(&first_message).await?; + io.write_all(&first_message).await?; io.flush().await?; // read back response which contains the remote peer id @@ -812,7 +812,7 @@ pub async fn handshake( // send the final message which contains local peer id let second_message = noise.second_message()?; - let _ = io.write(&second_message).await?; + io.write_all(&second_message).await?; io.flush().await?; payload @@ -823,7 +823,7 @@ pub async fn handshake( // send local peer id. let second_message = noise.second_message()?; - let _ = io.write(&second_message).await?; + io.write_all(&second_message).await?; io.flush().await?; // read remote's second message which contains their peer id