Commit f661d856 authored by David Goulet's avatar David Goulet 🐼 Committed by Nick Mathewson
Browse files

hs: Remove rend_client_allow_non_anonymous_connection



By removing Tor2Web, there is no way a client can be non anonymous so we
remove that function and the callsites.

Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
parent 67cd6761
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -888,11 +888,6 @@ circuit_log_ancient_one_hop_circuits(int age)
        (circ->purpose == CIRCUIT_PURPOSE_S_INTRO ||
        (circ->purpose == CIRCUIT_PURPOSE_S_INTRO ||
         circ->purpose == CIRCUIT_PURPOSE_S_REND_JOINED))
         circ->purpose == CIRCUIT_PURPOSE_S_REND_JOINED))
      continue;
      continue;
     /* We only ignore active rend point connections, if we take a long time
      * to rendezvous, that's worth logging. */
    if (rend_client_allow_non_anonymous_connection(options) &&
        circ->purpose == CIRCUIT_PURPOSE_C_REND_JOINED)
      continue;
    ocirc = CONST_TO_ORIGIN_CIRCUIT(circ);
    ocirc = CONST_TO_ORIGIN_CIRCUIT(circ);


    if (ocirc->build_state && ocirc->build_state->onehop_tunnel) {
    if (ocirc->build_state && ocirc->build_state->onehop_tunnel) {
+0 −14
Original line number Original line Diff line number Diff line
@@ -1219,20 +1219,6 @@ rend_parse_service_authorization(const or_options_t *options,
  return res;
  return res;
}
}


/* Can Tor client code make direct (non-anonymous) connections to introduction
 * or rendezvous points?
 * Returns true if tor was compiled with NON_ANONYMOUS_MODE_ENABLED. */
int
rend_client_allow_non_anonymous_connection(const or_options_t *options)
{
#ifdef NON_ANONYMOUS_MODE_ENABLED
  return 1;
#else
  (void)options;
  return 0;
#endif /* defined(NON_ANONYMOUS_MODE_ENABLED) */
}

/* At compile-time, was non-anonymous mode enabled via
/* At compile-time, was non-anonymous mode enabled via
 * NON_ANONYMOUS_MODE_ENABLED ? */
 * NON_ANONYMOUS_MODE_ENABLED ? */
int
int
+0 −1
Original line number Original line Diff line number Diff line
@@ -47,7 +47,6 @@ rend_service_authorization_t *rend_client_lookup_service_authorization(
                                                const char *onion_address);
                                                const char *onion_address);
void rend_service_authorization_free_all(void);
void rend_service_authorization_free_all(void);


int rend_client_allow_non_anonymous_connection(const or_options_t *options);
int rend_client_non_anonymous_mode_enabled(const or_options_t *options);
int rend_client_non_anonymous_mode_enabled(const or_options_t *options);


#endif /* !defined(TOR_RENDCLIENT_H) */
#endif /* !defined(TOR_RENDCLIENT_H) */
+2 −7
Original line number Original line Diff line number Diff line
@@ -979,16 +979,11 @@ rend_auth_decode_cookie(const char *cookie_in, uint8_t *cookie_out,


/* Is this a rend client or server that allows direct (non-anonymous)
/* Is this a rend client or server that allows direct (non-anonymous)
 * connections?
 * connections?
 * Clients must be specifically compiled and configured in this mode.
 * Onion services can be configured to start in this mode for single onion. */
 * Onion services can be configured to start in this mode.
 * Prefer rend_client_allow_non_anonymous_connection() or
 * rend_service_allow_non_anonymous_connection() whenever possible, so that
 * checks are specific to Single Onion Services. */
int
int
rend_allow_non_anonymous_connection(const or_options_t* options)
rend_allow_non_anonymous_connection(const or_options_t* options)
{
{
  return (rend_client_allow_non_anonymous_connection(options)
  return rend_service_allow_non_anonymous_connection(options);
          || rend_service_allow_non_anonymous_connection(options));
}
}


/* Is this a rend client or server in non-anonymous mode?
/* Is this a rend client or server in non-anonymous mode?