Source-Changes-HG archive

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

[src/trunk]: src/crypto/dist/ssh OpenSSH 2.3.1 as of 2001/2/8



details:   https://anonhg.NetBSD.org/src/rev/575f47e56142
branches:  trunk
changeset: 503511:575f47e56142
user:      itojun <itojun%NetBSD.org@localhost>
date:      Wed Feb 07 16:46:40 2001 +0000

description:
OpenSSH 2.3.1 as of 2001/2/8

diffstat:

 crypto/dist/ssh/RFC.nroff      |    2 +-
 crypto/dist/ssh/atomicio.c     |   48 +-
 crypto/dist/ssh/atomicio.h     |   31 +
 crypto/dist/ssh/auth-chall.c   |   62 +++
 crypto/dist/ssh/auth-krb4.c    |   20 +-
 crypto/dist/ssh/auth-options.c |  157 +++----
 crypto/dist/ssh/auth-options.h |   21 +-
 crypto/dist/ssh/auth-passwd.c  |   67 +---
 crypto/dist/ssh/auth-rh-rsa.c  |   23 +-
 crypto/dist/ssh/auth-rsa.c     |   41 +-
 crypto/dist/ssh/auth.c         |  315 +++++----------
 crypto/dist/ssh/auth.h         |   84 +++-
 crypto/dist/ssh/auth2-chall.c  |  113 +++++
 crypto/dist/ssh/auth2.c        |  190 ++++-----
 crypto/dist/ssh/authfd.c       |   31 +-
 crypto/dist/ssh/authfd.h       |    4 +-
 crypto/dist/ssh/authfile.c     |   60 +-
 crypto/dist/ssh/authfile.h     |    4 +-
 crypto/dist/ssh/bufaux.c       |   32 +-
 crypto/dist/ssh/bufaux.h       |    7 +-
 crypto/dist/ssh/buffer.c       |   12 +-
 crypto/dist/ssh/buffer.h       |    4 +-
 crypto/dist/ssh/canohost.h     |   34 +
 crypto/dist/ssh/channels.h     |   20 +-
 crypto/dist/ssh/cipher.h       |    4 +-
 crypto/dist/ssh/cli.c          |   39 +-
 crypto/dist/ssh/cli.h          |    8 +-
 crypto/dist/ssh/clientloop.h   |   39 +
 crypto/dist/ssh/compat.c       |   20 +-
 crypto/dist/ssh/compat.h       |    6 +-
 crypto/dist/ssh/compress.c     |   15 +-
 crypto/dist/ssh/compress.h     |    4 +-
 crypto/dist/ssh/crc32.c        |    9 +-
 crypto/dist/ssh/crc32.h        |    4 +-
 crypto/dist/ssh/deattack.h     |    2 +-
 crypto/dist/ssh/dh.c           |   25 +-
 crypto/dist/ssh/dh.h           |    2 +
 crypto/dist/ssh/dispatch.c     |   21 +-
 crypto/dist/ssh/dispatch.h     |    3 +-
 crypto/dist/ssh/getput.h       |   45 +-
 crypto/dist/ssh/groupaccess.c  |   78 +++
 crypto/dist/ssh/groupaccess.h  |   49 ++
 crypto/dist/ssh/hmac.c         |   14 +-
 crypto/dist/ssh/hmac.h         |    3 +-
 crypto/dist/ssh/hostfile.c     |   18 +-
 crypto/dist/ssh/hostfile.h     |    3 +-
 crypto/dist/ssh/includes.h     |    8 +-
 crypto/dist/ssh/kex.h          |    4 +-
 crypto/dist/ssh/key.c          |   62 +-
 crypto/dist/ssh/key.h          |    6 +-
 crypto/dist/ssh/log-client.c   |   21 +-
 crypto/dist/ssh/log.c          |   20 +-
 crypto/dist/ssh/log.h          |   75 +++
 crypto/dist/ssh/login.c        |   13 +-
 crypto/dist/ssh/login.h        |   40 ++
 crypto/dist/ssh/match.c        |   13 +-
 crypto/dist/ssh/match.h        |    3 +-
 crypto/dist/ssh/misc.c         |   97 ++++
 crypto/dist/ssh/misc.h         |   21 +
 crypto/dist/ssh/mpaux.c        |   12 +-
 crypto/dist/ssh/mpaux.h        |    4 +-
 crypto/dist/ssh/myproposal.h   |    2 +-
 crypto/dist/ssh/nchan.c        |   19 +-
 crypto/dist/ssh/nchan.h        |    4 +-
 crypto/dist/ssh/nchan.ms       |    3 +-
 crypto/dist/ssh/nchan2.ms      |    2 -
 crypto/dist/ssh/packet.h       |    6 +-
 crypto/dist/ssh/pathnames.h    |  156 ++++---
 crypto/dist/ssh/pty.c          |   26 +-
 crypto/dist/ssh/pty.h          |    4 +-
 crypto/dist/ssh/radix.c        |   26 +-
 crypto/dist/ssh/radix.h        |   28 +
 crypto/dist/ssh/readconf.h     |    7 +-
 crypto/dist/ssh/readpass.c     |   11 +-
 crypto/dist/ssh/readpass.h     |   20 +
 crypto/dist/ssh/rijndael.c     |  116 ++--
 crypto/dist/ssh/rijndael.h     |    2 +
 crypto/dist/ssh/rsa.c          |   27 +-
 crypto/dist/ssh/rsa.h          |    6 +-
 crypto/dist/ssh/scp.1          |    6 +-
 crypto/dist/ssh/serverloop.c   |  160 +++----
 crypto/dist/ssh/serverloop.h   |   22 +
 crypto/dist/ssh/session.c      |  164 +++++---
 crypto/dist/ssh/session.h      |    5 +-
 crypto/dist/ssh/sftp-client.c  |  800 +++++++++++++++++++++++++++++++++++++++++
 crypto/dist/ssh/sftp-client.h  |   84 ++++
 crypto/dist/ssh/sftp-common.c  |  146 +++++++
 crypto/dist/ssh/sftp-common.h  |   55 ++
 crypto/dist/ssh/sftp-int.c     |  626 ++++++++++++++++++++++++++++++++
 crypto/dist/ssh/sftp-int.h     |   27 +
 crypto/dist/ssh/sftp-server.8  |    7 +-
 crypto/dist/ssh/sftp.1         |  161 ++++++++
 crypto/dist/ssh/sftp.c         |  233 +++++++++++
 crypto/dist/ssh/sftp.h         |   88 ++++
 crypto/dist/ssh/ssh-add.1      |   41 +-
 crypto/dist/ssh/ssh-agent.1    |  182 +++-----
 crypto/dist/ssh/ssh-dss.c      |   33 +-
 crypto/dist/ssh/ssh-dss.h      |    2 +
 crypto/dist/ssh/ssh-keygen.1   |   42 +-
 crypto/dist/ssh/ssh-keyscan.c  |   67 +-
 crypto/dist/ssh/ssh-rsa.c      |   30 +-
 crypto/dist/ssh/ssh-rsa.h      |    2 +
 crypto/dist/ssh/ssh1.h         |   86 ++++
 crypto/dist/ssh/ssh2.h         |    5 +-
 crypto/dist/ssh/ssh_config     |   36 +
 crypto/dist/ssh/sshconnect.c   |   60 +-
 crypto/dist/ssh/sshconnect.h   |   33 +-
 crypto/dist/ssh/sshconnect1.c  |  128 +++---
 crypto/dist/ssh/sshconnect2.c  |   77 ++-
 crypto/dist/ssh/sshd_config    |   63 +++
 crypto/dist/ssh/tildexpand.c   |   12 +-
 crypto/dist/ssh/tildexpand.h   |   19 +
 crypto/dist/ssh/ttymodes.c     |   13 +-
 crypto/dist/ssh/ttymodes.h     |    4 +-
 crypto/dist/ssh/uidswap.c      |   14 +-
 crypto/dist/ssh/uidswap.h      |    2 +-
 crypto/dist/ssh/uuencode.c     |   13 +-
 crypto/dist/ssh/uuencode.h     |    2 +-
 crypto/dist/ssh/xmalloc.c      |   31 +-
 crypto/dist/ssh/xmalloc.h      |    4 +-
 120 files changed, 4509 insertions(+), 1733 deletions(-)

