summaryrefslogtreecommitdiff
path: root/auth1.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-05-10 19:28:02 +1000
committerDamien Miller <djm@mindrot.org>2003-05-10 19:28:02 +1000
commit4f9f42a9bb6a6aa8f6100d873dc6344f2f9994de (patch)
treef81c39146e1cfabb4b198f57f60453b2dcaac299 /auth1.c
parentc437cda328b4733b59a7ed028b72e6b7f58f86e6 (diff)
- (djm) Merge FreeBSD PAM code: replaces PAM password auth kludge with
proper challenge-response module
Diffstat (limited to 'auth1.c')
-rw-r--r--auth1.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/auth1.c b/auth1.c
index e7d744f6e..5086a47c3 100644
--- a/auth1.c
+++ b/auth1.c
@@ -73,7 +73,7 @@ do_authloop(Authctxt *authctxt)
73 char info[1024]; 73 char info[1024];
74 u_int dlen; 74 u_int dlen;
75 u_int ulen; 75 u_int ulen;
76 int type = 0; 76 int prev, type = 0;
77 struct passwd *pw = authctxt->pw; 77 struct passwd *pw = authctxt->pw;
78 78
79 debug("Attempting authentication for %s%.100s.", 79 debug("Attempting authentication for %s%.100s.",
@@ -103,8 +103,20 @@ do_authloop(Authctxt *authctxt)
103 info[0] = '\0'; 103 info[0] = '\0';
104 104
105 /* Get a packet from the client. */ 105 /* Get a packet from the client. */
106 prev = type;
106 type = packet_read(); 107 type = packet_read();
107 108
109 /*
110 * If we started challenge-response authentication but the
111 * next packet is not a response to our challenge, release
112 * the resources allocated by get_challenge() (which would
113 * normally have been released by verify_response() had we
114 * received such a response)
115 */
116 if (prev == SSH_CMSG_AUTH_TIS &&
117 type != SSH_CMSG_AUTH_TIS_RESPONSE)
118 abandon_challenge_response(authctxt);
119
108 /* Process the packet. */ 120 /* Process the packet. */
109 switch (type) { 121 switch (type) {
110 122