summaryrefslogtreecommitdiff
path: root/opentracker.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2021-04-20 04:05:50 +0200
committerDirk Engling <erdgeist@erdgeist.org>2021-04-20 04:05:50 +0200
commitb73b3b17ccf02337fb07f5ae78d78c2ff1dc3ccc (patch)
tree1ab5ec163419a5e6d275e0c5841e319c5a24976b /opentracker.c
parentccef1d0ccd0965ce91b2a439866dc1bd8301883d (diff)
Use arc4random whereever we need strong entropy
Diffstat (limited to 'opentracker.c')
-rw-r--r--opentracker.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/opentracker.c b/opentracker.c
index d2c0635..1c729cf 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -256,11 +256,17 @@ static void * server_mainloop( void * args ) {
256#ifdef _DEBUG_HTTPERROR 256#ifdef _DEBUG_HTTPERROR
257 ws.debugbuf= malloc( G_DEBUGBUF_SIZE ); 257 ws.debugbuf= malloc( G_DEBUGBUF_SIZE );
258#endif 258#endif
259
259 if( !ws.inbuf || !ws.outbuf ) 260 if( !ws.inbuf || !ws.outbuf )
260 panic( "Initializing worker failed" ); 261 panic( "Initializing worker failed" );
262
263#ifdef WANT_ARC4RANDOM
264 arc4random_buf(&ws.rand48_state[0], 3 * sizeof(uint16_t));
265#else
261 ws.rand48_state[0] = (uint16_t)random(); 266 ws.rand48_state[0] = (uint16_t)random();
262 ws.rand48_state[1] = (uint16_t)random(); 267 ws.rand48_state[1] = (uint16_t)random();
263 ws.rand48_state[2] = (uint16_t)random(); 268 ws.rand48_state[2] = (uint16_t)random();
269#endif
264 270
265 for( ; ; ) { 271 for( ; ; ) {
266 int64 sock; 272 int64 sock;