From: Eric Leblond Date: Mon, 23 Jan 2023 19:03:35 +0000 (+0100) Subject: ike: add TX orientation X-Git-Tag: suricata-7.0.0-rc2~468 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ce557a44c5f471791fca27be70bb51a6d709ad0;p=thirdparty%2Fsuricata.git ike: add TX orientation Set no inspection in the opposite side of the transaction. Ticket: #5799 --- diff --git a/rust/src/ike/ike.rs b/rust/src/ike/ike.rs index e715fa7bf9..997348053e 100644 --- a/rust/src/ike/ike.rs +++ b/rust/src/ike/ike.rs @@ -113,7 +113,7 @@ pub struct IKETransaction { pub errors: u32, logged: LoggerFlags, - tx_data: applayer::AppLayerTxData, + pub tx_data: applayer::AppLayerTxData, } impl Transaction for IKETransaction { diff --git a/rust/src/ike/ikev1.rs b/rust/src/ike/ikev1.rs index e8b58eb728..18d586ac4e 100644 --- a/rust/src/ike/ikev1.rs +++ b/rust/src/ike/ikev1.rs @@ -78,6 +78,7 @@ pub fn handle_ikev1( tx.ike_version = 1; tx.direction = direction; + tx.tx_data.set_inspect_direction(direction); tx.hdr.spi_initiator = format!("{:016x}", isakmp_header.init_spi); tx.hdr.spi_responder = format!("{:016x}", isakmp_header.resp_spi); tx.hdr.maj_ver = isakmp_header.maj_ver; diff --git a/rust/src/ike/ikev2.rs b/rust/src/ike/ikev2.rs index cd2e551812..6e3640d257 100644 --- a/rust/src/ike/ikev2.rs +++ b/rust/src/ike/ikev2.rs @@ -117,6 +117,7 @@ pub fn handle_ikev2( tx.ike_version = 2; // use init_spi as transaction identifier // tx.xid = hdr.init_spi; todo is this used somewhere? + tx.tx_data.set_inspect_direction(direction); tx.hdr.ikev2_header = hdr.clone(); tx.hdr.spi_initiator = format!("{:016x}", isakmp_header.init_spi); tx.hdr.spi_responder = format!("{:016x}", isakmp_header.resp_spi);