blob: 11c8d31b35666cf288c263dbc81c49221bd9400b [file] [log] [blame]
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +00001/* $OpenBSD: auth2-chall.c,v 1.48 2017/05/30 14:29:59 markus Exp $ */
Ben Lindstromdb65e8f2001-01-19 04:26:52 +00002/*
Ben Lindstrom92a2e382001-03-05 06:59:27 +00003 * Copyright (c) 2001 Markus Friedl. All rights reserved.
Ben Lindstrom551ea372001-06-05 18:56:16 +00004 * Copyright (c) 2001 Per Allansson. All rights reserved.
Ben Lindstromdb65e8f2001-01-19 04:26:52 +00005 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
Damien Millerd7834352006-08-05 12:39:39 +100026
Ben Lindstromdb65e8f2001-01-19 04:26:52 +000027#include "includes.h"
Ben Lindstromdb65e8f2001-01-19 04:26:52 +000028
Damien Millerd7834352006-08-05 12:39:39 +100029#include <sys/types.h>
30
Damien Millerded319c2006-09-01 15:38:36 +100031#include <stdarg.h>
Damien Millera7a73ee2006-08-05 11:37:59 +100032#include <stdio.h>
Damien Millere3476ed2006-07-24 14:13:33 +100033#include <string.h>
34
Damien Millerd7834352006-08-05 12:39:39 +100035#include "xmalloc.h"
Ben Lindstromdb65e8f2001-01-19 04:26:52 +000036#include "ssh2.h"
Damien Millerd7834352006-08-05 12:39:39 +100037#include "key.h"
38#include "hostfile.h"
Ben Lindstromdb65e8f2001-01-19 04:26:52 +000039#include "auth.h"
Damien Miller0e3b8722002-01-22 23:26:38 +110040#include "buffer.h"
Ben Lindstromdb65e8f2001-01-19 04:26:52 +000041#include "packet.h"
Ben Lindstromdb65e8f2001-01-19 04:26:52 +000042#include "dispatch.h"
Ben Lindstrom226cfa02001-01-22 05:34:40 +000043#include "log.h"
Damien Miller7acefbb2014-07-18 14:11:24 +100044#include "misc.h"
Darren Tucker3c660802005-01-20 22:20:50 +110045#include "servconf.h"
46
47/* import */
48extern ServerOptions options;
Ben Lindstromdb65e8f2001-01-19 04:26:52 +000049
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +000050static int auth2_challenge_start(struct ssh *);
Ben Lindstrombba81212001-06-25 05:01:22 +000051static int send_userauth_info_request(Authctxt *);
markus@openbsd.org2ae666a2017-05-30 14:23:52 +000052static int input_userauth_info_response(int, u_int32_t, struct ssh *);
Ben Lindstrom551ea372001-06-05 18:56:16 +000053
54#ifdef BSD_AUTH
55extern KbdintDevice bsdauth_device;
56#else
Damien Miller4f9f42a2003-05-10 19:28:02 +100057#ifdef USE_PAM
58extern KbdintDevice sshpam_device;
59#endif
Ben Lindstrom551ea372001-06-05 18:56:16 +000060#ifdef SKEY
61extern KbdintDevice skey_device;
62#endif
63#endif
64
65KbdintDevice *devices[] = {
66#ifdef BSD_AUTH
67 &bsdauth_device,
68#else
Damien Miller4f9f42a2003-05-10 19:28:02 +100069#ifdef USE_PAM
70 &sshpam_device,
71#endif
Ben Lindstrom551ea372001-06-05 18:56:16 +000072#ifdef SKEY
73 &skey_device,
74#endif
75#endif
76 NULL
77};
78
79typedef struct KbdintAuthctxt KbdintAuthctxt;
80struct KbdintAuthctxt
81{
82 char *devices;
83 void *ctxt;
84 KbdintDevice *device;
Damien Millerfb7fd952002-06-26 23:58:39 +100085 u_int nreq;
djm@openbsd.org5b64f852015-07-18 07:57:14 +000086 u_int devices_done;
Ben Lindstrom551ea372001-06-05 18:56:16 +000087};
88
Darren Tucker3c660802005-01-20 22:20:50 +110089#ifdef USE_PAM
90void
91remove_kbdint_device(const char *devname)
92{
93 int i, j;
94
95 for (i = 0; devices[i] != NULL; i++)
96 if (strcmp(devices[i]->name, devname) == 0) {
97 for (j = i; devices[j] != NULL; j++)
98 devices[j] = devices[j+1];
99 i--;
100 }
101}
102#endif
103
Ben Lindstrombba81212001-06-25 05:01:22 +0000104static KbdintAuthctxt *
Ben Lindstrom551ea372001-06-05 18:56:16 +0000105kbdint_alloc(const char *devs)
106{
107 KbdintAuthctxt *kbdintctxt;
Damien Miller0e3b8722002-01-22 23:26:38 +1100108 Buffer b;
Ben Lindstrom551ea372001-06-05 18:56:16 +0000109 int i;
Ben Lindstrom551ea372001-06-05 18:56:16 +0000110
Darren Tucker3c660802005-01-20 22:20:50 +1100111#ifdef USE_PAM
112 if (!options.use_pam)
113 remove_kbdint_device("pam");
114#endif
115
Damien Miller6c81fee2013-11-08 12:19:55 +1100116 kbdintctxt = xcalloc(1, sizeof(KbdintAuthctxt));
Ben Lindstrom551ea372001-06-05 18:56:16 +0000117 if (strcmp(devs, "") == 0) {
Damien Miller0e3b8722002-01-22 23:26:38 +1100118 buffer_init(&b);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000119 for (i = 0; devices[i]; i++) {
Damien Miller0e3b8722002-01-22 23:26:38 +1100120 if (buffer_len(&b) > 0)
121 buffer_append(&b, ",", 1);
122 buffer_append(&b, devices[i]->name,
123 strlen(devices[i]->name));
Ben Lindstrom551ea372001-06-05 18:56:16 +0000124 }
djm@openbsd.org1a31d022016-05-02 08:49:03 +0000125 if ((kbdintctxt->devices = sshbuf_dup_string(&b)) == NULL)
126 fatal("%s: sshbuf_dup_string failed", __func__);
Damien Miller0e3b8722002-01-22 23:26:38 +1100127 buffer_free(&b);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000128 } else {
129 kbdintctxt->devices = xstrdup(devs);
130 }
Damien Miller0e3b8722002-01-22 23:26:38 +1100131 debug("kbdint_alloc: devices '%s'", kbdintctxt->devices);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000132 kbdintctxt->ctxt = NULL;
133 kbdintctxt->device = NULL;
Damien Millerfb7fd952002-06-26 23:58:39 +1000134 kbdintctxt->nreq = 0;
Ben Lindstrom551ea372001-06-05 18:56:16 +0000135
136 return kbdintctxt;
137}
Ben Lindstrombba81212001-06-25 05:01:22 +0000138static void
Ben Lindstrom551ea372001-06-05 18:56:16 +0000139kbdint_reset_device(KbdintAuthctxt *kbdintctxt)
140{
141 if (kbdintctxt->ctxt) {
142 kbdintctxt->device->free_ctx(kbdintctxt->ctxt);
143 kbdintctxt->ctxt = NULL;
144 }
145 kbdintctxt->device = NULL;
146}
Ben Lindstrombba81212001-06-25 05:01:22 +0000147static void
Ben Lindstrom551ea372001-06-05 18:56:16 +0000148kbdint_free(KbdintAuthctxt *kbdintctxt)
149{
150 if (kbdintctxt->device)
151 kbdint_reset_device(kbdintctxt);
Darren Tuckera627d422013-06-02 07:31:17 +1000152 free(kbdintctxt->devices);
Damien Miller1d2c4562014-02-04 11:18:20 +1100153 explicit_bzero(kbdintctxt, sizeof(*kbdintctxt));
Darren Tuckera627d422013-06-02 07:31:17 +1000154 free(kbdintctxt);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000155}
156/* get next device */
Ben Lindstrombba81212001-06-25 05:01:22 +0000157static int
Damien Miller91a55f22013-04-23 15:18:10 +1000158kbdint_next_device(Authctxt *authctxt, KbdintAuthctxt *kbdintctxt)
Ben Lindstrom551ea372001-06-05 18:56:16 +0000159{
160 size_t len;
161 char *t;
162 int i;
163
164 if (kbdintctxt->device)
165 kbdint_reset_device(kbdintctxt);
166 do {
167 len = kbdintctxt->devices ?
168 strcspn(kbdintctxt->devices, ",") : 0;
169
170 if (len == 0)
171 break;
Damien Miller91a55f22013-04-23 15:18:10 +1000172 for (i = 0; devices[i]; i++) {
djm@openbsd.org5b64f852015-07-18 07:57:14 +0000173 if ((kbdintctxt->devices_done & (1 << i)) != 0 ||
174 !auth2_method_allowed(authctxt,
Damien Miller91a55f22013-04-23 15:18:10 +1000175 "keyboard-interactive", devices[i]->name))
176 continue;
djm@openbsd.org5b64f852015-07-18 07:57:14 +0000177 if (strncmp(kbdintctxt->devices, devices[i]->name,
178 len) == 0) {
Ben Lindstrom551ea372001-06-05 18:56:16 +0000179 kbdintctxt->device = devices[i];
djm@openbsd.org5b64f852015-07-18 07:57:14 +0000180 kbdintctxt->devices_done |= 1 << i;
181 }
Damien Miller91a55f22013-04-23 15:18:10 +1000182 }
Ben Lindstrom551ea372001-06-05 18:56:16 +0000183 t = kbdintctxt->devices;
184 kbdintctxt->devices = t[len] ? xstrdup(t+len+1) : NULL;
Darren Tuckera627d422013-06-02 07:31:17 +1000185 free(t);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000186 debug2("kbdint_next_device: devices %s", kbdintctxt->devices ?
Damien Miller0dc1bef2005-07-17 17:22:45 +1000187 kbdintctxt->devices : "<empty>");
Ben Lindstrom551ea372001-06-05 18:56:16 +0000188 } while (kbdintctxt->devices && !kbdintctxt->device);
189
190 return kbdintctxt->device ? 1 : 0;
191}
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000192
193/*
Ben Lindstrombdfb4df2001-10-03 17:12:43 +0000194 * try challenge-response, set authctxt->postponed if we have to
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000195 * wait for the response.
196 */
197int
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000198auth2_challenge(struct ssh *ssh, char *devs)
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000199{
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000200 Authctxt *authctxt = ssh->authctxt;
Ben Lindstrom551ea372001-06-05 18:56:16 +0000201 debug("auth2_challenge: user=%s devs=%s",
202 authctxt->user ? authctxt->user : "<nouser>",
203 devs ? devs : "<no devs>");
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000204
Ben Lindstrom742e89e2001-06-09 01:17:23 +0000205 if (authctxt->user == NULL || !devs)
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000206 return 0;
Damien Miller9f0f5c62001-12-21 14:45:46 +1100207 if (authctxt->kbdintctxt == NULL)
Ben Lindstrom551ea372001-06-05 18:56:16 +0000208 authctxt->kbdintctxt = kbdint_alloc(devs);
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000209 return auth2_challenge_start(ssh);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000210}
211
Damien Milleree116252001-12-21 12:42:34 +1100212/* unregister kbd-int callbacks and context */
213void
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000214auth2_challenge_stop(struct ssh *ssh)
Damien Milleree116252001-12-21 12:42:34 +1100215{
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000216 Authctxt *authctxt = ssh->authctxt;
Damien Milleree116252001-12-21 12:42:34 +1100217 /* unregister callback */
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000218 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_INFO_RESPONSE, NULL);
Damien Miller80163902007-01-05 16:30:16 +1100219 if (authctxt->kbdintctxt != NULL) {
Damien Milleree116252001-12-21 12:42:34 +1100220 kbdint_free(authctxt->kbdintctxt);
221 authctxt->kbdintctxt = NULL;
222 }
223}
224
Ben Lindstrom551ea372001-06-05 18:56:16 +0000225/* side effect: sets authctxt->postponed if a reply was sent*/
226static int
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000227auth2_challenge_start(struct ssh *ssh)
Ben Lindstrom551ea372001-06-05 18:56:16 +0000228{
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000229 Authctxt *authctxt = ssh->authctxt;
Ben Lindstrom551ea372001-06-05 18:56:16 +0000230 KbdintAuthctxt *kbdintctxt = authctxt->kbdintctxt;
231
232 debug2("auth2_challenge_start: devices %s",
233 kbdintctxt->devices ? kbdintctxt->devices : "<empty>");
234
Damien Miller91a55f22013-04-23 15:18:10 +1000235 if (kbdint_next_device(authctxt, kbdintctxt) == 0) {
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000236 auth2_challenge_stop(ssh);
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000237 return 0;
Ben Lindstrom551ea372001-06-05 18:56:16 +0000238 }
239 debug("auth2_challenge_start: trying authentication method '%s'",
240 kbdintctxt->device->name);
241
242 if ((kbdintctxt->ctxt = kbdintctxt->device->init_ctx(authctxt)) == NULL) {
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000243 auth2_challenge_stop(ssh);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000244 return 0;
245 }
246 if (send_userauth_info_request(authctxt) == 0) {
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000247 auth2_challenge_stop(ssh);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000248 return 0;
249 }
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000250 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_INFO_RESPONSE,
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000251 &input_userauth_info_response);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000252
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000253 authctxt->postponed = 1;
254 return 0;
255}
256
Ben Lindstrom551ea372001-06-05 18:56:16 +0000257static int
258send_userauth_info_request(Authctxt *authctxt)
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000259{
Ben Lindstrom551ea372001-06-05 18:56:16 +0000260 KbdintAuthctxt *kbdintctxt;
261 char *name, *instr, **prompts;
Damien Millereccb9de2005-06-17 12:59:34 +1000262 u_int i, *echo_on;
Ben Lindstrom551ea372001-06-05 18:56:16 +0000263
264 kbdintctxt = authctxt->kbdintctxt;
265 if (kbdintctxt->device->query(kbdintctxt->ctxt,
Damien Millerfb7fd952002-06-26 23:58:39 +1000266 &name, &instr, &kbdintctxt->nreq, &prompts, &echo_on))
Ben Lindstrom551ea372001-06-05 18:56:16 +0000267 return 0;
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000268
269 packet_start(SSH2_MSG_USERAUTH_INFO_REQUEST);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000270 packet_put_cstring(name);
271 packet_put_cstring(instr);
Ben Lindstromcb72e4f2002-06-21 00:41:51 +0000272 packet_put_cstring(""); /* language not used */
Damien Millerfb7fd952002-06-26 23:58:39 +1000273 packet_put_int(kbdintctxt->nreq);
274 for (i = 0; i < kbdintctxt->nreq; i++) {
Ben Lindstrom551ea372001-06-05 18:56:16 +0000275 packet_put_cstring(prompts[i]);
276 packet_put_char(echo_on[i]);
277 }
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000278 packet_send();
279 packet_write_wait();
Ben Lindstrom551ea372001-06-05 18:56:16 +0000280
Damien Millerfb7fd952002-06-26 23:58:39 +1000281 for (i = 0; i < kbdintctxt->nreq; i++)
Darren Tuckera627d422013-06-02 07:31:17 +1000282 free(prompts[i]);
283 free(prompts);
284 free(echo_on);
285 free(name);
286 free(instr);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000287 return 1;
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000288}
289
markus@openbsd.org3fdc88a2015-01-19 20:07:45 +0000290static int
markus@openbsd.org2ae666a2017-05-30 14:23:52 +0000291input_userauth_info_response(int type, u_int32_t seq, struct ssh *ssh)
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000292{
markus@openbsd.org5f4082d2017-05-30 14:18:15 +0000293 Authctxt *authctxt = ssh->authctxt;
Ben Lindstrom551ea372001-06-05 18:56:16 +0000294 KbdintAuthctxt *kbdintctxt;
Damien Millerc30def92009-01-28 16:13:39 +1100295 int authenticated = 0, res;
Damien Millereccb9de2005-06-17 12:59:34 +1000296 u_int i, nresp;
Damien Miller55aca022012-12-03 11:25:30 +1100297 const char *devicename = NULL;
298 char **response = NULL;
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000299
300 if (authctxt == NULL)
301 fatal("input_userauth_info_response: no authctxt");
Ben Lindstrom551ea372001-06-05 18:56:16 +0000302 kbdintctxt = authctxt->kbdintctxt;
303 if (kbdintctxt == NULL || kbdintctxt->ctxt == NULL)
304 fatal("input_userauth_info_response: no kbdintctxt");
305 if (kbdintctxt->device == NULL)
306 fatal("input_userauth_info_response: no device");
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000307
308 authctxt->postponed = 0; /* reset */
309 nresp = packet_get_int();
Damien Millerfb7fd952002-06-26 23:58:39 +1000310 if (nresp != kbdintctxt->nreq)
311 fatal("input_userauth_info_response: wrong number of replies");
312 if (nresp > 100)
313 fatal("input_userauth_info_response: too many replies");
Ben Lindstrom551ea372001-06-05 18:56:16 +0000314 if (nresp > 0) {
Damien Miller07d86be2006-03-26 14:19:21 +1100315 response = xcalloc(nresp, sizeof(char *));
Ben Lindstrom551ea372001-06-05 18:56:16 +0000316 for (i = 0; i < nresp; i++)
317 response[i] = packet_get_string(NULL);
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000318 }
Damien Miller48b03fc2002-01-22 23:11:40 +1100319 packet_check_eom();
Ben Lindstrom551ea372001-06-05 18:56:16 +0000320
Darren Tucker611649e2005-01-20 11:05:34 +1100321 res = kbdintctxt->device->respond(kbdintctxt->ctxt, nresp, response);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000322
323 for (i = 0; i < nresp; i++) {
Damien Millera5103f42014-02-04 11:20:14 +1100324 explicit_bzero(response[i], strlen(response[i]));
Darren Tuckera627d422013-06-02 07:31:17 +1000325 free(response[i]);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000326 }
Darren Tuckera627d422013-06-02 07:31:17 +1000327 free(response);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000328
329 switch (res) {
330 case 0:
331 /* Success! */
Darren Tucker611649e2005-01-20 11:05:34 +1100332 authenticated = authctxt->valid ? 1 : 0;
Ben Lindstrom551ea372001-06-05 18:56:16 +0000333 break;
334 case 1:
335 /* Authentication needs further interaction */
Damien Milleree116252001-12-21 12:42:34 +1100336 if (send_userauth_info_request(authctxt) == 1)
337 authctxt->postponed = 1;
Ben Lindstrom551ea372001-06-05 18:56:16 +0000338 break;
339 default:
340 /* Failure! */
341 break;
342 }
Damien Miller15b05cf2012-12-03 09:53:20 +1100343 devicename = kbdintctxt->device->name;
Ben Lindstrom551ea372001-06-05 18:56:16 +0000344 if (!authctxt->postponed) {
Ben Lindstrom551ea372001-06-05 18:56:16 +0000345 if (authenticated) {
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000346 auth2_challenge_stop(ssh);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000347 } else {
348 /* start next device */
349 /* may set authctxt->postponed */
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000350 auth2_challenge_start(ssh);
Ben Lindstrom551ea372001-06-05 18:56:16 +0000351 }
352 }
markus@openbsd.orgeb272ea2017-05-30 14:29:59 +0000353 userauth_finish(ssh, authenticated, "keyboard-interactive",
Damien Miller15b05cf2012-12-03 09:53:20 +1100354 devicename);
markus@openbsd.org3fdc88a2015-01-19 20:07:45 +0000355 return 0;
Ben Lindstromdb65e8f2001-01-19 04:26:52 +0000356}
Ben Lindstrom7a2073c2002-03-22 02:30:41 +0000357
358void
359privsep_challenge_enable(void)
360{
Damien Millera6a7c192003-05-26 21:36:13 +1000361#if defined(BSD_AUTH) || defined(USE_PAM) || defined(SKEY)
362 int n = 0;
363#endif
Ben Lindstrom7a2073c2002-03-22 02:30:41 +0000364#ifdef BSD_AUTH
365 extern KbdintDevice mm_bsdauth_device;
366#endif
Damien Miller4f9f42a2003-05-10 19:28:02 +1000367#ifdef USE_PAM
368 extern KbdintDevice mm_sshpam_device;
369#endif
Ben Lindstrom7a2073c2002-03-22 02:30:41 +0000370#ifdef SKEY
371 extern KbdintDevice mm_skey_device;
372#endif
Damien Miller4f9f42a2003-05-10 19:28:02 +1000373
Ben Lindstrom7a2073c2002-03-22 02:30:41 +0000374#ifdef BSD_AUTH
Damien Miller4f9f42a2003-05-10 19:28:02 +1000375 devices[n++] = &mm_bsdauth_device;
Ben Lindstrom7a2073c2002-03-22 02:30:41 +0000376#else
Damien Miller4f9f42a2003-05-10 19:28:02 +1000377#ifdef USE_PAM
378 devices[n++] = &mm_sshpam_device;
379#endif
Ben Lindstrom7a2073c2002-03-22 02:30:41 +0000380#ifdef SKEY
Damien Miller4f9f42a2003-05-10 19:28:02 +1000381 devices[n++] = &mm_skey_device;
Ben Lindstrom7a2073c2002-03-22 02:30:41 +0000382#endif
383#endif
384}