"test that we break on invalid format (missing option)")]
#[test_case("bitstring_overflowabsolute_offset",
DetectAsn1Data::default() => panics r#"Error { input: "absolute_offset", code: Verify }"#;
- "test that we break on invalid format (missing seperator)")]
+ "test that we break on invalid format (missing separator)")]
fn test_asn1_parse_rule(input: &str, expected: DetectAsn1Data) {
let (rest, res) = asn1_parse_rule(input).unwrap();
}
Err(_) => {
// Error, probably malformed data.
- SCLogDebug!("An error occured while parsing DCERPC header");
+ SCLogDebug!("An error occurred while parsing DCERPC header");
-2
}
}
pub fn parse_bindctx_item(i: &[u8], endianness: Endianness) -> IResult<&[u8], BindCtxItem> {
let (i, ctxid) = u16(endianness)(i)?;
let (i, _num_trans_items) = le_u8(i)?;
- let (i, _) = take(1_usize)(i)?; // Reservid bit
+ let (i, _) = take(1_usize)(i)?; // Reserved bit
let (i, uuid) = take(16_usize)(i)?;
let (i, version) = u16(endianness)(i)?;
let (i, versionminor) = u16(endianness)(i)?;
return true;
}
-// Start of MD5 C bindins.
+// Start of MD5 C bindings.
pub struct SCMd5(Md5);
* \file
* \author Victor Julien <victor@inliniac.net>
*
- * Tracks chunk based file transfers. Chunks may be transfered out
- * of order, but cannot be transfered in parallel. So only one
+ * Tracks chunk based file transfers. Chunks may be transferred out
+ * of order, but cannot be transferred in parallel. So only one
* chunk at a time.
*
* GAP handling. If a data gap is encountered, the file is truncated
self.file_is_truncated = true;
},
_ => {
- SCLogDebug!("got error so truncing file");
+ SCLogDebug!("got error so truncating file");
self.file_is_truncated = true;
},
}
self.file_is_truncated = true;
},
_ => {
- SCLogDebug!("got error so truncing file");
+ SCLogDebug!("got error so truncating file");
self.file_is_truncated = true;
},
}
self.file_is_truncated = true;
},
_ => {
- SCLogDebug!("got error so truncing file");
+ SCLogDebug!("got error so truncating file");
self.file_is_truncated = true;
},
}
}
// same as http2_frames_get_header_value but returns a new Vec
-// instead of using the transation to store the result slice
+// instead of using the transaction to store the result slice
pub fn http2_frames_get_header_value_vec(
tx: &HTTP2Transaction, direction: Direction, name: &str,
) -> Result<Vec<u8>, ()> {
HTTP2StateDataServer = 5,
HTTP2StateHalfClosedServer = 6,
HTTP2StateClosed = 7,
- //not a RFC-defined state, used for stream 0 frames appyling to the global connection
+ //not a RFC-defined state, used for stream 0 frames applying to the global connection
HTTP2StateGlobal = 8,
//not a RFC-defined state, dropping this old tx because we have too many
HTTP2StateTodrop = 9,
fn http2_parse_headers_block<'a>(
input: &'a [u8], dyn_headers: &mut HTTP2DynTable,
) -> IResult<&'a [u8], HTTP2FrameHeaderBlock> {
- //caller garantees o have at least one byte
+ //caller guarantees o have at least one byte
if input[0] & 0x80 != 0 {
return http2_parse_headers_block_indexed(input, dyn_headers);
} else if input[0] & 0x40 != 0 {
IkeV2Transform::Auth(ref auth) => {
match *auth {
IkeTransformAuthType::NONE => {
- // Note: this could be expected with an AEAD encription alg.
+ // Note: this could be expected with an AEAD encryption alg.
// See rule 4
}
IkeTransformAuthType::AUTH_HMAC_MD5_96
if let RpcRequestCreds::GssApi(ref creds) = r.creds {
if creds.procedure == 0 && creds.service == 2 {
- SCLogDebug!("GSS INTEGRITIY: {:?}", creds);
+ SCLogDebug!("GSS INTEGRITY: {:?}", creds);
match parse_rpc_gssapi_integrity(r.prog_data) {
Ok((_rem, rec)) => {
- SCLogDebug!("GSS INTEGRITIY wrapper: {:?}", rec);
+ SCLogDebug!("GSS INTEGRITY wrapper: {:?}", rec);
data = rec.data;
// store proc and serv for the reply
xidmap.gssapi_proc = creds.procedure;
xidmap.gssapi_service = creds.service;
}
Err(Err::Incomplete(_n)) => {
- SCLogDebug!("NFSPROC4_COMPOUND/GSS INTEGRITIY: INCOMPLETE {:?}", _n);
+ SCLogDebug!("NFSPROC4_COMPOUND/GSS INTEGRITY: INCOMPLETE {:?}", _n);
self.set_event(NFSEvent::MalformedData);
return;
}
Err(Err::Error(_e)) | Err(Err::Failure(_e)) => {
SCLogDebug!(
- "NFSPROC4_COMPOUND/GSS INTEGRITIY: Parsing failed: {:?}",
+ "NFSPROC4_COMPOUND/GSS INTEGRITY: Parsing failed: {:?}",
_e
);
self.set_event(NFSEvent::MalformedData);
let mut data = r.prog_data;
if xidmap.gssapi_proc == 0 && xidmap.gssapi_service == 2 {
- SCLogDebug!("GSS INTEGRITIY as set by call: {:?}", xidmap);
+ SCLogDebug!("GSS INTEGRITY as set by call: {:?}", xidmap);
match parse_rpc_gssapi_integrity(r.prog_data) {
Ok((_rem, rec)) => {
- SCLogDebug!("GSS INTEGRITIY wrapper: {:?}", rec);
+ SCLogDebug!("GSS INTEGRITY wrapper: {:?}", rec);
data = rec.data;
}
Err(Err::Incomplete(_n)) => {
- SCLogDebug!("NFSPROC4_COMPOUND/GSS INTEGRITIY: INCOMPLETE {:?}", _n);
+ SCLogDebug!("NFSPROC4_COMPOUND/GSS INTEGRITY: INCOMPLETE {:?}", _n);
self.set_event(NFSEvent::MalformedData);
return;
}
Err(Err::Error(_e)) | Err(Err::Failure(_e)) => {
- SCLogDebug!("NFSPROC4_COMPOUND/GSS INTEGRITIY: Parsing failed: {:?}", _e);
+ SCLogDebug!("NFSPROC4_COMPOUND/GSS INTEGRITY: Parsing failed: {:?}", _e);
self.set_event(NFSEvent::MalformedData);
return;
}
DestroyClientID(u32),
}
-// might need improvment with a stateid_present = yes case
+// might need improvement with a stateid_present = yes case
fn nfs4_res_layoutreturn(i:&[u8]) -> IResult<&[u8], Nfs4ResponseContent> {
let (i, status) = be_u32(i)?;
let (i, _stateid_present) = verify(be_u32, |&v| v <= 1)(i)?;
}
#[test]
- fn test_nfs4_request_sequenece() {
+ fn test_nfs4_request_sequence() {
#[rustfmt::skip]
let buf: &[u8] = &[
0x00, 0x00, 0x00, 0x35, /*opcode*/
#[rustfmt::skip]
let buf: &[u8] = &[
0x00, 0x00, 0x00, 0x0f, /*opcode*/
- 0x00, 0x00, 0x00, 0x04, 0x76, 0x6f, 0x6c, 0x31, /*fiename: (vol1)*/
+ 0x00, 0x00, 0x00, 0x04, 0x76, 0x6f, 0x6c, 0x31, /*filename: (vol1)*/
];
let (_, filename_buf) = nfs4_parse_nfsstring(&buf[4..]).unwrap();
}
}
- // server_selected_procotol not logged
+ // server_selected_protocol not logged
if let Some(width) = client.desktop_physical_width {
js.set_uint("physical_width", width as u64)?;
if self.tls_parsing {
match parse_tls_plaintext(available) {
Ok((remainder, _tls)) => {
- // bytes available for futher parsing are what remain
+ // bytes available for further parsing are what remain
available = remainder;
}
match parse_t123_tpkt(available) {
// success
Ok((remainder, t123)) => {
- // bytes available for futher parsing are what remain
+ // bytes available for further parsing are what remain
available = remainder;
// evaluate message within the tpkt
match t123.child {
if self.tls_parsing {
match parse_tls_plaintext(available) {
Ok((remainder, tls)) => {
- // bytes available for futher parsing are what remain
+ // bytes available for further parsing are what remain
available = remainder;
for message in &tls.msg {
#[allow(clippy::single_match)]
match parse_t123_tpkt(available) {
// success
Ok((remainder, t123)) => {
- // bytes available for futher parsing are what remain
+ // bytes available for further parsing are what remain
available = remainder;
// evaluate message within the tpkt
match t123.child {
fn parse_dcerpc_flags2(i:&[u8]) -> IResult<&[u8],(u32,u32,u32)> {
bits(tuple((
take_bits(3u32),
- take_bits(1u32), // endianess
+ take_bits(1u32), // endianness
take_bits(28u32),
)))(i)
}
pub fn parse_ntlm_auth_record(i: &[u8]) -> IResult<&[u8], NTLMSSPAuthRecord> {
let orig_i = i;
- let record_len = i.len() + NTLMSSP_IDTYPE_LEN; // idenfier (8) and type (4) are cut before we are called
+ let record_len = i.len() + NTLMSSP_IDTYPE_LEN; // identifier (8) and type (4) are cut before we are called
let (i, _lm_blob_len) = verify(le_u16, |&v| (v as usize) < record_len)(i)?;
let (i, _lm_blob_maxlen) = le_u16(i)?;
pub ssn2tree_map: HashMap<SMBCommonHdr, SMBTree>,
- // store partial data records that are transfered in multiple
+ // store partial data records that are transferred in multiple
// requests for DCERPC.
pub ssnguid2vec_map: HashMap<SMBHashKeyHdrGuid, Vec<u8>>,
for tx in &mut self.transactions {
if !tx.request_done {
- SCLogDebug!("TRUNCING TX {} in TOSERVER direction", tx.id);
+ SCLogDebug!("TRUNCATING TX {} in TOSERVER direction", tx.id);
tx.request_done = true;
}
}
for tx in &mut self.transactions {
if !tx.response_done {
- SCLogDebug!("TRUNCING TX {} in TOCLIENT direction", tx.id);
+ SCLogDebug!("TRUNCATING TX {} in TOCLIENT direction", tx.id);
tx.response_done = true;
}
}
}
}
-/// update or create a tx for a command / reponse pair based
+/// update or create a tx for a command / response pair based
/// on the response. We only create a tx for the response side
/// if we didn't already update a tx, and we have to set events
fn smb1_response_record_generic(state: &mut SMBState, r: &SmbRecord, events: Vec<SMBEvent>) {