mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-26 15:42:34 +01:00
Do not send a NETINFO cell as a client until after we have got a CERT cell
This commit is contained in:
parent
d029c3223a
commit
3dd2f990a3
1 changed files with 8 additions and 2 deletions
|
@ -688,8 +688,7 @@ command_process_versions_cell(var_cell_t *cell, or_connection_t *conn)
|
||||||
const int send_chall = !started_here && public_server_mode(get_options());
|
const int send_chall = !started_here && public_server_mode(get_options());
|
||||||
/* If our certs cell will authenticate us, or if we have no intention of
|
/* If our certs cell will authenticate us, or if we have no intention of
|
||||||
* authenticating, send a netinfo cell right now. */
|
* authenticating, send a netinfo cell right now. */
|
||||||
const int send_netinfo =
|
const int send_netinfo = !started_here;
|
||||||
!(started_here && public_server_mode(get_options()));
|
|
||||||
const int send_any =
|
const int send_any =
|
||||||
send_versions || send_certs || send_chall || send_netinfo;
|
send_versions || send_certs || send_chall || send_netinfo;
|
||||||
tor_assert(conn->link_proto >= 3);
|
tor_assert(conn->link_proto >= 3);
|
||||||
|
@ -1021,6 +1020,13 @@ command_process_cert_cell(var_cell_t *cell, or_connection_t *conn)
|
||||||
|
|
||||||
conn->handshake_state->id_cert = id_cert;
|
conn->handshake_state->id_cert = id_cert;
|
||||||
id_cert = NULL;
|
id_cert = NULL;
|
||||||
|
if (!public_server_mode(get_options())) {
|
||||||
|
if (connection_or_send_netinfo(conn) < 0) {
|
||||||
|
log_warn(LD_OR, "Couldn't send netinfo cell");
|
||||||
|
connection_mark_for_close(TO_CONN(conn));
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (! (id_cert && auth_cert))
|
if (! (id_cert && auth_cert))
|
||||||
ERR("The certs we wanted were missing");
|
ERR("The certs we wanted were missing");
|
||||||
|
|
Loading…
Add table
Reference in a new issue