summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-06-25 05:01:22 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-06-25 05:01:22 +0000
commitbba81213b972ce15fbbaca60b9ffabb42371ce8f (patch)
treee6bd40752969f2b93d179cfb9aaae9074ca45956 /sshd.c
parent34f91883a6f3123656b0a8017d68b658f7cf2403 (diff)
- itojun@cvs.openbsd.org 2001/06/23 15:12:20
[auth1.c auth2.c auth2-chall.c authfd.c authfile.c auth-rhosts.c canohost.c channels.c cipher.c clientloop.c deattack.c dh.c hostfile.c kex.c kexdh.c kexgex.c key.c nchan.c packet.c radix.c readpass.c scp.c servconf.c serverloop.c session.c sftp.c sftp-client.c sftp-glob.c sftp-int.c sftp-server.c ssh-add.c ssh-agent.c ssh.c sshconnect1.c sshconnect2.c sshconnect.c sshd.c ssh-keygen.c ssh-keyscan.c] more strict prototypes. raise warning level in Makefile.inc. markus ok'ed TODO; cleanup headers
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/sshd.c b/sshd.c
index 1dfcac0d7..431f4e2ac 100644
--- a/sshd.c
+++ b/sshd.c
@@ -40,7 +40,7 @@
40 */ 40 */
41 41
42#include "includes.h" 42#include "includes.h"
43RCSID("$OpenBSD: sshd.c,v 1.199 2001/06/04 23:07:21 markus Exp $"); 43RCSID("$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;
182u_int utmp_len = MAXHOSTNAMELEN; 182u_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. */
185void do_ssh1_kex(void); 185void destroy_sensitive_data(void);
186void do_ssh2_kex(void);
187 186
188void ssh_dh1_server(Kex *, Buffer *_kexinit, Buffer *); 187static void do_ssh1_kex(void);
189void ssh_dhgex_server(Kex *, Buffer *_kexinit, Buffer *); 188static void do_ssh2_kex(void);
190 189
191/* 190/*
192 * Close all listening sockets 191 * Close all listening sockets
193 */ 192 */
194void 193static void
195close_listen_socks(void) 194close_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 */
208void 207static void
209sighup_handler(int sig) 208sighup_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 */
219void 218static void
220sighup_restart(void) 219sighup_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 */
232void 231static void
233sigterm_handler(int sig) 232sigterm_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 */
242void 241static void
243main_sigchld_handler(int sig) 242main_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 */
258void 257static void
259grace_alarm_handler(int sig) 258grace_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 */
277void 276static void
278generate_ephemeral_server_key(void) 277generate_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
300void 299static void
301key_regeneration_alarm(int sig) 300key_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
309void 308static void
310sshd_exchange_identification(int sock_in, int sock_out) 309sshd_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
459char * 458static char *
460list_hostkey_types(void) 459list_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
484Key * 483static Key *
485get_hostkey_by_type(int type) 484get_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 */
502int 501static int
503drop_connection(int startups) 502drop_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 */
1206void 1205static void
1207do_ssh1_kex(void) 1206do_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 */
1427void 1426static void
1428do_ssh2_kex(void) 1427do_ssh2_kex(void)
1429{ 1428{
1430 Kex *kex; 1429 Kex *kex;