Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src sync with openssh 3.3.



details:   https://anonhg.NetBSD.org/src/rev/72aeff10cdc0
branches:  trunk
changeset: 533192:72aeff10cdc0
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Jun 24 05:48:24 2002 +0000

description:
sync with openssh 3.3.
local mods included to make it compile with openssl 0.9.6d.

diffstat:

 crypto/dist/ssh/auth-bsdauth.c   |   10 +-
 crypto/dist/ssh/auth-krb4.c      |    8 +-
 crypto/dist/ssh/auth-passwd.c    |   25 +-
 crypto/dist/ssh/auth-skey.c      |    8 +-
 crypto/dist/ssh/auth.c           |    4 +-
 crypto/dist/ssh/auth.h           |   11 +-
 crypto/dist/ssh/auth1.c          |    6 +-
 crypto/dist/ssh/auth2-chall.c    |    6 +-
 crypto/dist/ssh/auth2-none.c     |    4 +-
 crypto/dist/ssh/auth2.c          |  555 +-------------------------------
 crypto/dist/ssh/authfd.c         |   55 ++-
 crypto/dist/ssh/authfile.c       |    6 +-
 crypto/dist/ssh/canohost.c       |    9 +-
 crypto/dist/ssh/channels.c       |  128 +-------
 crypto/dist/ssh/channels.h       |    9 +-
 crypto/dist/ssh/cipher.c         |   97 +++--
 crypto/dist/ssh/clientloop.c     |    6 +-
 crypto/dist/ssh/kex.c            |    6 +-
 crypto/dist/ssh/key.c            |   16 +-
 crypto/dist/ssh/log.h            |    8 +-
 crypto/dist/ssh/mac.c            |    4 +-
 crypto/dist/ssh/monitor.c        |  270 +++++++++-------
 crypto/dist/ssh/monitor_wrap.c   |  230 +++++++------
 crypto/dist/ssh/msg.c            |   10 +-
 crypto/dist/ssh/packet.c         |   38 +-
 crypto/dist/ssh/pathnames.h      |    7 +-
 crypto/dist/ssh/radix.c          |    6 +-
 crypto/dist/ssh/readconf.c       |   42 +-
 crypto/dist/ssh/readconf.h       |    6 +-
 crypto/dist/ssh/scard.c          |    6 +-
 crypto/dist/ssh/scp.c            |   16 +-
 crypto/dist/ssh/servconf.c       |   33 +-
 crypto/dist/ssh/servconf.h       |    5 +-
 crypto/dist/ssh/serverloop.c     |    8 +-
 crypto/dist/ssh/session.c        |  141 +++++++-
 crypto/dist/ssh/session.h        |   10 +-
 crypto/dist/ssh/sftp-client.c    |   69 ++--
 crypto/dist/ssh/sftp-client.h    |   10 +-
 crypto/dist/ssh/sftp-common.c    |    6 +-
 crypto/dist/ssh/sftp-int.c       |    6 +-
 crypto/dist/ssh/sftp-server.c    |   74 ++-
 crypto/dist/ssh/sftp.1           |   19 +-
 crypto/dist/ssh/sftp.c           |    7 +-
 crypto/dist/ssh/ssh-add.1        |   21 +-
 crypto/dist/ssh/ssh-add.c        |   65 +++-
 crypto/dist/ssh/ssh-agent.1      |   15 +-
 crypto/dist/ssh/ssh-agent.c      |  321 +++++++++++++-----
 crypto/dist/ssh/ssh-dss.c        |   16 +-
 crypto/dist/ssh/ssh-keygen.1     |    6 +-
 crypto/dist/ssh/ssh-keygen.c     |   17 +-
 crypto/dist/ssh/ssh-keyscan.c    |   10 +-
 crypto/dist/ssh/ssh-rsa.c        |   43 +-
 crypto/dist/ssh/ssh.1            |  623 +-----------------------------------
 crypto/dist/ssh/ssh.c            |  139 ++------
 crypto/dist/ssh/ssh.h            |   10 +-
 crypto/dist/ssh/ssh_config       |   18 +-
 crypto/dist/ssh/sshconnect.c     |   56 +--
 crypto/dist/ssh/sshconnect1.c    |   14 +-
 crypto/dist/ssh/sshconnect2.c    |  128 ++++++-
 crypto/dist/ssh/sshd.8           |  644 +--------------------------------------
 crypto/dist/ssh/sshd.c           |   85 +++--
 crypto/dist/ssh/sshd_config      |    9 +-
 crypto/dist/ssh/sshlogin.c       |   11 +-
 crypto/dist/ssh/sshpty.c         |   14 +-
 crypto/dist/ssh/tildexpand.c     |    7 +-
 crypto/dist/ssh/version.h        |    8 +-
 distrib/sets/lists/base/mi       |    3 +-
 distrib/sets/lists/man/mi        |   12 +-
 usr.bin/ssh/Makefile             |    5 +-
 usr.bin/ssh/libssh/Makefile      |    4 +-
 usr.bin/ssh/ssh-keysign/Makefile |   19 +
 usr.bin/ssh/ssh/Makefile         |    3 +-
 usr.bin/ssh/sshd/Makefile        |   10 +-
 73 files changed, 1532 insertions(+), 2804 deletions(-)

