diff options
author | Roger Dingledine <arma@torproject.org> | 2004-07-22 06:03:53 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-07-22 06:03:53 +0000 |
commit | b48cdc9d4035217b2d4d160778092e104fcd91f9 (patch) | |
tree | 47dcbc2e9df8470a4c5afff9d05ebc63e03d09ac /src/or/connection_or.c | |
parent | 38d8e36919e6ae699a0b76c355e5a171b837bbf4 (diff) | |
download | tor-b48cdc9d4035217b2d4d160778092e104fcd91f9.tar.gz tor-b48cdc9d4035217b2d4d160778092e104fcd91f9.zip |
populate router_get_my_routerinfo()->is_verified
svn:r2097
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 4c07f1bec0..1648b02ebe 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -207,8 +207,20 @@ connection_t *connection_or_connect(uint32_t addr, uint16_t port, * Return -1 if <b>conn</b> is broken, else return 0. */ int connection_tls_start_handshake(connection_t *conn, int receiving) { + int use_no_cert=0; conn->state = OR_CONN_STATE_HANDSHAKING; - conn->tls = tor_tls_new(conn->s, receiving); + if(receiving) { /* check if he's 0.0.7 and I'm unverified */ + routerinfo_t *him, *me; + him = router_get_by_digest(conn->identity_digest); + me = router_get_my_routerinfo(); + + if(him && !strncmp(him->platform, "Tor 0.0.7", 9) && + (!me || !me->is_verified)) { + log_fn(LOG_INFO,"He's running 0.0.7, and I'm unverified. Acting like OP."); + use_no_cert = 1; + } + } + conn->tls = tor_tls_new(conn->s, receiving, use_no_cert); if(!conn->tls) { log_fn(LOG_WARN,"tor_tls_new failed. Closing."); return -1; |