]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: spelling
authorVictor Julien <vjulien@oisf.net>
Fri, 5 May 2023 18:40:54 +0000 (20:40 +0200)
committerVictor Julien <vjulien@oisf.net>
Sat, 6 May 2023 12:50:43 +0000 (14:50 +0200)
17 files changed:
rust/src/asn1/parse_rules.rs
rust/src/dcerpc/dcerpc.rs
rust/src/dcerpc/parser.rs
rust/src/ffi/hashing.rs
rust/src/filetracker.rs
rust/src/http2/detect.rs
rust/src/http2/http2.rs
rust/src/http2/parser.rs
rust/src/ike/ikev2.rs
rust/src/nfs/nfs4.rs
rust/src/nfs/nfs4_records.rs
rust/src/rdp/log.rs
rust/src/rdp/rdp.rs
rust/src/smb/dcerpc_records.rs
rust/src/smb/ntlmssp_records.rs
rust/src/smb/smb.rs
rust/src/smb/smb1.rs

index 1538f76b548ff357ce448fb74dc6cf6848887b9b..540734c72fa577c3f58f0ad8121e370e1356e3b4 100644 (file)
@@ -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();
 
index 378c1cd4df7854b41a99b5ef61c033a6202e7bb1..1b93ce9b731cf0bbca0b2cd642881bdb755bd6e5 100644 (file)
@@ -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
             }
         }
index befefe38c212e040a7a9475b927a872d4fafd2fc..256259843f724b0da3e09b5f5da43eecf53a148e 100644 (file)
@@ -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)?;
index d5c247ddc300d1d74c639e08f716a5b01f44fb0d..69745c1478e2e9f37f1d93828739cae80a0e1f36 100644 (file)
@@ -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);
 
index dbc80a682ee93c8bd98402afca0e797bbea4e855..0aab94bffb04bc3e4fd465a287ecac63285f28d6 100644 (file)
@@ -19,8 +19,8 @@
  *  \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
@@ -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;
                         },
                     }
index 31b534efa524cbcabea3e6763fbf7f8540afbe43..9685bfa764ee76c8d73818fd6d190eebc0bdc1e7 100644 (file)
@@ -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<Vec<u8>, ()> {
index a24b8a058158e1f0a9f0d7ffd1e66077af5524e1..6da671532377e08936f34720470914a7d1e0c868 100644 (file)
@@ -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,
index 7c8c88101eb0bb3917e4f21f49a88289fffaf92f..88486f03b03933e6dcbf6e6c0a867644e8b1f89a 100644 (file)
@@ -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 {
index 672fbbaccd791d6a7008ae69f41789f4c4978ed7..9e464876cdc52127a50bcfa36afe6447e582ba14 100644 (file)
@@ -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
index d8a353fb3c67ab0732945cadfae13b461e634d98..730e82ba1b608d9358dc35cecdf474b2c7d16b40 100644 (file)
@@ -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;
                     }
index c24feb393df057ba0bbdd9983da23c9fb087f845..9d61da39d33ee8a61a3f734e3f718cce94697200 100644 (file)
@@ -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();
index 00cba685da9e15cde11235c373b524ada6287c3b..e0a71a839b8f9b02fc7a96f681ca85bb9e127f72 100644 (file)
@@ -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)?;
index 833d4011739f12e9ce6736129edca12506cbacce..f08026a82db8c359d4f8bbc4b5e6e4e00ea7d41c 100644 (file)
@@ -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 {
index 3e4c183c2edcdf25ee55afa335a66c927181c397..0c8c17fe18c4dcbdf588ecb9f045a73a302e7ca9 100644 (file)
@@ -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)
 }
index 9bdd57828399d769eebbd4e1411347e26fdb5471..d9346294a505d30de9b1958f2261301cd586b551 100644 (file)
@@ -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)?;
index 6acc948991b8242104d16ccbd52115f3abd87492..4d151df0afeb755baff9c99765f69313ebc5971e 100644 (file)
@@ -693,7 +693,7 @@ pub struct SMBState<> {
 
     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>>,
 
@@ -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;
             }
         }
index 378ed856e541c65dae4c6cdcecbc286f849a70e7..9d7d47e27c855d3cd3e955d5c729e2a11e870eb9 100644 (file)
@@ -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<SMBEvent>) {