buffers update, warning fixes, ghosts killed
This commit is contained in:
@@ -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,
|
||||
)
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user