diff options
author | Nick Mathewson <nickm@torproject.org> | 2003-04-17 17:10:41 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2003-04-17 17:10:41 +0000 |
commit | 32a3e704b48ac277456fd89c6bd8cd96ccb3d0c8 (patch) | |
tree | 27b2fd77b157b7663af55c3a3483e5cbaf39cb81 /src/or/circuit.c | |
parent | fdf4d4aa85c1b996f36944cea19c13e49e52b972 (diff) | |
download | tor-32a3e704b48ac277456fd89c6bd8cd96ccb3d0c8.tar tor-32a3e704b48ac277456fd89c6bd8cd96ccb3d0c8.tar.gz |
Choose correct abstraction for topic_foo. Abstract random-integer code
svn:r249
Diffstat (limited to 'src/or/circuit.c')
-rw-r--r-- | src/or/circuit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c index 54fb8bc62..9b11d5580 100644 --- a/src/or/circuit.c +++ b/src/or/circuit.c @@ -118,7 +118,8 @@ aci_t get_unique_aci_by_addr_port(uint32_t addr, uint16_t port, int aci_type) { try_again: log(LOG_DEBUG,"get_unique_aci_by_addr_port() trying to get a unique aci"); - crypto_pseudo_rand(2, (unsigned char *)&test_aci); + if (CRYPTO_PSEUDO_RAND_INT(test_aci)) + return -1; if(aci_type == ACI_TYPE_LOWER && test_aci >= (1<<15)) test_aci -= (1<<15); |