aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-04-06 00:50:40 +0000
committerRoger Dingledine <arma@torproject.org>2005-04-06 00:50:40 +0000
commitf860b490be8285fea727f2e85c119a6897337412 (patch)
tree204046e42e5c6335f1b260c4892a40fa034b4845 /src/or/connection_or.c
parentac268a83408e1450544db2f23f364dfa3dee5042 (diff)
downloadtor-f860b490be8285fea727f2e85c119a6897337412.tar
tor-f860b490be8285fea727f2e85c119a6897337412.tar.gz
When we're connecting to an OR and he's got a different nickname/key
than we were expecting, only complain loudly if we're an OP or an authdirserver. Complaining loudly to OR admins just confuses people. svn:r4014
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 79e8a9dee..bea644f51 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -436,6 +436,8 @@ connection_tls_finish_handshake(connection_t *conn) {
crypto_pk_env_t *identity_rcvd=NULL;
char digest_rcvd[DIGEST_LEN];
or_options_t *options = get_options();
+ int severity = (authdir_mode(options) || !server_mode(options))
+ ? LOG_WARN : LOG_INFO;
conn->state = OR_CONN_STATE_OPEN;
connection_watch_events(conn, EV_READ);
@@ -479,7 +481,9 @@ connection_tls_finish_handshake(connection_t *conn) {
if (router && /* we know this nickname */
router->is_verified && /* make sure it's the right guy */
memcmp(digest_rcvd, router->identity_digest, DIGEST_LEN) != 0) {
- log_fn(LOG_WARN, "Identity key not as expected for router claiming to be '%s' (%s:%d) ", nickname, conn->address, conn->port);
+ log_fn(severity,
+ "Identity key not as expected for router claiming to be '%s' (%s:%d)",
+ nickname, conn->address, conn->port);
return -1;
}
#if 0
@@ -507,7 +511,7 @@ connection_tls_finish_handshake(connection_t *conn) {
}
} else if (strcasecmp(conn->nickname, nickname)) {
/* I was aiming for a nickname. Did I get it? */
- log_fn(authdir_mode(options) ? LOG_WARN : LOG_INFO,
+ log_fn(severity,
"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);