[or-cvs] more details to track a warning in tls handshakes

Roger Dingledine arma at seul.org
Tue Oct 7 23:54:06 UTC 2003


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	connection_or.c routers.c 
Log Message:
more details to track a warning in tls handshakes
plus make exit policy comparisons not always reject


Index: connection_or.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_or.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- connection_or.c	4 Oct 2003 03:29:09 -0000	1.63
+++ connection_or.c	7 Oct 2003 23:54:02 -0000	1.64
@@ -188,12 +188,14 @@
     if(tor_tls_peer_has_cert(conn->tls)) { /* it's another OR */
       pk = tor_tls_verify(conn->tls);
       if(!pk) {
-        log_fn(LOG_WARNING,"Other side has a cert but it's invalid. Closing.");
+        log_fn(LOG_WARNING,"Other side (%s:%p) has a cert but it's invalid. Closing.",
+               conn->address, conn->port);
         return -1;
       }
       router = router_get_by_link_pk(pk);
       if (!router) {
-        log_fn(LOG_WARNING,"Unrecognized public key from peer. Closing.");
+        log_fn(LOG_WARNING,"Unrecognized public key from peer (%s:%d). Closing.",
+               conn->address, conn->port);
         crypto_free_pk_env(pk);
         return -1;
       }
@@ -223,12 +225,14 @@
     }
     pk = tor_tls_verify(conn->tls);
     if(!pk) {
-      log_fn(LOG_WARNING,"Other side has a cert but it's invalid. Closing.");
+      log_fn(LOG_WARNING,"Other side (%s:%d) has a cert but it's invalid. Closing.",
+             conn->address, conn->port);
       return -1;
     }
     router = router_get_by_link_pk(pk);
     if (!router) {
-      log_fn(LOG_WARNING,"Unrecognized public key from peer. Closing.");
+      log_fn(LOG_WARNING,"Unrecognized public key from peer (%s:%d). Closing.",
+             conn->address, conn->port);
       crypto_free_pk_env(pk);
       return -1;
     }

Index: routers.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routers.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- routers.c	7 Oct 2003 23:25:10 -0000	1.76
+++ routers.c	7 Oct 2003 23:54:02 -0000	1.77
@@ -1083,7 +1083,8 @@
     assert(tmpe->port);
 
     log_fn(LOG_DEBUG,"Considering exit policy %s:%s",tmpe->address, tmpe->port);
-    if(inet_aton(tmpe->address,&in) == 0) { /* malformed IP. reject. */
+    if(strcmp(tmpe->address,"*") &&
+       inet_aton(tmpe->address,&in) == 0) { /* malformed IP. reject. */
       log_fn(LOG_WARNING,"Malformed IP %s in exit policy. Rejecting.",tmpe->address);
       return -1;
     }
@@ -1286,8 +1287,6 @@
 
   return written+1;
 }
-
-
 
 /*
   Local Variables:



More information about the tor-commits mailing list