aboutsummaryrefslogtreecommitdiff
path: root/src/or/command.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-11-03 13:01:59 -0400
committerNick Mathewson <nickm@torproject.org>2011-11-20 00:48:25 -0500
commit7992eb43c5d9313ad66d9fea46121a47d0ca997c (patch)
tree2f894f2db5d8a5bc4fbe1228f62519ccc0d1d11e /src/or/command.c
parentf2f156f0e8aa404cbfa84af262b8933ecf0ad5e9 (diff)
downloadtor-7992eb43c5d9313ad66d9fea46121a47d0ca997c.tar
tor-7992eb43c5d9313ad66d9fea46121a47d0ca997c.tar.gz
Log more loudly on a bad cert from an authority.
Clock skew made this situation way too frequent so we demoted it to "protocol_warn", but when there's an authority, it should really just be warn.
Diffstat (limited to 'src/or/command.c')
-rw-r--r--src/or/command.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/or/command.c b/src/or/command.c
index a963d4210..535c2ef43 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -985,15 +985,24 @@ command_process_cert_cell(var_cell_t *cell, or_connection_t *conn)
}
if (conn->handshake_state->started_here) {
+ int severity;
if (! (id_cert && link_cert))
ERR("The certs we wanted were missing");
/* Okay. We should be able to check the certificates now. */
if (! tor_tls_cert_matches_key(conn->tls, link_cert)) {
ERR("The link certificate didn't match the TLS public key");
}
- if (! tor_tls_cert_is_valid(LOG_PROTOCOL_WARN, link_cert, id_cert, 0))
+ /* Note that this warns more loudly about time and validity if we were
+ * _trying_ to connect to an authority, not necessarily if we _did_ connect
+ * to one. */
+ if (router_digest_is_trusted_dir(conn->identity_digest))
+ severity = LOG_WARN;
+ else
+ severity = LOG_PROTOCOL_WARN;
+
+ if (! tor_tls_cert_is_valid(severity, link_cert, id_cert, 0))
ERR("The link certificate was not valid");
- if (! tor_tls_cert_is_valid(LOG_PROTOCOL_WARN, id_cert, id_cert, 1))
+ if (! tor_tls_cert_is_valid(severity, id_cert, id_cert, 1))
ERR("The ID certificate was not valid");
conn->handshake_state->authenticated = 1;