aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeel Chauhan <neel@neelc.org>2020-10-12 20:46:42 -0700
committerNeel Chauhan <neel@neelc.org>2020-10-12 20:46:42 -0700
commit05242f5555ceb276dd945f9d43a37dbe3d5d875b (patch)
tree91b7bd1a45c153f908ff5ca94e7f2240d1f8a950
parentc4812698c3df0bd8aa51c615b0274bbb53b9eb6c (diff)
downloadtor-05242f5555ceb276dd945f9d43a37dbe3d5d875b.tar.gz
tor-05242f5555ceb276dd945f9d43a37dbe3d5d875b.zip
Pass the SOCKS request address in relay begin cells
-rw-r--r--changes/bug331244
-rw-r--r--src/core/or/circuituse.c3
-rw-r--r--src/core/or/connection_edge.c4
3 files changed, 9 insertions, 2 deletions
diff --git a/changes/bug33124 b/changes/bug33124
new file mode 100644
index 0000000000..bc7003d9b5
--- /dev/null
+++ b/changes/bug33124
@@ -0,0 +1,4 @@
+ o Minor bugfixes (SOCKS, onion services):
+ - Make sure we send the SOCKS request address in relay begin cells when a
+ stream is attached with the purpose CIRCUIT_PURPOSE_CONTROLLER. Fixes bug
+ 33124; bugfix on 0.0.5. Patch by Neel Chauhan.
diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c
index df23c63cff..a0816fc73c 100644
--- a/src/core/or/circuituse.c
+++ b/src/core/or/circuituse.c
@@ -2710,7 +2710,8 @@ link_apconn_to_circ(entry_connection_t *apconn, origin_circuit_t *circ,
apconn->may_use_optimistic_data = 0;
log_info(LD_APP, "Looks like completed circuit to %s %s allow "
"optimistic data for connection to %s",
- circ->base_.purpose == CIRCUIT_PURPOSE_C_GENERAL ?
+ (circ->base_.purpose == CIRCUIT_PURPOSE_C_GENERAL ||
+ circ->base_.purpose == CIRCUIT_PURPOSE_CONTROLLER) ?
/* node_describe() does the right thing if exitnode is NULL */
safe_str_client(node_describe(exitnode)) :
"hidden service",
diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c
index 25337f0720..f22c49d036 100644
--- a/src/core/or/connection_edge.c
+++ b/src/core/or/connection_edge.c
@@ -1205,6 +1205,7 @@ connection_ap_expire_beginning(void)
}
if (circ->purpose != CIRCUIT_PURPOSE_C_GENERAL &&
+ circ->purpose != CIRCUIT_PURPOSE_CONTROLLER &&
circ->purpose != CIRCUIT_PURPOSE_C_HSDIR_GET &&
circ->purpose != CIRCUIT_PURPOSE_S_HSDIR_POST &&
circ->purpose != CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT &&
@@ -3266,7 +3267,8 @@ connection_ap_handshake_send_begin,(entry_connection_t *ap_conn))
edge_conn->begincell_flags = connection_ap_get_begincell_flags(ap_conn);
tor_snprintf(payload,RELAY_PAYLOAD_SIZE, "%s:%d",
- (circ->base_.purpose == CIRCUIT_PURPOSE_C_GENERAL) ?
+ (circ->base_.purpose == CIRCUIT_PURPOSE_C_GENERAL ||
+ circ->base_.purpose == CIRCUIT_PURPOSE_CONTROLLER) ?
ap_conn->socks_request->address : "",
ap_conn->socks_request->port);
payload_len = (int)strlen(payload)+1;