diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2002-03-22 01:27:35 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2002-03-22 01:27:35 +0000 |
commit | 73ab9ba45d369ef35b0e81590d5d46cc376466c9 (patch) | |
tree | d71733dedcdf95447dc81ffb62db5f2f56150dc6 | |
parent | 2ae18f40a70632eb87eca114980649dae8c476ff (diff) |
- provos@cvs.openbsd.org 2002/03/18 01:12:14
[auth.h auth1.c auth2.c sshd.c]
have the authentication functions return the authentication context
and then do_authenticated; okay millert@
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | auth.h | 6 | ||||
-rw-r--r-- | auth1.c | 7 | ||||
-rw-r--r-- | auth2.c | 7 | ||||
-rw-r--r-- | sshd.c | 12 |
5 files changed, 24 insertions, 14 deletions
@@ -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 | ||
37 | 20020317 | 41 | 20020317 |
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 $ |
@@ -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 | ||
124 | void do_authentication(void); | 124 | Authctxt *do_authentication(void); |
125 | void do_authentication2(void); | 125 | Authctxt *do_authentication2(void); |
126 | 126 | ||
127 | Authctxt *authctxt_new(void); | 127 | Authctxt *authctxt_new(void); |
128 | void auth_log(Authctxt *, int, char *, char *); | 128 | void auth_log(Authctxt *, int, char *, char *); |
@@ -10,7 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include "includes.h" | 12 | #include "includes.h" |
13 | RCSID("$OpenBSD: auth1.c,v 1.36 2002/03/17 20:25:56 provos Exp $"); | 13 | RCSID("$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 | */ |
358 | void | 358 | Authctxt * |
359 | do_authentication(void) | 359 | do_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 | } |
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: auth2.c,v 1.86 2002/03/17 20:25:56 provos Exp $"); | 26 | RCSID("$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 | ||
112 | void | 112 | Authctxt * |
113 | do_authentication2(void) | 113 | do_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 | ||
131 | static void | 132 | static void |
@@ -40,7 +40,7 @@ | |||
40 | */ | 40 | */ |
41 | 41 | ||
42 | #include "includes.h" | 42 | #include "includes.h" |
43 | RCSID("$OpenBSD: sshd.c,v 1.229 2002/03/14 16:38:26 markus Exp $"); | 43 | RCSID("$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 | ||