summaryrefslogtreecommitdiff
path: root/src/or/rendcommon.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-11-25 10:42:00 -0500
committerNick Mathewson <nickm@torproject.org>2015-11-25 22:29:59 -0500
commitddcbe264745a0c10d80d8ad74125d23eb251662d (patch)
treeb522f4302d71982a38ad0caf34b77b6c675103c2 /src/or/rendcommon.c
parent10fdee628552bca65ddb86b17e0b057628ad3703 (diff)
downloadtor-ddcbe264745a0c10d80d8ad74125d23eb251662d.tar.gz
tor-ddcbe264745a0c10d80d8ad74125d23eb251662d.zip
Now that crypto_rand() cannot fail, it should return void.
Diffstat (limited to 'src/or/rendcommon.c')
-rw-r--r--src/or/rendcommon.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index 22599e9830..1e6c6dabda 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -268,11 +268,7 @@ rend_encrypt_v2_intro_points_basic(char **encrypted_out,
tor_assert(client_cookies && smartlist_len(client_cookies) > 0);
/* Generate session key. */
- if (crypto_rand(session_key, CIPHER_KEY_LEN) < 0) {
- log_warn(LD_REND, "Unable to generate random session key to encrypt "
- "introduction point string.");
- goto done;
- }
+ crypto_rand(session_key, CIPHER_KEY_LEN);
/* Determine length of encrypted introduction points including session
* keys. */
@@ -334,11 +330,7 @@ rend_encrypt_v2_intro_points_basic(char **encrypted_out,
REND_BASIC_AUTH_CLIENT_MULTIPLE;
i < REND_BASIC_AUTH_CLIENT_MULTIPLE - 1; i++) {
client_part = tor_malloc_zero(REND_BASIC_AUTH_CLIENT_ENTRY_LEN);
- if (crypto_rand(client_part, REND_BASIC_AUTH_CLIENT_ENTRY_LEN) < 0) {
- log_warn(LD_REND, "Unable to generate fake client entry.");
- tor_free(client_part);
- goto done;
- }
+ crypto_rand(client_part, REND_BASIC_AUTH_CLIENT_ENTRY_LEN);
smartlist_add(encrypted_session_keys, client_part);
}
/* Sort smartlist and put elements in result in order. */