summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--auth.h6
-rw-r--r--auth1.c7
-rw-r--r--auth2.c7
-rw-r--r--sshd.c12
5 files changed, 24 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 8fc1f1381..0419a17c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,10 @@
33 - provos@cvs.openbsd.org 2002/03/17 20:25:56 33 - provos@cvs.openbsd.org 2002/03/17 20:25:56
34 [auth.c auth.h auth1.c auth2.c] 34 [auth.c auth.h auth1.c auth2.c]
35 getpwnamallow returns struct passwd * only if user valid; okay markus@ 35 getpwnamallow returns struct passwd * only if user valid; okay markus@
36 - provos@cvs.openbsd.org 2002/03/18 01:12:14
37 [auth.h auth1.c auth2.c sshd.c]
38 have the authentication functions return the authentication context
39 and then do_authenticated; okay millert@
36 40
3720020317 4120020317
38 - (tim) [configure.ac] Assume path given with --with-pid-dir=PATH is wanted, 42 - (tim) [configure.ac] Assume path given with --with-pid-dir=PATH is wanted,
@@ -7879,4 +7883,4 @@
7879 - Wrote replacements for strlcpy and mkdtemp 7883 - Wrote replacements for strlcpy and mkdtemp
7880 - Released 1.0pre1 7884 - Released 1.0pre1
7881 7885
7882$Id: ChangeLog,v 1.1934 2002/03/22 01:24:38 mouring Exp $ 7886$Id: ChangeLog,v 1.1935 2002/03/22 01:27:35 mouring Exp $
diff --git a/auth.h b/auth.h
index 5f0ed7da4..bdfdf1c54 100644
--- a/auth.h
+++ b/auth.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth.h,v 1.32 2002/03/17 20:25:56 provos Exp $ */ 1/* $OpenBSD: auth.h,v 1.33 2002/03/18 01:12:14 provos Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -121,8 +121,8 @@ void krb5_cleanup_proc(void *authctxt);
121#include "auth-pam.h" 121#include "auth-pam.h"
122#include "auth2-pam.h" 122#include "auth2-pam.h"
123 123
124void do_authentication(void); 124Authctxt *do_authentication(void);
125void do_authentication2(void); 125Authctxt *do_authentication2(void);
126 126
127Authctxt *authctxt_new(void); 127Authctxt *authctxt_new(void);
128void auth_log(Authctxt *, int, char *, char *); 128void auth_log(Authctxt *, int, char *, char *);
diff --git a/auth1.c b/auth1.c
index 013c74188..4c295215f 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.36 2002/03/17 20:25:56 provos Exp $"); 13RCSID("$OpenBSD: auth1.c,v 1.37 2002/03/18 01:12:14 provos Exp $");
14 14
15#include "xmalloc.h" 15#include "xmalloc.h"
16#include "rsa.h" 16#include "rsa.h"
@@ -355,7 +355,7 @@ do_authloop(Authctxt *authctxt)
355 * Performs authentication of an incoming connection. Session key has already 355 * Performs authentication of an incoming connection. Session key has already
356 * been exchanged and encryption is enabled. 356 * been exchanged and encryption is enabled.
357 */ 357 */
358void 358Authctxt *
359do_authentication(void) 359do_authentication(void)
360{ 360{
361 Authctxt *authctxt; 361 Authctxt *authctxt;
@@ -418,6 +418,5 @@ do_authentication(void)
418 packet_send(); 418 packet_send();
419 packet_write_wait(); 419 packet_write_wait();
420 420
421 /* Perform session preparation. */ 421 return (authctxt);
422 do_authenticated(authctxt);
423} 422}
diff --git a/auth2.c b/auth2.c
index c5ab08067..b57fda216 100644
--- a/auth2.c
+++ b/auth2.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth2.c,v 1.86 2002/03/17 20:25:56 provos Exp $"); 26RCSID("$OpenBSD: auth2.c,v 1.87 2002/03/18 01:12:14 provos Exp $");
27 27
28#include <openssl/evp.h> 28#include <openssl/evp.h>
29 29
@@ -109,7 +109,7 @@ Authmethod authmethods[] = {
109 * loop until authctxt->success == TRUE 109 * loop until authctxt->success == TRUE
110 */ 110 */
111 111
112void 112Authctxt *
113do_authentication2(void) 113do_authentication2(void)
114{ 114{
115 Authctxt *authctxt = authctxt_new(); 115 Authctxt *authctxt = authctxt_new();
@@ -125,7 +125,8 @@ do_authentication2(void)
125 dispatch_init(&dispatch_protocol_error); 125 dispatch_init(&dispatch_protocol_error);
126 dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request); 126 dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request);
127 dispatch_run(DISPATCH_BLOCK, &authctxt->success, authctxt); 127 dispatch_run(DISPATCH_BLOCK, &authctxt->success, authctxt);
128 do_authenticated(authctxt); 128
129 return (authctxt);
129} 130}
130 131
131static void 132static void
diff --git a/sshd.c b/sshd.c
index 0fd902f90..0764588fc 100644
--- a/sshd.c
+++ b/sshd.c
@@ -40,7 +40,7 @@
40 */ 40 */
41 41
42#include "includes.h" 42#include "includes.h"
43RCSID("$OpenBSD: sshd.c,v 1.229 2002/03/14 16:38:26 markus Exp $"); 43RCSID("$OpenBSD: sshd.c,v 1.230 2002/03/18 01:12:14 provos Exp $");
44 44
45#include <openssl/dh.h> 45#include <openssl/dh.h>
46#include <openssl/bn.h> 46#include <openssl/bn.h>
@@ -72,6 +72,7 @@ RCSID("$OpenBSD: sshd.c,v 1.229 2002/03/14 16:38:26 markus Exp $");
72#include "misc.h" 72#include "misc.h"
73#include "dispatch.h" 73#include "dispatch.h"
74#include "channels.h" 74#include "channels.h"
75#include "session.h"
75 76
76#ifdef LIBWRAP 77#ifdef LIBWRAP
77#include <tcpd.h> 78#include <tcpd.h>
@@ -594,6 +595,7 @@ main(int ac, char **av)
594 int listen_sock, maxfd; 595 int listen_sock, maxfd;
595 int startup_p[2]; 596 int startup_p[2];
596 int startups = 0; 597 int startups = 0;
598 Authctxt *authctxt;
597 Key *key; 599 Key *key;
598 int ret, key_used = 0; 600 int ret, key_used = 0;
599 601
@@ -1235,11 +1237,15 @@ main(int ac, char **av)
1235 /* authenticate user and start session */ 1237 /* authenticate user and start session */
1236 if (compat20) { 1238 if (compat20) {
1237 do_ssh2_kex(); 1239 do_ssh2_kex();
1238 do_authentication2(); 1240 authctxt = do_authentication2();
1239 } else { 1241 } else {
1240 do_ssh1_kex(); 1242 do_ssh1_kex();
1241 do_authentication(); 1243 authctxt = do_authentication();
1242 } 1244 }
1245
1246 /* Perform session preparation. */
1247 do_authenticated(authctxt);
1248
1243 /* The connection has been terminated. */ 1249 /* The connection has been terminated. */
1244 verbose("Closing connection to %.100s", remote_ip); 1250 verbose("Closing connection to %.100s", remote_ip);
1245 1251