From d710242566a71d84f2fa05a184856000bd08fb80 Mon Sep 17 00:00:00 2001 From: Simon Wicky Date: Thu, 10 Aug 2023 13:34:09 +0200 Subject: [PATCH] buffer size change --- common/nymnoise/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/nymnoise/src/lib.rs b/common/nymnoise/src/lib.rs index 67bdae7f8f..1f1745e0c5 100644 --- a/common/nymnoise/src/lib.rs +++ b/common/nymnoise/src/lib.rs @@ -74,8 +74,8 @@ impl NoiseStream { inner_stream, handshake: Some(handshake), noise: None, - enc_storage: VecDeque::with_capacity(MAXMSGLEN + HEADER_SIZE), - dec_storage: VecDeque::with_capacity(MAXMSGLEN + HEADER_SIZE), + enc_storage: VecDeque::with_capacity(MAXMSGLEN + TAGLEN + HEADER_SIZE), //At least one message + dec_storage: VecDeque::with_capacity(MAXMSGLEN), } } @@ -130,7 +130,7 @@ impl AsyncRead for NoiseStream { Poll::Ready(Ok(())) => { //Read what we can into enc_storage, decrypt what we can into dec_storage - let mut tcp_buf = vec![0u8; MAXMSGLEN + HEADER_SIZE]; + let mut tcp_buf = vec![0u8; MAXMSGLEN + HEADER_SIZE + TAGLEN]; if let Ok(tcp_len) = projected_self.inner_stream.try_read(&mut tcp_buf) { if tcp_len == 0 && projected_self.dec_storage.len() == 0 { //EOF