]> andersk Git - openssh.git/blob - auth2.c
- stevesk@cvs.openbsd.org 2001/02/04 06:30:12
[openssh.git] / auth2.c
1 /*
2  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  */
24
25 #include "includes.h"
26 RCSID("$OpenBSD: auth2.c,v 1.36 2001/02/04 15:32:22 stevesk Exp $");
27
28 #ifdef HAVE_OSF_SIA
29 # include <sia.h>
30 # include <siad.h>
31 #endif
32
33 #include <openssl/evp.h>
34
35 #include "ssh2.h"
36 #include "xmalloc.h"
37 #include "rsa.h"
38 #include "pty.h"
39 #include "packet.h"
40 #include "buffer.h"
41 #include "log.h"
42 #include "servconf.h"
43 #include "compat.h"
44 #include "channels.h"
45 #include "bufaux.h"
46 #include "auth.h"
47 #include "session.h"
48 #include "dispatch.h"
49 #include "key.h"
50 #include "cipher.h"
51 #include "kex.h"
52 #include "pathnames.h"
53 #include "uidswap.h"
54 #include "auth-options.h"
55
56 /* import */
57 extern ServerOptions options;
58 extern u_char *session_id2;
59 extern int session_id2_len;
60
61 #ifdef WITH_AIXAUTHENTICATE
62 extern char *aixloginmsg;
63 #endif
64 #ifdef HAVE_OSF_SIA
65 extern int saved_argc;
66 extern char **saved_argv;
67 #endif
68
69 static Authctxt *x_authctxt = NULL;
70 static int one = 1;
71
72 typedef struct Authmethod Authmethod;
73 struct Authmethod {
74         char    *name;
75         int     (*userauth)(Authctxt *authctxt);
76         int     *enabled;
77 };
78
79 /* protocol */
80
81 void    input_service_request(int type, int plen, void *ctxt);
82 void    input_userauth_request(int type, int plen, void *ctxt);
83 void    protocol_error(int type, int plen, void *ctxt);
84
85 /* helper */
86 Authmethod      *authmethod_lookup(const char *name);
87 struct passwd   *pwcopy(struct passwd *pw);
88 int     user_key_allowed(struct passwd *pw, Key *key);
89 char    *authmethods_get(void);
90
91 /* auth */
92 void    userauth_banner(void);
93 int     userauth_none(Authctxt *authctxt);
94 int     userauth_passwd(Authctxt *authctxt);
95 int     userauth_pubkey(Authctxt *authctxt);
96 int     userauth_kbdint(Authctxt *authctxt);
97
98 Authmethod authmethods[] = {
99         {"none",
100                 userauth_none,
101                 &one},
102         {"publickey",
103                 userauth_pubkey,
104                 &options.pubkey_authentication},
105         {"keyboard-interactive",
106                 userauth_kbdint,
107                 &options.kbd_interactive_authentication},
108         {"password",
109                 userauth_passwd,
110                 &options.password_authentication},
111         {NULL, NULL, NULL}
112 };
113
114 /*
115  * loop until authctxt->success == TRUE
116  */
117
118 void
119 do_authentication2()
120 {
121         Authctxt *authctxt = authctxt_new();
122
123         x_authctxt = authctxt;          /*XXX*/
124
125         /* challenge-reponse is implemented via keyboard interactive */
126         if (options.challenge_reponse_authentication)
127                 options.kbd_interactive_authentication = 1;
128
129 #ifdef AFS
130         /* If machine has AFS, set process authentication group. */
131         if (k_hasafs()) {
132                 k_setpag();
133                 k_unlog();
134         }
135 #endif
136         dispatch_init(&protocol_error);
137         dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request);
138         dispatch_run(DISPATCH_BLOCK, &authctxt->success, authctxt);
139         do_authenticated2(authctxt);
140 }
141
142 void
143 protocol_error(int type, int plen, void *ctxt)
144 {
145         log("auth: protocol error: type %d plen %d", type, plen);
146         packet_start(SSH2_MSG_UNIMPLEMENTED);
147         packet_put_int(0);
148         packet_send();
149         packet_write_wait();
150 }
151
152 void
153 input_service_request(int type, int plen, void *ctxt)
154 {
155         Authctxt *authctxt = ctxt;
156         u_int len;
157         int accept = 0;
158         char *service = packet_get_string(&len);
159         packet_done();
160
161         if (authctxt == NULL)
162                 fatal("input_service_request: no authctxt");
163
164         if (strcmp(service, "ssh-userauth") == 0) {
165                 if (!authctxt->success) {
166                         accept = 1;
167                         /* now we can handle user-auth requests */
168                         dispatch_set(SSH2_MSG_USERAUTH_REQUEST, &input_userauth_request);
169                 }
170         }
171         /* XXX all other service requests are denied */
172
173         if (accept) {
174                 packet_start(SSH2_MSG_SERVICE_ACCEPT);
175                 packet_put_cstring(service);
176                 packet_send();
177                 packet_write_wait();
178         } else {
179                 debug("bad service request %s", service);
180                 packet_disconnect("bad service request %s", service);
181         }
182         xfree(service);
183 }
184
185 void
186 input_userauth_request(int type, int plen, void *ctxt)
187 {
188         Authctxt *authctxt = ctxt;
189         Authmethod *m = NULL;
190         char *user, *service, *method, *style = NULL;
191         int authenticated = 0;
192
193         if (authctxt == NULL)
194                 fatal("input_userauth_request: no authctxt");
195
196         user = packet_get_string(NULL);
197         service = packet_get_string(NULL);
198         method = packet_get_string(NULL);
199         debug("userauth-request for user %s service %s method %s", user, service, method);
200         debug("attempt %d failures %d", authctxt->attempt, authctxt->failures);
201
202         if ((style = strchr(user, ':')) != NULL)
203                 *style++ = 0;
204
205         if (authctxt->attempt++ == 0) {
206                 /* setup auth context */
207                 struct passwd *pw = NULL;
208                 setproctitle("%s", user);
209                 pw = getpwnam(user);
210                 if (pw && allowed_user(pw) && strcmp(service, "ssh-connection")==0) {
211                         authctxt->pw = pwcopy(pw);
212                         authctxt->valid = 1;
213                         debug2("input_userauth_request: setting up authctxt for %s", user);
214 #ifdef USE_PAM
215                         start_pam(pw->pw_name);
216 #endif
217                 } else {
218                         log("input_userauth_request: illegal user %s", user);
219 #ifdef USE_PAM
220                         start_pam("NOUSER");
221 #endif
222                 }
223                 authctxt->user = xstrdup(user);
224                 authctxt->service = xstrdup(service);
225                 authctxt->style = style ? xstrdup(style) : NULL; /* currently unused */
226         } else if (authctxt->valid) {
227                 if (strcmp(user, authctxt->user) != 0 ||
228                     strcmp(service, authctxt->service) != 0) {
229                         log("input_userauth_request: missmatch: (%s,%s)!=(%s,%s)",
230                             user, service, authctxt->user, authctxt->service);
231                         authctxt->valid = 0;
232                 }
233         }
234         /* reset state */
235         dispatch_set(SSH2_MSG_USERAUTH_INFO_RESPONSE, &protocol_error);
236         authctxt->postponed = 0;
237
238         /* try to authenticate user */
239         m = authmethod_lookup(method);
240         if (m != NULL) {
241                 debug2("input_userauth_request: try method %s", method);
242                 authenticated = m->userauth(authctxt);
243         }
244         if (!authctxt->valid && authenticated)
245                 fatal("INTERNAL ERROR: authenticated invalid user %s",
246                     authctxt->user);
247
248         /* Special handling for root */
249         if (authenticated && authctxt->pw->pw_uid == 0 && !auth_root_allowed())
250                 authenticated = 0;
251
252 #ifdef USE_PAM
253         if (authenticated && authctxt->user && !do_pam_account(authctxt->user, NULL))
254                 authenticated = 0;
255 #endif /* USE_PAM */
256
257         /* Log before sending the reply */
258         auth_log(authctxt, authenticated, method, " ssh2");
259
260         if (!authctxt->postponed)
261                 userauth_reply(authctxt, authenticated);
262
263         xfree(service);
264         xfree(user);
265         xfree(method);
266 }
267
268 void
269 userauth_banner(void)
270 {
271         struct stat st;
272         char *banner = NULL;
273         off_t len, n;
274         int fd;
275
276         if (options.banner == NULL || (datafellows & SSH_BUG_BANNER))
277                 return;
278         if ((fd = open(options.banner, O_RDONLY)) < 0) {
279                 error("userauth_banner: open %s failed: %s",
280                     options.banner, strerror(errno));
281                 return;
282         }
283         if (fstat(fd, &st) < 0)
284                 goto done;
285         len = st.st_size;
286         banner = xmalloc(len + 1);
287         if ((n = read(fd, banner, len)) < 0)
288                 goto done;
289         banner[n] = '\0';
290         packet_start(SSH2_MSG_USERAUTH_BANNER);
291         packet_put_cstring(banner);
292         packet_put_cstring("");         /* language, unused */
293         packet_send();
294         debug("userauth_banner: sent");
295 done:
296         if (banner)
297                 xfree(banner);
298         close(fd);
299         return;
300 }
301
302 void
303 userauth_reply(Authctxt *authctxt, int authenticated)
304 {
305         char *methods;
306
307         /* XXX todo: check if multiple auth methods are needed */
308         if (authenticated) {
309 #ifdef WITH_AIXAUTHENTICATE
310                 /* We don't have a pty yet, so just label the line as "ssh" */
311                 if (loginsuccess(authctxt->user?authctxt->user:"NOUSER",
312                     get_canonical_hostname(options.reverse_mapping_check),
313                     "ssh", &aixloginmsg) < 0)
314                         aixloginmsg = NULL;
315 #endif /* WITH_AIXAUTHENTICATE */
316                 /* turn off userauth */
317                 dispatch_set(SSH2_MSG_USERAUTH_REQUEST, &protocol_error);
318                 packet_start(SSH2_MSG_USERAUTH_SUCCESS);
319                 packet_send();
320                 packet_write_wait();
321                 /* now we can break out */
322                 authctxt->success = 1;
323         } else {
324                 if (authctxt->failures++ > AUTH_FAIL_MAX)
325                         packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
326                 methods = authmethods_get();
327                 packet_start(SSH2_MSG_USERAUTH_FAILURE);
328                 packet_put_cstring(methods);
329                 packet_put_char(0);     /* XXX partial success, unused */
330                 packet_send();
331                 packet_write_wait();
332                 xfree(methods);
333         }
334 }
335
336 int
337 userauth_none(Authctxt *authctxt)
338 {
339         /* disable method "none", only allowed one time */
340         Authmethod *m = authmethod_lookup("none");
341         if (m != NULL)
342                 m->enabled = NULL;
343         packet_done();
344         userauth_banner();
345
346         if (authctxt->valid == 0)
347                 return(0);
348
349 #ifdef HAVE_CYGWIN
350         if (check_nt_auth(1, authctxt->pw->pw_uid) == 0)
351                 return(0);
352 #endif
353 #ifdef USE_PAM
354         return auth_pam_password(authctxt->pw, "");
355 #elif defined(HAVE_OSF_SIA)
356         return (sia_validate_user(NULL, saved_argc, saved_argv,
357             get_canonical_hostname(options.reverse_mapping_check),
358             authctxt->user?authctxt->user:"NOUSER", NULL, 0,
359             NULL, "") == SIASUCCESS);
360 #else /* !HAVE_OSF_SIA && !USE_PAM */
361         return auth_password(authctxt->pw, "");
362 #endif /* USE_PAM */
363 }
364
365 int
366 userauth_passwd(Authctxt *authctxt)
367 {
368         char *password;
369         int authenticated = 0;
370         int change;
371         u_int len;
372         change = packet_get_char();
373         if (change)
374                 log("password change not supported");
375         password = packet_get_string(&len);
376         packet_done();
377         if (authctxt->valid &&
378 #ifdef HAVE_CYGWIN
379                 check_nt_auth(1, authctxt->pw->pw_uid) &&
380 #endif
381 #ifdef USE_PAM
382             auth_pam_password(authctxt->pw, password) == 1)
383 #elif defined(HAVE_OSF_SIA)
384             sia_validate_user(NULL, saved_argc, saved_argv,
385             get_canonical_hostname(options.reverse_mapping_check),
386             authctxt->user?authctxt->user:"NOUSER", NULL, 0, NULL,
387             password) == SIASUCCESS)
388 #else /* !USE_PAM && !HAVE_OSF_SIA */
389             auth_password(authctxt->pw, password) == 1)
390 #endif /* USE_PAM */
391                 authenticated = 1;
392         memset(password, 0, len);
393         xfree(password);
394         return authenticated;
395 }
396
397 int
398 userauth_kbdint(Authctxt *authctxt)
399 {
400         int authenticated = 0;
401         char *lang = NULL;
402         char *devs = NULL;
403
404         lang = packet_get_string(NULL);
405         devs = packet_get_string(NULL);
406         packet_done();
407
408         debug("keyboard-interactive language %s devs %s", lang, devs);
409
410         if (options.challenge_reponse_authentication)
411                 authenticated = auth2_challenge(authctxt, devs);
412
413 #ifdef USE_PAM
414         if (authenticated == 0)
415                 authenticated = auth2_pam(authctxt);
416 #endif
417         xfree(lang);
418         xfree(devs);
419 #ifdef HAVE_CYGWIN
420         if (check_nt_auth(0, authctxt->pw->pw_uid) == 0)
421                 return(0);
422 #endif
423         return authenticated;
424 }
425
426 int
427 userauth_pubkey(Authctxt *authctxt)
428 {
429         Buffer b;
430         Key *key;
431         char *pkalg, *pkblob, *sig;
432         u_int alen, blen, slen;
433         int have_sig, pktype;
434         int authenticated = 0;
435
436         if (!authctxt->valid) {
437                 debug2("userauth_pubkey: disabled because of invalid user");
438                 return 0;
439         }
440         have_sig = packet_get_char();
441         if (datafellows & SSH_BUG_PKAUTH) {
442                 debug2("userauth_pubkey: SSH_BUG_PKAUTH");
443                 /* no explicit pkalg given */
444                 pkblob = packet_get_string(&blen);
445                 buffer_init(&b);
446                 buffer_append(&b, pkblob, blen);
447                 /* so we have to extract the pkalg from the pkblob */
448                 pkalg = buffer_get_string(&b, &alen);
449                 buffer_free(&b);
450         } else {
451                 pkalg = packet_get_string(&alen);
452                 pkblob = packet_get_string(&blen);
453         }
454         pktype = key_type_from_name(pkalg);
455         if (pktype == KEY_UNSPEC) {
456                 /* this is perfectly legal */
457                 log("userauth_pubkey: unsupported public key algorithm: %s", pkalg);
458                 xfree(pkalg);
459                 xfree(pkblob);
460                 return 0;
461         }
462         key = key_from_blob(pkblob, blen);
463         if (key != NULL) {
464                 if (have_sig) {
465                         sig = packet_get_string(&slen);
466                         packet_done();
467                         buffer_init(&b);
468                         if (datafellows & SSH_OLD_SESSIONID) {
469                                 buffer_append(&b, session_id2, session_id2_len);
470                         } else {
471                                 buffer_put_string(&b, session_id2, session_id2_len);
472                         }
473                         /* reconstruct packet */
474                         buffer_put_char(&b, SSH2_MSG_USERAUTH_REQUEST);
475                         buffer_put_cstring(&b, authctxt->user);
476                         buffer_put_cstring(&b,
477                             datafellows & SSH_BUG_PKSERVICE ?
478                             "ssh-userauth" :
479                             authctxt->service);
480                         if (datafellows & SSH_BUG_PKAUTH) {
481                                 buffer_put_char(&b, have_sig);
482                         } else {
483                                 buffer_put_cstring(&b, "publickey");
484                                 buffer_put_char(&b, have_sig);
485                                 buffer_put_cstring(&b, key_ssh_name(key));
486                         }
487                         buffer_put_string(&b, pkblob, blen);
488 #ifdef DEBUG_PK
489                         buffer_dump(&b);
490 #endif
491                         /* test for correct signature */
492                         if (user_key_allowed(authctxt->pw, key) &&
493                             key_verify(key, sig, slen, buffer_ptr(&b), buffer_len(&b)) == 1)
494                                 authenticated = 1;
495                         buffer_clear(&b);
496                         xfree(sig);
497                 } else {
498                         debug("test whether pkalg/pkblob are acceptable");
499                         packet_done();
500
501                         /* XXX fake reply and always send PK_OK ? */
502                         /*
503                          * XXX this allows testing whether a user is allowed
504                          * to login: if you happen to have a valid pubkey this
505                          * message is sent. the message is NEVER sent at all
506                          * if a user is not allowed to login. is this an
507                          * issue? -markus
508                          */
509                         if (user_key_allowed(authctxt->pw, key)) {
510                                 packet_start(SSH2_MSG_USERAUTH_PK_OK);
511                                 packet_put_string(pkalg, alen);
512                                 packet_put_string(pkblob, blen);
513                                 packet_send();
514                                 packet_write_wait();
515                                 authenticated = -1;
516                         }
517                 }
518                 if (authenticated != 1)
519                         auth_clear_options();
520                 key_free(key);
521         }
522         debug2("userauth_pubkey: authenticated %d pkalg %s", authenticated, pkalg);
523         xfree(pkalg);
524         xfree(pkblob);
525 #ifdef HAVE_CYGWIN
526         if (check_nt_auth(0, authctxt->pw->pw_uid) == 0)
527                 return(0);
528 #endif
529         return authenticated;
530 }
531
532 /* get current user */
533
534 struct passwd*
535 auth_get_user(void)
536 {
537         return (x_authctxt != NULL && x_authctxt->valid) ? x_authctxt->pw : NULL;
538 }
539
540 #define DELIM   ","
541
542 char *
543 authmethods_get(void)
544 {
545         Authmethod *method = NULL;
546         u_int size = 0;
547         char *list;
548
549         for (method = authmethods; method->name != NULL; method++) {
550                 if (strcmp(method->name, "none") == 0)
551                         continue;
552                 if (method->enabled != NULL && *(method->enabled) != 0) {
553                         if (size != 0)
554                                 size += strlen(DELIM);
555                         size += strlen(method->name);
556                 }
557         }
558         size++;                 /* trailing '\0' */
559         list = xmalloc(size);
560         list[0] = '\0';
561
562         for (method = authmethods; method->name != NULL; method++) {
563                 if (strcmp(method->name, "none") == 0)
564                         continue;
565                 if (method->enabled != NULL && *(method->enabled) != 0) {
566                         if (list[0] != '\0')
567                                 strlcat(list, DELIM, size);
568                         strlcat(list, method->name, size);
569                 }
570         }
571         return list;
572 }
573
574 Authmethod *
575 authmethod_lookup(const char *name)
576 {
577         Authmethod *method = NULL;
578         if (name != NULL)
579                 for (method = authmethods; method->name != NULL; method++)
580                         if (method->enabled != NULL &&
581                             *(method->enabled) != 0 &&
582                             strcmp(name, method->name) == 0)
583                                 return method;
584         debug2("Unrecognized authentication method name: %s", name ? name : "NULL");
585         return NULL;
586 }
587
588 /* return 1 if user allows given key */
589 int
590 user_key_allowed(struct passwd *pw, Key *key)
591 {
592         char line[8192], file[MAXPATHLEN];
593         int found_key = 0;
594         FILE *f;
595         u_long linenum = 0;
596         struct stat st;
597         Key *found;
598
599         if (pw == NULL)
600                 return 0;
601
602         /* Temporarily use the user's uid. */
603         temporarily_use_uid(pw->pw_uid);
604
605         /* The authorized keys. */
606         snprintf(file, sizeof file, "%.500s/%.100s", pw->pw_dir,
607             _PATH_SSH_USER_PERMITTED_KEYS2);
608
609         /* Fail quietly if file does not exist */
610         if (stat(file, &st) < 0) {
611                 /* Restore the privileged uid. */
612                 restore_uid();
613                 return 0;
614         }
615         /* Open the file containing the authorized keys. */
616         f = fopen(file, "r");
617         if (!f) {
618                 /* Restore the privileged uid. */
619                 restore_uid();
620                 return 0;
621         }
622         if (options.strict_modes) {
623                 int fail = 0;
624                 char buf[1024];
625                 /* Check open file in order to avoid open/stat races */
626                 if (fstat(fileno(f), &st) < 0 ||
627                     (st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
628                     (st.st_mode & 022) != 0) {
629                         snprintf(buf, sizeof buf,
630                             "%s authentication refused for %.100s: "
631                             "bad ownership or modes for '%s'.",
632                             key_type(key), pw->pw_name, file);
633                         fail = 1;
634                 } else {
635                         /* Check path to _PATH_SSH_USER_PERMITTED_KEYS */
636                         int i;
637                         static const char *check[] = {
638                                 "", _PATH_SSH_USER_DIR, NULL
639                         };
640                         for (i = 0; check[i]; i++) {
641                                 snprintf(line, sizeof line, "%.500s/%.100s",
642                                     pw->pw_dir, check[i]);
643                                 if (stat(line, &st) < 0 ||
644                                     (st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
645                                     (st.st_mode & 022) != 0) {
646                                         snprintf(buf, sizeof buf,
647                                             "%s authentication refused for %.100s: "
648                                             "bad ownership or modes for '%s'.",
649                                             key_type(key), pw->pw_name, line);
650                                         fail = 1;
651                                         break;
652                                 }
653                         }
654                 }
655                 if (fail) {
656                         fclose(f);
657                         log("%s",buf);
658                         restore_uid();
659                         return 0;
660                 }
661         }
662         found_key = 0;
663         found = key_new(key->type);
664
665         while (fgets(line, sizeof(line), f)) {
666                 char *cp, *options = NULL;
667                 linenum++;
668                 /* Skip leading whitespace, empty and comment lines. */
669                 for (cp = line; *cp == ' ' || *cp == '\t'; cp++)
670                         ;
671                 if (!*cp || *cp == '\n' || *cp == '#')
672                         continue;
673
674                 if (key_read(found, &cp) == -1) {
675                         /* no key?  check if there are options for this key */
676                         int quoted = 0;
677                         debug2("user_key_allowed: check options: '%s'", cp);
678                         options = cp;
679                         for (; *cp && (quoted || (*cp != ' ' && *cp != '\t')); cp++) {
680                                 if (*cp == '\\' && cp[1] == '"')
681                                         cp++;   /* Skip both */
682                                 else if (*cp == '"')
683                                         quoted = !quoted;
684                         }
685                         /* Skip remaining whitespace. */
686                         for (; *cp == ' ' || *cp == '\t'; cp++)
687                                 ;
688                         if (key_read(found, &cp) == -1) {
689                                 debug2("user_key_allowed: advance: '%s'", cp);
690                                 /* still no key?  advance to next line*/
691                                 continue;
692                         }
693                 }
694                 if (key_equal(found, key) &&
695                     auth_parse_options(pw, options, file, linenum) == 1) {
696                         found_key = 1;
697                         debug("matching key found: file %s, line %ld",
698                             file, linenum);
699                         break;
700                 }
701         }
702         restore_uid();
703         fclose(f);
704         key_free(found);
705         return found_key;
706 }
This page took 0.139204 seconds and 5 git commands to generate.