diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-08-20 14:52:56 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-08-20 14:52:56 -0400 |
commit | 1bb4a4f9bdf24706a459e4aefb2b0fb75622f7ac (patch) | |
tree | d613e68826eb910fe85d313cff7639dda7e30aa9 /src/or/channeltls.c | |
parent | edaea773e57cc39e892643bcce12c755810f508b (diff) | |
download | tor-1bb4a4f9bdf24706a459e4aefb2b0fb75622f7ac.tar.gz tor-1bb4a4f9bdf24706a459e4aefb2b0fb75622f7ac.zip |
Send NETINFO on receiving a NETINFO if we have not yet sent one.
Relays previously, when initiating a connection, would only send a
NETINFO after sending an AUTHENTICATE. But bridges, when receiving a
connection, would never send AUTH_CHALLENGE. So relays wouldn't
AUTHENTICATE, and wouldn't NETINFO, and then bridges would be
surprised to be receiving CREATE cells on a non-open circuit.
Fixes bug 9546.
Diffstat (limited to 'src/or/channeltls.c')
-rw-r--r-- | src/or/channeltls.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/channeltls.c b/src/or/channeltls.c index d758d22d82..a7953e7a8a 100644 --- a/src/or/channeltls.c +++ b/src/or/channeltls.c @@ -1474,6 +1474,16 @@ channel_tls_process_netinfo_cell(cell_t *cell, channel_tls_t *chan) /* XXX maybe act on my_apparent_addr, if the source is sufficiently * trustworthy. */ + if (! chan->conn->handshake_state->sent_netinfo) { + /* If we were prepared to authenticate, but we never got an AUTH_CHALLENGE + * cell, then we would not previously have sent a NETINFO cell. Do so + * now. */ + if (connection_or_send_netinfo(chan->conn) < 0) { + connection_or_close_for_error(chan->conn, 0); + return; + } + } + if (connection_or_set_state_open(chan->conn) < 0) { log_fn(LOG_PROTOCOL_WARN, LD_OR, "Got good NETINFO cell from %s:%d; but " |