[or-cvs] tls works with onion proxies now.

Roger Dingledine arma at seul.org
Fri Sep 12 06:20:38 UTC 2003


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

Modified Files:
	connection.c connection_or.c 
Log Message:
tls works with onion proxies now.


Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- connection.c	11 Sep 2003 22:19:48 -0000	1.85
+++ connection.c	12 Sep 2003 06:20:36 -0000	1.86
@@ -308,6 +308,7 @@
   conn->state = OR_CONN_STATE_OPEN;
   directory_set_dirty();
   connection_watch_events(conn, POLLIN);
+  log_fn(LOG_DEBUG,"tls handshake done. verifying.");
   if(options.OnionRouter) { /* I'm an OR */
     if(tor_tls_peer_has_cert(conn->tls)) { /* it's another OR */
       pk = tor_tls_verify(conn->tls);
@@ -368,7 +369,6 @@
     conn->bandwidth = DEFAULT_BANDWIDTH_OP;
     circuit_n_conn_open(conn); /* send the pending create */
   }
-  log_fn(LOG_DEBUG,"tls handshake done, now open.");
   return 0;
 }
 #endif

Index: connection_or.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_or.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- connection_or.c	11 Sep 2003 20:06:55 -0000	1.45
+++ connection_or.c	12 Sep 2003 06:20:36 -0000	1.46
@@ -36,7 +36,8 @@
   }
 
 #ifdef USE_TLS
-  assert(conn->state == OR_CONN_STATE_OPEN);
+  if(conn->state != OR_CONN_STATE_OPEN)
+    return 0; /* don't do anything */
   return connection_process_cell_from_inbuf(conn);
 #else
 //  log(LOG_DEBUG,"connection_or_process_inbuf(): state %d.",conn->state);
@@ -81,7 +82,7 @@
       }
       /* the connect has finished. */
 
-      log_fn(LOG_DEBUG,"OR connection to router %s:%u established.",
+      log_fn(LOG_DEBUG,"OR connect() to router %s:%u finished.",
           conn->address,conn->port);
 
 #ifdef USE_TLS



More information about the tor-commits mailing list