diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-11-14 22:35:49 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-11-14 22:35:49 -0500 |
commit | 4af82fb3886e8be25ba83a1f93da54bf0d5d7974 (patch) | |
tree | 7c63e4492769d1e2f927553cd6727e0fc78e6021 /src | |
parent | 8592126a184c5f80e3213085d666362f21320df0 (diff) | |
parent | 325a659cb16350b1e28db803e2e673068ca2eb82 (diff) | |
download | tor-4af82fb3886e8be25ba83a1f93da54bf0d5d7974.tar.gz tor-4af82fb3886e8be25ba83a1f93da54bf0d5d7974.zip |
Merge remote-tracking branch 'public/bug4367'
Diffstat (limited to 'src')
-rw-r--r-- | src/or/command.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/or/command.c b/src/or/command.c index c02d353bb1..5d0ebaa68a 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -1100,7 +1100,14 @@ command_process_auth_challenge_cell(var_cell_t *cell, or_connection_t *conn) conn->handshake_state->received_auth_challenge = 1; - if (use_type && public_server_mode(get_options())) { + if (! public_server_mode(get_options())) { + /* If we're not a public server then we don't want to authenticate on a + connection we originated, and we already sent a NETINFO cell when we + got the CERTS cell. We have nothing more to do. */ + return; + } + + if (use_type >= 0) { log_info(LD_OR, "Got an AUTH_CHALLENGE cell from %s:%d: Sending " "authentication", safe_str(conn->_base.address), conn->_base.port); @@ -1110,16 +1117,18 @@ command_process_auth_challenge_cell(var_cell_t *cell, or_connection_t *conn) connection_mark_for_close(TO_CONN(conn)); return; } - if (connection_or_send_netinfo(conn) < 0) { - log_warn(LD_OR, "Couldn't send netinfo cell"); - connection_mark_for_close(TO_CONN(conn)); - return; - } } else { - log_info(LD_OR, "Got an AUTH_CHALLENGE cell from %s:%d: Not " - "authenticating", + log_info(LD_OR, "Got an AUTH_CHALLENGE cell from %s:%d, but we don't " + "know any of its authentication types. Not authenticating.", safe_str(conn->_base.address), conn->_base.port); } + + if (connection_or_send_netinfo(conn) < 0) { + log_warn(LD_OR, "Couldn't send netinfo cell"); + connection_mark_for_close(TO_CONN(conn)); + return; + } + #undef ERR } |