[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor] 10/15: relay: Remove unused conn->ext_or_conn_id



This is an automated email from the git hooks/post-receive script.

dgoulet pushed a commit to branch main
in repository tor.

commit d634a5ebc75728b5b9cce1772713ed14fcb4fd52
Author: David Goulet <dgoulet@xxxxxxxxxxxxxx>
AuthorDate: Tue Jul 26 11:18:15 2022 -0400

    relay: Remove unused conn->ext_or_conn_id
    
    This also incidently removes a use of uninitialized stack data from the
    connection_or_set_ext_or_identifier() function.
    
    Fixes #40648
    
    Signed-off-by: David Goulet <dgoulet@xxxxxxxxxxxxxx>
---
 changes/ticket40648            |  3 +++
 src/core/mainloop/connection.c |  2 --
 src/core/or/or_connection_st.h |  2 --
 src/feature/relay/ext_orport.c | 13 -------------
 src/feature/relay/ext_orport.h |  4 ----
 5 files changed, 3 insertions(+), 21 deletions(-)

diff --git a/changes/ticket40648 b/changes/ticket40648
new file mode 100644
index 0000000000..a891e30204
--- /dev/null
+++ b/changes/ticket40648
@@ -0,0 +1,3 @@
+  o Code simplification and refactoring (bridges):
+    - Remove unused code related to ExtPort connection ID. Fixes bug 40648;
+      bugfix on 0.3.5.1-alpha.
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c
index 8bb3534b28..0a39a7b1ff 100644
--- a/src/core/mainloop/connection.c
+++ b/src/core/mainloop/connection.c
@@ -590,7 +590,6 @@ or_connection_new(int type, int socket_family)
     /* If we aren't told an address for this connection, we should
      * presume it isn't local, and should be rate-limited. */
     TO_CONN(or_conn)->always_rate_limit_as_remote = 1;
-    connection_or_set_ext_or_identifier(or_conn);
   }
 
   return or_conn;
@@ -960,7 +959,6 @@ connection_free_minimal(connection_t *conn)
     connection_or_clear_identity(TO_OR_CONN(conn));
   }
   if (conn->type == CONN_TYPE_OR || conn->type == CONN_TYPE_EXT_OR) {
-    tor_free(TO_OR_CONN(conn)->ext_or_conn_id);
     tor_free(TO_OR_CONN(conn)->ext_or_auth_correct_client_hash);
     tor_free(TO_OR_CONN(conn)->ext_or_transport);
   }
diff --git a/src/core/or/or_connection_st.h b/src/core/or/or_connection_st.h
index 81ba2091ec..aceed4d2c4 100644
--- a/src/core/or/or_connection_st.h
+++ b/src/core/or/or_connection_st.h
@@ -26,8 +26,6 @@ struct or_connection_t {
    * if the other side hasn't shown us a valid identity key. */
   char identity_digest[DIGEST_LEN];
 
-  /** Extended ORPort connection identifier. */
-  char *ext_or_conn_id;
   /** This is the ClientHash value we expect to receive from the
    *  client during the Extended ORPort authentication protocol. We
    *  compute it upon receiving the ClientNoce from the client, and we
diff --git a/src/feature/relay/ext_orport.c b/src/feature/relay/ext_orport.c
index 3dd884932e..89b287b0b4 100644
--- a/src/feature/relay/ext_orport.c
+++ b/src/feature/relay/ext_orport.c
@@ -656,19 +656,6 @@ connection_ext_or_start_auth(or_connection_t *or_conn)
   return 0;
 }
 
-/** Creates an Extended ORPort identifier for <b>conn</b> and deposits
- *  it into the global list of identifiers. */
-void
-connection_or_set_ext_or_identifier(or_connection_t *conn)
-{
-  char random_id[EXT_OR_CONN_ID_LEN];
-
-  if (!conn->ext_or_conn_id)
-    conn->ext_or_conn_id = tor_malloc_zero(EXT_OR_CONN_ID_LEN);
-
-  memcpy(conn->ext_or_conn_id, random_id, EXT_OR_CONN_ID_LEN);
-}
-
 /** Free any leftover allocated memory of the ext_orport.c subsystem. */
 void
 ext_orport_free_all(void)
diff --git a/src/feature/relay/ext_orport.h b/src/feature/relay/ext_orport.h
index 722dc3787c..5a9063d005 100644
--- a/src/feature/relay/ext_orport.h
+++ b/src/feature/relay/ext_orport.h
@@ -35,7 +35,6 @@
 
 int connection_ext_or_start_auth(or_connection_t *or_conn);
 
-void connection_or_set_ext_or_identifier(or_connection_t *conn);
 int connection_ext_or_finished_flushing(or_connection_t *conn);
 int connection_ext_or_process_inbuf(or_connection_t *or_conn);
 char *get_ext_or_auth_cookie_file_name(void);
@@ -67,9 +66,6 @@ connection_ext_or_process_inbuf(or_connection_t *conn)
   tor_assert_nonfatal_unreached();
   return -1;
 }
-#define connection_or_set_ext_or_identifier(conn) \
-  ((void)(conn))
-
 #define get_ext_or_auth_cookie_file_name() \
   (NULL)
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits