mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 23:53:32 +01:00
Look up the rend circ whose INTRODUCE1 is being ACKed correctly
This change cannibalizes circuit_get_by_rend_query_and_purpose because it had exactly one caller.
This commit is contained in:
parent
66f77561c0
commit
4c3a23b283
14
changes/bug4759
Normal file
14
changes/bug4759
Normal file
@ -0,0 +1,14 @@
|
||||
o Minor bugfixes:
|
||||
|
||||
- Make sure we never mark the wrong rendezvous circuit as having
|
||||
had its introduction cell acknowleged by the introduction-point
|
||||
relay. Previously, when we received an INTRODUCE_ACK cell on a
|
||||
client-side hidden-service introduction circuit, we might have
|
||||
marked a rendezvous circuit other than the one we specified in
|
||||
the INTRODUCE1 cell as INTRO_ACKED, which would have produced a
|
||||
warning message and interfered with the hidden service
|
||||
connection-establishment process. Bugfix on 0.2.3.3-alpha, when
|
||||
the stream-isolation feature which might cause Tor to open
|
||||
multiple rendezvous circuits for the same hidden service was
|
||||
added. Fixes bug 4759.
|
||||
|
@ -873,26 +873,30 @@ circuit_unlink_all_from_or_conn(or_connection_t *conn, int reason)
|
||||
}
|
||||
}
|
||||
|
||||
/** Return a circ such that:
|
||||
* - circ-\>rend_data-\>onion_address is equal to <b>rend_query</b>, and
|
||||
* - circ-\>purpose is equal to <b>purpose</b>.
|
||||
/** Return a circ such that
|
||||
* - circ-\>rend_data-\>onion_address is equal to
|
||||
* <b>rend_data</b>-\>onion_address,
|
||||
* - circ-\>rend_data-\>rend_cookie is equal to
|
||||
* <b>rend_data</b>-\>rend_cookie, and
|
||||
* - circ-\>purpose is equal to CIRCUIT_PURPOSE_C_REND_READY.
|
||||
*
|
||||
* Return NULL if no such circuit exists.
|
||||
*/
|
||||
origin_circuit_t *
|
||||
circuit_get_by_rend_query_and_purpose(const char *rend_query, uint8_t purpose)
|
||||
circuit_get_ready_rend_circ_by_rend_data(const rend_data_t *rend_data)
|
||||
{
|
||||
circuit_t *circ;
|
||||
|
||||
tor_assert(CIRCUIT_PURPOSE_IS_ORIGIN(purpose));
|
||||
|
||||
for (circ = global_circuitlist; circ; circ = circ->next) {
|
||||
if (!circ->marked_for_close &&
|
||||
circ->purpose == purpose) {
|
||||
circ->purpose == CIRCUIT_PURPOSE_C_REND_READY) {
|
||||
origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);
|
||||
if (ocirc->rend_data &&
|
||||
!rend_cmp_service_ids(rend_query,
|
||||
ocirc->rend_data->onion_address))
|
||||
!rend_cmp_service_ids(rend_data->onion_address,
|
||||
ocirc->rend_data->onion_address) &&
|
||||
tor_memeq(ocirc->rend_data->rend_cookie,
|
||||
rend_data->rend_cookie,
|
||||
REND_COOKIE_LEN))
|
||||
return ocirc;
|
||||
}
|
||||
}
|
||||
|
@ -32,8 +32,8 @@ int circuit_id_in_use_on_orconn(circid_t circ_id, or_connection_t *conn);
|
||||
circuit_t *circuit_get_by_edge_conn(edge_connection_t *conn);
|
||||
void circuit_unlink_all_from_or_conn(or_connection_t *conn, int reason);
|
||||
origin_circuit_t *circuit_get_by_global_id(uint32_t id);
|
||||
origin_circuit_t *circuit_get_by_rend_query_and_purpose(const char *rend_query,
|
||||
uint8_t purpose);
|
||||
origin_circuit_t *circuit_get_ready_rend_circ_by_rend_data(
|
||||
const rend_data_t *rend_data);
|
||||
origin_circuit_t *circuit_get_next_by_pk_and_purpose(origin_circuit_t *start,
|
||||
const char *digest, uint8_t purpose);
|
||||
or_circuit_t *circuit_get_rendezvous(const char *cookie);
|
||||
|
@ -350,8 +350,7 @@ rend_client_introduction_acked(origin_circuit_t *circ,
|
||||
* and tell it.
|
||||
*/
|
||||
log_info(LD_REND,"Received ack. Telling rend circ...");
|
||||
rendcirc = circuit_get_by_rend_query_and_purpose(
|
||||
circ->rend_data->onion_address, CIRCUIT_PURPOSE_C_REND_READY);
|
||||
rendcirc = circuit_get_ready_rend_circ_by_rend_data(circ->rend_data);
|
||||
if (rendcirc) { /* remember the ack */
|
||||
#ifndef NON_ANONYMOUS_MODE_ENABLED
|
||||
tor_assert(!(rendcirc->build_state->onehop_tunnel));
|
||||
|
Loading…
Reference in New Issue
Block a user