diffs (truncated from 9095 to 300 lines):

diff -r 52dbb73f0a81 -r 72aeff10cdc0 crypto/dist/ssh/auth-bsdauth.c
--- a/crypto/dist/ssh/auth-bsdauth.c    Mon Jun 24 05:46:47 2002 +0000
+++ b/crypto/dist/ssh/auth-bsdauth.c    Mon Jun 24 05:48:24 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auth-bsdauth.c,v 1.3 2002/04/22 07:59:35 itojun Exp $  */
+/*     $NetBSD: auth-bsdauth.c,v 1.4 2002/06/24 05:48:26 itojun Exp $  */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  *
@@ -23,7 +23,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: auth-bsdauth.c,v 1.3 2002/03/18 17:50:31 provos Exp $");
+RCSID("$OpenBSD: auth-bsdauth.c,v 1.4 2002/06/19 00:27:55 deraadt Exp $");
 
 #ifdef BSD_AUTH
 #include "xmalloc.h"
@@ -58,7 +58,7 @@
                debug3("bsdauth_query: style %s",
                    authctxt->style ? authctxt->style : "<default>");
                authctxt->as = auth_userchallenge(authctxt->user,
-                    authctxt->style, "auth-ssh", &challenge);
+                   authctxt->style, "auth-ssh", &challenge);
                if (authctxt->as == NULL)
                        challenge = NULL;
                debug2("bsdauth_query: <%s>", challenge ? challenge : "empty");
@@ -67,8 +67,8 @@
        if (challenge == NULL)
                return -1;
 
-       *name       = xstrdup("");
-       *infotxt    = xstrdup("");
+       *name = xstrdup("");
+       *infotxt = xstrdup("");
        *numprompts = 1;
        *prompts = xmalloc(*numprompts * sizeof(char*));
        *echo_on = xmalloc(*numprompts * sizeof(u_int));
diff -r 52dbb73f0a81 -r 72aeff10cdc0 crypto/dist/ssh/auth-krb4.c
--- a/crypto/dist/ssh/auth-krb4.c       Mon Jun 24 05:46:47 2002 +0000
+++ b/crypto/dist/ssh/auth-krb4.c       Mon Jun 24 05:48:24 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auth-krb4.c,v 1.6 2002/04/22 07:59:35 itojun Exp $     */
+/*     $NetBSD: auth-krb4.c,v 1.7 2002/06/24 05:48:26 itojun Exp $     */
 /*
  * Copyright (c) 1999 Dug Song.  All rights reserved.
  *
@@ -24,7 +24,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth-krb4.c,v 1.26 2002/03/18 01:30:10 dugsong Exp $");
+RCSID("$OpenBSD: auth-krb4.c,v 1.27 2002/06/11 05:46:20 mpech Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -58,8 +58,8 @@
                if (lstat("/ticket", &st) != -1)
                        tkt_root = "/ticket/";
 #endif /* AFS */
-               snprintf(authctxt->krb4_ticket_file, MAXPATHLEN, "%s%u_%d",
-                   tkt_root, authctxt->pw->pw_uid, getpid());
+               snprintf(authctxt->krb4_ticket_file, MAXPATHLEN, "%s%u_%ld",
+                   tkt_root, authctxt->pw->pw_uid, (long)getpid());
                krb_set_tkt_string(authctxt->krb4_ticket_file);
        }
        /* Register ticket cleanup in case of fatal error. */
diff -r 52dbb73f0a81 -r 72aeff10cdc0 crypto/dist/ssh/auth-passwd.c
--- a/crypto/dist/ssh/auth-passwd.c     Mon Jun 24 05:46:47 2002 +0000
+++ b/crypto/dist/ssh/auth-passwd.c     Mon Jun 24 05:48:24 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auth-passwd.c,v 1.6 2002/05/13 02:58:17 itojun Exp $   */
+/*     $NetBSD: auth-passwd.c,v 1.7 2002/06/24 05:48:27 itojun Exp $   */
 /*
  * Author: Tatu Ylonen <ylo%cs.hut.fi@localhost>
  * Copyright (c) 1995 Tatu Ylonen <ylo%cs.hut.fi@localhost>, Espoo, Finland
@@ -37,7 +37,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth-passwd.c,v 1.26 2002/05/10 02:30:12 mouring Exp $");
+RCSID("$OpenBSD: auth-passwd.c,v 1.27 2002/05/24 16:45:16 stevesk Exp $");
 
 #include "packet.h"
 #include "log.h"
@@ -55,7 +55,6 @@
 auth_password(Authctxt *authctxt, const char *password)
 {
        struct passwd * pw = authctxt->pw;
-       char *encrypted_password;
 
        /* deny if no user. */
        if (pw == NULL)
