summaryrefslogtreecommitdiff
path: root/toxcore/TCP_connection.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-08-01 23:37:48 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-08-10 14:53:27 +0000
commit463cbcb19a68bc4109285872258d494332bdeaf6 (patch)
treebca1abb46cc91d3dbe462eed773ed54a0ccba164 /toxcore/TCP_connection.h
parentafab28f0ff0bd71efcf39bd633770053da99e04a (diff)
Use the crypto random functions instead of `rand()`.
Presumably the uses of `rand()` were fine because they were not used in security-sensitive places, but having to think about whether a crappy RNG is acceptable in each situation requires effort that could better be spent elsewhere. Also, this means that once we have a custom deterministic RNG for testing, that RNG is used everywhere, so all the code is deterministic. It also allowed us to delete a system-specific function that wasn't used anywhere except in a call to `srand()`.
Diffstat (limited to 'toxcore/TCP_connection.h')
-rw-r--r--toxcore/TCP_connection.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/toxcore/TCP_connection.h b/toxcore/TCP_connection.h
index 658ee1f4..2d99e122 100644
--- a/toxcore/TCP_connection.h
+++ b/toxcore/TCP_connection.h
@@ -210,7 +210,7 @@ int add_tcp_relay_global(TCP_Connections *tcp_c, IP_Port ip_port, const uint8_t
210 * return number of relays copied to tcp_relays on success. 210 * return number of relays copied to tcp_relays on success.
211 * return 0 on failure. 211 * return 0 on failure.
212 */ 212 */
213unsigned int tcp_copy_connected_relays(TCP_Connections *tcp_c, Node_format *tcp_relays, uint16_t max_num); 213uint32_t tcp_copy_connected_relays(TCP_Connections *tcp_c, Node_format *tcp_relays, uint16_t max_num);
214 214
215/* Returns a new TCP_Connections object associated with the secret_key. 215/* Returns a new TCP_Connections object associated with the secret_key.
216 * 216 *