aboutsummaryrefslogtreecommitdiff
path: root/src/or/onion.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/onion.c')
-rw-r--r--src/or/onion.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/or/onion.c b/src/or/onion.c
index 61ad1e2a5..7b288f975 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -311,15 +311,14 @@ int chooselen(double cw)
{
int len = 2;
int retval = 0;
- unsigned char coin;
+ uint8_t coin;
if ((cw < 0) || (cw >= 1)) /* invalid parameter */
return -1;
while(1)
{
- retval = crypto_pseudo_rand(1, &coin);
- if (retval)
+ if (CRYPTO_PSEUDO_RAND_INT(coin))
return -1;
if (coin > cw*255) /* don't extend */
@@ -378,7 +377,7 @@ unsigned int *new_route(double cw, routerinfo_t **rarray, int rarray_len, int *r
oldchoice = rarray_len;
for(i=0;i<*routelen;i++) {
log(LOG_DEBUG,"new_route(): Choosing hop %u.",i);
- if(crypto_pseudo_rand(sizeof(unsigned int),(unsigned char *)&choice)) {
+ if (CRYPTO_PSEUDO_RAND_INT(choice)) {
free((void *)route);
return NULL;
}