diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-08-01 23:37:48 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-08-10 14:53:27 +0000 |
commit | 463cbcb19a68bc4109285872258d494332bdeaf6 (patch) | |
tree | bca1abb46cc91d3dbe462eed773ed54a0ccba164 /toxcore/network.c | |
parent | afab28f0ff0bd71efcf39bd633770053da99e04a (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/network.c')
-rw-r--r-- | toxcore/network.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/toxcore/network.c b/toxcore/network.c index 1c1459db..68ca43e5 100644 --- a/toxcore/network.c +++ b/toxcore/network.c | |||
@@ -698,7 +698,6 @@ int networking_at_startup(void) | |||
698 | } | 698 | } |
699 | 699 | ||
700 | #endif | 700 | #endif |
701 | srand((uint32_t)current_time_actual()); | ||
702 | at_startup_ran = 1; | 701 | at_startup_ran = 1; |
703 | return 0; | 702 | return 0; |
704 | } | 703 | } |