fn find_incomplete_tx(&mut self, hdr: &DCERPCHdrUdp) -> Option<&mut DCERPCTransaction> {
for tx in &mut self.transactions {
- if tx.seqnum == hdr.seqnum && tx.activityuuid == hdr.activityuuid {
- if (hdr.pkt_type == DCERPC_TYPE_REQUEST && !tx.req_done) ||
- (hdr.pkt_type == DCERPC_TYPE_RESPONSE && !tx.resp_done) {
- SCLogDebug!("found tx id {}, last tx_id {}, {} {}", tx.id, self.tx_id, tx.seqnum, tx.activityuuid[0]);
- return Some(tx);
- }
+ if tx.seqnum == hdr.seqnum && tx.activityuuid == hdr.activityuuid && ((hdr.pkt_type == DCERPC_TYPE_REQUEST && !tx.req_done) || (hdr.pkt_type == DCERPC_TYPE_RESPONSE && !tx.resp_done)) {
+ SCLogDebug!("found tx id {}, last tx_id {}, {} {}", tx.id, self.tx_id, tx.seqnum, tx.activityuuid[0]);
+ return Some(tx);
}
}
None
blocks: &[parser::HTTP2FrameHeaderBlock], ctx: &DetectUintData<u64>,
) -> std::os::raw::c_int {
for block in blocks.iter() {
- if block.error == parser::HTTP2HeaderDecodeStatus::HTTP2HeaderDecodeSizeUpdate {
- if detect_match_uint(ctx, block.sizeupdate) {
- return 1;
- }
+ if block.error == parser::HTTP2HeaderDecodeStatus::HTTP2HeaderDecodeSizeUpdate && detect_match_uint(ctx, block.sizeupdate) {
+ return 1;
}
}
return 0;
IkeV2Transform::Auth(IkeTransformAuthType::NONE) => false,
IkeV2Transform::Auth(_) => true,
_ => false,
- }) {
- if !transforms.iter().any(|x| match *x {
+ }) && !transforms.iter().any(|x| match *x {
IkeV2Transform::Encryption(ref enc) => enc.is_aead(),
_ => false,
}) {
- SCLogDebug!("No integrity transform found");
- tx.set_event(IkeEvent::WeakCryptoNoAuth);
- }
+ SCLogDebug!("No integrity transform found");
+ tx.set_event(IkeEvent::WeakCryptoNoAuth);
}
// Finally
if direction == Direction::ToClient {
fn smb_probe_tcp(flags: u8, slice: &[u8], rdir: *mut u8, begins: bool) -> AppProto
{
- if flags & STREAM_MIDSTREAM == STREAM_MIDSTREAM {
- if smb_probe_tcp_midstream(flags.into(), slice, rdir, begins) == 1 {
- unsafe { return ALPROTO_SMB; }
- }
+ if flags & STREAM_MIDSTREAM == STREAM_MIDSTREAM && smb_probe_tcp_midstream(flags.into(), slice, rdir, begins) == 1 {
+ unsafe { return ALPROTO_SMB; }
}
match parse_nbss_record_partial(slice) {
Ok((_, ref hdr)) => {
false
},
};
- if !have_tx {
- if smb1_create_new_tx(command) {
- let tx_key = SMBCommonHdr::from1(r, SMBHDR_TYPE_GENERICTX);
- let tx = state.new_generic_tx(1, command as u16, tx_key);
- SCLogDebug!("tx {} created for {}/{}", tx.id, command, &smb1_command_string(command));
- tx.set_events(events);
- if no_response_expected {
- tx.response_done = true;
- }
+ if !have_tx && smb1_create_new_tx(command) {
+ let tx_key = SMBCommonHdr::from1(r, SMBHDR_TYPE_GENERICTX);
+ let tx = state.new_generic_tx(1, command as u16, tx_key);
+ SCLogDebug!("tx {} created for {}/{}", tx.id, command, &smb1_command_string(command));
+ tx.set_events(events);
+ if no_response_expected {
+ tx.response_done = true;
}
}
}
},
};
/* if we don't have a tx, create it here (maybe) */
- if !have_tx {
- if smb2_create_new_tx(r.command) {
- let tx_key = SMBCommonHdr::from2(r, SMBHDR_TYPE_GENERICTX);
- let tx = state.new_generic_tx(2, r.command, tx_key);
- SCLogDebug!("TS TX {} command {} created with session_id {} tree_id {} message_id {}",
- tx.id, r.command, r.session_id, r.tree_id, r.message_id);
- tx.set_events(events);
- }
+ if !have_tx && smb2_create_new_tx(r.command) {
+ let tx_key = SMBCommonHdr::from2(r, SMBHDR_TYPE_GENERICTX);
+ let tx = state.new_generic_tx(2, r.command, tx_key);
+ SCLogDebug!("TS TX {} command {} created with session_id {} tree_id {} message_id {}",
+ tx.id, r.command, r.session_id, r.tree_id, r.message_id);
+ tx.set_events(events);
}
}