diffs (truncated from 10312 to 300 lines):

diff -r 1477f94c4aac -r 575f47e56142 crypto/dist/ssh/RFC.nroff
--- a/crypto/dist/ssh/RFC.nroff Wed Feb 07 15:29:21 2001 +0000
+++ b/crypto/dist/ssh/RFC.nroff Wed Feb 07 16:46:40 2001 +0000
@@ -1,6 +1,6 @@
 .\" -*- nroff -*-
 .\"
-.\" $NetBSD: RFC.nroff,v 1.1.1.1 2000/09/28 22:09:37 thorpej Exp $
+.\" $OpenBSD: RFC.nroff,v 1.2 2000/10/16 09:38:44 djm Exp $
 .\"
 .pl 10.0i
 .po 0
diff -r 1477f94c4aac -r 575f47e56142 crypto/dist/ssh/atomicio.c
--- a/crypto/dist/ssh/atomicio.c        Wed Feb 07 15:29:21 2001 +0000
+++ b/crypto/dist/ssh/atomicio.c        Wed Feb 07 16:46:40 2001 +0000
@@ -1,5 +1,3 @@
-/*     $NetBSD: atomicio.c,v 1.1.1.2 2001/01/14 04:49:56 itojun Exp $  */
-
 /*
  * Copyright (c) 1995,1999 Theo de Raadt
  * All rights reserved.
@@ -25,24 +23,27 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* from OpenBSD: atomicio.c,v 1.7 2000/10/18 18:04:02 markus Exp */
+#include "includes.h"
+RCSID("$OpenBSD: atomicio.c,v 1.8 2001/01/21 19:05:40 markus Exp $");
 
