mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
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 svn:r960
This commit is contained in:
@@ -75,6 +75,8 @@ circuit_t *circuit_new(uint16_t p_circ_id, connection_t *p_conn) {
|
||||
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;
|
||||
|
||||
@@ -88,6 +88,8 @@ connection_t *connection_new(int type) {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user