comparison cli-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 efbaf6b03837
children 6b41e2cbf071 79bf1023cf11 973fccb59ea4 0e4f225b7e07
comparison
equal deleted inserted replaced
271:be18c7dd486e 272:3be7ae2e8dfa
74 NULL /* Null termination */ 74 NULL /* Null termination */
75 }; 75 };
76 76
77 void cli_session(int sock, char* remotehost) { 77 void cli_session(int sock, char* remotehost) {
78 78
79 seedrandom();
80
79 crypto_init(); 81 crypto_init();
82
80 common_session_init(sock, remotehost); 83 common_session_init(sock, remotehost);
81 84
82 chaninitialise(cli_chantypes); 85 chaninitialise(cli_chantypes);
83
84 86
85 /* Set up cli_ses vars */ 87 /* Set up cli_ses vars */
86 cli_session_init(); 88 cli_session_init();
87 89
88 /* Ready to go */ 90 /* Ready to go */
89 sessinitdone = 1; 91 sessinitdone = 1;
90 92
91 /* Exchange identification */ 93 /* Exchange identification */
92 session_identification(); 94 session_identification();
93 95
94 seedrandom();
95
96 send_msg_kexinit(); 96 send_msg_kexinit();
97
98 /* XXX here we do stuff differently */
99 97
100 session_loop(cli_sessionloop); 98 session_loop(cli_sessionloop);
101 99
102 /* Not reached */ 100 /* Not reached */
103 101