Commit df6191f6 authored by Nick Mathewson's avatar Nick Mathewson 🤹
Browse files

Make connection_or_get_by_ext_or_id() testing-only

Apparently it is only used by the unit tests: tor doesn't want it at
all.

I've opened a new ticket (33383) to we if we should remove this
whole feature.
parent a1a3a4d5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -675,6 +675,7 @@ connection_or_remove_from_ext_or_id_map(or_connection_t *conn)
  memset(conn->ext_or_conn_id, 0, EXT_OR_CONN_ID_LEN);
}

#ifdef TOR_UNIT_TESTS
/** Return the connection whose ext_or_id is <b>id</b>. Return NULL if no such
 * connection is found. */
or_connection_t *
@@ -684,6 +685,7 @@ connection_or_get_by_ext_or_id(const char *id)
    return NULL;
  return digestmap_get(orconn_ext_or_id_map, id);
}
#endif

/** Deallocate the global Extended ORPort identifier list */
void
+2 −2
Original line number Diff line number Diff line
@@ -38,8 +38,6 @@ int connection_ext_or_start_auth(or_connection_t *or_conn);
void connection_or_set_ext_or_identifier(or_connection_t *conn);
void connection_or_remove_from_ext_or_id_map(or_connection_t *conn);
void connection_or_clear_ext_or_id_map(void);
or_connection_t *connection_or_get_by_ext_or_id(const char *id);

int connection_ext_or_finished_flushing(or_connection_t *conn);
int connection_ext_or_process_inbuf(or_connection_t *or_conn);

@@ -91,9 +89,11 @@ STATIC int handle_client_auth_nonce(const char *client_nonce,
                         size_t client_nonce_len,
                         char **client_hash_out,
                         char **reply_out, size_t *reply_len_out);

#ifdef TOR_UNIT_TESTS
extern uint8_t *ext_or_auth_cookie;
extern int ext_or_auth_cookie_is_set;
or_connection_t *connection_or_get_by_ext_or_id(const char *id);
#endif
#endif /* defined(EXT_ORPORT_PRIVATE) */