rust: move EncryptionHandling definition to its own file

as it is not specific to ssh anymore
pull/14618/head
Philippe Antoine 11 months ago committed by Victor Julien
parent 7422c97bf2
commit 7acfea57a9

@ -0,0 +1,25 @@
/* Copyright (C) 2025 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
#[repr(C)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[allow(non_camel_case_types)]
pub enum SshEncryptionHandling {
SSH_HANDLE_ENCRYPTION_TRACK_ONLY = 0, // Disable raw content inspection, continue tracking
SSH_HANDLE_ENCRYPTION_BYPASS = 1, // Skip processing of flow, bypass if possible
SSH_HANDLE_ENCRYPTION_FULL = 2, // Handle fully like any other protocol
}

@ -93,6 +93,7 @@ pub mod utils;
pub mod ja4;
pub mod tls_version;
pub mod handshake;
pub mod encryption;
pub mod lua;

@ -22,7 +22,7 @@ use super::{
parser::{quic_pkt_num, QuicData, QuicHeader, QuicType},
};
use crate::conf::conf_get;
use crate::ssh::ssh::SshEncryptionHandling;
use crate::encryption::SshEncryptionHandling;
use crate::{
applayer::{self, *},
direction::Direction,

@ -19,6 +19,7 @@ use super::parser;
use crate::applayer::*;
use crate::core::*;
use crate::direction::Direction;
use crate::encryption::SshEncryptionHandling;
use crate::flow::Flow;
use crate::frames::Frame;
use nom8::Err;
@ -30,15 +31,6 @@ use suricata_sys::sys::{
SCAppLayerProtoDetectConfProtoDetectionEnabled,
};
#[repr(C)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[allow(non_camel_case_types)]
pub enum SshEncryptionHandling {
SSH_HANDLE_ENCRYPTION_TRACK_ONLY = 0, // Disable raw content inspection, continue tracking
SSH_HANDLE_ENCRYPTION_BYPASS = 1, // Skip processing of flow, bypass if possible
SSH_HANDLE_ENCRYPTION_FULL = 2, // Handle fully like any other protocol
}
static mut ALPROTO_SSH: AppProto = ALPROTO_UNKNOWN;
static HASSH_ENABLED: AtomicBool = AtomicBool::new(false);

Loading…
Cancel
Save