]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- provos@cvs.openbsd.org 2002/03/18 01:12:14
authorBen Lindstrom <mouring@eviladmin.org>
Fri, 22 Mar 2002 01:27:35 +0000 (01:27 +0000)
committerBen Lindstrom <mouring@eviladmin.org>
Fri, 22 Mar 2002 01:27:35 +0000 (01:27 +0000)
     [auth.h auth1.c auth2.c sshd.c]
     have the authentication functions return the authentication context
     and then do_authenticated; okay millert@

ChangeLog
auth.h
auth1.c
auth2.c
sshd.c

index 8fc1f13815dac1c4b8f2dd38354aa37158b69d2f..0419a17c74250b5ba26d201c5e671140e7884fff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
    - provos@cvs.openbsd.org 2002/03/17 20:25:56
      [auth.c auth.h auth1.c auth2.c]
      getpwnamallow returns struct passwd * only if user valid; okay markus@
+   - 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@
 
 20020317
  - (tim) [configure.ac] Assume path given with --with-pid-dir=PATH is wanted,
  - Wrote replacements for strlcpy and mkdtemp
  - Released 1.0pre1
 
-$Id: ChangeLog,v 1.1934 2002/03/22 01:24:38 mouring Exp $
+$Id: ChangeLog,v 1.1935 2002/03/22 01:27:35 mouring Exp $
diff --git a/auth.h b/auth.h
index 5f0ed7da4a28ce69414fbb7f74b0e03b35749ccb..bdfdf1c54117f2438879db454ec0d59136c8323f 100644 (file)
--- a/auth.h
+++ b/auth.h
@@ -1,4 +1,4 @@
-/*     $OpenBSD: auth.h,v 1.32 2002/03/17 20:25:56 provos Exp $        */
+/*     $OpenBSD: auth.h,v 1.33 2002/03/18 01:12:14 provos Exp $        */
 
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -121,8 +121,8 @@ void        krb5_cleanup_proc(void *authctxt);
 #include "auth-pam.h"
 #include "auth2-pam.h"
 
-void   do_authentication(void);
-void   do_authentication2(void);
+Authctxt *do_authentication(void);
+Authctxt *do_authentication2(void);
 
 Authctxt *authctxt_new(void);
 void   auth_log(Authctxt *, int, char *, char *);
diff --git a/auth1.c b/auth1.c
index 013c741886bfafc929a88fe20ec1089fead92656..4c295215f20c549a4c10be5594d5eb2d99d1efba 100644 (file)
--- a/auth1.c
+++ b/auth1.c
@@ -10,7 +10,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth1.c,v 1.36 2002/03/17 20:25:56 provos Exp $");
+RCSID("$OpenBSD: auth1.c,v 1.37 2002/03/18 01:12:14 provos Exp $");
 
 #include "xmalloc.h"
 #include "rsa.h"
@@ -355,7 +355,7 @@ do_authloop(Authctxt *authctxt)
  * Performs authentication of an incoming connection.  Session key has already
  * been exchanged and encryption is enabled.
  */
-void
+Authctxt *
 do_authentication(void)
 {
        Authctxt *authctxt;
@@ -418,6 +418,5 @@ do_authentication(void)
        packet_send();
        packet_write_wait();
 
-       /* Perform session preparation. */
-       do_authenticated(authctxt);
+       return (authctxt);
 }
diff --git a/auth2.c b/auth2.c
index c5ab08067ff1bc7d3ce89a5d24a85299c6324c3e..b57fda216de8068b4f7b970f407fdb43c3e9b5bd 100644 (file)
--- a/auth2.c
+++ b/auth2.c
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth2.c,v 1.86 2002/03/17 20:25:56 provos Exp $");
+RCSID("$OpenBSD: auth2.c,v 1.87 2002/03/18 01:12:14 provos Exp $");
 
 #include <openssl/evp.h>
 
@@ -109,7 +109,7 @@ Authmethod authmethods[] = {
  * loop until authctxt->success == TRUE
  */
 
-void
+Authctxt *
 do_authentication2(void)
 {
        Authctxt *authctxt = authctxt_new();
@@ -125,7 +125,8 @@ do_authentication2(void)
        dispatch_init(&dispatch_protocol_error);
        dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request);
        dispatch_run(DISPATCH_BLOCK, &authctxt->success, authctxt);
-       do_authenticated(authctxt);
+
+       return (authctxt);
 }
 
 static void
diff --git a/sshd.c b/sshd.c
index 0fd902f904938611d040148083da9f448268b884..0764588fc394ee0339c9b76cbca703f4134e89b6 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -40,7 +40,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.229 2002/03/14 16:38:26 markus Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.230 2002/03/18 01:12:14 provos Exp $");
 
 #include <openssl/dh.h>
 #include <openssl/bn.h>
@@ -72,6 +72,7 @@ RCSID("$OpenBSD: sshd.c,v 1.229 2002/03/14 16:38:26 markus Exp $");
 #include "misc.h"
 #include "dispatch.h"
 #include "channels.h"
+#include "session.h"
 
 #ifdef LIBWRAP
 #include <tcpd.h>
@@ -594,6 +595,7 @@ main(int ac, char **av)
        int listen_sock, maxfd;
        int startup_p[2];
        int startups = 0;
+       Authctxt *authctxt;
        Key *key;
        int ret, key_used = 0;
 
@@ -1235,11 +1237,15 @@ main(int ac, char **av)
        /* authenticate user and start session */
        if (compat20) {
                do_ssh2_kex();
-               do_authentication2();
+               authctxt = do_authentication2();
        } else {
                do_ssh1_kex();
-               do_authentication();
+               authctxt = do_authentication();
        }
+
+       /* Perform session preparation. */
+       do_authenticated(authctxt);
+
        /* The connection has been terminated. */
        verbose("Closing connection to %.100s", remote_ip);