]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ldap: fix clippy warnings (unneded conversions)
authorPierre Chifflier <chifflier@wzdftpd.net>
Thu, 5 Jun 2025 12:39:29 +0000 (14:39 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 11 Jun 2025 18:49:15 +0000 (20:49 +0200)
rust/src/ldap/ldap.rs

index e59e36cefd12d55af9706f773d65b698a6a56556..65b0b066dda6b1185416b20511fd408381dab23d 100644 (file)
@@ -234,7 +234,7 @@ impl LdapState {
                     }
                     let mut tx = tx.unwrap();
                     let tx_id = tx.id();
-                    let request = LdapMessage::from(msg);
+                    let request = msg;
                     // check if STARTTLS was requested
                     if let ProtocolOp::ExtendedRequest(request) = &request.protocol_op {
                         if request.request_name.0 == STARTTLS_OID {
@@ -299,7 +299,7 @@ impl LdapState {
             }
             match ldap_parse_msg(start) {
                 Ok((rem, msg)) => {
-                    let response = LdapMessage::from(msg);
+                    let response = msg;
                     // check if STARTTLS was requested
                     if self.request_tls {
                         if let ProtocolOp::ExtendedResponse(response) = &response.protocol_op {
@@ -395,7 +395,7 @@ impl LdapState {
                     return AppLayerResult::err();
                 }
                 let mut tx = tx.unwrap();
-                let request = LdapMessage::from(msg);
+                let request = msg;
                 tx.complete |= tx_is_complete(&request.protocol_op, Direction::ToServer);
                 tx.request = Some(request.to_static());
                 self.transactions.push_back(tx);
@@ -436,7 +436,7 @@ impl LdapState {
             }
             match ldap_parse_msg(start) {
                 Ok((rem, msg)) => {
-                    let response = LdapMessage::from(msg);
+                    let response = msg;
                     if let Some(tx) = self.find_request(response.message_id) {
                         tx.complete |= tx_is_complete(&response.protocol_op, Direction::ToClient);
                         let tx_id = tx.id();
@@ -535,7 +535,7 @@ fn tx_is_complete(op: &ProtocolOp, dir: Direction) -> bool {
 fn probe(input: &[u8], direction: Direction, rdir: *mut u8) -> AppProto {
     match ldap_parse_msg(input) {
         Ok((_, msg)) => {
-            let ldap_msg = LdapMessage::from(msg);
+            let ldap_msg = msg;
             if direction == Direction::ToServer && !ldap_is_request(&ldap_msg) {
                 unsafe {
                     *rdir = Direction::ToClient.into();