summaryrefslogtreecommitdiff
path: root/auth2-chall.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth2-chall.c')
-rw-r--r--auth2-chall.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/auth2-chall.c b/auth2-chall.c
index f5f2f1477..4e2b1e856 100644
--- a/auth2-chall.c
+++ b/auth2-chall.c
@@ -23,7 +23,7 @@
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth2-chall.c,v 1.21 2004/06/01 14:20:45 dtucker Exp $"); 26RCSID("$OpenBSD: auth2-chall.c,v 1.22 2005/01/19 13:11:47 dtucker Exp $");
27 27
28#include "ssh2.h" 28#include "ssh2.h"
29#include "auth.h" 29#include "auth.h"
@@ -32,6 +32,10 @@ RCSID("$OpenBSD: auth2-chall.c,v 1.21 2004/06/01 14:20:45 dtucker Exp $");
32#include "xmalloc.h" 32#include "xmalloc.h"
33#include "dispatch.h" 33#include "dispatch.h"
34#include "log.h" 34#include "log.h"
35#include "servconf.h"
36
37/* import */
38extern ServerOptions options;
35 39
36static int auth2_challenge_start(Authctxt *); 40static int auth2_challenge_start(Authctxt *);
37static int send_userauth_info_request(Authctxt *); 41static int send_userauth_info_request(Authctxt *);
@@ -71,6 +75,21 @@ struct KbdintAuthctxt
71 u_int nreq; 75 u_int nreq;
72}; 76};
73 77
78#ifdef USE_PAM
79void
80remove_kbdint_device(const char *devname)
81{
82 int i, j;
83
84 for (i = 0; devices[i] != NULL; i++)
85 if (strcmp(devices[i]->name, devname) == 0) {
86 for (j = i; devices[j] != NULL; j++)
87 devices[j] = devices[j+1];
88 i--;
89 }
90}
91#endif
92
74static KbdintAuthctxt * 93static KbdintAuthctxt *
75kbdint_alloc(const char *devs) 94kbdint_alloc(const char *devs)
76{ 95{
@@ -78,6 +97,11 @@ kbdint_alloc(const char *devs)
78 Buffer b; 97 Buffer b;
79 int i; 98 int i;
80 99
100#ifdef USE_PAM
101 if (!options.use_pam)
102 remove_kbdint_device("pam");
103#endif
104
81 kbdintctxt = xmalloc(sizeof(KbdintAuthctxt)); 105 kbdintctxt = xmalloc(sizeof(KbdintAuthctxt));
82 if (strcmp(devs, "") == 0) { 106 if (strcmp(devs, "") == 0) {
83 buffer_init(&b); 107 buffer_init(&b);