aboutsummaryrefslogtreecommitdiff
path: root/src/feature/rend
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-08-28 16:02:04 -0400
committerNick Mathewson <nickm@torproject.org>2018-08-28 16:02:04 -0400
commit48632455a5bd679d5f97c5137f24f91e564abad6 (patch)
treee723bcde6858825b41c7dfc2b8def8e05779c9c7 /src/feature/rend
parentb1d32a92239ae1727e22b592ac1908b616ba869a (diff)
parent8f13c3d3ed842d8db13bcf9ca6393dbe8e5781e3 (diff)
downloadtor-48632455a5bd679d5f97c5137f24f91e564abad6.tar.gz
tor-48632455a5bd679d5f97c5137f24f91e564abad6.zip
Merge branch 'bug26367_035_01'
Diffstat (limited to 'src/feature/rend')
-rw-r--r--src/feature/rend/rendclient.c37
-rw-r--r--src/feature/rend/rendclient.h3
-rw-r--r--src/feature/rend/rendcommon.c22
-rw-r--r--src/feature/rend/rendmid.c2
4 files changed, 7 insertions, 57 deletions
diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index 9f62156eb9..2c4cec65b1 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -449,12 +449,7 @@ directory_get_from_hs_dir(const char *desc_id,
char desc_id_base32[REND_DESC_ID_V2_LEN_BASE32 + 1];
char descriptor_cookie_base64[3*REND_DESC_COOKIE_LEN_BASE64];
const rend_data_v2_t *rend_data;
-#ifdef ENABLE_TOR2WEB_MODE
- const int tor2web_mode = get_options()->Tor2webMode;
- const int how_to_fetch = tor2web_mode ? DIRIND_ONEHOP : DIRIND_ANONYMOUS;
-#else
const int how_to_fetch = DIRIND_ANONYMOUS;
-#endif /* defined(ENABLE_TOR2WEB_MODE) */
tor_assert(desc_id);
tor_assert(rend_query);
@@ -1223,35 +1218,3 @@ rend_parse_service_authorization(const or_options_t *options,
}
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, and is
- * configured in Tor2web mode. */
-int
-rend_client_allow_non_anonymous_connection(const or_options_t *options)
-{
- /* Tor2web support needs to be compiled in to a tor binary. */
-#ifdef NON_ANONYMOUS_MODE_ENABLED
- /* Tor2web */
- return options->Tor2webMode ? 1 : 0;
-#else
- (void)options;
- return 0;
-#endif /* defined(NON_ANONYMOUS_MODE_ENABLED) */
-}
-
-/* At compile-time, was non-anonymous mode enabled via
- * NON_ANONYMOUS_MODE_ENABLED ? */
-int
-rend_client_non_anonymous_mode_enabled(const or_options_t *options)
-{
- (void)options;
- /* Tor2web support needs to be compiled in to a tor binary. */
-#ifdef NON_ANONYMOUS_MODE_ENABLED
- /* Tor2web */
- return 1;
-#else
- return 0;
-#endif /* defined(NON_ANONYMOUS_MODE_ENABLED) */
-}
diff --git a/src/feature/rend/rendclient.h b/src/feature/rend/rendclient.h
index e41faa4932..0d27d63e65 100644
--- a/src/feature/rend/rendclient.h
+++ b/src/feature/rend/rendclient.h
@@ -47,8 +47,5 @@ rend_service_authorization_t *rend_client_lookup_service_authorization(
const char *onion_address);
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);
-
#endif /* !defined(TOR_RENDCLIENT_H) */
diff --git a/src/feature/rend/rendcommon.c b/src/feature/rend/rendcommon.c
index 5bf9477446..8cb5fd91e6 100644
--- a/src/feature/rend/rendcommon.c
+++ b/src/feature/rend/rendcommon.c
@@ -979,37 +979,27 @@ rend_auth_decode_cookie(const char *cookie_in, uint8_t *cookie_out,
/* Is this a rend client or server that allows direct (non-anonymous)
* connections?
- * Clients must be specifically compiled and configured in this mode.
- * 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 or Tor2web. */
+ * Onion services can be configured to start in this mode for single onion. */
int
rend_allow_non_anonymous_connection(const or_options_t* options)
{
- return (rend_client_allow_non_anonymous_connection(options)
- || rend_service_allow_non_anonymous_connection(options));
+ return rend_service_allow_non_anonymous_connection(options);
}
/* Is this a rend client or server in non-anonymous mode?
- * Clients must be specifically compiled in this mode.
- * Onion services can be configured to start in this mode.
- * Prefer rend_client_non_anonymous_mode_enabled() or
- * rend_service_non_anonymous_mode_enabled() whenever possible, so that checks
- * are specific to Single Onion Services or Tor2web. */
+ * Onion services can be configured to start in this mode for single onion. */
int
rend_non_anonymous_mode_enabled(const or_options_t *options)
{
- return (rend_client_non_anonymous_mode_enabled(options)
- || rend_service_non_anonymous_mode_enabled(options));
+ return rend_service_non_anonymous_mode_enabled(options);
}
/* Make sure that tor only builds one-hop circuits when they would not
* compromise user anonymity.
*
- * One-hop circuits are permitted in Tor2web or Single Onion modes.
+ * One-hop circuits are permitted in Single Onion modes.
*
- * Tor2web or Single Onion modes are also allowed to make multi-hop circuits.
+ * Single Onion modes are also allowed to make multi-hop circuits.
* For example, single onion HSDir circuits are 3-hop to prevent denial of
* service.
*/
diff --git a/src/feature/rend/rendmid.c b/src/feature/rend/rendmid.c
index 22cd6c3435..0fd6516eaa 100644
--- a/src/feature/rend/rendmid.c
+++ b/src/feature/rend/rendmid.c
@@ -237,7 +237,7 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request,
}
/* Check if we are configured to accept established rendezvous cells from
- * client or in other words tor2web clients. */
+ * client or in other words Tor2Web clients. */
if (channel_is_client(circ->p_chan) &&
dos_should_refuse_single_hop_client()) {
/* Note it down for the heartbeat log purposes. */