comparison svr-session.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 364a75cfebab
children 973fccb59ea4 a588558bfc94
comparison
equal deleted inserted replaced
271:be18c7dd486e 272:3be7ae2e8dfa
76 76
77 void svr_session(int sock, int childpipe, 77 void svr_session(int sock, int childpipe,
78 char* remotehost, char *addrstring) { 78 char* remotehost, char *addrstring) {
79 79
80 struct timeval timeout; 80 struct timeval timeout;
81 81
82 reseedrandom();
83
82 crypto_init(); 84 crypto_init();
83 common_session_init(sock, remotehost); 85 common_session_init(sock, remotehost);
84 86
85 /* Initialise server specific parts of the session */ 87 /* Initialise server specific parts of the session */
86 svr_ses.childpipe = childpipe; 88 svr_ses.childpipe = childpipe;
107 /* We're ready to go now */ 109 /* We're ready to go now */
108 sessinitdone = 1; 110 sessinitdone = 1;
109 111
110 /* exchange identification, version etc */ 112 /* exchange identification, version etc */
111 session_identification(); 113 session_identification();
112
113 seedrandom();
114 114
115 /* start off with key exchange */ 115 /* start off with key exchange */
116 send_msg_kexinit(); 116 send_msg_kexinit();
117 117
118 /* Run the main for loop. NULL is for the dispatcher - only the client 118 /* Run the main for loop. NULL is for the dispatcher - only the client