diff options
author | Roger Dingledine <arma@torproject.org> | 2003-12-28 04:46:09 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2003-12-28 04:46:09 +0000 |
commit | f3fdbadfdfeea0fff981303355c3b07f4b1bc718 (patch) | |
tree | 801060aa286daa5c0c4fe7ea110151a2e116476a /src/or/connection.c | |
parent | 71739b486a817344d47def696b9f1840d720a456 (diff) | |
download | tor-f3fdbadfdfeea0fff981303355c3b07f4b1bc718.tar.gz tor-f3fdbadfdfeea0fff981303355c3b07f4b1bc718.zip |
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
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 19be1e8a6f..5299e8965c 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -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; |