blob: 50388285ce4cf1763940b4feb426597aee7eba90 [file] [log] [blame]
Damien Miller7acefbb2014-07-18 14:11:24 +10001/* $OpenBSD: auth1.c,v 1.82 2014/07/15 15:54:14 millert Exp $ */
Damien Millereba71ba2000-04-29 23:57:08 +10002/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved
Damien Millere4340be2000-09-16 13:29:08 +11005 *
6 * As far as I am concerned, the code I have written for this software
7 * can be used freely for any purpose. Any derived versions of this
8 * software must be clearly marked as such, and if the derived work is
9 * incompatible with the protocol description in the RFC file, it must be
10 * called by a name other than "ssh" or "Secure Shell".
Damien Millereba71ba2000-04-29 23:57:08 +100011 */
12
13#include "includes.h"
Damien Millereba71ba2000-04-29 23:57:08 +100014
Damien Miller1cdde6f2006-07-24 14:07:35 +100015#include <sys/types.h>
16
Damien Millerded319c2006-09-01 15:38:36 +100017#include <stdarg.h>
Damien Millera7a73ee2006-08-05 11:37:59 +100018#include <stdio.h>
Damien Millere3476ed2006-07-24 14:13:33 +100019#include <string.h>
Damien Miller1cdde6f2006-07-24 14:07:35 +100020#include <unistd.h>
Damien Millerd7834352006-08-05 12:39:39 +100021#include <pwd.h>
Damien Miller1cdde6f2006-07-24 14:07:35 +100022
Damien Millerb84886b2008-05-19 15:05:07 +100023#include "openbsd-compat/sys-queue.h"
Damien Miller874d77b2000-10-14 16:23:11 +110024#include "xmalloc.h"
25#include "rsa.h"
Ben Lindstrom226cfa02001-01-22 05:34:40 +000026#include "ssh1.h"
Damien Miller874d77b2000-10-14 16:23:11 +110027#include "packet.h"
28#include "buffer.h"
Ben Lindstrom226cfa02001-01-22 05:34:40 +000029#include "log.h"
Damien Miller7acefbb2014-07-18 14:11:24 +100030#include "misc.h"
Damien Miller874d77b2000-10-14 16:23:11 +110031#include "servconf.h"
32#include "compat.h"
Damien Millerd7834352006-08-05 12:39:39 +100033#include "key.h"
34#include "hostfile.h"
Damien Miller874d77b2000-10-14 16:23:11 +110035#include "auth.h"
Damien Millerc7ef63d2002-02-05 12:21:42 +110036#include "channels.h"
Damien Miller874d77b2000-10-14 16:23:11 +110037#include "session.h"
Ben Lindstromec95ed92001-07-04 04:21:14 +000038#include "uidswap.h"
Damien Millerd7834352006-08-05 12:39:39 +100039#ifdef GSSAPI
40#include "ssh-gss.h"
41#endif
Ben Lindstrom7a2073c2002-03-22 02:30:41 +000042#include "monitor_wrap.h"
Darren Tuckerc1386672004-12-03 14:33:47 +110043#include "buffer.h"
Damien Miller874d77b2000-10-14 16:23:11 +110044
Damien Millereba71ba2000-04-29 23:57:08 +100045/* import */
46extern ServerOptions options;
Darren Tuckerc1386672004-12-03 14:33:47 +110047extern Buffer loginmsg;
Damien Miller874d77b2000-10-14 16:23:11 +110048
Darren Tucker0acca372013-06-02 07:41:51 +100049static int auth1_process_password(Authctxt *);
50static int auth1_process_rsa(Authctxt *);
51static int auth1_process_rhosts_rsa(Authctxt *);
52static int auth1_process_tis_challenge(Authctxt *);
53static int auth1_process_tis_response(Authctxt *);
Damien Miller6abf57c2005-06-19 07:31:37 +100054
55static char *client_user = NULL; /* Used to fill in remote user for PAM */
56
57struct AuthMethod1 {
58 int type;
59 char *name;
60 int *enabled;
Darren Tucker12f65332013-06-02 08:01:24 +100061 int (*method)(Authctxt *);
Damien Miller6abf57c2005-06-19 07:31:37 +100062};
63
64const struct AuthMethod1 auth1_methods[] = {
65 {
66 SSH_CMSG_AUTH_PASSWORD, "password",
67 &options.password_authentication, auth1_process_password
68 },
69 {
70 SSH_CMSG_AUTH_RSA, "rsa",
71 &options.rsa_authentication, auth1_process_rsa
72 },
73 {
74 SSH_CMSG_AUTH_RHOSTS_RSA, "rhosts-rsa",
75 &options.rhosts_rsa_authentication, auth1_process_rhosts_rsa
76 },
77 {
78 SSH_CMSG_AUTH_TIS, "challenge-response",
79 &options.challenge_response_authentication,
80 auth1_process_tis_challenge
81 },
82 {
83 SSH_CMSG_AUTH_TIS_RESPONSE, "challenge-response",
84 &options.challenge_response_authentication,
85 auth1_process_tis_response
86 },
87 { -1, NULL, NULL, NULL}
88};
89
90static const struct AuthMethod1
91*lookup_authmethod1(int type)
92{
93 int i;
94
Damien Millerd62f2ca2006-03-26 13:57:41 +110095 for (i = 0; auth1_methods[i].name != NULL; i++)
Damien Miller6abf57c2005-06-19 07:31:37 +100096 if (auth1_methods[i].type == type)
97 return (&(auth1_methods[i]));
98
99 return (NULL);
100}
101
Ben Lindstrombba81212001-06-25 05:01:22 +0000102static char *
Damien Millereba71ba2000-04-29 23:57:08 +1000103get_authname(int type)
104{
Damien Miller6abf57c2005-06-19 07:31:37 +1000105 const struct AuthMethod1 *a;
106 static char buf[64];
107
108 if ((a = lookup_authmethod1(type)) != NULL)
109 return (a->name);
110 snprintf(buf, sizeof(buf), "bad-auth-msg-%d", type);
111 return (buf);
112}
113
Damien Miller91d4b122006-03-26 14:05:20 +1100114/*ARGSUSED*/
Damien Miller6abf57c2005-06-19 07:31:37 +1000115static int
Darren Tucker0acca372013-06-02 07:41:51 +1000116auth1_process_password(Authctxt *authctxt)
Damien Miller6abf57c2005-06-19 07:31:37 +1000117{
118 int authenticated = 0;
119 char *password;
120 u_int dlen;
121
122 /*
123 * Read user password. It is in plain text, but was
124 * transmitted over the encrypted channel so it is
125 * not visible to an outside observer.
126 */
127 password = packet_get_string(&dlen);
128 packet_check_eom();
129
130 /* Try authentication with the password. */
131 authenticated = PRIVSEP(auth_password(authctxt, password));
132
Damien Millera5103f42014-02-04 11:20:14 +1100133 explicit_bzero(password, dlen);
Darren Tuckera627d422013-06-02 07:31:17 +1000134 free(password);
Damien Miller6abf57c2005-06-19 07:31:37 +1000135
136 return (authenticated);
137}
138
Damien Miller91d4b122006-03-26 14:05:20 +1100139/*ARGSUSED*/
Damien Miller6abf57c2005-06-19 07:31:37 +1000140static int
Darren Tucker0acca372013-06-02 07:41:51 +1000141auth1_process_rsa(Authctxt *authctxt)
Damien Miller6abf57c2005-06-19 07:31:37 +1000142{
143 int authenticated = 0;
144 BIGNUM *n;
145
146 /* RSA authentication requested. */
147 if ((n = BN_new()) == NULL)
148 fatal("do_authloop: BN_new failed");
149 packet_get_bignum(n);
150 packet_check_eom();
151 authenticated = auth_rsa(authctxt, n);
152 BN_clear_free(n);
153
154 return (authenticated);
155}
156
Damien Miller91d4b122006-03-26 14:05:20 +1100157/*ARGSUSED*/
Damien Miller6abf57c2005-06-19 07:31:37 +1000158static int
Darren Tucker0acca372013-06-02 07:41:51 +1000159auth1_process_rhosts_rsa(Authctxt *authctxt)
Damien Miller6abf57c2005-06-19 07:31:37 +1000160{
Damien Miller06221f12005-06-19 07:36:10 +1000161 int keybits, authenticated = 0;
Damien Miller6abf57c2005-06-19 07:31:37 +1000162 u_int bits;
163 Key *client_host_key;
164 u_int ulen;
165
166 /*
167 * Get client user name. Note that we just have to
168 * trust the client; root on the client machine can
169 * claim to be any user.
170 */
Damien Millerda108ec2010-08-31 22:36:39 +1000171 client_user = packet_get_cstring(&ulen);
Damien Miller6abf57c2005-06-19 07:31:37 +1000172
173 /* Get the client host key. */
174 client_host_key = key_new(KEY_RSA1);
175 bits = packet_get_int();
176 packet_get_bignum(client_host_key->rsa->e);
177 packet_get_bignum(client_host_key->rsa->n);
178
Damien Miller06221f12005-06-19 07:36:10 +1000179 keybits = BN_num_bits(client_host_key->rsa->n);
180 if (keybits < 0 || bits != (u_int)keybits) {
Damien Miller6abf57c2005-06-19 07:31:37 +1000181 verbose("Warning: keysize mismatch for client_host_key: "
182 "actual %d, announced %d",
183 BN_num_bits(client_host_key->rsa->n), bits);
Damien Millereba71ba2000-04-29 23:57:08 +1000184 }
Damien Miller6abf57c2005-06-19 07:31:37 +1000185 packet_check_eom();
186
187 authenticated = auth_rhosts_rsa(authctxt, client_user,
188 client_host_key);
189 key_free(client_host_key);
190
Darren Tucker0acca372013-06-02 07:41:51 +1000191 auth_info(authctxt, "ruser %.100s", client_user);
Damien Miller94cf4c82005-07-17 17:04:47 +1000192
Damien Miller6abf57c2005-06-19 07:31:37 +1000193 return (authenticated);
194}
195
Damien Miller91d4b122006-03-26 14:05:20 +1100196/*ARGSUSED*/
Damien Miller6abf57c2005-06-19 07:31:37 +1000197static int
Darren Tucker0acca372013-06-02 07:41:51 +1000198auth1_process_tis_challenge(Authctxt *authctxt)
Damien Miller6abf57c2005-06-19 07:31:37 +1000199{
200 char *challenge;
Damien Miller46d38de2005-07-17 17:02:09 +1000201
Damien Miller6abf57c2005-06-19 07:31:37 +1000202 if ((challenge = get_challenge(authctxt)) == NULL)
203 return (0);
204
205 debug("sending challenge '%s'", challenge);
206 packet_start(SSH_SMSG_AUTH_TIS_CHALLENGE);
207 packet_put_cstring(challenge);
Darren Tuckera627d422013-06-02 07:31:17 +1000208 free(challenge);
Damien Miller6abf57c2005-06-19 07:31:37 +1000209 packet_send();
210 packet_write_wait();
211
212 return (-1);
213}
214
Damien Miller91d4b122006-03-26 14:05:20 +1100215/*ARGSUSED*/
Damien Miller6abf57c2005-06-19 07:31:37 +1000216static int
Darren Tucker0acca372013-06-02 07:41:51 +1000217auth1_process_tis_response(Authctxt *authctxt)
Damien Miller6abf57c2005-06-19 07:31:37 +1000218{
219 int authenticated = 0;
220 char *response;
221 u_int dlen;
222
223 response = packet_get_string(&dlen);
224 packet_check_eom();
225 authenticated = verify_response(authctxt, response);
Damien Millera5103f42014-02-04 11:20:14 +1100226 explicit_bzero(response, dlen);
Darren Tuckera627d422013-06-02 07:31:17 +1000227 free(response);
Damien Miller6abf57c2005-06-19 07:31:37 +1000228
229 return (authenticated);
Damien Millereba71ba2000-04-29 23:57:08 +1000230}
231
232/*
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000233 * read packets, try to authenticate the user and
234 * return only if authentication is successful
Damien Millereba71ba2000-04-29 23:57:08 +1000235 */
Ben Lindstrombba81212001-06-25 05:01:22 +0000236static void
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000237do_authloop(Authctxt *authctxt)
Damien Millereba71ba2000-04-29 23:57:08 +1000238{
Damien Miller874d77b2000-10-14 16:23:11 +1100239 int authenticated = 0;
Damien Miller6abf57c2005-06-19 07:31:37 +1000240 int prev = 0, type = 0;
241 const struct AuthMethod1 *meth;
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000242
243 debug("Attempting authentication for %s%.100s.",
Darren Tucker5cb30ad2004-08-12 22:40:24 +1000244 authctxt->valid ? "" : "invalid user ", authctxt->user);
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000245
246 /* If the user has no password, accept authentication immediately. */
Damien Millerbda3eca2010-06-26 10:01:33 +1000247 if (options.permit_empty_passwd && options.password_authentication &&
Darren Tucker6aaa58c2003-08-02 22:24:49 +1000248#ifdef KRB5
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000249 (!options.kerberos_authentication || options.kerberos_or_local_passwd) &&
250#endif
Ben Lindstrom7a2073c2002-03-22 02:30:41 +0000251 PRIVSEP(auth_password(authctxt, ""))) {
Darren Tuckera8c73d32004-06-23 09:17:54 +1000252#ifdef USE_PAM
253 if (options.use_pam && (PRIVSEP(do_pam_account())))
254#endif
255 {
Damien Miller15b05cf2012-12-03 09:53:20 +1100256 auth_log(authctxt, 1, 0, "without authentication",
Darren Tucker0acca372013-06-02 07:41:51 +1000257 NULL);
Darren Tuckera8c73d32004-06-23 09:17:54 +1000258 return;
259 }
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000260 }
Damien Millereba71ba2000-04-29 23:57:08 +1000261
262 /* Indicate that authentication is needed. */
263 packet_start(SSH_SMSG_FAILURE);
264 packet_send();
265 packet_write_wait();
266
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000267 for (;;) {
Damien Miller874d77b2000-10-14 16:23:11 +1100268 /* default to fail */
269 authenticated = 0;
270
Damien Millereba71ba2000-04-29 23:57:08 +1000271
272 /* Get a packet from the client. */
Damien Miller4f9f42a2003-05-10 19:28:02 +1000273 prev = type;
Damien Millerdff50992002-01-22 23:16:32 +1100274 type = packet_read();
Damien Millereba71ba2000-04-29 23:57:08 +1000275
Damien Miller4f9f42a2003-05-10 19:28:02 +1000276 /*
277 * If we started challenge-response authentication but the
278 * next packet is not a response to our challenge, release
279 * the resources allocated by get_challenge() (which would
280 * normally have been released by verify_response() had we
281 * received such a response)
282 */
283 if (prev == SSH_CMSG_AUTH_TIS &&
284 type != SSH_CMSG_AUTH_TIS_RESPONSE)
285 abandon_challenge_response(authctxt);
286
Damien Miller0b4d48b2008-07-05 09:44:53 +1000287 if (authctxt->failures >= options.max_authtries)
288 goto skip;
Damien Miller6abf57c2005-06-19 07:31:37 +1000289 if ((meth = lookup_authmethod1(type)) == NULL) {
290 logit("Unknown message during authentication: "
291 "type %d", type);
292 goto skip;
Damien Millereba71ba2000-04-29 23:57:08 +1000293 }
Damien Miller6abf57c2005-06-19 07:31:37 +1000294
295 if (!*(meth->enabled)) {
296 verbose("%s authentication disabled.", meth->name);
297 goto skip;
298 }
299
Darren Tucker0acca372013-06-02 07:41:51 +1000300 authenticated = meth->method(authctxt);
Damien Miller6abf57c2005-06-19 07:31:37 +1000301 if (authenticated == -1)
302 continue; /* "postponed" */
303
Damien Miller60396b02001-02-18 17:01:00 +1100304#ifdef BSD_AUTH
305 if (authctxt->as) {
306 auth_close(authctxt->as);
307 authctxt->as = NULL;
308 }
309#endif
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000310 if (!authctxt->valid && authenticated)
311 fatal("INTERNAL ERROR: authenticated invalid user %s",
312 authctxt->user);
Damien Millereba71ba2000-04-29 23:57:08 +1000313
Tim Rice81ed5182002-09-25 17:38:46 -0700314#ifdef _UNICOS
Tim Rice81ed5182002-09-25 17:38:46 -0700315 if (authenticated && cray_access_denied(authctxt->user)) {
316 authenticated = 0;
317 fatal("Access denied for user %s.",authctxt->user);
318 }
319#endif /* _UNICOS */
320
Darren Tucker9d86e5d2009-03-08 11:40:27 +1100321#ifndef HAVE_CYGWIN
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000322 /* Special handling for root */
Damien Miller556f9312003-02-24 11:59:26 +1100323 if (authenticated && authctxt->pw->pw_uid == 0 &&
Damien Miller6abf57c2005-06-19 07:31:37 +1000324 !auth_root_allowed(meth->name)) {
325 authenticated = 0;
Darren Tucker2e0cf0d2005-02-08 21:52:47 +1100326# ifdef SSH_AUDIT_EVENTS
327 PRIVSEP(audit_event(SSH_LOGIN_ROOT_DENIED));
Darren Tucker269a1ea2005-02-03 00:20:53 +1100328# endif
329 }
Ben Lindstrom5dc81502001-01-19 06:10:29 +0000330#endif
Damien Millereba71ba2000-04-29 23:57:08 +1000331
Damien Miller1f499fd2003-08-25 13:08:49 +1000332#ifdef USE_PAM
Damien Millera8e06ce2003-11-21 23:48:55 +1100333 if (options.use_pam && authenticated &&
Darren Tuckerc1386672004-12-03 14:33:47 +1100334 !PRIVSEP(do_pam_account())) {
335 char *msg;
336 size_t len;
337
338 error("Access denied for user %s by PAM account "
Damien Millerb6f72f52005-07-17 17:26:43 +1000339 "configuration", authctxt->user);
Darren Tuckerc1386672004-12-03 14:33:47 +1100340 len = buffer_len(&loginmsg);
341 buffer_append(&loginmsg, "\0", 1);
342 msg = buffer_ptr(&loginmsg);
343 /* strip trailing newlines */
344 if (len > 0)
345 while (len > 0 && msg[--len] == '\n')
346 msg[len] = '\0';
347 else
348 msg = "Access denied.";
Damien Miller773a7b92008-07-09 20:54:05 +1000349 packet_disconnect("%s", msg);
Darren Tuckerc1386672004-12-03 14:33:47 +1100350 }
Damien Miller1f499fd2003-08-25 13:08:49 +1000351#endif
352
Damien Miller6abf57c2005-06-19 07:31:37 +1000353 skip:
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000354 /* Log before sending the reply */
Darren Tucker0acca372013-06-02 07:41:51 +1000355 auth_log(authctxt, authenticated, 0, get_authname(type), NULL);
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000356
Darren Tuckera627d422013-06-02 07:31:17 +1000357 free(client_user);
358 client_user = NULL;
Damien Millereba71ba2000-04-29 23:57:08 +1000359
Damien Miller874d77b2000-10-14 16:23:11 +1100360 if (authenticated)
361 return;
362
Damien Miller0b4d48b2008-07-05 09:44:53 +1000363 if (++authctxt->failures >= options.max_authtries) {
Darren Tucker2e0cf0d2005-02-08 21:52:47 +1100364#ifdef SSH_AUDIT_EVENTS
365 PRIVSEP(audit_event(SSH_LOGIN_EXCEED_MAXTRIES));
Darren Tucker269a1ea2005-02-03 00:20:53 +1100366#endif
Damien Miller686feb52014-07-03 21:29:38 +1000367 auth_maxtries_exceeded(authctxt);
Darren Tucker269a1ea2005-02-03 00:20:53 +1100368 }
Damien Millereba71ba2000-04-29 23:57:08 +1000369
Damien Millereba71ba2000-04-29 23:57:08 +1000370 packet_start(SSH_SMSG_FAILURE);
371 packet_send();
372 packet_write_wait();
373 }
374}
375
376/*
377 * Performs authentication of an incoming connection. Session key has already
378 * been exchanged and encryption is enabled.
379 */
Darren Tucker3e33cec2003-10-02 16:12:36 +1000380void
381do_authentication(Authctxt *authctxt)
Damien Millereba71ba2000-04-29 23:57:08 +1000382{
Ben Lindstrom46c16222000-12-22 01:43:59 +0000383 u_int ulen;
Ben Lindstromc8226382002-04-10 16:22:09 +0000384 char *user, *style = NULL;
Damien Millereba71ba2000-04-29 23:57:08 +1000385
386 /* Get the name of the user that we wish to log in as. */
Damien Millerdff50992002-01-22 23:16:32 +1100387 packet_read_expect(SSH_CMSG_USER);
Damien Millereba71ba2000-04-29 23:57:08 +1000388
389 /* Get the user name. */
Damien Millerda108ec2010-08-31 22:36:39 +1000390 user = packet_get_cstring(&ulen);
Damien Miller48b03fc2002-01-22 23:11:40 +1100391 packet_check_eom();
Damien Millereba71ba2000-04-29 23:57:08 +1000392
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000393 if ((style = strchr(user, ':')) != NULL)
Ben Lindstromec95ed92001-07-04 04:21:14 +0000394 *style++ = '\0';
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000395
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000396 authctxt->user = user;
397 authctxt->style = style;
398
Damien Millereba71ba2000-04-29 23:57:08 +1000399 /* Verify that the user is a valid user. */
Ben Lindstrom7ebb6352002-03-22 03:04:08 +0000400 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000401 authctxt->valid = 1;
Damien Miller856f0be2003-09-03 07:32:45 +1000402 else {
Darren Tucker5cb30ad2004-08-12 22:40:24 +1000403 debug("do_authentication: invalid user %s", user);
Damien Miller856f0be2003-09-03 07:32:45 +1000404 authctxt->pw = fakepw();
405 }
Ben Lindstrom7a2073c2002-03-22 02:30:41 +0000406
Damien Millera6e3f012012-11-04 23:21:40 +1100407 /* Configuration may have changed as a result of Match */
408 if (options.num_auth_methods != 0)
409 fatal("AuthenticationMethods is not supported with SSH "
410 "protocol 1");
411
Damien Miller30d1f842004-07-21 20:48:53 +1000412 setproctitle("%s%s", authctxt->valid ? user : "unknown",
Ben Lindstrom7a2073c2002-03-22 02:30:41 +0000413 use_privsep ? " [net]" : "");
Ben Lindstromc1ba31f2001-02-15 03:14:11 +0000414
Damien Millereba71ba2000-04-29 23:57:08 +1000415#ifdef USE_PAM
Damien Miller4e448a32003-05-14 15:11:48 +1000416 if (options.use_pam)
Darren Tuckerdbf7a742004-03-08 23:04:06 +1100417 PRIVSEP(start_pam(authctxt));
Damien Millereba71ba2000-04-29 23:57:08 +1000418#endif
419
420 /*
421 * If we are not running as root, the user must have the same uid as
Damien Miller6abf57c2005-06-19 07:31:37 +1000422 * the server.
Damien Millereba71ba2000-04-29 23:57:08 +1000423 */
Damien Miller874d77b2000-10-14 16:23:11 +1100424#ifndef HAVE_CYGWIN
Ben Lindstrom7ebb6352002-03-22 03:04:08 +0000425 if (!use_privsep && getuid() != 0 && authctxt->pw &&
426 authctxt->pw->pw_uid != getuid())
Damien Millereba71ba2000-04-29 23:57:08 +1000427 packet_disconnect("Cannot change user when server not running as root.");
Damien Millerbac2d8a2000-09-05 16:13:06 +1100428#endif
Damien Millereba71ba2000-04-29 23:57:08 +1000429
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000430 /*
Kevin Steves12aaa042001-01-24 21:23:39 +0000431 * Loop until the user has been authenticated or the connection is
432 * closed, do_authloop() returns only if authentication is successful
433 */
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000434 do_authloop(authctxt);
Damien Millereba71ba2000-04-29 23:57:08 +1000435
436 /* The user has been authenticated and accepted. */
Damien Miller874d77b2000-10-14 16:23:11 +1100437 packet_start(SSH_SMSG_SUCCESS);
438 packet_send();
439 packet_write_wait();
Damien Millereba71ba2000-04-29 23:57:08 +1000440}