comparison svr-session.c @ 33:f789045062e6

Progressing client support
author Matt Johnston <matt@ucc.asn.au>
date Tue, 27 Jul 2004 16:30:46 +0000
parents 0969767bca0d
children 0ad5fb979f42
comparison
equal deleted inserted replaced
32:8fd0cdbb5b1b 33:f789045062e6
77 crypto_init(); 77 crypto_init();
78 common_session_init(sock, remotehost); 78 common_session_init(sock, remotehost);
79 79
80 /* Initialise server specific parts of the session */ 80 /* Initialise server specific parts of the session */
81 svr_ses.childpipe = childpipe; 81 svr_ses.childpipe = childpipe;
82 authinitialise(); 82 svr_authinitialise();
83 chaninitialise(svr_chantypes); 83 chaninitialise(svr_chantypes);
84 svr_chansessinitialise(); 84 svr_chansessinitialise();
85 85
86 if (gettimeofday(&timeout, 0) < 0) { 86 if (gettimeofday(&timeout, 0) < 0) {
87 dropbear_exit("Error getting time"); 87 dropbear_exit("Error getting time");
88 } 88 }
89 89
90 ses.connecttimeout = timeout.tv_sec + AUTH_TIMEOUT; 90 ses.connecttimeout = timeout.tv_sec + AUTH_TIMEOUT;
91 91
92 /* set up messages etc */ 92 /* set up messages etc */
93 session_remoteclosed = svr_remoteclosed; 93 ses.remoteclosed = svr_remoteclosed;
94 94
95 /* packet handlers */ 95 /* packet handlers */
96 ses.packettypes = svr_packettypes; 96 ses.packettypes = svr_packettypes;
97 ses.buf_match_algo = svr_buf_match_algo;
97 98
98 /* We're ready to go now */ 99 /* We're ready to go now */
99 sessinitdone = 1; 100 sessinitdone = 1;
100 101
101 /* exchange identification, version etc */ 102 /* exchange identification, version etc */
121 122
122 if (!sessinitdone) { 123 if (!sessinitdone) {
123 /* before session init */ 124 /* before session init */
124 snprintf(fmtbuf, sizeof(fmtbuf), 125 snprintf(fmtbuf, sizeof(fmtbuf),
125 "premature exit: %s", format); 126 "premature exit: %s", format);
126 } else if (svr_ses.authstate.authdone) { 127 } else if (ses.authstate.authdone) {
127 /* user has authenticated */ 128 /* user has authenticated */
128 snprintf(fmtbuf, sizeof(fmtbuf), 129 snprintf(fmtbuf, sizeof(fmtbuf),
129 "exit after auth (%s): %s", 130 "exit after auth (%s): %s",
130 svr_ses.authstate.printableuser, format); 131 ses.authstate.printableuser, format);
131 } else if (svr_ses.authstate.printableuser) { 132 } else if (ses.authstate.printableuser) {
132 /* we have a potential user */ 133 /* we have a potential user */
133 snprintf(fmtbuf, sizeof(fmtbuf), 134 snprintf(fmtbuf, sizeof(fmtbuf),
134 "exit before auth (user '%s', %d fails): %s", 135 "exit before auth (user '%s', %d fails): %s",
135 svr_ses.authstate.printableuser, svr_ses.authstate.failcount, format); 136 ses.authstate.printableuser, ses.authstate.failcount, format);
136 } else { 137 } else {
137 /* before userauth */ 138 /* before userauth */
138 snprintf(fmtbuf, sizeof(fmtbuf), 139 snprintf(fmtbuf, sizeof(fmtbuf),
139 "exit before auth: %s", format); 140 "exit before auth: %s", format);
140 } 141 }