@@ -86,14 +85,20 @@
                return 0;
        else
                return 1;
-#endif
+#else
        /* Check for users with no password. */
        if (strcmp(password, "") == 0 && strcmp(pw->pw_passwd, "") == 0)
                return 1;
-       /* Encrypt the candidate password using the proper salt. */
-       encrypted_password = crypt(password,
-           (pw->pw_passwd[0] && pw->pw_passwd[1]) ? pw->pw_passwd : "xx");
-
-       /* Authentication is accepted if the encrypted passwords are identical. */
-       return (strcmp(encrypted_password, pw->pw_passwd) == 0);
+       else {
+               /* Encrypt the candidate password using the proper salt. */
+               char *encrypted_password = crypt(password,
+                   (pw->pw_passwd[0] && pw->pw_passwd[1]) ?
+                   pw->pw_passwd : "xx");
+               /*
+                * Authentication is accepted if the encrypted passwords
+                * are identical.
+                */
+               return (strcmp(encrypted_password, pw->pw_passwd) == 0);
+       }
+#endif
 }
diff -r 52dbb73f0a81 -r 72aeff10cdc0 crypto/dist/ssh/auth-skey.c
--- a/crypto/dist/ssh/auth-skey.c       Mon Jun 24 05:46:47 2002 +0000
+++ b/crypto/dist/ssh/auth-skey.c       Mon Jun 24 05:48:24 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auth-skey.c,v 1.7 2002/04/22 07:59:36 itojun Exp $     */
+/*     $NetBSD: auth-skey.c,v 1.8 2002/06/24 05:48:27 itojun Exp $     */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  *
@@ -23,7 +23,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: auth-skey.c,v 1.17 2002/03/18 17:50:31 provos Exp $");
+RCSID("$OpenBSD: auth-skey.c,v 1.19 2002/06/19 00:27:55 deraadt Exp $");
 
 #ifdef SKEY
 
@@ -51,8 +51,8 @@
        if (skeychallenge(&skey, authctxt->user, challenge, sizeof(challenge)) == -1)
                return -1;
 
-       *name       = xstrdup("");
-       *infotxt    = xstrdup("");
+       *name  = xstrdup("");
+       *infotxt  = xstrdup("");
        *numprompts = 1;
        *prompts = xmalloc(*numprompts * sizeof(char*));
        *echo_on = xmalloc(*numprompts * sizeof(u_int));
diff -r 52dbb73f0a81 -r 72aeff10cdc0 crypto/dist/ssh/auth.c
--- a/crypto/dist/ssh/auth.c    Mon Jun 24 05:46:47 2002 +0000
+++ b/crypto/dist/ssh/auth.c    Mon Jun 24 05:48:24 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auth.c,v 1.13 2002/05/27 13:45:17 itojun Exp $ */
+/*     $NetBSD: auth.c,v 1.14 2002/06/24 05:48:27 itojun Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -24,7 +24,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth.c,v 1.41 2002/03/19 15:31:47 markus Exp $");
+RCSID("$OpenBSD: auth.c,v 1.43 2002/05/17 14:27:55 millert Exp $");
 
 #include <libgen.h>
 
diff -r 52dbb73f0a81 -r 72aeff10cdc0 crypto/dist/ssh/auth.h
--- a/crypto/dist/ssh/auth.h    Mon Jun 24 05:46:47 2002 +0000
+++ b/crypto/dist/ssh/auth.h    Mon Jun 24 05:48:24 2002 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: auth.h,v 1.11 2002/05/27 13:45:17 itojun Exp $ */
-/*     $OpenBSD: auth.h,v 1.36 2002/05/12 23:53:45 djm Exp $   */
+/*     $NetBSD: auth.h,v 1.12 2002/06/24 05:48:27 itojun Exp $ */
+/*     $OpenBSD: auth.h,v 1.39 2002/05/31 11:35:15 markus Exp $        */
 
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -44,6 +44,7 @@
 #endif
 
 typedef struct Authctxt Authctxt;
+typedef struct Authmethod Authmethod;
 typedef struct KbdintDevice KbdintDevice;
 
 struct Authctxt {
@@ -72,6 +73,12 @@
 #endif
 };
 
