blob: 5073c49bb37db6157ad42c511d1c6c476d27c245 [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 Miller76c04802015-01-13 19:38:18 +110015#ifdef WITH_SSH1
16
Damien Miller1cdde6f2006-07-24 14:07:35 +100017#include <sys/types.h>
18
Damien Millerded319c2006-09-01 15:38:36 +100019#include <stdarg.h>
Damien Millera7a73ee2006-08-05 11:37:59 +100020#include <stdio.h>
Damien Millere3476ed2006-07-24 14:13:33 +100021#include <string.h>
Damien Miller1cdde6f2006-07-24 14:07:35 +100022#include <unistd.h>
Damien Millerd7834352006-08-05 12:39:39 +100023#include <pwd.h>
Damien Miller1cdde6f2006-07-24 14:07:35 +100024
Damien Millerb84886b2008-05-19 15:05:07 +100025#include "openbsd-compat/sys-queue.h"
Damien Miller874d77b2000-10-14 16:23:11 +110026#include "xmalloc.h"
27#include "rsa.h"
Ben Lindstrom226cfa02001-01-22 05:34:40 +000028#include "ssh1.h"
Damien Miller874d77b2000-10-14 16:23:11 +110029#include "packet.h"
30#include "buffer.h"
Ben Lindstrom226cfa02001-01-22 05:34:40 +000031#include "log.h"
Damien Miller7acefbb2014-07-18 14:11:24 +100032#include "misc.h"
Damien Miller874d77b2000-10-14 16:23:11 +110033#include "servconf.h"
34#include "compat.h"
Damien Millerd7834352006-08-05 12:39:39 +100035#include "key.h"
36#include "hostfile.h"
Damien Miller874d77b2000-10-14 16:23:11 +110037#include "auth.h"
Damien Millerc7ef63d2002-02-05 12:21:42 +110038#include "channels.h"
Damien Miller874d77b2000-10-14 16:23:11 +110039#include "session.h"
Ben Lindstromec95ed92001-07-04 04:21:14 +000040#include "uidswap.h"
Damien Millerd7834352006-08-05 12:39:39 +100041#ifdef GSSAPI
42#include "ssh-gss.h"
43#endif
Ben Lindstrom7a2073c2002-03-22 02:30:41 +000044#include "monitor_wrap.h"
Darren Tuckerc1386672004-12-03 14:33:47 +110045#include "buffer.h"
Damien Miller874d77b2000-10-14 16:23:11 +110046
Damien Millereba71ba2000-04-29 23:57:08 +100047/* import */
48extern ServerOptions options;
Darren Tuckerc1386672004-12-03 14:33:47 +110049extern Buffer loginmsg;
Damien Miller874d77b2000-10-14 16:23:11 +110050
Darren Tucker0acca372013-06-02 07:41:51 +100051static int auth1_process_password(Authctxt *);
52static int auth1_process_rsa(Authctxt *);
53static int auth1_process_rhosts_rsa(Authctxt *);
54static int auth1_process_tis_challenge(Authctxt *);
55static int auth1_process_tis_response(Authctxt *);
Damien Miller6abf57c2005-06-19 07:31:37 +100056
57static char *client_user = NULL; /* Used to fill in remote user for PAM */
58
59struct AuthMethod1 {
60 int type;
61 char *name;
62 int *enabled;
Darren Tucker12f65332013-06-02 08:01:24 +100063 int (*method)(Authctxt *);
Damien Miller6abf57c2005-06-19 07:31:37 +100064};
65
66const struct AuthMethod1 auth1_methods[] = {
67 {
68 SSH_CMSG_AUTH_PASSWORD, "password",
69 &options.password_authentication, auth1_process_password
70 },
71 {
72 SSH_CMSG_AUTH_RSA, "rsa",
73 &options.rsa_authentication, auth1_process_rsa
74 },
75 {
76 SSH_CMSG_AUTH_RHOSTS_RSA, "rhosts-rsa",
77 &options.rhosts_rsa_authentication, auth1_process_rhosts_rsa
78 },
79 {
80 SSH_CMSG_AUTH_TIS, "challenge-response",
81 &options.challenge_response_authentication,
82 auth1_process_tis_challenge
83 },
84 {
85 SSH_CMSG_AUTH_TIS_RESPONSE, "challenge-response",
86 &options.challenge_response_authentication,
87 auth1_process_tis_response
88 },
89 { -1, NULL, NULL, NULL}
90};
91
92static const struct AuthMethod1
93*lookup_authmethod1(int type)
94{
95 int i;
96
Damien Millerd62f2ca2006-03-26 13:57:41 +110097 for (i = 0; auth1_methods[i].name != NULL; i++)
Damien Miller6abf57c2005-06-19 07:31:37 +100098 if (auth1_methods[i].type == type)
99 return (&(auth1_methods[i]));
100
101 return (NULL);
102}
103
Ben Lindstrombba81212001-06-25 05:01:22 +0000104static char *
Damien Millereba71ba2000-04-29 23:57:08 +1000105get_authname(int type)
106{
Damien Miller6abf57c2005-06-19 07:31:37 +1000107 const struct AuthMethod1 *a;
108 static char buf[64];
109
110 if ((a = lookup_authmethod1(type)) != NULL)
111 return (a->name);
112 snprintf(buf, sizeof(buf), "bad-auth-msg-%d", type);
113 return (buf);
114}
115
Damien Miller91d4b122006-03-26 14:05:20 +1100116/*ARGSUSED*/
Damien Miller6abf57c2005-06-19 07:31:37 +1000117static int
Darren Tucker0acca372013-06-02 07:41:51 +1000118auth1_process_password(Authctxt *authctxt)
Damien Miller6abf57c2005-06-19 07:31:37 +1000119{
120 int authenticated = 0;
121 char *password;
122 u_int dlen;
123
124 /*
125 * Read user password. It is in plain text, but was
126 * transmitted over the encrypted channel so it is
127 * not visible to an outside observer.
128 */
129 password = packet_get_string(&dlen);
130 packet_check_eom();
131
132 /* Try authentication with the password. */
133 authenticated = PRIVSEP(auth_password(authctxt, password));
134
Damien Millera5103f42014-02-04 11:20:14 +1100135 explicit_bzero(password, dlen);
Darren Tuckera627d422013-06-02 07:31:17 +1000136 free(password);
Damien Miller6abf57c2005-06-19 07:31:37 +1000137
138 return (authenticated);
139}
140
Damien Miller91d4b122006-03-26 14:05:20 +1100141/*ARGSUSED*/
Damien Miller6abf57c2005-06-19 07:31:37 +1000142static int
Darren Tucker0acca372013-06-02 07:41:51 +1000143auth1_process_rsa(Authctxt *authctxt)
Damien Miller6abf57c2005-06-19 07:31:37 +1000144{
145 int authenticated = 0;
146 BIGNUM *n;
147
148 /* RSA authentication requested. */
149 if ((n = BN_new()) == NULL)
150 fatal("do_authloop: BN_new failed");
151 packet_get_bignum(n);
152 packet_check_eom();
153 authenticated = auth_rsa(authctxt, n);
154 BN_clear_free(n);
155
156 return (authenticated);
157}
158
Damien Miller91d4b122006-03-26 14:05:20 +1100159/*ARGSUSED*/
Damien Miller6abf57c2005-06-19 07:31:37 +1000160static int
Darren Tucker0acca372013-06-02 07:41:51 +1000161auth1_process_rhosts_rsa(Authctxt *authctxt)
Damien Miller6abf57c2005-06-19 07:31:37 +1000162{
Damien Miller06221f12005-06-19 07:36:10 +1000163 int keybits, authenticated = 0;
Damien Miller6abf57c2005-06-19 07:31:37 +1000164 u_int bits;
165 Key *client_host_key;
166 u_int ulen;
167
168 /*
169 * Get client user name. Note that we just have to
170 * trust the client; root on the client machine can
171 * claim to be any user.
172 */
Damien Millerda108ec2010-08-31 22:36:39 +1000173 client_user = packet_get_cstring(&ulen);
Damien Miller6abf57c2005-06-19 07:31:37 +1000174
175 /* Get the client host key. */
176 client_host_key = key_new(KEY_RSA1);
177 bits = packet_get_int();
178 packet_get_bignum(client_host_key->rsa->e);
179 packet_get_bignum(client_host_key->rsa->n);
180
Damien Miller06221f12005-06-19 07:36:10 +1000181 keybits = BN_num_bits(client_host_key->rsa->n);
182 if (keybits < 0 || bits != (u_int)keybits) {
Damien Miller6abf57c2005-06-19 07:31:37 +1000183 verbose("Warning: keysize mismatch for client_host_key: "
184 "actual %d, announced %d",
185 BN_num_bits(client_host_key->rsa->n), bits);
Damien Millereba71ba2000-04-29 23:57:08 +1000186 }
Damien Miller6abf57c2005-06-19 07:31:37 +1000187 packet_check_eom();
188
189 authenticated = auth_rhosts_rsa(authctxt, client_user,
190 client_host_key);
191 key_free(client_host_key);
192
Darren Tucker0acca372013-06-02 07:41:51 +1000193 auth_info(authctxt, "ruser %.100s", client_user);
Damien Miller94cf4c82005-07-17 17:04:47 +1000194
Damien Miller6abf57c2005-06-19 07:31:37 +1000195 return (authenticated);
196}
197
Damien Miller91d4b122006-03-26 14:05:20 +1100198/*ARGSUSED*/
Damien Miller6abf57c2005-06-19 07:31:37 +1000199static int
Darren Tucker0acca372013-06-02 07:41:51 +1000200auth1_process_tis_challenge(Authctxt *authctxt)
Damien Miller6abf57c2005-06-19 07:31:37 +1000201{
202 char *challenge;
Damien Miller46d38de2005-07-17 17:02:09 +1000203
Damien Miller6abf57c2005-06-19 07:31:37 +1000204 if ((challenge = get_challenge(authctxt)) == NULL)
205 return (0);
206
207 debug("sending challenge '%s'", challenge);
208 packet_start(SSH_SMSG_AUTH_TIS_CHALLENGE);
209 packet_put_cstring(challenge);
Darren Tuckera627d422013-06-02 07:31:17 +1000210 free(challenge);
Damien Miller6abf57c2005-06-19 07:31:37 +1000211 packet_send();
212 packet_write_wait();
213
214 return (-1);
215}
216
Damien Miller91d4b122006-03-26 14:05:20 +1100217/*ARGSUSED*/
Damien Miller6abf57c2005-06-19 07:31:37 +1000218static int
Darren Tucker0acca372013-06-02 07:41:51 +1000219auth1_process_tis_response(Authctxt *authctxt)
Damien Miller6abf57c2005-06-19 07:31:37 +1000220{
221 int authenticated = 0;
222 char *response;
223 u_int dlen;
224
225 response = packet_get_string(&dlen);
226 packet_check_eom();
227 authenticated = verify_response(authctxt, response);
Damien Millera5103f42014-02-04 11:20:14 +1100228 explicit_bzero(response, dlen);
Darren Tuckera627d422013-06-02 07:31:17 +1000229 free(response);
Damien Miller6abf57c2005-06-19 07:31:37 +1000230
231 return (authenticated);
Damien Millereba71ba2000-04-29 23:57:08 +1000232}
233
234/*
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000235 * read packets, try to authenticate the user and
236 * return only if authentication is successful
Damien Millereba71ba2000-04-29 23:57:08 +1000237 */
Ben Lindstrombba81212001-06-25 05:01:22 +0000238static void
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000239do_authloop(Authctxt *authctxt)
Damien Millereba71ba2000-04-29 23:57:08 +1000240{
Damien Miller874d77b2000-10-14 16:23:11 +1100241 int authenticated = 0;
Damien Miller6abf57c2005-06-19 07:31:37 +1000242 int prev = 0, type = 0;
243 const struct AuthMethod1 *meth;
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000244
245 debug("Attempting authentication for %s%.100s.",
Darren Tucker5cb30ad2004-08-12 22:40:24 +1000246 authctxt->valid ? "" : "invalid user ", authctxt->user);
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000247
248 /* If the user has no password, accept authentication immediately. */
Damien Millerbda3eca2010-06-26 10:01:33 +1000249 if (options.permit_empty_passwd && options.password_authentication &&
Darren Tucker6aaa58c2003-08-02 22:24:49 +1000250#ifdef KRB5
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000251 (!options.kerberos_authentication || options.kerberos_or_local_passwd) &&
252#endif
Ben Lindstrom7a2073c2002-03-22 02:30:41 +0000253 PRIVSEP(auth_password(authctxt, ""))) {
Darren Tuckera8c73d32004-06-23 09:17:54 +1000254#ifdef USE_PAM
255 if (options.use_pam && (PRIVSEP(do_pam_account())))
256#endif
257 {
Damien Miller15b05cf2012-12-03 09:53:20 +1100258 auth_log(authctxt, 1, 0, "without authentication",
Darren Tucker0acca372013-06-02 07:41:51 +1000259 NULL);
Darren Tuckera8c73d32004-06-23 09:17:54 +1000260 return;
261 }
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000262 }
Damien Millereba71ba2000-04-29 23:57:08 +1000263
264 /* Indicate that authentication is needed. */
265 packet_start(SSH_SMSG_FAILURE);
266 packet_send();
267 packet_write_wait();
268
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000269 for (;;) {
Damien Miller874d77b2000-10-14 16:23:11 +1100270 /* default to fail */
271 authenticated = 0;
272
Damien Millereba71ba2000-04-29 23:57:08 +1000273
274 /* Get a packet from the client. */
Damien Miller4f9f42a2003-05-10 19:28:02 +1000275 prev = type;
Damien Millerdff50992002-01-22 23:16:32 +1100276 type = packet_read();
Damien Millereba71ba2000-04-29 23:57:08 +1000277
Damien Miller4f9f42a2003-05-10 19:28:02 +1000278 /*
279 * If we started challenge-response authentication but the
280 * next packet is not a response to our challenge, release
281 * the resources allocated by get_challenge() (which would
282 * normally have been released by verify_response() had we
283 * received such a response)
284 */
285 if (prev == SSH_CMSG_AUTH_TIS &&
286 type != SSH_CMSG_AUTH_TIS_RESPONSE)
287 abandon_challenge_response(authctxt);
288
Damien Miller0b4d48b2008-07-05 09:44:53 +1000289 if (authctxt->failures >= options.max_authtries)
290 goto skip;
Damien Miller6abf57c2005-06-19 07:31:37 +1000291 if ((meth = lookup_authmethod1(type)) == NULL) {
292 logit("Unknown message during authentication: "
293 "type %d", type);
294 goto skip;
Damien Millereba71ba2000-04-29 23:57:08 +1000295 }
Damien Miller6abf57c2005-06-19 07:31:37 +1000296
297 if (!*(meth->enabled)) {
298 verbose("%s authentication disabled.", meth->name);
299 goto skip;
300 }
301
Darren Tucker0acca372013-06-02 07:41:51 +1000302 authenticated = meth->method(authctxt);
Damien Miller6abf57c2005-06-19 07:31:37 +1000303 if (authenticated == -1)
304 continue; /* "postponed" */
305
Damien Miller60396b02001-02-18 17:01:00 +1100306#ifdef BSD_AUTH
307 if (authctxt->as) {
308 auth_close(authctxt->as);
309 authctxt->as = NULL;
310 }
311#endif
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000312 if (!authctxt->valid && authenticated)
313 fatal("INTERNAL ERROR: authenticated invalid user %s",
314 authctxt->user);
Damien Millereba71ba2000-04-29 23:57:08 +1000315
Tim Rice81ed5182002-09-25 17:38:46 -0700316#ifdef _UNICOS
Tim Rice81ed5182002-09-25 17:38:46 -0700317 if (authenticated && cray_access_denied(authctxt->user)) {
318 authenticated = 0;
319 fatal("Access denied for user %s.",authctxt->user);
320 }
321#endif /* _UNICOS */
322
Darren Tucker9d86e5d2009-03-08 11:40:27 +1100323#ifndef HAVE_CYGWIN
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000324 /* Special handling for root */
Damien Miller556f9312003-02-24 11:59:26 +1100325 if (authenticated && authctxt->pw->pw_uid == 0 &&
Damien Miller6abf57c2005-06-19 07:31:37 +1000326 !auth_root_allowed(meth->name)) {
327 authenticated = 0;
Darren Tucker2e0cf0d2005-02-08 21:52:47 +1100328# ifdef SSH_AUDIT_EVENTS
329 PRIVSEP(audit_event(SSH_LOGIN_ROOT_DENIED));
Darren Tucker269a1ea2005-02-03 00:20:53 +1100330# endif
331 }
Ben Lindstrom5dc81502001-01-19 06:10:29 +0000332#endif
Damien Millereba71ba2000-04-29 23:57:08 +1000333
Damien Miller1f499fd2003-08-25 13:08:49 +1000334#ifdef USE_PAM
Damien Millera8e06ce2003-11-21 23:48:55 +1100335 if (options.use_pam && authenticated &&
Darren Tuckerc1386672004-12-03 14:33:47 +1100336 !PRIVSEP(do_pam_account())) {
337 char *msg;
338 size_t len;
339
340 error("Access denied for user %s by PAM account "
Damien Millerb6f72f52005-07-17 17:26:43 +1000341 "configuration", authctxt->user);
Darren Tuckerc1386672004-12-03 14:33:47 +1100342 len = buffer_len(&loginmsg);
343 buffer_append(&loginmsg, "\0", 1);
344 msg = buffer_ptr(&loginmsg);
345 /* strip trailing newlines */
346 if (len > 0)
347 while (len > 0 && msg[--len] == '\n')
348 msg[len] = '\0';
349 else
350 msg = "Access denied.";
Damien Miller773a7b92008-07-09 20:54:05 +1000351 packet_disconnect("%s", msg);
Darren Tuckerc1386672004-12-03 14:33:47 +1100352 }
Damien Miller1f499fd2003-08-25 13:08:49 +1000353#endif
354
Damien Miller6abf57c2005-06-19 07:31:37 +1000355 skip:
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000356 /* Log before sending the reply */
Darren Tucker0acca372013-06-02 07:41:51 +1000357 auth_log(authctxt, authenticated, 0, get_authname(type), NULL);
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000358
Darren Tuckera627d422013-06-02 07:31:17 +1000359 free(client_user);
360 client_user = NULL;
Damien Millereba71ba2000-04-29 23:57:08 +1000361
Damien Miller874d77b2000-10-14 16:23:11 +1100362 if (authenticated)
363 return;
364
Damien Miller0b4d48b2008-07-05 09:44:53 +1000365 if (++authctxt->failures >= options.max_authtries) {
Darren Tucker2e0cf0d2005-02-08 21:52:47 +1100366#ifdef SSH_AUDIT_EVENTS
367 PRIVSEP(audit_event(SSH_LOGIN_EXCEED_MAXTRIES));
Darren Tucker269a1ea2005-02-03 00:20:53 +1100368#endif
Damien Miller686feb52014-07-03 21:29:38 +1000369 auth_maxtries_exceeded(authctxt);
Darren Tucker269a1ea2005-02-03 00:20:53 +1100370 }
Damien Millereba71ba2000-04-29 23:57:08 +1000371
Damien Millereba71ba2000-04-29 23:57:08 +1000372 packet_start(SSH_SMSG_FAILURE);
373 packet_send();
374 packet_write_wait();
375 }
376}
377
378/*
379 * Performs authentication of an incoming connection. Session key has already
380 * been exchanged and encryption is enabled.
381 */
Darren Tucker3e33cec2003-10-02 16:12:36 +1000382void
383do_authentication(Authctxt *authctxt)
Damien Millereba71ba2000-04-29 23:57:08 +1000384{
Ben Lindstrom46c16222000-12-22 01:43:59 +0000385 u_int ulen;
Ben Lindstromc8226382002-04-10 16:22:09 +0000386 char *user, *style = NULL;
Damien Millereba71ba2000-04-29 23:57:08 +1000387
388 /* Get the name of the user that we wish to log in as. */
Damien Millerdff50992002-01-22 23:16:32 +1100389 packet_read_expect(SSH_CMSG_USER);
Damien Millereba71ba2000-04-29 23:57:08 +1000390
391 /* Get the user name. */
Damien Millerda108ec2010-08-31 22:36:39 +1000392 user = packet_get_cstring(&ulen);
Damien Miller48b03fc2002-01-22 23:11:40 +1100393 packet_check_eom();
Damien Millereba71ba2000-04-29 23:57:08 +1000394
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000395 if ((style = strchr(user, ':')) != NULL)
Ben Lindstromec95ed92001-07-04 04:21:14 +0000396 *style++ = '\0';
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000397
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000398 authctxt->user = user;
399 authctxt->style = style;
400
Damien Millereba71ba2000-04-29 23:57:08 +1000401 /* Verify that the user is a valid user. */
Ben Lindstrom7ebb6352002-03-22 03:04:08 +0000402 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000403 authctxt->valid = 1;
Damien Miller856f0be2003-09-03 07:32:45 +1000404 else {
Darren Tucker5cb30ad2004-08-12 22:40:24 +1000405 debug("do_authentication: invalid user %s", user);
Damien Miller856f0be2003-09-03 07:32:45 +1000406 authctxt->pw = fakepw();
407 }
Ben Lindstrom7a2073c2002-03-22 02:30:41 +0000408
Damien Millera6e3f012012-11-04 23:21:40 +1100409 /* Configuration may have changed as a result of Match */
410 if (options.num_auth_methods != 0)
411 fatal("AuthenticationMethods is not supported with SSH "
412 "protocol 1");
413
Damien Miller30d1f842004-07-21 20:48:53 +1000414 setproctitle("%s%s", authctxt->valid ? user : "unknown",
Ben Lindstrom7a2073c2002-03-22 02:30:41 +0000415 use_privsep ? " [net]" : "");
Ben Lindstromc1ba31f2001-02-15 03:14:11 +0000416
Damien Millereba71ba2000-04-29 23:57:08 +1000417#ifdef USE_PAM
Damien Miller4e448a32003-05-14 15:11:48 +1000418 if (options.use_pam)
Darren Tuckerdbf7a742004-03-08 23:04:06 +1100419 PRIVSEP(start_pam(authctxt));
Damien Millereba71ba2000-04-29 23:57:08 +1000420#endif
421
422 /*
423 * If we are not running as root, the user must have the same uid as
Damien Miller6abf57c2005-06-19 07:31:37 +1000424 * the server.
Damien Millereba71ba2000-04-29 23:57:08 +1000425 */
Damien Miller874d77b2000-10-14 16:23:11 +1100426#ifndef HAVE_CYGWIN
Ben Lindstrom7ebb6352002-03-22 03:04:08 +0000427 if (!use_privsep && getuid() != 0 && authctxt->pw &&
428 authctxt->pw->pw_uid != getuid())
Damien Millereba71ba2000-04-29 23:57:08 +1000429 packet_disconnect("Cannot change user when server not running as root.");
Damien Millerbac2d8a2000-09-05 16:13:06 +1100430#endif
Damien Millereba71ba2000-04-29 23:57:08 +1000431
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000432 /*
Kevin Steves12aaa042001-01-24 21:23:39 +0000433 * Loop until the user has been authenticated or the connection is
434 * closed, do_authloop() returns only if authentication is successful
435 */
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000436 do_authloop(authctxt);
Damien Millereba71ba2000-04-29 23:57:08 +1000437
438 /* The user has been authenticated and accepted. */
Damien Miller874d77b2000-10-14 16:23:11 +1100439 packet_start(SSH_SMSG_SUCCESS);
440 packet_send();
441 packet_write_wait();
Damien Millereba71ba2000-04-29 23:57:08 +1000442}
Damien Miller76c04802015-01-13 19:38:18 +1100443
444#endif /* WITH_SSH1 */