-#include <sys/cdefs.h>
-#ifndef lint
-__RCSID("$NetBSD: atomicio.c,v 1.1.1.2 2001/01/14 04:49:56 itojun Exp $");
-#endif
+#include "xmalloc.h"
+#include "atomicio.h"
 
-#include "includes.h"
-#include "ssh.h"
-
+/*
+ * ensure all of data on socket comes through. f==read || f==write
+ */
 ssize_t
-atomic_read(int fd, void *v, size_t n)
+atomicio(f, fd, _s, n)
+       ssize_t (*f) ();
+       int fd;
+       void *_s;
+       size_t n;
 {
-       char *s = v;
+       char *s = _s;
        ssize_t res, pos = 0;
 
        while (n > pos) {
-               res = read(fd, s + pos, n - pos);
+               res = (f) (fd, s + pos, n - pos);
                switch (res) {
                case -1:
                        if (errno == EINTR || errno == EAGAIN)
@@ -55,24 +56,3 @@
        }
        return (pos);
 }
-
-ssize_t
-atomic_write(int fd, const void *v, size_t n)
-{
-       const char *s = v;
-       ssize_t res, pos = 0;
-
-       while (n > pos) {
-               res = write(fd, s + pos, n - pos);
-               switch (res) {
-               case -1:
-                       if (errno == EINTR || errno == EAGAIN)
-                               continue;
-               case 0:
-                       return (res);
-               default:
-                       pos += res;
-               }
-       }
-       return (pos);
-}
diff -r 1477f94c4aac -r 575f47e56142 crypto/dist/ssh/atomicio.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/crypto/dist/ssh/atomicio.h        Wed Feb 07 16:46:40 2001 +0000
@@ -0,0 +1,31 @@
+/*     $OpenBSD: atomicio.h,v 1.2 2001/01/29 01:58:14 niklas Exp $     */
+
+/*
+ * Copyright (c) 1995,1999 Theo de Raadt
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Ensure all of data on socket comes through. f==read || f==write
+ */
+ssize_t        atomicio(ssize_t (*f)(), int fd, void *s, size_t n);
diff -r 1477f94c4aac -r 575f47e56142 crypto/dist/ssh/auth-chall.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/crypto/dist/ssh/auth-chall.c      Wed Feb 07 16:46:40 2001 +0000
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2001 Markus Friedl. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "includes.h"
+RCSID("$OpenBSD: auth-chall.c,v 1.4 2001/02/04 15:32:22 stevesk Exp $");
+
+#include "auth.h"
+
+#ifdef SKEY
+#include <skey.h>
+
+char *
+get_challenge(Authctxt *authctxt, char *devs)
+{
+       static char challenge[1024];
+       struct skey skey;
+       if (skeychallenge(&skey, authctxt->user, challenge) == -1)
+               return NULL;
+       strlcat(challenge, "\nS/Key Password: ", sizeof challenge);
+       return challenge;
+}
+int
+verify_response(Authctxt *authctxt, char *response)
+{
+       return (authctxt->valid &&
+           skey_haskey(authctxt->pw->pw_name) == 0 &&
+           skey_passcheck(authctxt->pw->pw_name, response) != -1);
+}
+#else
+/* not available */
+char *
+get_challenge(Authctxt *authctxt, char *devs)
+{
+       return NULL;
+}
+int
+verify_response(Authctxt *authctxt, char *response)
+{
+       return 0;
+}
+#endif
diff -r 1477f94c4aac -r 575f47e56142 crypto/dist/ssh/auth-krb4.c
--- a/crypto/dist/ssh/auth-krb4.c       Wed Feb 07 15:29:21 2001 +0000
+++ b/crypto/dist/ssh/auth-krb4.c       Wed Feb 07 16:46:40 2001 +0000
@@ -1,5 +1,3 @@
-/*     $NetBSD: auth-krb4.c,v 1.1.1.2 2001/01/14 04:49:57 itojun Exp $ */
-
 /*
  * Copyright (c) 1999 Dug Song.  All rights reserved.
  *
@@ -24,18 +22,20 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* from: OpenBSD: auth-krb4.c,v 1.20 2000/12/19 23:17:54 markus Exp */
+#include "includes.h"
+RCSID("$OpenBSD: auth-krb4.c,v 1.23 2001/01/22 08:15:00 markus Exp $");
 
-#include <sys/cdefs.h>
-#ifndef lint
-__RCSID("$NetBSD: auth-krb4.c,v 1.1.1.2 2001/01/14 04:49:57 itojun Exp $");
-#endif
-
-#include "includes.h"
+#include "ssh.h"
+#include "ssh1.h"
 #include "packet.h"
 #include "xmalloc.h"
-#include "ssh.h"
+#include "log.h"
 #include "servconf.h"
+#include "auth.h"
+
+#ifdef AFS
+#include "radix.h"
+#endif
 
 #ifdef KRB4
 char *ticket = NULL;
diff -r 1477f94c4aac -r 575f47e56142 crypto/dist/ssh/auth-options.c
--- a/crypto/dist/ssh/auth-options.c    Wed Feb 07 15:29:21 2001 +0000
+++ b/crypto/dist/ssh/auth-options.c    Wed Feb 07 16:46:40 2001 +0000
@@ -1,13 +1,7 @@
-/*     $NetBSD: auth-options.c,v 1.1.1.2 2001/01/14 04:49:57 itojun Exp $      */
-
 /*
  * Author: Tatu Ylonen <ylo%cs.hut.fi@localhost>
  * Copyright (c) 1995 Tatu Ylonen <ylo%cs.hut.fi@localhost>, Espoo, Finland
  *                    All rights reserved
- * RSA-based authentication.  This code determines whether to admit a login
- * based on RSA authentication.  This file also contains functions to check
- * validity of the host key.
- *
  * As far as I am concerned, the code I have written for this software
  * can be used freely for any purpose.  Any derived versions of this
  * software must be clearly marked as such, and if the derived work is
@@ -15,21 +9,16 @@
  * called by a name other than "ssh" or "Secure Shell".
  */
 
-/* from OpenBSD: auth-options.c,v 1.7 2000/12/19 23:17:54 markus Exp */
+#include "includes.h"
+RCSID("$OpenBSD: auth-options.c,v 1.12 2001/02/03 10:08:36 markus Exp $");
 
-#include <sys/cdefs.h>
-#ifndef lint
-__RCSID("$NetBSD: auth-options.c,v 1.1.1.2 2001/01/14 04:49:57 itojun Exp $");
-#endif
-
-#include "includes.h"
-
-#include "ssh.h"
 #include "packet.h"
-#include "pathnames.h"
 #include "xmalloc.h"
 #include "match.h"
+#include "log.h"
+#include "canohost.h"
 #include "auth-options.h"
+#include "servconf.h"
 
 /* Flags set authorized_keys flags */
 int no_port_forwarding_flag = 0;
@@ -43,6 +32,8 @@
 /* "environment=" options. */
 struct envstring *custom_environment = NULL;
 
+extern ServerOptions options;
+
 void
 auth_clear_options(void)
 {
@@ -62,103 +53,106 @@
        }
 }
 
-/* return 1 if access is granted, 0 if not. side effect: sets key option flags */
+/*
+ * return 1 if access is granted, 0 if not.
+ * side effect: sets key option flags
+ */
 int
-auth_parse_options(struct passwd *pw, char *options, u_long linenum)
+auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum)
 {
        const char *cp;
-       if (!options)
+       if (!opts)
                return 1;
 
        /* reset options */
        auth_clear_options();
 
-       while (*options && *options != ' ' && *options != '\t') {
+       while (*opts && *opts != ' ' && *opts != '\t') {
                cp = "no-port-forwarding";



Home | Main Index | Thread Index | Old Index