buffers update, warning fixes, ghosts killed

This commit is contained in:
2026-04-03 18:18:10 +07:00
parent e53a95692e
commit 780750171b
29 changed files with 1205 additions and 1044 deletions
+5 -2
View File
@@ -139,10 +139,13 @@ impl Codec {
let decrypted = self.crypto.decrypt(&mut data_to_decrypt).map_err(|_| {
self.staging.clear();
// Сохраняем первые 32 байта зашифрованного пакета для логов, чтобы понять, что нам прислали
let bad_data =
Bytes::copy_from_slice(&data_to_decrypt[..data_to_decrypt.len().min(32)]);
TlsError::new(
ErrorStage::Tls("Decr error"),
ErrorStage::Tls("AEAD Decrypt Failed (MITM?)"),
ErrorAction::Drop,
Bytes::new(),
bad_data,
)
})?;
+2 -2
View File
@@ -1,5 +1,5 @@
use bytes::Bytes;
use netrunner_logger::{error, trace, warn};
use netrunner_logger::{error, trace};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ErrorAction {
@@ -63,7 +63,7 @@ impl TlsError {
);
}
ErrorAction::Redirect => {
warn!(
error!(
stage = stage_name,
action = ?self.action,
data = %data_preview,
+1 -1
View File
@@ -5,4 +5,4 @@ mod frame;
pub(crate) use codec::Codec;
pub(crate) use errors::{ErrorAction, ErrorStage, TlsError};
pub(crate) use frame::{Frame, FrameType, FRAME_HEADER_SIZE, MAX_PADDING_SIZE};
pub(crate) use frame::{Frame, FrameType};