fix(core): add raw_len and noise_len to noise-read error

This commit is contained in:
ospab 2026-05-21 18:02:42 +03:00
parent b57a3180bd
commit 7c84c17336
1 changed files with 3 additions and 1 deletions

View File

@ -243,7 +243,9 @@ impl ProtocolMachine {
tracing::info!("handle_inbound: raw_vec.len()={}, noise_len={}, raw_vec[0..6]={:?}", raw_vec.len(), noise_len, &raw_vec[0..6]);
let mut read_out = vec![0_u8; 1024];
let n = self.noise.read_handshake(&raw_vec[6..6 + noise_len], &mut read_out)?;
let n = self.noise.read_handshake(&raw_vec[6..6 + noise_len], &mut read_out).map_err(|e| {
ProtocolError::Crypto(format!("noise-read: {:?} (raw_len={}, noise_len={})", e, raw_vec.len(), noise_len))
})?;
read_out.truncate(n);
let response = match self.role {