From ecb1f1e92ab449023d1427f9db26c5bac09c4901 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 24 Oct 2026 01:50:25 +0200 Subject: Use new entropy fascility and add tests for it --- trackerlogic.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'trackerlogic.c') diff --git a/trackerlogic.c b/trackerlogic.c index 59e9643..d8a2f9b 100644 --- a/trackerlogic.c +++ b/trackerlogic.c @@ -22,6 +22,7 @@ #include "ot_http.h" #include "ot_livesync.h" #include "ot_mutex.h" +#include "ot_random.h" #include "ot_stats.h" #include "ot_vector.h" #include "ot_udp.h" @@ -536,8 +537,8 @@ void trackerlogic_add_random_torrents(size_t amount) { ws.hash = (ot_hash *)ws.inbuf; while (amount--) { - arc4random_buf(ws.hash, sizeof(ot_hash)); - arc4random_buf(&ws.peer, sizeof(ws.peer)); + random_bytes(ws.hash, sizeof(ot_hash)); + random_bytes(&ws.peer, sizeof(ws.peer)); OT_PEERFLAG(ws.peer) &= PEER_FLAG_SEEDING | PEER_FLAG_COMPLETED | PEER_FLAG_STOPPED; @@ -555,7 +556,7 @@ void exerr(char *message) { } void trackerlogic_init(void) { - g_tracker_id = random(); + g_tracker_id = random_uint32(); if (!g_stats_path) g_stats_path = "stats"; -- cgit v1.3