diff options
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 37 |
1 files changed, 18 insertions, 19 deletions
@@ -40,7 +40,7 @@ | |||
40 | */ | 40 | */ |
41 | 41 | ||
42 | #include "includes.h" | 42 | #include "includes.h" |
43 | RCSID("$OpenBSD: sshd.c,v 1.199 2001/06/04 23:07:21 markus Exp $"); | 43 | RCSID("$OpenBSD: sshd.c,v 1.200 2001/06/23 15:12:21 itojun Exp $"); |
44 | 44 | ||
45 | #include <openssl/dh.h> | 45 | #include <openssl/dh.h> |
46 | #include <openssl/bn.h> | 46 | #include <openssl/bn.h> |
@@ -182,16 +182,15 @@ int session_id2_len = 0; | |||
182 | u_int utmp_len = MAXHOSTNAMELEN; | 182 | u_int utmp_len = MAXHOSTNAMELEN; |
183 | 183 | ||
184 | /* Prototypes for various functions defined later in this file. */ | 184 | /* Prototypes for various functions defined later in this file. */ |
185 | void do_ssh1_kex(void); | 185 | void destroy_sensitive_data(void); |
186 | void do_ssh2_kex(void); | ||
187 | 186 | ||
188 | void ssh_dh1_server(Kex *, Buffer *_kexinit, Buffer *); | 187 | static void do_ssh1_kex(void); |
189 | void ssh_dhgex_server(Kex *, Buffer *_kexinit, Buffer *); | 188 | static void do_ssh2_kex(void); |
190 | 189 | ||
191 | /* | 190 | /* |
192 | * Close all listening sockets | 191 | * Close all listening sockets |
193 | */ | 192 | */ |
194 | void | 193 | static void |
195 | close_listen_socks(void) | 194 | close_listen_socks(void) |
196 | { | 195 | { |
197 | int i; | 196 | int i; |
@@ -205,7 +204,7 @@ close_listen_socks(void) | |||
205 | * the effect is to reread the configuration file (and to regenerate | 204 | * the effect is to reread the configuration file (and to regenerate |
206 | * the server key). | 205 | * the server key). |
207 | */ | 206 | */ |
208 | void | 207 | static void |
209 | sighup_handler(int sig) | 208 | sighup_handler(int sig) |
210 | { | 209 | { |
211 | received_sighup = 1; | 210 | received_sighup = 1; |
@@ -216,7 +215,7 @@ sighup_handler(int sig) | |||
216 | * Called from the main program after receiving SIGHUP. | 215 | * Called from the main program after receiving SIGHUP. |
217 | * Restarts the server. | 216 | * Restarts the server. |
218 | */ | 217 | */ |
219 | void | 218 | static void |
220 | sighup_restart(void) | 219 | sighup_restart(void) |
221 | { | 220 | { |
222 | log("Received SIGHUP; restarting."); | 221 | log("Received SIGHUP; restarting."); |
@@ -229,7 +228,7 @@ sighup_restart(void) | |||
229 | /* | 228 | /* |
230 | * Generic signal handler for terminating signals in the master daemon. | 229 | * Generic signal handler for terminating signals in the master daemon. |
231 | */ | 230 | */ |
232 | void | 231 | static void |
233 | sigterm_handler(int sig) | 232 | sigterm_handler(int sig) |
234 | { | 233 | { |
235 | received_sigterm = sig; | 234 | received_sigterm = sig; |
@@ -239,7 +238,7 @@ sigterm_handler(int sig) | |||
239 | * SIGCHLD handler. This is called whenever a child dies. This will then | 238 | * SIGCHLD handler. This is called whenever a child dies. This will then |
240 | * reap any zombies left by exited children. | 239 | * reap any zombies left by exited children. |
241 | */ | 240 | */ |
242 | void | 241 | static void |
243 | main_sigchld_handler(int sig) | 242 | main_sigchld_handler(int sig) |
244 | { | 243 | { |
245 | int save_errno = errno; | 244 | int save_errno = errno; |
@@ -255,7 +254,7 @@ main_sigchld_handler(int sig) | |||
255 | /* | 254 | /* |
256 | * Signal handler for the alarm after the login grace period has expired. | 255 | * Signal handler for the alarm after the login grace period has expired. |
257 | */ | 256 | */ |
258 | void | 257 | static void |
259 | grace_alarm_handler(int sig) | 258 | grace_alarm_handler(int sig) |
260 | { | 259 | { |
261 | /* XXX no idea how fix this signal handler */ | 260 | /* XXX no idea how fix this signal handler */ |
@@ -274,7 +273,7 @@ grace_alarm_handler(int sig) | |||
274 | * Thus there should be no concurrency control/asynchronous execution | 273 | * Thus there should be no concurrency control/asynchronous execution |
275 | * problems. | 274 | * problems. |
276 | */ | 275 | */ |
277 | void | 276 | static void |
278 | generate_ephemeral_server_key(void) | 277 | generate_ephemeral_server_key(void) |
279 | { | 278 | { |
280 | u_int32_t rand = 0; | 279 | u_int32_t rand = 0; |
@@ -297,7 +296,7 @@ generate_ephemeral_server_key(void) | |||
297 | arc4random_stir(); | 296 | arc4random_stir(); |
298 | } | 297 | } |
299 | 298 | ||
300 | void | 299 | static void |
301 | key_regeneration_alarm(int sig) | 300 | key_regeneration_alarm(int sig) |
302 | { | 301 | { |
303 | int save_errno = errno; | 302 | int save_errno = errno; |
@@ -306,7 +305,7 @@ key_regeneration_alarm(int sig) | |||
306 | key_do_regen = 1; | 305 | key_do_regen = 1; |
307 | } | 306 | } |
308 | 307 | ||
309 | void | 308 | static void |
310 | sshd_exchange_identification(int sock_in, int sock_out) | 309 | sshd_exchange_identification(int sock_in, int sock_out) |
311 | { | 310 | { |
312 | int i, mismatch; | 311 | int i, mismatch; |
@@ -456,7 +455,7 @@ destroy_sensitive_data(void) | |||
456 | memset(sensitive_data.ssh1_cookie, 0, SSH_SESSION_KEY_LENGTH); | 455 | memset(sensitive_data.ssh1_cookie, 0, SSH_SESSION_KEY_LENGTH); |
457 | } | 456 | } |
458 | 457 | ||
459 | char * | 458 | static char * |
460 | list_hostkey_types(void) | 459 | list_hostkey_types(void) |
461 | { | 460 | { |
462 | static char buf[1024]; | 461 | static char buf[1024]; |
@@ -481,7 +480,7 @@ list_hostkey_types(void) | |||
481 | return buf; | 480 | return buf; |
482 | } | 481 | } |
483 | 482 | ||
484 | Key * | 483 | static Key * |
485 | get_hostkey_by_type(int type) | 484 | get_hostkey_by_type(int type) |
486 | { | 485 | { |
487 | int i; | 486 | int i; |
@@ -499,7 +498,7 @@ get_hostkey_by_type(int type) | |||
499 | * of (max_startups_rate/100). the probability increases linearly until | 498 | * of (max_startups_rate/100). the probability increases linearly until |
500 | * all connections are dropped for startups > max_startups | 499 | * all connections are dropped for startups > max_startups |
501 | */ | 500 | */ |
502 | int | 501 | static int |
503 | drop_connection(int startups) | 502 | drop_connection(int startups) |
504 | { | 503 | { |
505 | double p, r; | 504 | double p, r; |
@@ -1203,7 +1202,7 @@ main(int ac, char **av) | |||
1203 | /* | 1202 | /* |
1204 | * SSH1 key exchange | 1203 | * SSH1 key exchange |
1205 | */ | 1204 | */ |
1206 | void | 1205 | static void |
1207 | do_ssh1_kex(void) | 1206 | do_ssh1_kex(void) |
1208 | { | 1207 | { |
1209 | int i, len; | 1208 | int i, len; |
@@ -1424,7 +1423,7 @@ do_ssh1_kex(void) | |||
1424 | /* | 1423 | /* |
1425 | * SSH2 key exchange: diffie-hellman-group1-sha1 | 1424 | * SSH2 key exchange: diffie-hellman-group1-sha1 |
1426 | */ | 1425 | */ |
1427 | void | 1426 | static void |
1428 | do_ssh2_kex(void) | 1427 | do_ssh2_kex(void) |
1429 | { | 1428 | { |
1430 | Kex *kex; | 1429 | Kex *kex; |