diff options
author | Roger Dingledine <arma@torproject.org> | 2006-06-08 09:38:18 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-06-08 09:38:18 +0000 |
commit | 29f041ed78c62cdb97b676220a8eab9fcf27e8b2 (patch) | |
tree | 6d35faa464bba72a57483ce6fd9b925a5980d7e2 | |
parent | acec3ddd7016705cb29e4e35e842491db5712428 (diff) | |
download | tor-29f041ed78c62cdb97b676220a8eab9fcf27e8b2.tar.gz tor-29f041ed78c62cdb97b676220a8eab9fcf27e8b2.zip |
backport the bugfix: if we get a create cell that asks us to
extend somewhere, but the tor server there doesn't match the
expected digest, we now send a destroy cell back, rather than
doing nothing.
svn:r6567
-rw-r--r-- | src/or/circuitbuild.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 4a39cff844..75d3524920 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -421,12 +421,18 @@ circuit_n_conn_done(connection_t *or_conn, int status) tor_assert(circ->state == CIRCUIT_STATE_OR_WAIT); if (!circ->n_conn && circ->n_addr == or_conn->addr && - circ->n_port == or_conn->port && - !memcmp(or_conn->identity_digest, circ->n_conn_id_digest, - DIGEST_LEN)) { + circ->n_port == or_conn->port) { + if (memcmp(or_conn->identity_digest, circ->n_conn_id_digest, + DIGEST_LEN)) { + log_fn(LOG_PROTOCOL_WARN, LD_CIRC, + "Pending circuit to %s:%d is intended for different digest!", + or_conn->address, or_conn->port); + circuit_mark_for_close(circ, END_CIRC_REASON_OR_IDENTITY); + continue; + } if (!status) { /* or_conn failed; close circ */ log_info(LD_CIRC,"or_conn failed. Closing circ."); - circuit_mark_for_close(circ, END_CIRC_REASON_OR_IDENTITY); + circuit_mark_for_close(circ, END_CIRC_REASON_OR_CONN_CLOSED); continue; } log_debug(LD_CIRC, |