[or-cvs] randomize the initial circ_id and stream_id, so an adversar...
Roger Dingledine
arma at seul.org
Sun Dec 28 04:46:11 UTC 2003
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or
Modified Files:
circuit.c connection.c
Log Message:
randomize the initial circ_id and stream_id, so an adversary who
breaks in part-way through can't learn how many circs/streams have
been made
Index: circuit.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuit.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -d -r1.128 -r1.129
--- circuit.c 26 Dec 2003 06:29:57 -0000 1.128
+++ circuit.c 28 Dec 2003 04:46:08 -0000 1.129
@@ -75,6 +75,8 @@
circ->package_window = CIRCWINDOW_START;
circ->deliver_window = CIRCWINDOW_START;
+ circ->next_stream_id = crypto_pseudo_rand_int(1<<16);
+
circuit_add(circ);
return circ;
Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection.c,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -d -r1.144 -r1.145
--- connection.c 19 Dec 2003 19:55:02 -0000 1.144
+++ connection.c 28 Dec 2003 04:46:09 -0000 1.145
@@ -88,6 +88,8 @@
conn->socks_request = tor_malloc_zero(sizeof(socks_request_t));
}
+ conn->next_circ_id = crypto_pseudo_rand_int(1<<15);
+
conn->timestamp_created = now;
conn->timestamp_lastread = now;
conn->timestamp_lastwritten = now;
More information about the tor-commits
mailing list