|
@@ -498,7 +498,13 @@ connection_tls_finish_handshake(connection_t *conn) {
|
|
|
#endif
|
|
|
|
|
|
if (connection_or_nonopen_was_started_here(conn)) {
|
|
|
- /* I initiated this connection. */
|
|
|
+ if (authdir_mode(options)) {
|
|
|
+ /* We initiated this connection to address:port. Drop all routers
|
|
|
+ * with the same address:port and a different key or nickname.
|
|
|
+ */
|
|
|
+ dirserv_orconn_tls_done(conn->address, conn->port,
|
|
|
+ digest_rcvd, nickname);
|
|
|
+ }
|
|
|
if (conn->nickname[0] == '$') {
|
|
|
/* I was aiming for a particular digest. Did I get it? */
|
|
|
char d[HEX_DIGEST_LEN+1];
|
|
@@ -508,7 +514,6 @@ connection_tls_finish_handshake(connection_t *conn) {
|
|
|
"Identity key not as expected for router at %s:%d: wanted %s but got %s",
|
|
|
conn->address, conn->port, conn->nickname, d);
|
|
|
control_event_or_conn_status(conn, OR_CONN_EVENT_FAILED);
|
|
|
- // XXX if we're an authdir_mode, forget about nickname's descriptor
|
|
|
return -1;
|
|
|
}
|
|
|
} else if (strcasecmp(conn->nickname, nickname)) {
|
|
@@ -517,14 +522,8 @@ connection_tls_finish_handshake(connection_t *conn) {
|
|
|
"Other side (%s:%d) is '%s', but we tried to connect to '%s'",
|
|
|
conn->address, conn->port, nickname, conn->nickname);
|
|
|
control_event_or_conn_status(conn, OR_CONN_EVENT_FAILED);
|
|
|
- // XXX if we're an authdir_mode, forget about nickname's descriptor
|
|
|
return -1;
|
|
|
}
|
|
|
- if (authdir_mode(options)) {
|
|
|
- /* I got exactly the guy I wanted. Now go through and blow away
|
|
|
- * descriptors for exactly this Address:ORPort that aren't this guy. */
|
|
|
- //XXX
|
|
|
- }
|
|
|
} else {
|
|
|
if ((c=connection_get_by_identity_digest(digest_rcvd, CONN_TYPE_OR))) {
|
|
|
log_fn(LOG_INFO,"Router '%s' is already connected on fd %d. Dropping fd %d.", nickname, c->s, conn->s);
|