[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] point out bug



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

Modified Files:
	connection_edge.c 
Log Message:
point out bug


Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_edge.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- connection_edge.c	11 Nov 2003 06:42:10 -0000	1.50
+++ connection_edge.c	11 Nov 2003 19:47:51 -0000	1.51
@@ -483,6 +483,8 @@
       /* r<0: There was an error sending the begin cell; other pending  
        *   AP connections may succeed.
        */
+      /* XXX r is only <0 if openssl can't generate random bytes. if
+       * the begin failed, r==0 and the circ is closed. */
       connection_ap_handshake_socks_reply(conn, NULL, 0, 0);
       conn->marked_for_close = 1;
       conn->has_sent_end = 1; /* if the begin failed, don't try an end */
@@ -606,9 +608,11 @@
   assert(ap_conn->socks_request);
   assert(ap_conn->socks_request->addr);
 
-  if(crypto_pseudo_rand(STREAM_ID_SIZE, ap_conn->stream_id) < 0)
+  if(crypto_pseudo_rand(STREAM_ID_SIZE, ap_conn->stream_id) < 0) {
+    /* XXX can we just make this call abort if it fails? then this func could be a void. */
+    /* FIXME check for collisions */
     return -1;
-  /* FIXME check for collisions */
+  }
 
   memcpy(payload, ap_conn->stream_id, STREAM_ID_SIZE);
   payload_len = STREAM_ID_SIZE + 1 +