diff svr-main.c @ 272:3be7ae2e8dfa

Only read /dev/random once when the program starts rather than for every connection, to "conserve entropy".
author Matt Johnston <matt@ucc.asn.au>
date Sat, 11 Feb 2006 15:15:37 +0000
parents 306499676384
children 1f5ec029dfe8
line wrap: on
line diff
--- a/svr-main.c	Wed Feb 01 09:05:13 2006 +0000
+++ b/svr-main.c	Sat Feb 11 15:15:37 2006 +0000
@@ -83,7 +83,7 @@
 	int remoteaddrlen;
 	char * addrstring = NULL;
 
-	/* Set up handlers, syslog */
+	/* Set up handlers, syslog, seed random */
 	commonsetup();
 
 	remoteaddrlen = sizeof(remoteaddr);
@@ -359,6 +359,8 @@
 	/* Now we can setup the hostkeys - needs to be after logging is on,
 	 * otherwise we might end up blatting error messages to the socket */
 	loadhostkeys();
+
+    seedrandom();
 }
 
 /* Set up listening sockets for all the requested ports */