diff options
author | Damien Miller <djm@mindrot.org> | 2013-04-23 15:18:10 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2013-04-23 15:18:10 +1000 |
commit | 91a55f28f35431f9000b95815c343b5a18fda712 (patch) | |
tree | dc3339c3a51fd5f78776b0f80220e4c078f52cfb /auth2-chall.c | |
parent | 4ce189d9108c62090a0dd5dea973d175328440db (diff) |
- markus@cvs.openbsd.org 2013/03/07 19:27:25
[auth.h auth2-chall.c auth2.c monitor.c sshd_config.5]
add submethod support to AuthenticationMethods; ok and freedback djm@
Diffstat (limited to 'auth2-chall.c')
-rw-r--r-- | auth2-chall.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/auth2-chall.c b/auth2-chall.c index 6505d4009..ed1acdd3b 100644 --- a/auth2-chall.c +++ b/auth2-chall.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: auth2-chall.c,v 1.36 2012/12/03 00:14:06 djm Exp $ */ | 1 | /* $OpenBSD: auth2-chall.c,v 1.37 2013/03/07 19:27:25 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2001 Markus Friedl. All rights reserved. |
4 | * Copyright (c) 2001 Per Allansson. All rights reserved. | 4 | * Copyright (c) 2001 Per Allansson. All rights reserved. |
@@ -155,7 +155,7 @@ kbdint_free(KbdintAuthctxt *kbdintctxt) | |||
155 | } | 155 | } |
156 | /* get next device */ | 156 | /* get next device */ |
157 | static int | 157 | static int |
158 | kbdint_next_device(KbdintAuthctxt *kbdintctxt) | 158 | kbdint_next_device(Authctxt *authctxt, KbdintAuthctxt *kbdintctxt) |
159 | { | 159 | { |
160 | size_t len; | 160 | size_t len; |
161 | char *t; | 161 | char *t; |
@@ -169,9 +169,13 @@ kbdint_next_device(KbdintAuthctxt *kbdintctxt) | |||
169 | 169 | ||
170 | if (len == 0) | 170 | if (len == 0) |
171 | break; | 171 | break; |
172 | for (i = 0; devices[i]; i++) | 172 | for (i = 0; devices[i]; i++) { |
173 | if (!auth2_method_allowed(authctxt, | ||
174 | "keyboard-interactive", devices[i]->name)) | ||
175 | continue; | ||
173 | if (strncmp(kbdintctxt->devices, devices[i]->name, len) == 0) | 176 | if (strncmp(kbdintctxt->devices, devices[i]->name, len) == 0) |
174 | kbdintctxt->device = devices[i]; | 177 | kbdintctxt->device = devices[i]; |
178 | } | ||
175 | t = kbdintctxt->devices; | 179 | t = kbdintctxt->devices; |
176 | kbdintctxt->devices = t[len] ? xstrdup(t+len+1) : NULL; | 180 | kbdintctxt->devices = t[len] ? xstrdup(t+len+1) : NULL; |
177 | xfree(t); | 181 | xfree(t); |
@@ -221,7 +225,7 @@ auth2_challenge_start(Authctxt *authctxt) | |||
221 | debug2("auth2_challenge_start: devices %s", | 225 | debug2("auth2_challenge_start: devices %s", |
222 | kbdintctxt->devices ? kbdintctxt->devices : "<empty>"); | 226 | kbdintctxt->devices ? kbdintctxt->devices : "<empty>"); |
223 | 227 | ||
224 | if (kbdint_next_device(kbdintctxt) == 0) { | 228 | if (kbdint_next_device(authctxt, kbdintctxt) == 0) { |
225 | auth2_challenge_stop(authctxt); | 229 | auth2_challenge_stop(authctxt); |
226 | return 0; | 230 | return 0; |
227 | } | 231 | } |