r18041@catbus: nickm | 2008-02-11 23:43:18 -0500

Make version negotiation and handshaking messages more useful and accurate.


svn:r13477
This commit is contained in:
Nick Mathewson
2008-02-12 04:43:25 +00:00
parent 5ced3fd790
commit aace52320c
2 changed files with 8 additions and 4 deletions
+4 -1
View File
@@ -921,6 +921,8 @@ tor_tls_handshake(tor_tls_t *tls)
" get set. Fixing that.");
}
tls->wasV2Handshake = 1;
log_debug(LD_NET, "Completed V2 TLS handshake with client; waiting "
"for renegotiation."));
} else {
tls->wasV2Handshake = 0;
}
@@ -934,7 +936,8 @@ tor_tls_handshake(tor_tls_t *tls)
if (n_certs > 1 || (n_certs == 1 && cert != sk_X509_value(chain, 0)))
tls->wasV2Handshake = 0;
else {
log_debug(LD_NET, "I think I got a v2 handshake on %p!", tls);
log_debug(LD_NET, "Server sent back a single certificate; looks like "
"a v2 handshake on %p.", tls);
tls->wasV2Handshake = 1;
}
if (cert)
+4 -3
View File
@@ -487,7 +487,7 @@ command_process_versions_cell(var_cell_t *cell, or_connection_t *conn)
conn->link_proto = highest_supported_version;
conn->handshake_state->received_versions = 1;
log_info(LD_OR, "Negotiated version %d with %s",
log_info(LD_OR, "Negotiated version %d with %s; sending NETINFO.",
highest_supported_version, safe_str(conn->_base.address));
tor_assert(conn->link_proto >= 2);
@@ -595,8 +595,9 @@ command_process_netinfo_cell(cell_t *cell, or_connection_t *conn)
if (connection_or_set_state_open(conn)<0)
connection_mark_for_close(TO_CONN(conn));
else
log_info(LD_OR, "Got good NETINFO cell from %s",
safe_str(conn->_base.address));
log_info(LD_OR, "Got good NETINFO cell from %s; OR connection is now "
"open, using protocol version %d",
safe_str(conn->_base.address), (int)conn->link_proto);
assert_connection_ok(TO_CONN(conn),time(NULL));
}