diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-12-25 22:43:01 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-01-03 11:29:49 -0500 |
commit | d3de0b91fb322c00d11857d89a8420af0d466e39 (patch) | |
tree | 1c33f8f2126db0ede938cbff1d5a111640cf167d /src/or/onion_ntor.c | |
parent | 94cb7bd24d2ffda9038c267b3ee0837dd64ec903 (diff) | |
download | tor-d3de0b91fb322c00d11857d89a8420af0d466e39.tar.gz tor-d3de0b91fb322c00d11857d89a8420af0d466e39.zip |
Check all crypto_rand return values for ntor.
Diffstat (limited to 'src/or/onion_ntor.c')
-rw-r--r-- | src/or/onion_ntor.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/onion_ntor.c b/src/or/onion_ntor.c index b601d1ebb1..58ab107f1b 100644 --- a/src/or/onion_ntor.c +++ b/src/or/onion_ntor.c @@ -78,7 +78,10 @@ onion_skin_ntor_create(const uint8_t *router_id, memcpy(state->router_id, router_id, DIGEST_LEN); memcpy(&state->pubkey_B, router_key, sizeof(curve25519_public_key_t)); - curve25519_secret_key_generate(&state->seckey_x, 0); + if (curve25519_secret_key_generate(&state->seckey_x, 0) < 0) { + tor_free(state); + return -1; + } curve25519_public_key_generate(&state->pubkey_X, &state->seckey_x); op = onion_skin_out; |