From: Victor Julien Date: Fri, 5 May 2023 18:40:54 +0000 (+0200) Subject: rust: spelling X-Git-Tag: suricata-7.0.0-rc2~239 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee7ed99b6fac5ae1cb43e0434bf65c01cd667374;p=thirdparty%2Fsuricata.git rust: spelling --- diff --git a/rust/src/asn1/parse_rules.rs b/rust/src/asn1/parse_rules.rs index 1538f76b54..540734c72f 100644 --- a/rust/src/asn1/parse_rules.rs +++ b/rust/src/asn1/parse_rules.rs @@ -316,7 +316,7 @@ mod tests { "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(); diff --git a/rust/src/dcerpc/dcerpc.rs b/rust/src/dcerpc/dcerpc.rs index 378c1cd4df..1b93ce9b73 100644 --- a/rust/src/dcerpc/dcerpc.rs +++ b/rust/src/dcerpc/dcerpc.rs @@ -660,7 +660,7 @@ impl DCERPCState { } Err(_) => { // Error, probably malformed data. - SCLogDebug!("An error occured while parsing DCERPC header"); + SCLogDebug!("An error occurred while parsing DCERPC header"); -2 } } diff --git a/rust/src/dcerpc/parser.rs b/rust/src/dcerpc/parser.rs index befefe38c2..256259843f 100644 --- a/rust/src/dcerpc/parser.rs +++ b/rust/src/dcerpc/parser.rs @@ -170,7 +170,7 @@ pub fn parse_dcerpc_bindack(i: &[u8]) -> IResult<&[u8], DCERPCBindAck> { 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)?; diff --git a/rust/src/ffi/hashing.rs b/rust/src/ffi/hashing.rs index d5c247ddc3..69745c1478 100644 --- a/rust/src/ffi/hashing.rs +++ b/rust/src/ffi/hashing.rs @@ -129,7 +129,7 @@ pub unsafe extern "C" fn SCSha1HashBuffer( return true; } -// Start of MD5 C bindins. +// Start of MD5 C bindings. pub struct SCMd5(Md5); diff --git a/rust/src/filetracker.rs b/rust/src/filetracker.rs index dbc80a682e..0aab94bffb 100644 --- a/rust/src/filetracker.rs +++ b/rust/src/filetracker.rs @@ -19,8 +19,8 @@ * \file * \author Victor Julien * - * 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 @@ -226,7 +226,7 @@ impl FileTransferTracker { self.file_is_truncated = true; }, _ => { - SCLogDebug!("got error so truncing file"); + SCLogDebug!("got error so truncating file"); self.file_is_truncated = true; }, } @@ -279,7 +279,7 @@ impl FileTransferTracker { self.file_is_truncated = true; }, _ => { - SCLogDebug!("got error so truncing file"); + SCLogDebug!("got error so truncating file"); self.file_is_truncated = true; }, } @@ -319,7 +319,7 @@ impl FileTransferTracker { self.file_is_truncated = true; }, _ => { - SCLogDebug!("got error so truncing file"); + SCLogDebug!("got error so truncating file"); self.file_is_truncated = true; }, } diff --git a/rust/src/http2/detect.rs b/rust/src/http2/detect.rs index 31b534efa5..9685bfa764 100644 --- a/rust/src/http2/detect.rs +++ b/rust/src/http2/detect.rs @@ -412,7 +412,7 @@ fn http2_frames_get_header_firstvalue<'a>( } // 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, ()> { diff --git a/rust/src/http2/http2.rs b/rust/src/http2/http2.rs index a24b8a0581..6da6715323 100644 --- a/rust/src/http2/http2.rs +++ b/rust/src/http2/http2.rs @@ -110,7 +110,7 @@ pub enum HTTP2TransactionState { 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, diff --git a/rust/src/http2/parser.rs b/rust/src/http2/parser.rs index 7c8c88101e..88486f03b0 100644 --- a/rust/src/http2/parser.rs +++ b/rust/src/http2/parser.rs @@ -565,7 +565,7 @@ fn http2_parse_headers_block_dynamic_size<'a>( 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 { diff --git a/rust/src/ike/ikev2.rs b/rust/src/ike/ikev2.rs index 672fbbaccd..9e464876cd 100644 --- a/rust/src/ike/ikev2.rs +++ b/rust/src/ike/ikev2.rs @@ -222,7 +222,7 @@ fn add_proposals( 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 diff --git a/rust/src/nfs/nfs4.rs b/rust/src/nfs/nfs4.rs index d8a353fb3c..730e82ba1b 100644 --- a/rust/src/nfs/nfs4.rs +++ b/rust/src/nfs/nfs4.rs @@ -261,23 +261,23 @@ impl NFSState { 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); @@ -389,19 +389,19 @@ impl NFSState { 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; } diff --git a/rust/src/nfs/nfs4_records.rs b/rust/src/nfs/nfs4_records.rs index c24feb393d..9d61da39d3 100644 --- a/rust/src/nfs/nfs4_records.rs +++ b/rust/src/nfs/nfs4_records.rs @@ -656,7 +656,7 @@ pub enum Nfs4ResponseContent<'a> { 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)?; @@ -1443,7 +1443,7 @@ mod tests { } #[test] - fn test_nfs4_request_sequenece() { + fn test_nfs4_request_sequence() { #[rustfmt::skip] let buf: &[u8] = &[ 0x00, 0x00, 0x00, 0x35, /*opcode*/ @@ -1469,7 +1469,7 @@ mod tests { #[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(); diff --git a/rust/src/rdp/log.rs b/rust/src/rdp/log.rs index 00cba685da..e0a71a839b 100644 --- a/rust/src/rdp/log.rs +++ b/rust/src/rdp/log.rs @@ -333,7 +333,7 @@ fn mcs_req_to_json(mcs: &McsConnectRequest, js: &mut JsonBuilder) -> Result<(), } } - // 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)?; diff --git a/rust/src/rdp/rdp.rs b/rust/src/rdp/rdp.rs index 833d401173..f08026a82d 100644 --- a/rust/src/rdp/rdp.rs +++ b/rust/src/rdp/rdp.rs @@ -177,7 +177,7 @@ impl RdpState { 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; } @@ -198,7 +198,7 @@ impl RdpState { 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 { @@ -271,7 +271,7 @@ impl RdpState { 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)] @@ -312,7 +312,7 @@ impl RdpState { 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 { diff --git a/rust/src/smb/dcerpc_records.rs b/rust/src/smb/dcerpc_records.rs index 3e4c183c2e..0c8c17fe18 100644 --- a/rust/src/smb/dcerpc_records.rs +++ b/rust/src/smb/dcerpc_records.rs @@ -216,7 +216,7 @@ fn parse_dcerpc_flags1(i:&[u8]) -> IResult<&[u8],(u8,u8,u8)> { 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) } diff --git a/rust/src/smb/ntlmssp_records.rs b/rust/src/smb/ntlmssp_records.rs index 9bdd578283..d9346294a5 100644 --- a/rust/src/smb/ntlmssp_records.rs +++ b/rust/src/smb/ntlmssp_records.rs @@ -98,7 +98,7 @@ fn extract_ntlm_substring(i: &[u8], offset: u32, length: u16) -> IResult<&[u8], 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)?; diff --git a/rust/src/smb/smb.rs b/rust/src/smb/smb.rs index 6acc948991..4d151df0af 100644 --- a/rust/src/smb/smb.rs +++ b/rust/src/smb/smb.rs @@ -693,7 +693,7 @@ pub struct SMBState<> { pub ssn2tree_map: HashMap, - // 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>, @@ -1923,7 +1923,7 @@ impl SMBState { 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; } } @@ -1934,7 +1934,7 @@ impl SMBState { 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; } } diff --git a/rust/src/smb/smb1.rs b/rust/src/smb/smb1.rs index 378ed856e5..9d7d47e27c 100644 --- a/rust/src/smb/smb1.rs +++ b/rust/src/smb/smb1.rs @@ -1131,7 +1131,7 @@ fn smb1_request_record_generic(state: &mut SMBState, r: &SmbRecord, events: Vec< } } -/// 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) {