summaryrefslogtreecommitdiff
path: root/auth2-pubkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth2-pubkey.c')
-rw-r--r--auth2-pubkey.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/auth2-pubkey.c b/auth2-pubkey.c
index 7d2141355..137887ecd 100644
--- a/auth2-pubkey.c
+++ b/auth2-pubkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-pubkey.c,v 1.27 2010/11/20 05:12:38 deraadt Exp $ */ 1/* $OpenBSD: auth2-pubkey.c,v 1.29 2011/05/23 03:30:07 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -436,7 +436,7 @@ user_cert_trusted_ca(struct passwd *pw, Key *key)
436int 436int
437user_key_allowed(struct passwd *pw, Key *key) 437user_key_allowed(struct passwd *pw, Key *key)
438{ 438{
439 int success; 439 u_int success, i;
440 char *file; 440 char *file;
441 441
442 if (auth_key_is_revoked(key)) 442 if (auth_key_is_revoked(key))
@@ -448,16 +448,13 @@ user_key_allowed(struct passwd *pw, Key *key)
448 if (success) 448 if (success)
449 return success; 449 return success;
450 450
451 file = authorized_keys_file(pw); 451 for (i = 0; !success && i < options.num_authkeys_files; i++) {
452 success = user_key_allowed2(pw, key, file); 452 file = expand_authorized_keys(
453 xfree(file); 453 options.authorized_keys_files[i], pw);
454 if (success) 454 success = user_key_allowed2(pw, key, file);
455 return success; 455 xfree(file);
456 }
456 457
457 /* try suffix "2" for backward compat, too */
458 file = authorized_keys_file2(pw);
459 success = user_key_allowed2(pw, key, file);
460 xfree(file);
461 return success; 458 return success;
462} 459}
463 460