]> andersk Git - openssh.git/blobdiff - auth2-chall.c
- djm@cvs.openbsd.org 2004/03/03 09:31:20
[openssh.git] / auth2-chall.c
index e1440f47d7cb4e234420ec65d7732716e25f5286..aacbf0bccebb19509760f91c4998f4a034fe9860 100644 (file)
@@ -23,7 +23,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: auth2-chall.c,v 1.19 2002/06/26 13:55:37 markus Exp $");
+RCSID("$OpenBSD: auth2-chall.c,v 1.20 2002/06/30 21:59:45 deraadt Exp $");
 
 #include "ssh2.h"
 #include "auth.h"
@@ -41,6 +41,9 @@ static void input_userauth_info_response(int, u_int32_t, void *);
 #ifdef BSD_AUTH
 extern KbdintDevice bsdauth_device;
 #else
+#ifdef USE_PAM
+extern KbdintDevice sshpam_device;
+#endif
 #ifdef SKEY
 extern KbdintDevice skey_device;
 #endif
@@ -50,6 +53,9 @@ KbdintDevice *devices[] = {
 #ifdef BSD_AUTH
        &bsdauth_device,
 #else
+#ifdef USE_PAM
+       &sshpam_device,
+#endif
 #ifdef SKEY
        &skey_device,
 #endif
@@ -263,7 +269,7 @@ input_userauth_info_response(int type, u_int32_t seq, void *ctxt)
        if (nresp > 100)
                fatal("input_userauth_info_response: too many replies");
        if (nresp > 0) {
-               response = xmalloc(nresp * sizeof(char*));
+               response = xmalloc(nresp * sizeof(char *));
                for (i = 0; i < nresp; i++)
                        response[i] = packet_get_string(NULL);
        }
@@ -320,18 +326,27 @@ input_userauth_info_response(int type, u_int32_t seq, void *ctxt)
 void
 privsep_challenge_enable(void)
 {
+#if defined(BSD_AUTH) || defined(USE_PAM) || defined(SKEY)
+       int n = 0;
+#endif
 #ifdef BSD_AUTH
        extern KbdintDevice mm_bsdauth_device;
 #endif
+#ifdef USE_PAM
+       extern KbdintDevice mm_sshpam_device;
+#endif
 #ifdef SKEY
        extern KbdintDevice mm_skey_device;
 #endif
-       /* As long as SSHv1 has devices[0] hard coded this is fine */
+
 #ifdef BSD_AUTH
-       devices[0] = &mm_bsdauth_device;
+       devices[n++] = &mm_bsdauth_device;
 #else
+#ifdef USE_PAM
+       devices[n++] = &mm_sshpam_device;
+#endif
 #ifdef SKEY
-       devices[0] = &mm_skey_device;
+       devices[n++] = &mm_skey_device;
 #endif
 #endif
 }
This page took 1.191622 seconds and 4 git commands to generate.