+struct Authmethod {
+       char    *name;
+       int     (*userauth)(Authctxt *authctxt);
+       int     *enabled;
+};
+
 /*
  * Keyboard interactive device:
  * init_ctx    returns: non NULL upon success
diff -r 52dbb73f0a81 -r 72aeff10cdc0 crypto/dist/ssh/auth1.c
--- a/crypto/dist/ssh/auth1.c   Mon Jun 24 05:46:47 2002 +0000
+++ b/crypto/dist/ssh/auth1.c   Mon Jun 24 05:48:24 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auth1.c,v 1.17 2002/04/22 07:59:36 itojun Exp $        */
+/*     $NetBSD: auth1.c,v 1.18 2002/06/24 05:48:27 itojun Exp $        */
 /*
  * Copyright (c) 1995 Tatu Ylonen <ylo%cs.hut.fi@localhost>, Espoo, Finland
  *                    All rights reserved
@@ -11,7 +11,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth1.c,v 1.40 2002/04/10 08:21:47 markus Exp $");
+RCSID("$OpenBSD: auth1.c,v 1.41 2002/06/19 00:27:55 deraadt Exp $");
 
 #include "xmalloc.h"
 #include "rsa.h"
@@ -205,7 +205,7 @@
                        if (bits != BN_num_bits(client_host_key->rsa->n))
                                verbose("Warning: keysize mismatch for client_host_key: "
                                    "actual %d, announced %d",
-                                    BN_num_bits(client_host_key->rsa->n), bits);
+                                   BN_num_bits(client_host_key->rsa->n), bits);
                        packet_check_eom();
 
                        authenticated = auth_rhosts_rsa(pw, client_user,
diff -r 52dbb73f0a81 -r 72aeff10cdc0 crypto/dist/ssh/auth2-chall.c
--- a/crypto/dist/ssh/auth2-chall.c     Mon Jun 24 05:46:47 2002 +0000
+++ b/crypto/dist/ssh/auth2-chall.c     Mon Jun 24 05:48:24 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auth2-chall.c,v 1.7 2002/04/22 07:59:37 itojun Exp $   */
+/*     $NetBSD: auth2-chall.c,v 1.8 2002/06/24 05:48:27 itojun Exp $   */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  * Copyright (c) 2001 Per Allansson.  All rights reserved.
@@ -24,7 +24,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: auth2-chall.c,v 1.17 2002/03/18 17:50:31 provos Exp $");
+RCSID("$OpenBSD: auth2-chall.c,v 1.18 2002/06/19 00:27:55 deraadt Exp $");
 
 #include "ssh2.h"
 #include "auth.h"
@@ -220,7 +220,7 @@
        packet_start(SSH2_MSG_USERAUTH_INFO_REQUEST);
        packet_put_cstring(name);
        packet_put_cstring(instr);
-       packet_put_cstring("");         /* language not used */
+       packet_put_cstring("");         /* language not used */
        packet_put_int(numprompts);
        for (i = 0; i < numprompts; i++) {
                packet_put_cstring(prompts[i]);
diff -r 52dbb73f0a81 -r 72aeff10cdc0 crypto/dist/ssh/auth2-none.c
--- a/crypto/dist/ssh/auth2-none.c      Mon Jun 24 05:46:47 2002 +0000
+++ b/crypto/dist/ssh/auth2-none.c      Mon Jun 24 05:48:24 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auth2-none.c,v 1.1.1.1 2002/06/24 05:26:12 itojun Exp $        */
+/*     $NetBSD: auth2-none.c,v 1.2 2002/06/24 05:48:27 itojun Exp $    */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -58,7 +58,7 @@
        }
        len = st.st_size;
        banner = xmalloc(len + 1);
-       n = atomicio(read, fd, banner, len);
+       n = atomic_read(fd, banner, len);
        close(fd);
 
        if (n != len) {
diff -r 52dbb73f0a81 -r 72aeff10cdc0 crypto/dist/ssh/auth2.c
--- a/crypto/dist/ssh/auth2.c   Mon Jun 24 05:46:47 2002 +0000
+++ b/crypto/dist/ssh/auth2.c   Mon Jun 24 05:48:24 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auth2.c,v 1.16 2002/05/13 02:58:17 itojun Exp $        */
+/*     $NetBSD: auth2.c,v 1.17 2002/06/24 05:48:28 itojun Exp $        */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -24,33 +24,17 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth2.c,v 1.90 2002/05/12 23:53:45 djm Exp $");
-
-#include <openssl/evp.h>
+RCSID("$OpenBSD: auth2.c,v 1.93 2002/05/31 11:35:15 markus Exp $");
 
 #include "ssh2.h"
 #include "xmalloc.h"
-#include "rsa.h"
-#include "sshpty.h"
 #include "packet.h"
-#include "buffer.h"
 #include "log.h"
 #include "servconf.h"
 #include "compat.h"
-#include "channels.h"



Home | Main Index | Thread Index | Old Index