diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-11-25 10:42:00 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-11-25 22:29:59 -0500 |
commit | ddcbe264745a0c10d80d8ad74125d23eb251662d (patch) | |
tree | b522f4302d71982a38ad0caf34b77b6c675103c2 /src/or/onion_fast.c | |
parent | 10fdee628552bca65ddb86b17e0b057628ad3703 (diff) | |
download | tor-ddcbe264745a0c10d80d8ad74125d23eb251662d.tar.gz tor-ddcbe264745a0c10d80d8ad74125d23eb251662d.zip |
Now that crypto_rand() cannot fail, it should return void.
Diffstat (limited to 'src/or/onion_fast.c')
-rw-r--r-- | src/or/onion_fast.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/or/onion_fast.c b/src/or/onion_fast.c index 7584112570..22bef4eee0 100644 --- a/src/or/onion_fast.c +++ b/src/or/onion_fast.c @@ -30,10 +30,7 @@ fast_onionskin_create(fast_handshake_state_t **handshake_state_out, { fast_handshake_state_t *s; *handshake_state_out = s = tor_malloc(sizeof(fast_handshake_state_t)); - if (crypto_rand((char*)s->state, sizeof(s->state)) < 0) { - tor_free(s); - return -1; - } + crypto_rand((char*)s->state, sizeof(s->state)); memcpy(handshake_out, s->state, DIGEST_LEN); return 0; } @@ -56,8 +53,7 @@ fast_server_handshake(const uint8_t *key_in, /* DIGEST_LEN bytes */ size_t out_len; int r = -1; - if (crypto_rand((char*)handshake_reply_out, DIGEST_LEN)<0) - return -1; + crypto_rand((char*)handshake_reply_out, DIGEST_LEN); memcpy(tmp, key_in, DIGEST_LEN); memcpy(tmp+DIGEST_LEN, handshake_reply_out, DIGEST_LEN); |