summaryrefslogtreecommitdiff
path: root/auth1.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2004-03-01 02:25:32 +0000
committerColin Watson <cjwatson@debian.org>2004-03-01 02:25:32 +0000
commitea8116a11e3de70036dbc665ccb0d486cf89cac9 (patch)
treed73ccdff78d8608e156465af42e6a1b3527fb2d6 /auth1.c
parente39b311381a5609cc05acf298c42fba196dc524b (diff)
parentf5bda272678ec6dccaa5f29379cf60cb855018e8 (diff)
Merge 3.8p1 to the trunk. This builds and runs, but I haven't tested it
extensively yet. ProtocolKeepAlives is now just a compatibility alias for ServerAliveInterval.
Diffstat (limited to 'auth1.c')
-rw-r--r--auth1.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/auth1.c b/auth1.c
index dfe944dd1..82fe5fb80 100644
--- a/auth1.c
+++ b/auth1.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include "includes.h" 12#include "includes.h"
13RCSID("$OpenBSD: auth1.c,v 1.52 2003/08/28 12:54:34 markus Exp $"); 13RCSID("$OpenBSD: auth1.c,v 1.55 2003/11/08 16:02:40 jakob Exp $");
14 14
15#include "xmalloc.h" 15#include "xmalloc.h"
16#include "rsa.h" 16#include "rsa.h"
@@ -139,7 +139,7 @@ do_authloop(Authctxt *authctxt)
139 BN_num_bits(client_host_key->rsa->n), bits); 139 BN_num_bits(client_host_key->rsa->n), bits);
140 packet_check_eom(); 140 packet_check_eom();
141 141
142 authenticated = auth_rhosts_rsa(pw, client_user, 142 authenticated = auth_rhosts_rsa(authctxt, client_user,
143 client_host_key); 143 client_host_key);
144 key_free(client_host_key); 144 key_free(client_host_key);
145 145
@@ -156,7 +156,7 @@ do_authloop(Authctxt *authctxt)
156 fatal("do_authloop: BN_new failed"); 156 fatal("do_authloop: BN_new failed");
157 packet_get_bignum(n); 157 packet_get_bignum(n);
158 packet_check_eom(); 158 packet_check_eom();
159 authenticated = auth_rsa(pw, n); 159 authenticated = auth_rsa(authctxt, n);
160 BN_clear_free(n); 160 BN_clear_free(n);
161 break; 161 break;
162 162
@@ -235,7 +235,7 @@ do_authloop(Authctxt *authctxt)
235 if (authenticated && 235 if (authenticated &&
236 !check_nt_auth(type == SSH_CMSG_AUTH_PASSWORD, pw)) { 236 !check_nt_auth(type == SSH_CMSG_AUTH_PASSWORD, pw)) {
237 packet_disconnect("Authentication rejected for uid %d.", 237 packet_disconnect("Authentication rejected for uid %d.",
238 pw == NULL ? -1 : pw->pw_uid); 238 pw == NULL ? -1 : pw->pw_uid);
239 authenticated = 0; 239 authenticated = 0;
240 } 240 }
241#else 241#else
@@ -246,7 +246,7 @@ do_authloop(Authctxt *authctxt)
246#endif 246#endif
247 247
248#ifdef USE_PAM 248#ifdef USE_PAM
249 if (options.use_pam && authenticated && 249 if (options.use_pam && authenticated &&
250 !PRIVSEP(do_pam_account())) 250 !PRIVSEP(do_pam_account()))
251 authenticated = 0; 251 authenticated = 0;
252#endif 252#endif
@@ -275,10 +275,9 @@ do_authloop(Authctxt *authctxt)
275 * Performs authentication of an incoming connection. Session key has already 275 * Performs authentication of an incoming connection. Session key has already
276 * been exchanged and encryption is enabled. 276 * been exchanged and encryption is enabled.
277 */ 277 */
278Authctxt * 278void
279do_authentication(void) 279do_authentication(Authctxt *authctxt)
280{ 280{
281 Authctxt *authctxt;
282 u_int ulen; 281 u_int ulen;
283 char *user, *style = NULL; 282 char *user, *style = NULL;
284 283
@@ -292,7 +291,6 @@ do_authentication(void)
292 if ((style = strchr(user, ':')) != NULL) 291 if ((style = strchr(user, ':')) != NULL)
293 *style++ = '\0'; 292 *style++ = '\0';
294 293
295 authctxt = authctxt_new();
296 authctxt->user = user; 294 authctxt->user = user;
297 authctxt->style = style; 295 authctxt->style = style;
298 296
@@ -332,6 +330,4 @@ do_authentication(void)
332 packet_start(SSH_SMSG_SUCCESS); 330 packet_start(SSH_SMSG_SUCCESS);
333 packet_send(); 331 packet_send();
334 packet_write_wait(); 332 packet_write_wait();
335
336 return (authctxt);
337} 333}