From 510132b69d4fdceca750f6de39b2be84c49006c8 Mon Sep 17 00:00:00 2001 From: jbasney Date: Fri, 7 Jun 2002 18:37:16 +0000 Subject: [PATCH] updating OPENSSH_GSSAPI_Protocol1-branch with latest on the trunk (OpenSSH 3.2.3p1) --- openssh/CREDITS | 2 +- openssh/ChangeLog | 8431 ++---------------- openssh/INSTALL | 18 +- openssh/LICENCE | 1 + openssh/Makefile.in | 23 +- openssh/README.privsep | 57 + openssh/README.smartcard | 57 +- openssh/WARNING.RNG | 35 +- openssh/acconfig.h | 48 +- openssh/auth-bsdauth.c | 15 +- openssh/auth-krb4.c | 3 +- openssh/auth-krb5.c | 27 +- openssh/auth-options.c | 42 +- openssh/auth-pam.c | 10 +- openssh/auth-pam.h | 2 +- openssh/auth-passwd.c | 115 +- openssh/auth-rh-rsa.c | 59 +- openssh/auth-rhosts.c | 68 +- openssh/auth-rsa.c | 209 +- openssh/auth-sia.c | 55 +- openssh/auth-sia.h | 26 +- openssh/auth-skey.c | 21 +- openssh/auth.c | 123 +- openssh/auth.h | 40 +- openssh/auth1.c | 61 +- openssh/auth2-chall.c | 21 +- openssh/auth2.c | 113 +- openssh/authfd.c | 5 +- openssh/authfd.h | 4 +- openssh/bufaux.c | 28 +- openssh/bufaux.h | 8 +- openssh/channels.c | 30 +- openssh/channels.h | 14 +- openssh/cipher.c | 75 +- openssh/cipher.h | 9 +- openssh/clientloop.c | 74 +- openssh/clientloop.h | 3 +- openssh/compat.c | 31 +- openssh/compat.h | 6 +- openssh/compress.c | 14 +- openssh/configure.ac | 526 +- openssh/contrib/aix/buildbff.sh | 37 +- openssh/contrib/aix/inventory.sh | 2 +- openssh/contrib/caldera/openssh.spec | 10 +- openssh/contrib/cygwin/README | 4 +- openssh/contrib/cygwin/ssh-host-config | 4 +- openssh/contrib/redhat/gnome-ssh-askpass.csh | 1 + openssh/contrib/redhat/gnome-ssh-askpass.sh | 2 + openssh/contrib/redhat/openssh.spec | 616 +- openssh/contrib/redhat/sshd.init | 161 +- openssh/contrib/redhat/sshd.pam | 10 +- openssh/contrib/solaris/README | 12 +- openssh/contrib/solaris/buildpkg.sh | 292 +- openssh/contrib/suse/openssh.spec | 4 +- openssh/defines.h | 130 +- openssh/entropy.c | 12 +- openssh/gss-serv.c | 2 +- openssh/includes.h | 123 +- openssh/kex.c | 36 +- openssh/kex.h | 5 +- openssh/kexdh.c | 5 +- openssh/kexgex.c | 11 +- openssh/key.c | 45 +- openssh/key.h | 3 +- openssh/loginrec.c | 5 + openssh/mdoc2man.pl | 6 +- openssh/misc.h | 8 +- openssh/monitor.c | 1503 ++++ openssh/monitor.h | 82 + openssh/monitor_fdpass.c | 127 + openssh/monitor_fdpass.h | 34 + openssh/monitor_mm.c | 341 + openssh/monitor_mm.h | 66 + openssh/monitor_wrap.c | 931 ++ openssh/monitor_wrap.h | 92 + openssh/myproposal.h | 4 +- openssh/nchan.c | 60 +- openssh/openbsd-compat/bsd-arc4random.c | 2 +- openssh/openbsd-compat/bsd-cray.c | 43 +- openssh/openbsd-compat/bsd-cray.h | 36 + openssh/openbsd-compat/bsd-cygwin_util.c | 24 +- openssh/openbsd-compat/bsd-cygwin_util.h | 28 +- openssh/openbsd-compat/bsd-misc.c | 19 + openssh/openbsd-compat/bsd-misc.h | 3 + openssh/openbsd-compat/fake-queue.h | 87 +- openssh/openbsd-compat/fake-socket.h | 2 +- openssh/openbsd-compat/inet_aton.c | 2 +- openssh/openbsd-compat/readpassphrase.c | 3 +- openssh/openbsd-compat/tree.h | 667 ++ openssh/packet.c | 137 +- openssh/packet.h | 12 +- openssh/pathnames.h | 8 +- openssh/radix.c | 251 +- openssh/readpass.c | 7 +- openssh/readpass.h | 3 +- openssh/rijndael.c | 2 +- openssh/scard-opensc.c | 462 + openssh/scard.c | 309 +- openssh/scard.h | 10 +- openssh/scard/Makefile.in | 9 +- openssh/scard/Ssh.bin.uu | 27 +- openssh/scard/Ssh.java | 57 +- openssh/scp.c | 25 +- openssh/servconf.c | 21 +- openssh/servconf.h | 3 +- openssh/serverloop.c | 21 +- openssh/session.c | 170 +- openssh/session.h | 40 +- openssh/sftp-client.c | 68 +- openssh/sftp-glob.h | 4 +- openssh/sftp-int.c | 9 +- openssh/sftp.c | 21 +- openssh/ssh-add.c | 22 +- openssh/ssh-agent.c | 113 +- openssh/ssh-keygen.c | 158 +- openssh/ssh-keyscan.c | 5 - openssh/ssh-rand-helper.8 | 94 + openssh/ssh-rand-helper.c | 80 +- openssh/ssh-rsa.c | 13 +- openssh/ssh.1 | 15 +- openssh/ssh.c | 81 +- openssh/ssh.h | 14 +- openssh/sshconnect1.c | 6 +- openssh/sshconnect2.c | 79 +- openssh/sshd.8 | 72 +- openssh/sshd.c | 355 +- openssh/sshd_config | 9 +- openssh/sshpty.c | 14 + openssh/ttymodes.c | 18 +- openssh/uidswap.c | 4 +- openssh/version.h | 5 +- 131 files changed, 9313 insertions(+), 9731 deletions(-) create mode 100644 openssh/README.privsep create mode 100644 openssh/contrib/redhat/gnome-ssh-askpass.csh create mode 100644 openssh/contrib/redhat/gnome-ssh-askpass.sh create mode 100644 openssh/monitor.c create mode 100644 openssh/monitor.h create mode 100644 openssh/monitor_fdpass.c create mode 100644 openssh/monitor_fdpass.h create mode 100644 openssh/monitor_mm.c create mode 100644 openssh/monitor_mm.h create mode 100644 openssh/monitor_wrap.c create mode 100644 openssh/monitor_wrap.h create mode 100644 openssh/openbsd-compat/tree.h create mode 100644 openssh/scard-opensc.c create mode 100644 openssh/ssh-rand-helper.8 diff --git a/openssh/CREDITS b/openssh/CREDITS index bcc0359..1acb3f8 100644 --- a/openssh/CREDITS +++ b/openssh/CREDITS @@ -75,7 +75,7 @@ Philippe WILLEM - Bugfixes Phill Camp - login code fix Rip Loomis - Solaris package support, fixes SAKAI Kiyotaka - Multiple bugfixes -Simon Wilkinson - PAM fixes +Simon Wilkinson - PAM fixes, Compat with MIT KrbV Svante Signell - Bugfixes Thomas Neumann - Shadow passwords Tim Rice - Portability & SCO fixes diff --git a/openssh/ChangeLog b/openssh/ChangeLog index bd2d9c5..beaf3e3 100644 --- a/openssh/ChangeLog +++ b/openssh/ChangeLog @@ -1,7817 +1,674 @@ -20020307 - - (djm) OpenBSD CVS Sync - - markus@cvs.openbsd.org 2002/03/06 00:20:54 - [compat.c dh.c] - compat.c - - markus@cvs.openbsd.org 2002/03/06 00:23:27 - [compat.c dh.c] - undo - - markus@cvs.openbsd.org 2002/03/06 00:24:39 - [compat.c] - compat.c - - markus@cvs.openbsd.org 2002/03/06 00:25:55 - [version.h] - OpenSSH_3.1 - - (djm) Update RPM spec files with new version number - -20020305 - - stevesk@cvs.openbsd.org 2002/03/02 09:34:42 - [LICENCE] - correct copyright dates for scp license; ok markus@ - -20020304 - - OpenBSD CVS Sync - - deraadt@cvs.openbsd.org 2002/02/26 18:52:32 - [sftp.1] - Ic cannot have that many arguments; spotted by mouring@etoh.eviladmin.org - - mouring@cvs.openbsd.org 2002/02/26 19:04:37 - [sftp.1] - > Ic cannot have that many arguments; spotted by mouring@etoh.eviladmin.org - Last Ic on the first line should not have a space between it and the final - comma. - - deraadt@cvs.openbsd.org 2002/02/26 19:06:43 - [sftp.1] - no, look closely. the comma was highlighted. split .Ic even more - - stevesk@cvs.openbsd.org 2002/02/26 20:03:51 - [misc.c] - use socklen_t - - stevesk@cvs.openbsd.org 2002/02/27 21:23:13 - [canohost.c channels.c packet.c sshd.c] - remove unneeded casts in [gs]etsockopt(); ok markus@ - - markus@cvs.openbsd.org 2002/02/28 15:46:33 - [authfile.c kex.c kexdh.c kexgex.c key.c ssh-dss.c] - add some const EVP_MD for openssl-0.9.7 - - stevesk@cvs.openbsd.org 2002/02/28 19:36:28 - [auth.c match.c match.h] - delay hostname lookup until we see a ``@'' in DenyUsers and AllowUsers - for sshd -u0; ok markus@ - - stevesk@cvs.openbsd.org 2002/02/28 20:36:42 - [sshd.8] - DenyUsers allows user@host pattern also - - stevesk@cvs.openbsd.org 2002/02/28 20:46:10 - [sshd.8] - -u0 DNS for user@host - - stevesk@cvs.openbsd.org 2002/02/28 20:56:00 - [auth.c] - log user not allowed details, from dwd@bell-labs.com; ok markus@ - - markus@cvs.openbsd.org 2002/03/01 13:12:10 - [auth.c match.c match.h] - undo the 'delay hostname lookup' change - match.c must not use compress.c (via canonhost.c/packet.c) - thanks to wilfried@ - - markus@cvs.openbsd.org 2002/03/04 12:43:06 - [auth-passwd.c auth-rh-rsa.c auth-rhosts.c] - - markus@cvs.openbsd.org 2002/03/04 13:10:46 - [misc.c] - error-> debug, because O_NONBLOCK for /dev/null causes too many different - errnos; ok stevesk@, deraadt@ - unused include - - stevesk@cvs.openbsd.org 2002/03/04 17:27:39 - [auth-krb5.c auth-options.h auth.h authfd.h authfile.h bufaux.h buffer.h - channels.h cipher.h compat.h compress.h crc32.h deattack.c getput.h - groupaccess.c misc.c mpaux.h packet.h readconf.h rsa.h scard.h - servconf.h ssh-agent.c ssh.h ssh2.h sshpty.h sshtty.c ttymodes.h - uuencode.c xmalloc.h] - $OpenBSD$ and RCSID() cleanup: don't use RCSID() in .h files; add - missing RCSID() to .c files and remove dup /*$OpenBSD$*/ from .c - files. ok markus@ - - stevesk@cvs.openbsd.org 2002/03/04 18:30:23 - [ssh-keyscan.c] - handle connection close during read of protocol version string. - fixes erroneous "bad greeting". ok markus@ - - markus@cvs.openbsd.org 2002/03/04 19:37:58 - [channels.c] - off by one; thanks to joost@pine.nl - - (bal) Added contrib/aix/ to support BFF package generation provided - by Darren Tucker -20020226 - - (tim) Bug 12 [configure.ac] add sys/bitypes.h to int64_t tests - based on patch by mooney@dogbert.cc.ndsu.nodak.edu (Tim Mooney) - Bug 45 [configure.ac] modify skey test to work around conflict with autoconf - reported by nolan@naic.edu (Michael Nolan) - patch by Pekka Savola - Bug 74 [configure.ac defines.h] add sig_atomic_t test - reported by dwd@bell-labs.com (Dave Dykstra) - Bug 102 [defines.h] UNICOS fixes. patch by wendyp@cray.com - [configure.ac Makefile.in] link libwrap only with sshd - based on patch by Maciej W. Rozycki - Bug 123 link libpam only with sshd - reported by peak@argo.troja.mff.cuni.cz (Pavel Kankovsky) - [configure.ac defines.h] modify previous SCO3 fix to not break Solaris 7 - [acconfig.h] remove unused HAVE_REGCOMP - [configure.ac] put back in search for prngd-socket - - (stevesk) openbsd-compat/base64.h: typo in comment - - (bal) Update sshd_config CVSID - - (bal) OpenBSD CVS Sync - - markus@cvs.openbsd.org 2002/02/15 23:54:10 - [auth-krb5.c] - krb5_get_err_text() does not like context==NULL; he@nordu.net via google; - ok provos@ - - markus@cvs.openbsd.org 2002/02/22 12:20:34 - [log.c log.h ssh-keyscan.c] - overwrite fatal() in ssh-keyscan.c; fixes pr 2354; ok provos@ - - markus@cvs.openbsd.org 2002/02/23 17:59:02 - [kex.c kexdh.c kexgex.c] - don't allow garbage after payload. - - stevesk@cvs.openbsd.org 2002/02/24 16:09:52 - [sshd.c] - use u_char* here; ok markus@ - - markus@cvs.openbsd.org 2002/02/24 16:57:19 - [sftp-client.c] - early close(), missing free; ok stevesk@ - - markus@cvs.openbsd.org 2002/02/24 16:58:32 - [packet.c] - make 'cp' unsigned and merge with 'ucp'; ok stevesk@ - - markus@cvs.openbsd.org 2002/02/24 18:31:09 - [uuencode.c] - typo in comment - - markus@cvs.openbsd.org 2002/02/24 19:14:59 - [auth2.c authfd.c authfd.h authfile.c kexdh.c kexgex.c key.c key.h - ssh-dss.c ssh-dss.h ssh-keygen.c ssh-rsa.c ssh-rsa.h sshconnect2.c] - signed vs. unsigned: make size arguments u_int, ok stevesk@ - - stevesk@cvs.openbsd.org 2002/02/24 19:59:42 - [channels.c misc.c] - disable Nagle in connect_to() and channel_post_port_listener() (port - forwarding endpoints). the intention is to preserve the on-the-wire - appearance to applications at either end; the applications can then - enable TCP_NODELAY according to their requirements. ok markus@ - - markus@cvs.openbsd.org 2002/02/25 16:33:27 - [ssh-keygen.c sshconnect2.c uuencode.c uuencode.h] - more u_* fixes - - (bal) Imported missing fatal.c and fixed up Makefile.in - - (tim) [configure.ac] correction to Bug 123 fix - [configure.ac] correction to sig_atomic_t test - -20020225 - - (bal) Last AIX patch. Moved aix_usrinfo() outside of do_setuserconext() - since we need more session information than provided by that function. +20020522 + - (djm) Fix spelling mistakes, spotted by Solar Designer i + + - Sync scard/ (not sure when it drifted) + - (djm) OpenBSD CVS Sync: + [auth.c] + Fix typo/thinko. Pass in as to auth_approval(), not NULL. + Closes PR 2659. + - Crank version + - Crank RPM spec versions -20020224 - - (bal) Drop Session *s usage in ports-aix.[ch] and pass just what we - need to do the jobs (AIX still does not fully compile, but that is - coming). - - (bal) Part two.. Drop unused AIX header, fix up missing char *cp. All - that is left is handling aix_usrinfo(). - - (tim) [loginrec.c session.c sshlogin.c sshlogin.h] Bug 84 - patch by wknox@mitre.org (William Knox). - [sshlogin.h] declare record_utmp_only for session.c +20020521 + - (stevesk) [sshd.c] bug 245; disable setsid() for now + - (stevesk) [sshd.c] #ifndef HAVE_CYGWIN for setgroups() -20020221 - - (bal) Minor session.c fixup for cygwin. mispelt 'is_winnt' variable. +20020517 + - (tim) [configure.ac] remove extra MD5_MSG="no" line. -20020219 - - (djm) OpenBSD CVS Sync - - mpech@cvs.openbsd.org 2002/02/13 08:33:47 - [ssh-keyscan.1] - When you give command examples and etc., in a manual page prefix them with: $ command - or - # command - - markus@cvs.openbsd.org 2002/02/14 23:27:59 - [channels.c] - increase the SSH v2 window size to 4 packets. comsumes a little - bit more memory for slow receivers but increases througput. - - markus@cvs.openbsd.org 2002/02/14 23:28:00 - [channels.h session.c ssh.c] - increase the SSH v2 window size to 4 packets. comsumes a little - bit more memory for slow receivers but increases througput. - - markus@cvs.openbsd.org 2002/02/14 23:41:01 - [authfile.c cipher.c cipher.h kex.c kex.h packet.c] - hide some more implementation details of cipher.[ch] and prepares for move - to EVP, ok deraadt@ - - stevesk@cvs.openbsd.org 2002/02/16 14:53:37 - [ssh-keygen.1] - -t required now for key generation - - stevesk@cvs.openbsd.org 2002/02/16 20:40:08 - [ssh-keygen.c] - default to rsa keyfile path for non key generation operations where - keyfile not specified. fixes core dump in those cases. ok markus@ - - millert@cvs.openbsd.org 2002/02/16 21:27:53 - [auth.h] - Part one of userland __P removal. Done with a simple regexp with - some minor hand editing to make comments line up correctly. Another - pass is forthcoming that handles the cases that could not be done - automatically. - - millert@cvs.openbsd.org 2002/02/17 19:42:32 - [auth.h] - Manual cleanup of remaining userland __P use (excluding packages - maintained outside the tree) - - markus@cvs.openbsd.org 2002/02/18 13:05:32 - [cipher.c cipher.h] - switch to EVP, ok djm@ deraadt@ - - markus@cvs.openbsd.org 2002/02/18 17:55:20 - [ssh.1] - -q: Fatal errors are _not_ displayed. - - deraadt@cvs.openbsd.org 2002/02/19 02:50:59 - [sshd_config] - stategy is not an english word - - (bal) Migrated IRIX jobs/projects/audit/etc code to - openbsd-compat/port-irix.[ch] to improve readiblity of do_child() - - (bal) Migrated AIX getuserattr and usrinfo code to - openbsd-compat/port-aix.[c] to improve readilbity of do_child() and - simplify our diffs against upstream source. +20020515 + - (bal) CVS ID fix up on auth-passwd.c - (bal) OpenBSD CVS Sync - - markus@cvs.openbsd.org 2002/02/15 23:11:26 - [session.c] - split do_child(), ok mouring@ - - markus@cvs.openbsd.org 2002/02/16 00:51:44 - [session.c] - typo - - (bal) CVS ID sync since the last two patches were merged mistakenly - -20020218 - - (tim) newer config.guess from ftp://ftp.gnu.org/gnu/config/config.guess - -20020213 - - (djm) Don't use system sys/queue.h on AIX. Report from - gert@greenie.muc.de - - (djm) Bug #114 - not starting PAM for SSH protocol 1 invalid users - -20020213 - - (djm) OpenBSD CVS Sync - - markus@cvs.openbsd.org 2002/02/11 16:10:15 - [kex.c] - restore kexinit handler if we reset the dispatcher, this unbreaks - rekeying s/kex_clear_dispatch/kex_reset_dispatch/ - - markus@cvs.openbsd.org 2002/02/11 16:15:46 - [sshconnect1.c] - include md5.h, not evp.h - - markus@cvs.openbsd.org 2002/02/11 16:17:55 - [sshd.c] - do not complain about port > 1024 if rhosts-auth is disabled - - markus@cvs.openbsd.org 2002/02/11 16:19:39 - [sshd.c] - include md5.h not hmac.h - - markus@cvs.openbsd.org 2002/02/11 16:21:42 - [match.c] - support up to 40 algorithms per proposal - - djm@cvs.openbsd.org 2002/02/12 12:32:27 - [sftp.1 sftp.c sftp-client.c sftp-client.h sftp-int.c] - Perform multiple overlapping read/write requests in file transfer. Mostly - done by Tobias Ringstrom ; ok markus@ - - djm@cvs.openbsd.org 2002/02/12 12:44:46 - [sftp-client.c] - Let overlapped upload path handle servers which reorder ACKs. This may be - permitted by the protocol spec; ok markus@ - - markus@cvs.openbsd.org 2002/02/13 00:28:13 - [sftp-server.c] - handle SSH2_FILEXFER_ATTR_SIZE in SSH2_FXP_(F)SETSTAT; ok djm@ - - markus@cvs.openbsd.org 2002/02/13 00:39:15 - [readpass.c] - readpass.c is not longer from UCB, since we now use readpassphrase(3) - - djm@cvs.openbsd.org 2002/02/13 00:59:23 - [sftp-client.c sftp-client.h sftp-glob.c sftp-glob.h sftp.h] - [sftp-int.c sftp-int.h] - API cleanup and backwards compat for filexfer v.0 servers; ok markus@ - - (djm) Sync openbsd-compat with OpenBSD CVS too - - (djm) Bug #106: Add --without-rpath configure option. Patch from - Nicolas.Williams@ubsw.com - - (tim) [configure.ac, defines.h ] add rpc/rpc.h for INADDR_LOOPBACK - on SCO OSR3 - -20020210 - - (djm) OpenBSD CVS Sync - - deraadt@cvs.openbsd.org 2002/02/09 17:37:34 - [pathnames.h session.c ssh.1 sshd.8 sshd_config ssh-keyscan.1] - move ssh config files to /etc/ssh - - (djm) Adjust portable Makefile.in tnd ssh-rand-helper.c o match - - deraadt@cvs.openbsd.org 2002/02/10 01:07:05 - [readconf.h sshd.8] - more /etc/ssh; openbsd@davidkrause.com - -20020208 - - (djm) OpenBSD CVS Sync - - markus@cvs.openbsd.org 2002/02/04 12:15:25 - [sshd.c] - add SYSLOG_FACILITY_NOT_SET = -1, SYSLOG_LEVEL_NOT_SET = -1, - fixes arm/netbsd; based on patch from bjh21@netbsd.org; ok djm@ - - stevesk@cvs.openbsd.org 2002/02/04 20:41:16 - [ssh-agent.1] - more sync for default ssh-add identities; ok markus@ - - djm@cvs.openbsd.org 2002/02/05 00:00:46 - [sftp.1 sftp.c sftp-client.c sftp-client.h sftp-int.c] - Add "-B" option to specify copy buffer length (default 32k); ok markus@ - - markus@cvs.openbsd.org 2002/02/05 14:32:55 - [channels.c channels.h ssh.c] - merge channel_request() into channel_request_start() - - markus@cvs.openbsd.org 2002/02/06 14:22:42 - [sftp.1] - sort options; ok mpech@, stevesk@ - - mpech@cvs.openbsd.org 2002/02/06 14:27:23 - [sftp.c] - sync usage() with manual. - - markus@cvs.openbsd.org 2002/02/06 14:37:22 - [session.c] - minor KNF - - markus@cvs.openbsd.org 2002/02/06 14:55:16 - [channels.c clientloop.c serverloop.c ssh.c] - channel_new never returns NULL, mouring@; ok djm@ - - markus@cvs.openbsd.org 2002/02/07 09:35:39 - [ssh.c] - remove bogus comments - -20020205 - - (djm) Cleanup after sync: - - :%s/reverse_mapping_check/verify_reverse_mapping/g - - (djm) OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2002/01/24 21:09:25 - [channels.c misc.c misc.h packet.c] - add set_nodelay() to set TCP_NODELAY on a socket (prep for nagle tuning). - no nagle changes just yet; ok djm@ markus@ - - stevesk@cvs.openbsd.org 2002/01/24 21:13:23 - [packet.c] - need misc.h for set_nodelay() - - markus@cvs.openbsd.org 2002/01/25 21:00:24 - [sshconnect2.c] - unused include - - markus@cvs.openbsd.org 2002/01/25 21:42:11 - [ssh-dss.c ssh-rsa.c] - use static EVP_MAX_MD_SIZE buffers for EVP_DigestFinal; ok stevesk@ - don't use evp_md->md_size, it's not public. - - markus@cvs.openbsd.org 2002/01/25 22:07:40 - [kex.c kexdh.c kexgex.c key.c mac.c] - use EVP_MD_size(evp_md) and not evp_md->md_size; ok steveks@ - - stevesk@cvs.openbsd.org 2002/01/26 16:44:22 - [includes.h session.c] - revert code to add x11 localhost display authorization entry for - hostname/unix:d and uts.nodename/unix:d if nodename was different than - hostname. just add entry for unix:d instead. ok markus@ - - stevesk@cvs.openbsd.org 2002/01/27 14:57:46 - [channels.c servconf.c servconf.h session.c sshd.8 sshd_config] - add X11UseLocalhost; ok markus@ - - stevesk@cvs.openbsd.org 2002/01/27 18:08:17 - [ssh.c] - handle simple case to identify FamilyLocal display; ok markus@ - - markus@cvs.openbsd.org 2002/01/29 14:27:57 - [ssh-add.c] - exit 2 if no agent, exit 1 if list fails; debian#61078; ok djm@ - - markus@cvs.openbsd.org 2002/01/29 14:32:03 - [auth2.c auth.c auth-options.c auth-rhosts.c auth-rh-rsa.c canohost.c] - [servconf.c servconf.h session.c sshd.8 sshd_config] - s/ReverseMappingCheck/VerifyReverseMapping/ and avoid confusion; - ok stevesk@ - - stevesk@cvs.openbsd.org 2002/01/29 16:29:02 - [session.c] - limit subsystem length in log; ok markus@ - - markus@cvs.openbsd.org 2002/01/29 16:41:19 - [ssh-add.1] - add DIAGNOSTICS; ok stevesk@ - - markus@cvs.openbsd.org 2002/01/29 22:46:41 - [session.c] - don't depend on servconf.c; ok djm@ - - markus@cvs.openbsd.org 2002/01/29 23:50:37 - [scp.1 ssh.1] - mention exit status; ok stevesk@ - - markus@cvs.openbsd.org 2002/01/31 13:35:11 - [kexdh.c kexgex.c] - cross check announced key type and type from key blob - - markus@cvs.openbsd.org 2002/01/31 15:00:05 - [serverloop.c] - no need for WNOHANG; ok stevesk@ - - markus@cvs.openbsd.org 2002/02/03 17:53:25 - [auth1.c serverloop.c session.c session.h] - don't use channel_input_channel_request and callback - use new server_input_channel_req() instead: - server_input_channel_req does generic request parsing on server side - session_input_channel_req handles just session specific things now - ok djm@ - - markus@cvs.openbsd.org 2002/02/03 17:55:55 - [channels.c channels.h] - remove unused channel_input_channel_request - - markus@cvs.openbsd.org 2002/02/03 17:58:21 - [channels.c channels.h ssh.c] - generic callbacks are not really used, remove and - add a callback for msg of type SSH2_MSG_CHANNEL_OPEN_CONFIRMATION - ok djm@ - - markus@cvs.openbsd.org 2002/02/03 17:59:23 - [sshconnect2.c] - more cross checking if announced vs. used key type; ok stevesk@ - - stevesk@cvs.openbsd.org 2002/02/03 22:35:57 - [ssh.1 sshd.8] - some KeepAlive cleanup/clarify; ok markus@ - - stevesk@cvs.openbsd.org 2002/02/03 23:22:59 - [ssh-agent.1] - ssh-add also adds $HOME/.ssh/id_rsa and $HOME/.ssh/id_dsa now. - - stevesk@cvs.openbsd.org 2002/02/04 00:53:39 - [ssh-agent.c] - unneeded includes - - markus@cvs.openbsd.org 2002/02/04 11:58:10 - [auth2.c] - cross checking of announced vs actual pktype in pubkey/hostbaed auth; - ok stevesk@ - - markus@cvs.openbsd.org 2002/02/04 12:15:25 - [log.c log.h readconf.c servconf.c] - add SYSLOG_FACILITY_NOT_SET = -1, SYSLOG_LEVEL_NOT_SET = -1, - fixes arm/netbsd; based on patch from bjh21@netbsd.org; ok djm@ - - stevesk@cvs.openbsd.org 2002/02/04 20:41:16 - [ssh-add.1] - more sync for default ssh-add identities; ok markus@ - - djm@cvs.openbsd.org 2002/02/04 21:53:12 - [sftp.1 sftp.c] - Add "-P" option to directly connect to a local sftp-server. Should be - useful for regression testing; ok markus@ - - djm@cvs.openbsd.org 2002/02/05 00:00:46 - [sftp.1 sftp.c sftp-client.c sftp-client.h sftp-int.c] - Add "-B" option to specify copy buffer length (default 32k); ok markus@ - -20020130 - - (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@ - - (tim) [configure.ac] fix logic on when ssh-rand-helper is installed. - [sshd_config] put back in line that tells what PATH was compiled into sshd. - -20020125 - - (djm) Don't grab Xserver or pointer by default. x11-ssh-askpass doesn't - and grabbing can cause deadlocks with kinput2. - -20020124 - - (stevesk) Makefile.in: bug #61; delete commented line for now. - -20020123 - - (djm) Fix non-standard shell syntax in autoconf. Patch from - Dave Dykstra - - (stevesk) fix --with-zlib= - - (djm) Use case statements in autoconf to clean up some tests - - (bal) reverted out of 5/2001 change to atexit(). I assume I - did it to handle SonyOS. If that is the case than we will - do a special case for them. - -20020122 - - (djm) autoconf hacking: - - We don't support --without-zlib currently, so don't allow it. - - Rework cryptographic random number support detection. We now detect - whether OpenSSL seeds itself. If it does, then we don't bother with - the ssh-rand-helper program. You can force the use of ssh-rand-helper - using the --with-rand-helper configure argument - - Simplify and clean up ssh-rand-helper configuration - - Add OpenSSL sanity check: verify that header version matches version - reported by library - - (djm) Fix some bugs I introduced into ssh-rand-helper yesterday - - OpenBSD CVS Sync - - djm@cvs.openbsd.org 2001/12/21 08:52:22 - [ssh-keygen.1 ssh-keygen.c] - Remove default (rsa1) key type; ok markus@ - - djm@cvs.openbsd.org 2001/12/21 08:53:45 - [readpass.c] - Avoid interruptable passphrase read; ok markus@ - - djm@cvs.openbsd.org 2001/12/21 10:06:43 - [ssh-add.1 ssh-add.c] - Try all standard key files (id_rsa, id_dsa, identity) when invoked with - no arguments; ok markus@ - - markus@cvs.openbsd.org 2001/12/21 12:17:33 - [serverloop.c] - remove ifdef for USE_PIPES since fdin != fdout; ok djm@ - - deraadt@cvs.openbsd.org 2001/12/24 07:29:43 - [ssh-add.c] - try all listed keys.. how did this get broken? - - markus@cvs.openbsd.org 2001/12/25 18:49:56 - [key.c] - be more careful on allocation - - markus@cvs.openbsd.org 2001/12/25 18:53:00 - [auth1.c] - be more carefull on allocation - - markus@cvs.openbsd.org 2001/12/27 18:10:29 - [ssh-keygen.c] - -t is only needed for key generation (unbreaks -i, -e, etc). - - markus@cvs.openbsd.org 2001/12/27 18:22:16 - [auth1.c authfile.c auth-rsa.c dh.c kexdh.c kexgex.c key.c rsa.c] - [scard.c ssh-agent.c sshconnect1.c sshd.c ssh-dss.c] - call fatal() for openssl allocation failures - - stevesk@cvs.openbsd.org 2001/12/27 18:22:53 - [sshd.8] - clarify -p; ok markus@ - - markus@cvs.openbsd.org 2001/12/27 18:26:13 - [authfile.c] - missing include - - markus@cvs.openbsd.org 2001/12/27 19:37:23 - [dh.c kexdh.c kexgex.c] - always use BN_clear_free instead of BN_free - - markus@cvs.openbsd.org 2001/12/27 19:54:53 - [auth1.c auth.h auth-rh-rsa.c] - auth_rhosts_rsa now accept generic keys. - - markus@cvs.openbsd.org 2001/12/27 20:39:58 - [auth1.c auth-rsa.c channels.c clientloop.c packet.c packet.h] - [serverloop.c session.c ssh.c sshconnect1.c sshd.c ttymodes.c] - get rid of packet_integrity_check, use packet_done() instead. - - markus@cvs.openbsd.org 2001/12/28 12:14:27 - [auth1.c auth2.c auth2-chall.c auth-rsa.c channels.c clientloop.c] - [kex.c kexdh.c kexgex.c packet.c packet.h serverloop.c session.c] - [ssh.c sshconnect1.c sshconnect2.c sshd.c] - s/packet_done/packet_check_eom/ (end-of-message); ok djm@ - - markus@cvs.openbsd.org 2001/12/28 13:57:33 - [auth1.c kexdh.c kexgex.c packet.c packet.h sshconnect1.c sshd.c] - packet_get_bignum* no longer returns a size - - markus@cvs.openbsd.org 2001/12/28 14:13:13 - [bufaux.c bufaux.h packet.c] - buffer_get_bignum: int -> void - - markus@cvs.openbsd.org 2001/12/28 14:50:54 - [auth1.c auth-rsa.c channels.c dispatch.c kex.c kexdh.c kexgex.c] - [packet.c packet.h serverloop.c session.c ssh.c sshconnect1.c] - [sshconnect2.c sshd.c] - packet_read* no longer return the packet length, since it's not used. - - markus@cvs.openbsd.org 2001/12/28 15:06:00 - [auth2.c auth2-chall.c channels.c channels.h clientloop.c dispatch.c] - [dispatch.h kex.c kex.h serverloop.c ssh.c sshconnect2.c] - remove plen from the dispatch fn. it's no longer used. - - stevesk@cvs.openbsd.org 2001/12/28 22:37:48 - [ssh.1 sshd.8] - document LogLevel DEBUG[123]; ok markus@ - - stevesk@cvs.openbsd.org 2001/12/29 21:56:01 - [authfile.c channels.c compress.c packet.c sftp-server.c] - [ssh-agent.c ssh-keygen.c] - remove unneeded casts and some char->u_char cleanup; ok markus@ - - stevesk@cvs.openbsd.org 2002/01/03 04:11:08 - [ssh_config] - grammar in comment - - stevesk@cvs.openbsd.org 2002/01/04 17:59:17 - [readconf.c servconf.c] - remove #ifdef _PATH_XAUTH/#endif; ok markus@ - - stevesk@cvs.openbsd.org 2002/01/04 18:14:16 - [servconf.c sshd.8] - protocol 2 HostKey code default is now /etc/ssh_host_rsa_key and - /etc/ssh_host_dsa_key like we have in sshd_config. ok markus@ - - markus@cvs.openbsd.org 2002/01/05 10:43:40 - [channels.c] - fix hanging x11 channels for rejected cookies (e.g. - XAUTHORITY=/dev/null xbiff) bug #36, based on patch from - djast@cs.toronto.edu - - stevesk@cvs.openbsd.org 2002/01/05 21:51:56 - [ssh.1 sshd.8] - some missing and misplaced periods - - markus@cvs.openbsd.org 2002/01/09 13:49:27 - [ssh-keygen.c] - append \n only for public keys - - markus@cvs.openbsd.org 2002/01/09 17:16:00 - [channels.c] - merge channel_pre_open_15/channel_pre_open_20; ok provos@ - - markus@cvs.openbsd.org 2002/01/09 17:26:35 - [channels.c nchan.c] - replace buffer_consume(b, buffer_len(b)) with buffer_clear(b); + - deraadt@cvs.openbsd.org 2002/05/07 19:54:36 + [ssh.h] + use ssh uid + - deraadt@cvs.openbsd.org 2002/05/08 21:06:34 + [ssh.h] + move to sshd.sshd instead + - stevesk@cvs.openbsd.org 2002/05/11 20:24:48 + [ssh.h] + typo in comment + - itojun@cvs.openbsd.org 2002/05/13 02:37:39 + [auth-skey.c auth2.c] + less warnings. skey_{respond,query} are public (in auth.h) + - markus@cvs.openbsd.org 2002/05/13 20:44:58 + [auth-options.c auth.c auth.h] + move the packet_send_debug handling from auth-options.c to auth.c; ok provos@ - - markus@cvs.openbsd.org 2002/01/10 11:13:29 - [serverloop.c] - skip client_alive_check until there are channels; ok beck@ - - markus@cvs.openbsd.org 2002/01/10 11:24:04 - [clientloop.c] - handle SSH2_MSG_GLOBAL_REQUEST (just reply with failure); ok djm@ - - markus@cvs.openbsd.org 2002/01/10 12:38:26 - [nchan.c] - remove dead code (skip drain) - - markus@cvs.openbsd.org 2002/01/10 12:47:59 - [nchan.c] - more unused code (with channels.c:1.156) - - markus@cvs.openbsd.org 2002/01/11 10:31:05 - [packet.c] - handle received SSH2_MSG_UNIMPLEMENTED messages; ok djm@ - - markus@cvs.openbsd.org 2002/01/11 13:36:43 - [ssh2.h] - add defines for msg type ranges - - markus@cvs.openbsd.org 2002/01/11 13:39:36 - [auth2.c dispatch.c dispatch.h kex.c] - a single dispatch_protocol_error() that sends a message of - type 'UNIMPLEMENTED' - dispatch_range(): set handler for a ranges message types - use dispatch_protocol_ignore() for authentication requests after - successful authentication (the drafts requirement). - serverloop/clientloop now send a 'UNIMPLEMENTED' message instead - of exiting. - - markus@cvs.openbsd.org 2002/01/11 20:14:11 - [auth2-chall.c auth-skey.c] - use strlcpy not strlcat; mouring@ - - markus@cvs.openbsd.org 2002/01/11 23:02:18 - [readpass.c] - use _PATH_TTY - - markus@cvs.openbsd.org 2002/01/11 23:02:51 - [auth2-chall.c] - use snprintf; mouring@ - - markus@cvs.openbsd.org 2002/01/11 23:26:30 - [auth-skey.c] - use snprintf; mouring@ - - markus@cvs.openbsd.org 2002/01/12 13:10:29 - [auth-skey.c] - undo local change - - provos@cvs.openbsd.org 2002/01/13 17:27:07 - [ssh-agent.c] - change to use queue.h macros; okay markus@ - - markus@cvs.openbsd.org 2002/01/13 17:57:37 - [auth2.c auth2-chall.c compat.c sshconnect2.c sshd.c] - use buffer API and avoid static strings of fixed size; - ok provos@/mouring@ - - markus@cvs.openbsd.org 2002/01/13 21:31:20 - [channels.h nchan.c] - add chan_set_[io]state(), order states, state is now an u_int, - simplifies debugging messages; ok provos@ - - markus@cvs.openbsd.org 2002/01/14 13:22:35 - [nchan.c] - chan_send_oclose1() no longer calls chan_shutdown_write(); ok provos@ - - markus@cvs.openbsd.org 2002/01/14 13:34:07 - [nchan.c] - merge chan_[io]buf_empty[12]; ok provos@ - - markus@cvs.openbsd.org 2002/01/14 13:40:10 - [nchan.c] - correct fn names for ssh2, do not switch from closed to closed; + - millert@cvs.openbsd.org 2002/05/13 15:53:19 + [sshd.c] + Call setsid() in the child after sshd accepts the connection and forks. + This is needed for privsep which calls setlogin() when it changes uids. + Without this, there is a race where the login name of an existing + connection, as returned by getlogin(), may be changed to the privsep + user (sshd). markus@ OK + - markus@cvs.openbsd.org 2002/05/13 21:26:49 + [auth-rhosts.c] + handle debug messages during rhosts-rsa and hostbased authentication; ok provos@ - - markus@cvs.openbsd.org 2002/01/14 13:41:13 - [nchan.c] - remove duplicated code; ok provos@ - - markus@cvs.openbsd.org 2002/01/14 13:55:55 - [channels.c channels.h nchan.c] - remove function pointers for events, remove chan_init*; ok provos@ - - markus@cvs.openbsd.org 2002/01/14 13:57:03 - [channels.h nchan.c] - (c) 2002 - - markus@cvs.openbsd.org 2002/01/16 13:17:51 - [channels.c channels.h serverloop.c ssh.c] - wrapper for channel_setup_fwd_listener - - stevesk@cvs.openbsd.org 2002/01/16 17:40:23 - [sshd_config] - The stategy now used for options in the default sshd_config shipped - with OpenSSH is to specify options with their default value where - possible, but leave them commented. Uncommented options change a - default value. Subsystem is currently the only default option - changed. ok markus@ - - stevesk@cvs.openbsd.org 2002/01/16 17:42:33 - [ssh.1] - correct defaults for -i/IdentityFile; ok markus@ - - stevesk@cvs.openbsd.org 2002/01/16 17:55:33 - [ssh_config] - correct some commented defaults. add Ciphers default. ok markus@ - - stevesk@cvs.openbsd.org 2002/01/17 04:27:37 - [log.c] - casts to silence enum type warnings for bugzilla bug 37; ok markus@ - - stevesk@cvs.openbsd.org 2002/01/18 17:14:16 - [sshd.8] - correct Ciphers default; paola.mannaro@ubs.com - - stevesk@cvs.openbsd.org 2002/01/18 18:14:17 - [authfd.c bufaux.c buffer.c cipher.c packet.c ssh-agent.c ssh-keygen.c] - unneeded cast cleanup; ok markus@ - - stevesk@cvs.openbsd.org 2002/01/18 20:46:34 - [sshd.8] - clarify Allow(Groups|Users) and Deny(Groups|Users); suggestion from - allard@oceanpark.com; ok markus@ - - markus@cvs.openbsd.org 2002/01/21 15:13:51 - [sshconnect.c] - use read_passphrase+ECHO in confirm(), allows use of ssh-askpass - for hostkey confirm. - - markus@cvs.openbsd.org 2002/01/21 22:30:12 - [cipher.c compat.c myproposal.h] - remove "rijndael-*", just use "aes-" since this how rijndael is called - in the drafts; ok stevesk@ - - markus@cvs.openbsd.org 2002/01/21 23:27:10 - [channels.c nchan.c] - cleanup channels faster if the are empty and we are in drain-state; - ok deraadt@ - - stevesk@cvs.openbsd.org 2002/01/22 02:52:41 - [servconf.c] - typo in error message; from djast@cs.toronto.edu - - (djm) Make auth2-pam.c compile again after dispatch.h and packet.h - changes - - (djm) Recent Glibc includes an incompatible sys/queue.h. Treat it as - bogus in configure - - (djm) Use local sys/queue.h if necessary in ssh-agent.c - -20020121 - - (djm) Rework ssh-rand-helper: - - Reduce quantity of ifdef code, in preparation for ssh_rand_conf - - Always seed from system calls, even when doing PRNGd seeding - - Tidy and comment #define knobs - - Remove unused facility for multiple runs through command list - - KNF, cleanup, update copyright - -20020114 - - (djm) Bug #50 - make autoconf entropy path checks more robust - -20020108 - - (djm) Merge Cygwin copy_environment with do_pam_environment, removing - fixed env var size limit in the process. Report from Corinna Vinschen - - - (stevesk) defines.h: use "/var/spool/sockets/X11/%u" for HP-UX. does - not depend on transition links. from Lutz Jaenicke. - -20020106 - - (stevesk) defines.h: determine _PATH_UNIX_X; currently "/tmp/.X11-unix/X%u" - for all platforms except HP-UX, which is "/usr/spool/sockets/X11/%u". - -20020105 - - (bal) NCR requies use_pipes to operate correctly. - - (stevesk) fix spurious ; from NCR change. - -20020103 - - (djm) Use bigcrypt() on systems with SCO_PROTECTED_PW. Patch from - Roger Cornelius - -20011229 - - (djm) Apply Cygwin pointer deref fix from Corinna Vinschen - Could be abused to guess valid usernames - - (djm) Typo in contrib/cygwin/README Fix from Corinna Vinschen - - -20011228 - - (djm) Remove recommendation to use GNU make, we should support most - make programs. - -20011225 - - (stevesk) [Makefile.in ssh-rand-helper.c] - portable lib and __progname support for ssh-rand-helper; ok djm@ - -20011223 - - (bal) Removed contrib/chroot.diff and noted in contrib/README that it - was not being maintained. - -20011222 - - (djm) Ignore fix & patchlevel in OpenSSL version check. Patch from - solar@openwall.com - - (djm) Rework entropy code. If the OpenSSL PRNG is has not been - internally seeded, execute a subprogram "ssh-rand-helper" to obtain - some entropy for us. Rewrite the old in-process entropy collecter as - an example ssh-rand-helper. - - (djm) Always perform ssh_prng_cmds path lookups in configure, even if - we don't end up using ssh_prng_cmds (so we always get a valid file) - -20011221 - - (djm) Add option to gnome-ssh-askpass to stop it from grabbing the X - server. I have found this necessary to avoid server hangs with X input - extensions (e.g. kinput2). Enable by setting the environment variable - "GNOME_SSH_ASKPASS_NOGRAB" - - OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/12/08 17:49:28 - [channels.c pathnames.h] - use only one path to X11 UNIX domain socket vs. an array of paths - to try. report from djast@cs.toronto.edu. ok markus@ - - markus@cvs.openbsd.org 2001/12/09 18:45:56 - [auth2.c auth2-chall.c auth.h] - add auth2_challenge_stop(), simplifies cleanup of kbd-int sessions, - fixes memleak. - - stevesk@cvs.openbsd.org 2001/12/10 16:45:04 - [sshd.c] - possible fd leak on error; ok markus@ - - markus@cvs.openbsd.org 2001/12/10 20:34:31 - [ssh-keyscan.c] - check that server supports v1 for -t rsa1, report from wirth@dfki.de - - jakob@cvs.openbsd.org 2001/12/18 10:04:21 - [auth.h hostfile.c hostfile.h] - remove auth_rsa_read_key, make hostfile_ready_key non static; ok markus@ - - jakob@cvs.openbsd.org 2001/12/18 10:05:15 - [auth2.c] - log fingerprint on successful public key authentication; ok markus@ - - jakob@cvs.openbsd.org 2001/12/18 10:06:24 - [auth-rsa.c] - log fingerprint on successful public key authentication, simplify - usage of key structs; ok markus@ - - deraadt@cvs.openbsd.org 2001/12/19 07:18:56 - [auth1.c auth2.c auth2-chall.c auth-bsdauth.c auth.c authfile.c auth.h] - [auth-krb4.c auth-rhosts.c auth-skey.c bufaux.c canohost.c channels.c] - [cipher.c clientloop.c compat.c compress.c deattack.c key.c log.c mac.c] - [match.c misc.c nchan.c packet.c readconf.c rijndael.c rijndael.h scard.c] - [servconf.c servconf.h serverloop.c session.c sftp.c sftp-client.c] - [sftp-glob.c sftp-int.c sftp-server.c ssh-add.c ssh-agent.c ssh.c] - [sshconnect1.c sshconnect2.c sshconnect.c sshd.8 sshd.c sshd_config] - [ssh-keygen.c sshlogin.c sshpty.c sshtty.c ttymodes.c uidswap.c] - basic KNF done while i was looking for something else - - markus@cvs.openbsd.org 2001/12/19 16:09:39 - [serverloop.c] - fix race between SIGCHLD and select with an additional pipe. writing - to the pipe on SIGCHLD wakes up select(). using pselect() is not - portable and siglongjmp() ugly. W. R. Stevens suggests similar solution. - initial idea by pmenage@ensim.com; ok deraadt@, djm@ - - stevesk@cvs.openbsd.org 2001/12/19 17:16:13 - [authfile.c bufaux.c bufaux.h buffer.c buffer.h packet.c packet.h ssh.c] - change the buffer/packet interface to use void* vs. char*; ok markus@ - - markus@cvs.openbsd.org 2001/12/20 16:37:29 - [channels.c channels.h session.c] - setup x11 listen socket for just one connect if the client requests so. - (v2 only, but the openssh client does not support this feature). - - djm@cvs.openbsd.org 2001/12/20 22:50:24 - [auth2.c auth2-chall.c channels.c channels.h clientloop.c dispatch.c] - [dispatch.h kex.c kex.h packet.c packet.h serverloop.c ssh.c] - [sshconnect2.c] - Conformance fix: we should send failing packet sequence number when - responding with a SSH_MSG_UNIMPLEMENTED message. Spotted by - yakk@yakk.dot.net; ok markus@ - -20011219 - - (stevesk) OpenBSD CVS sync X11 localhost display - - stevesk@cvs.openbsd.org 2001/11/29 14:10:51 - [channels.h channels.c session.c] - sshd X11 fake server will now listen on localhost by default: - $ echo $DISPLAY - localhost:12.0 - $ netstat -an|grep 6012 - tcp 0 0 127.0.0.1.6012 *.* LISTEN - tcp6 0 0 ::1.6012 *.* LISTEN - sshd_config gatewayports=yes can be used to revert back to the old - behavior. will control this with another option later. ok markus@ - - stevesk@cvs.openbsd.org 2001/12/19 08:43:11 - [includes.h session.c] - handle utsname.nodename case for FamilyLocal X authorization; ok markus@ - -20011207 - - (bal) PCRE no longer required. Banished from the source along with - fake-regex.h - - (bal) OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/12/06 18:02:32 - [channels.c sshconnect.c] - shutdown(sock, SHUT_RDWR) not needed here; ok markus@ - - stevesk@cvs.openbsd.org 2001/12/06 18:09:23 - [channels.c session.c] - strncpy->strlcpy. remaining strncpy's are necessary. ok markus@ - - stevesk@cvs.openbsd.org 2001/12/06 18:20:32 - [channels.c] - disable nagle for X11 fake server and client TCPs. from netbsd. - ok markus@ - -20011206 + - mouring@cvs.openbsd.org 2002/05/15 15:47:49 + [kex.c monitor.c monitor_wrap.c sshd.c] + 'monitor' variable clashes with at least one lame platform (NeXT). i + Renamed to 'pmonitor'. provos@ + - deraadt@cvs.openbsd.org 2002/05/04 02:39:35 + [servconf.c sshd.8 sshd_config] + enable privsep by default; provos ok + - millert@cvs.openbsd.org 2002/05/06 23:34:33 + [ssh.1 sshd.8] + Kill/adjust r(login|exec)d? references now that those are no longer in + the tree. + - markus@cvs.openbsd.org 2002/05/15 21:02:53 + [servconf.c sshd.8 sshd_config] + disable privsep and enable setuid for the 3.2.2 release + - (bal) Fixed up PAM case. I think. + - (bal) Clarified openbsd-compat/*-cray.* Licence provided by Wendy - (bal) OpenBSD CVS Sync - - deraadt@cvs.openbsd.org 2001/11/14 20:45:08 - [sshd.c] - errno saving wrapping in a signal handler - - markus@cvs.openbsd.org 2001/11/16 12:46:13 - [ssh-keyscan.c] - handle empty lines instead of dumping core; report from sha@sha-1.net - - stevesk@cvs.openbsd.org 2001/11/17 19:14:34 - [auth2.c auth.c readconf.c servconf.c ssh-agent.c ssh-keygen.c] - enum/int type cleanup where it made sense to do so; ok markus@ - - markus@cvs.openbsd.org 2001/11/19 11:20:21 - [sshd.c] - fd leak on HUP; ok stevesk@ - - stevesk@cvs.openbsd.org 2001/11/19 18:40:46 - [ssh-agent.1] - clarify/state that private keys are not exposed to clients using the - agent; ok markus@ - - mpech@cvs.openbsd.org 2001/11/19 19:02:16 - [deattack.c radix.c] - kill more registers - millert@ ok - - markus@cvs.openbsd.org 2001/11/21 15:51:24 - [key.c] - mem leak - - stevesk@cvs.openbsd.org 2001/11/21 18:49:14 - [ssh-keygen.1] - more on passphrase construction; ok markus@ - - stevesk@cvs.openbsd.org 2001/11/22 05:27:29 - [ssh-keyscan.c] - don't use "\n" in fatal() - - markus@cvs.openbsd.org 2001/11/22 12:34:22 - [clientloop.c serverloop.c sshd.c] - volatile sig_atomic_t - - stevesk@cvs.openbsd.org 2001/11/29 19:06:39 - [channels.h] - remove dead function prototype; ok markus@ - - markus@cvs.openbsd.org 2001/11/29 22:08:48 - [auth-rsa.c] - fix protocol error: send 'failed' message instead of a 2nd challenge - (happens if the same key is in authorized_keys twice). - reported Ralf_Meister@genua.de; ok djm@ - - stevesk@cvs.openbsd.org 2001/11/30 20:39:28 - [ssh.c] - sscanf() length dependencies are clearer now; can also shrink proto - and data if desired, but i have not done that. ok markus@ - - markus@cvs.openbsd.org 2001/12/01 21:41:48 - [session.c sshd.8] - don't pass user defined variables to /usr/bin/login - - deraadt@cvs.openbsd.org 2001/12/02 02:08:32 - [sftp-common.c] - zap }; - - itojun@cvs.openbsd.org 2001/12/05 03:50:01 - [clientloop.c serverloop.c sshd.c] - deal with LP64 printf issue with sig_atomic_t. from thorpej - - itojun@cvs.openbsd.org 2001/12/05 03:56:39 - [auth1.c auth2.c canohost.c channels.c deattack.c packet.c scp.c - sshconnect2.c] - make it compile with more strict prototype checking - - deraadt@cvs.openbsd.org 2001/12/05 10:06:12 - [authfd.c authfile.c bufaux.c channels.c compat.c kex.c kexgex.c - key.c misc.c packet.c servconf.c ssh-agent.c sshconnect2.c - sshconnect.c sshd.c ssh-dss.c ssh-keygen.c ssh-rsa.c] - minor KNF - - markus@cvs.openbsd.org 2001/12/05 15:04:48 + - markus@cvs.openbsd.org 2002/05/15 21:05:29 [version.h] - post 3.0.2 - - markus@cvs.openbsd.org 2001/12/05 16:54:51 - [compat.c match.c match.h] - make theo and djm happy: bye bye regexp - - markus@cvs.openbsd.org 2001/12/06 13:30:06 - [servconf.c servconf.h sshd.8 sshd.c] - add -o to sshd, too. ok deraadt@ - - (bal) Minor white space fix up in servconf.c - -20011126 - - (tim) [contrib/cygwin/README, openbsd-compat/bsd-cygwin_util.c, - openbsd-compat/bsd-cygwin_util.h, openbsd-compat/daemon.c] - Allow SSHD to install as service under WIndows 9x/Me - [configure.ac] Fix to allow linking against PCRE on Cygwin - Patches by Corinna Vinschen + enter OpenSSH_3.2.2 + - (bal) Caldara, Suse, and Redhat openssh.specs updated. -20011115 - - (djm) Fix IPv4 default in ssh-keyscan. Spotted by Dan Astoorian - Fix from markus@ - - (djm) Release 3.0.1p1 - -20011113 - - (djm) Fix early (and double) free of remote user when using Kerberos. - Patch from Simon Wilkinson - - (djm) AIX login{success,failed} changes. Move loginsuccess call to - do_authenticated. Call loginfailed for protocol 2 failures > MAX like - we do for protocol 1. Reports from Ralf Wenk , - K.Wolkersdorfer@fz-juelich.de and others +20020514 + - (stevesk) [README.privsep] PAM+privsep works with Solaris 8. + - (tim) [sshpty.c] set tty modes when allocating old style bsd ptys to + match what newer style ptys have when allocated. Based on a patch by + Roger Cornelius + - (tim) [README.privsep] UnixWare 7 and OpenUNIX 8 work. + - (tim) [README.privsep] remove reference to UnixWare 7 and OpenUNIX 8 + from PAM-enabled pragraph. UnixWare has no PAM. + - (tim) [contrib/caldera/openssh.spec] update version. + +20020513 + - (stevesk) add initial README.privsep + - (stevesk) [configure.ac] nicer message: --with-privsep-user=user + - (djm) Add --with-superuser-path=xxx configure option to specify + what $PATH the superuser receives. + - (djm) Bug #231: UsePrivilegeSeparation turns off Banner. + - (djm) Add --with-privsep-path configure option + - (djm) Update RPM spec file: different superuser path, use + /var/empty/sshd for privsep + - (djm) Bug #234: missing readpassphrase declaration and defines + - (djm) Add INSTALL warning about SSH protocol 1 blowfish w/ + OpenSSL < 0.9.6 + +20020511 + - (tim) [configure.ac] applied a rework of djm's OpenSSL search cleanup patch. + Now only searches system and /usr/local/ssl (OpenSSL's default install path) + Others must use --with-ssl-dir=.... + - (tim) [monitor_fdpass.c] fix for systems that have both + HAVE_ACCRIGHTS_IN_MSGHDR and HAVE_CONTROL_IN_MSGHDR. Ie. sys/socket.h + has #define msg_accrights msg_control + +20020510 + - (stevesk) [auth.c] Shadow account and expiration cleanup. Now + check for root forced expire. Still don't check for inactive. + - (djm) Rework RedHat RPM files. Based on spec from Nalin + Dahyabhai and patches from + Pekka Savola + - (djm) Try to drop supplemental groups at daemon startup. Patch from + RedHat + - (bal) Back all the way out of auth-passwd.c changes. Breaks too many + things that don't set pw->pw_passwd. + +20020509 + - (tim) [Makefile.in] Unbreak make -f Makefile.in distprep + +20020508 + - (tim) [openbsd-compat/bsd-arc4random.c] fix logic on when seed_rng() is + called. Report by Chris Maxwell + - (tim) [Makefile.in configure.ac] set SHELL variable in Makefile + - (djm) Disable PAM kbd-int auth if privsep is turned on (it doesn't work) + +20020507 + - (tim) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h] + Add truncate() emulation to address Bug 208 + +20020506 + - (djm) Unbreak auth-passwd.c for PAM and SIA + - (djm) Unbreak PAM auth for protocol 1. Report from Pekka Savola + + - (djm) Don't reinitialise PAM credentials before we have started PAM. + Report from Pekka Savola + +20020506 + - (bal) Fixed auth-passwd.c to resolve PermitEmptyPassword issue + +20020501 + - (djm) Import OpenBSD regression tests. Requires BSD make to run + - (djm) Fix readpassphase compilation for systems which have it + +20020429 + - (tim) [contrib/caldera/openssh.spec] update fixUP to reflect changes in + sshd_config. + - (tim) [contrib/cygwin/README] remove reference to regex. + patch from Corinna Vinschen + +20020426 + - (djm) Bug #137, #209: fix make problems for scard/Ssh.bin, do uudecode + during distprep only + - (djm) Disable PAM password expiry until a complete fix for bug #188 + exists + - (djm) Bug #180: Set ToS bits on IPv4-in-IPv6 mapped addresses. Based on + patch from openssh@misc.tecq.org + +20020425 + - (stevesk) [defines.h] remove USE_TIMEVAL; unused + - (stevesk) [acconfig.h auth-passwd.c configure.ac sshd.c] HP-UX 10.26 + support. bug #184. most from dcole@keysoftsys.com. + +20020424 - (djm) OpenBSD CVS Sync - - dugsong@cvs.openbsd.org 2001/11/11 18:47:10 - [auth-krb5.c] - fix krb5 authorization check. found by . from - art@, deraadt@ ok - - markus@cvs.openbsd.org 2001/11/12 11:17:07 - [servconf.c] - enable authorized_keys2 again. tested by fries@ - - markus@cvs.openbsd.org 2001/11/13 02:03:57 + - markus@cvs.openbsd.org 2002/04/23 12:54:10 [version.h] - enter 3.0.1 - - (djm) Bump RPM package versions - -20011112 - - (djm) Makefile correctness fix from Mark D. Baushke - - (djm) Cygwin config patch from Corinna Vinschen - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/10/24 08:41:41 - [sshd.c] - mention remote port in debug message - - markus@cvs.openbsd.org 2001/10/24 08:41:20 - [ssh.c] - remove unused - - markus@cvs.openbsd.org 2001/10/24 08:51:35 - [clientloop.c ssh.c] - ignore SIGPIPE early, makes ssh work if agent dies, netbsd-pr via itojun@ - - markus@cvs.openbsd.org 2001/10/24 19:57:40 - [clientloop.c] - make ~& (backgrounding) work again for proto v1; add support ~& for v2, too - - markus@cvs.openbsd.org 2001/10/25 21:14:32 - [ssh-keygen.1 ssh-keygen.c] - better docu for fingerprinting, ok deraadt@ - - markus@cvs.openbsd.org 2001/10/29 19:27:15 - [sshconnect2.c] - hostbased: check for client hostkey before building chost - - markus@cvs.openbsd.org 2001/10/30 20:29:09 - [ssh.1] - ssh.1 - - markus@cvs.openbsd.org 2001/11/07 16:03:17 - [packet.c packet.h sshconnect2.c] - pad using the padding field from the ssh2 packet instead of sending - extra ignore messages. tested against several other ssh servers. - - markus@cvs.openbsd.org 2001/11/07 21:40:21 - [ssh-rsa.c] - ssh_rsa_sign/verify: SSH_BUG_SIGBLOB not supported - - markus@cvs.openbsd.org 2001/11/07 22:10:28 - [ssh-dss.c ssh-rsa.c] - missing free and sync dss/rsa code. - - markus@cvs.openbsd.org 2001/11/07 22:12:01 - [sshd.8] - s/Keepalive/KeepAlive/; from openbsd@davidkrause.com - - markus@cvs.openbsd.org 2001/11/07 22:41:51 - [auth2.c auth-rh-rsa.c] - unused includes - - markus@cvs.openbsd.org 2001/11/07 22:53:21 - [channels.h] - crank c->path to 256 so they can hold a full hostname; dwd@bell-labs.com - - markus@cvs.openbsd.org 2001/11/08 10:51:08 - [readpass.c] - don't strdup too much data; from gotoh@taiyo.co.jp; ok millert. - - markus@cvs.openbsd.org 2001/11/08 17:49:53 - [ssh.1] - mention setuid root requirements; noted by cnorris@csc.UVic.ca; ok stevesk@ - - markus@cvs.openbsd.org 2001/11/08 20:02:24 - [auth.c] - don't print ROOT in CAPS for the authentication messages, i.e. - Accepted publickey for ROOT from 127.0.0.1 port 42734 ssh2 - becomes - Accepted publickey for root from 127.0.0.1 port 42734 ssh2 - - markus@cvs.openbsd.org 2001/11/09 18:59:23 - [clientloop.c serverloop.c] - don't memset too much memory, ok millert@ - original patch from jlk@kamens.brookline.ma.us via nalin@redhat.com - - markus@cvs.openbsd.org 2001/11/10 13:19:45 - [sshd.c] - cleanup libwrap support (remove bogus comment, bogus close(), add - debug, etc). - - markus@cvs.openbsd.org 2001/11/10 13:22:42 - [ssh-rsa.c] - KNF (unexpand) - - markus@cvs.openbsd.org 2001/11/10 13:37:20 - [packet.c] - remove extra debug() - - markus@cvs.openbsd.org 2001/11/11 13:02:31 - [servconf.c] - make AuthorizedKeysFile2 fallback to AuthorizedKeysFile if - AuthorizedKeysFile is specified. - - (djm) Reorder portable-specific server options so that they come first. - This should help reduce diff collisions for new server options (as they - will appear at the end) - -20011109 - - (stevesk) auth-pam.c: use do_pam_authenticate(PAM_DISALLOW_NULL_AUTHTOK) - if permit_empty_passwd == 0 so null password check cannot be bypassed. - jayaraj@amritapuri.com OpenBSD bug 2168 - - markus@cvs.openbsd.org 2001/11/09 19:08:35 - [sshd.c] - remove extra trailing dot from log message; pilot@naughty.monkey.org - -20011103 - - (tim) [ contrib/caldera/openssh.spec contrib/caldera/sshd.init] Updates - from Raymund Will - [acconfig.h configure.in] Clean up login checks. - Problem reported by Jim Knoble - -20011101 - - (djm) Compat define for OpenSSL < 0.9.6 (No OPENSSL_free) - -20011031 - - (djm) Unsmoke drugs: config files should be noreplace. - -20011030 - - (djm) Redhat RPM spec: remove noreplace from config files, allow IPv6 - by default (can force IPv4 using --define "noipv6 1") - -20011029 - - (tim) [TODO defines.h loginrec.c] Change the references to configure.in - to configure.ac - -20011028 - - (djm) Avoid bug in Solaris PAM libs - - (djm) Disconnect if no tty and PAM reports password expired - - (djm) Fix for PAM password changes being echoed (from stevesk) - - (stevesk) Fix compile problem with PAM password change fix - - (stevesk) README: zlib location is http://www.gzip.org/zlib/ - -20011027 - - (tim) [configure.ac] Fixes for ReliantUNIX (don't use libucb) - Patch by Robert Dahlem - -20011026 - - (bal) Set the correct current time in login_utmp_only(). Patch by - Wayne Davison - - (tim) [scard/Makefile.in] Fix install: when building outside of source - tree and using --src=/full_path/to/openssh - Patch by Mark D. Baushke - -20011025 - - (bal) Use VDISABLE if _POSIX_VDISABLE is set in readpassphrase.c. Patch - by todd@ - - (tim) [configure.ac] Give path given in --with-xxx= for pcre,zlib, and - tcp-wrappers precedence over system libraries and includes. - Report from Dave Dykstra - -20011024 - - (bal) Should be 3.0p1 not 3.0p2. Corrected version.h already. - - (tim) configure.in -> configure.ac - -20011023 - - (bal) Updated version to 3.0p1 in preparing for release. - - (bal) Added 'PAM_TTY_KLUDGE' to Solaris platform. - - (tim) [configure.in] Fix test for broken dirname. Based on patch from - Dave Dykstra . Remove un-needed test for zlib.h. - [contrib/caldera/openssh.spec, contrib/redhat/openssh.spec, - contrib/suse/openssh.spec] Update version to match version.h - -20011022 - - (djm) Fix fd leak in loginrec.c (ro fd to lastlog was left open). - Report from Michal Zalewski - -20011021 - - (tim) [configure.in] Clean up library testing. Add optional PATH to - --with-pcre, --with-zlib, and --with-tcp-wrappers. Based on - patch by albert chin (china@thewrittenword.com) - Re-arange AC_CHECK_HEADERS and AC_CHECK_FUNCS for eaiser reading - of patches to configure.in. Replace obsolete AC_STRUCT_ST_BLKSIZE - with AC_CHECK_MEMBERS. Add test for broken dirname() on - Solaris 2.5.1 by Dan Astoorian - [acconfig.h aclocal.m4 defines.h configure.in] Better socklen_t test. - patch by albert chin (china@thewrittenword.com) - [scp.c] Replace obsolete HAVE_ST_BLKSIZE with - HAVE_STRUCT_STAT_ST_BLKSIZE. - [Makefile.in] When running make in top level, always do make - in openbsd-compat. patch by Dave Dykstra - -20011019 - - (bal) Fixed up init.d symlink issue and piddir stuff. Patches by - Zoran Milojevic and j.petersen@msh.de - -20011012 - - (djm) OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/10/10 22:18:47 - [channels.c channels.h clientloop.c nchan.c serverloop.c] - [session.c session.h] - try to keep channels open until an exit-status message is sent. - don't kill the login shells if the shells stdin/out/err is closed. - this should now work: - ssh -2n localhost 'exec > /dev/null 2>&1; sleep 10; exit 5'; echo ? - - markus@cvs.openbsd.org 2001/10/11 13:45:21 - [session.c] - delay detach of session if a channel gets closed but the child is - still alive. however, release pty, since the fd's to the child are - already closed. - - markus@cvs.openbsd.org 2001/10/11 15:24:00 - [clientloop.c] - clear select masks if we return before calling select(). - - (djm) "make veryclean" fix from Tom Holroyd - - (djm) Clean some autoconf-2.52 junk when doing "make distclean" - - (djm) Cleanup sshpty.c a little - - (bal) First wave of contrib/solaris/ package upgrades. Still more - work needs to be done, but it is a 190% better then the stuff we - had before! - - (bal) Minor bug fix in contrib/solaris/opensshd.in .. $etcdir was not - set right. - -20011010 + 3.2.1 + - djm@cvs.openbsd.org 2002/04/23 22:16:29 + [sshd.c] + Improve error message; ok markus@ stevesk@ + +20020423 + - (stevesk) [acconfig.h configure.ac session.c] LOGIN_NO_ENDOPT for HP-UX + - (stevesk) [acconfig.h] NEED_IN_SYSTM_H unused + - (markus) OpenBSD CVS Sync + - markus@cvs.openbsd.org 2002/04/23 12:58:26 + [radix.c] + send complete ticket; semerad@ss1000.ms.mff.cuni.cz + - (djm) Trim ChangeLog to include only post-3.1 changes + - (djm) Update RPM spec file versions + - (djm) Redhat spec enables KrbV by default + - (djm) Applied OpenSC smartcard updates from Markus & + Antti Tapaninen + - (djm) Define BROKEN_REALPATH for AIX, patch from + Antti Tapaninen + - (djm) Bug #214: Fix utmp for Irix (don't strip "tty"). Patch from + Kevin Taylor (??) via Philipp Grau + + - (djm) Bug #213: Simplify CMSG_ALIGN macros to avoid symbol clashes. + Reported by Doug Manton + - (djm) Bug #222: Fix tests for getaddrinfo on OSF/1. Spotted by + Robert Urban + - (djm) Bug #206 - blibpath isn't always needed for AIX ld, avoid + sizeof(long long int) == 4 breakage. Patch from Matthew Clarke + + - (djm) Make privsep work with PAM (still experimental) - (djm) OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/10/04 14:34:16 - [key.c] - call OPENSSL_free() for memory allocated by openssl; from chombier@mac.com - - markus@cvs.openbsd.org 2001/10/04 15:05:40 - [channels.c serverloop.c] - comment out bogus conditions for selecting on connection_in - - markus@cvs.openbsd.org 2001/10/04 15:12:37 - [serverloop.c] - client_alive_check cleanup - - markus@cvs.openbsd.org 2001/10/06 00:14:50 - [sshconnect.c] - remove unused argument - - markus@cvs.openbsd.org 2001/10/06 00:36:42 - [session.c] - fix typo in error message, sync with do_exec_nopty - - markus@cvs.openbsd.org 2001/10/06 11:18:19 - [sshconnect1.c sshconnect2.c sshconnect.c] - unify hostkey check error messages, simplify prompt. - - markus@cvs.openbsd.org 2001/10/07 10:29:52 - [authfile.c] - grammer; Matthew_Clarke@mindlink.bc.ca - - markus@cvs.openbsd.org 2001/10/07 17:49:40 - [channels.c channels.h] - avoid possible FD_ISSET overflow for channels established - during channnel_after_select() (used for dynamic channels). - - markus@cvs.openbsd.org 2001/10/08 11:48:57 - [channels.c] - better debug - - markus@cvs.openbsd.org 2001/10/08 16:15:47 - [sshconnect.c] - use correct family for -b option - - markus@cvs.openbsd.org 2001/10/08 19:05:05 - [ssh.c sshconnect.c sshconnect.h ssh-keyscan.c] - some more IPv4or6 cleanup - - markus@cvs.openbsd.org 2001/10/09 10:12:08 - [session.c] - chdir $HOME after krb_afslog(); from bbense@networking.stanford.edu - - markus@cvs.openbsd.org 2001/10/09 19:32:49 - [session.c] - stat subsystem command before calling do_exec, and return error to client. - - markus@cvs.openbsd.org 2001/10/09 19:51:18 - [serverloop.c] - close all channels if the connection to the remote host has been closed, - should fix sshd's hanging with WCHAN==wait - - markus@cvs.openbsd.org 2001/10/09 21:59:41 - [channels.c channels.h serverloop.c session.c session.h] - simplify session close: no more delayed session_close, no more - blocking wait() calls. - - (bal) removed two unsed headers in openbsd-compat/bsd-misc.c - - (bal) seed_init() and seed_rng() required in ssh-keyscan.c - -20011007 - - (bal) ssh-copy-id corrected permissions for .ssh/ and authorized_keys. - Prompted by Matthew Vernon - -20011005 - - (bal) AES works under Cray, no more hack. - -20011004 - - (bal) nchan2.ms resync. BSD License applied. - -20011003 - - (bal) CVS ID fix up in version.h - - (bal) OpenBSD CVS Sync: - - markus@cvs.openbsd.org 2001/09/27 11:58:16 - [compress.c] - mem leak; chombier@mac.com - - markus@cvs.openbsd.org 2001/09/27 11:59:37 - [packet.c] - missing called=1; chombier@mac.com - - markus@cvs.openbsd.org 2001/09/27 15:31:17 - [auth2.c auth2-chall.c sshconnect1.c] - typos; from solar - - camield@cvs.openbsd.org 2001/09/27 17:53:24 - [sshd.8] - don't talk about compile-time options - ok markus@ - - djm@cvs.openbsd.org 2001/09/28 12:07:09 - [ssh-keygen.c] - bzero private key after loading to smartcard; ok markus@ - - markus@cvs.openbsd.org 2001/09/28 15:46:29 - [ssh.c] - bug: read user config first; report kaukasoi@elektroni.ee.tut.fi - - markus@cvs.openbsd.org 2001/10/01 08:06:28 - [scp.c] - skip filenames containing \n; report jdamery@chiark.greenend.org.uk - and matthew@debian.org - - markus@cvs.openbsd.org 2001/10/01 21:38:53 - [channels.c channels.h ssh.c sshd.c] - remove ugliness; vp@drexel.edu via angelos - - markus@cvs.openbsd.org 2001/10/01 21:51:16 - [readconf.c readconf.h ssh.1 sshconnect.c] - add NoHostAuthenticationForLocalhost; note that the hostkey is - now check for localhost, too. - - djm@cvs.openbsd.org 2001/10/02 08:38:50 - [ssh-add.c] - return non-zero exit code on error; ok markus@ - - stevesk@cvs.openbsd.org 2001/10/02 22:56:09 - [sshd.c] - #include "channels.h" for channel_set_af() - - markus@cvs.openbsd.org 2001/10/03 10:01:20 - [auth.c] - use realpath() for homedir, too. from jinmei@isl.rdc.toshiba.co.jp - -20011001 - - (stevesk) loginrec.c: fix type conversion problems exposed when using - 64-bit off_t. - -20010929 - - (bal) move reading 'config.h' up higher. Patch by albert chin - + +20020417 + - (djm) Tell users to configure /dev/random support into OpenSSL in + INSTALL + - (djm) Fix .Nm in mdoc2man.pl from pspencer@fields.utoronto.ca + - (tim) [configure.ac] Issue warning on --with-default-path=/some_path + if LOGIN_CAP is enabled. Report & testing by Tuc + +20020415 + - (djm) Unbreak "make install". Fix from Darren Tucker + + - (stevesk) bsd-cygwin_util.[ch] BSD license from Corinna Vinschen + - (tim) [configure.ac] add tests for recvmsg and sendmsg. + [monitor_fdpass.c] add checks for HAVE_SENDMSG and HAVE_RECVMSG for + systems that HAVE_ACCRIGHTS_IN_MSGHDR but no recvmsg or sendmsg. + +20020414 + - (djm) ssh-rand-helper improvements + - Add commandline debugging options + - Don't write binary data if stdout is a tty (use hex instead) + - Give it a manpage + - (djm) Random number collection doc fixes from Ben + +20020413 + - (djm) Add KrbV support patch from Simon Wilkinson + +20020412 + - (stevesk) [auth-sia.[ch]] add BSD license from Chris Adams + - (tim) [configure.ac] add to msghdr tests. Change -L + to -h on testing for /bin being symbolic link + - (bal) Mistaken in Cygwin scripts for ssh starting. Patch by + Corinna Vinschen + - (bal) disable privsep if no MAP_ANON. We can re-enable it + after the release when we can do more testing. + +20020411 + - (stevesk) [auth-sia.c] cleanup + - (tim) [acconfig.h defines.h includes.h] put includes in includes.h and + defines in defines.h [rijndael.c openbsd-compat/fake-socket.h + openbsd-compat/inet_aton.c] include "includes.h" instead of "config.h" + ok stevesk@ + +20020410 + - (stevesk) [configure.ac monitor.c] HAVE_SOCKETPAIR + - (stevesk) [auth-sia.c] compile fix Chris Adams - (bal) OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/09/20 00:15:54 - [sshd.8] - fix ClientAliveCountMax - - markus@cvs.openbsd.org 2001/09/20 13:46:48 - [auth2.c] - key_read returns now -1 or 1 - - markus@cvs.openbsd.org 2001/09/20 13:50:40 - [compat.c compat.h ssh.c] - bug compat: request a dummy channel for -N (no shell) sessions + - cleanup; vinschen@redhat.com - - mouring@cvs.openbsd.org 2001/09/20 20:57:51 - [sshd_config] - CheckMail removed. OKed stevesk@ - -20010919 - - (bal) OpenBSD Sync - - markus@cvs.openbsd.org 2001/09/19 10:08:51 - [sshd.8] - command=xxx applies to subsystem now, too - - markus@cvs.openbsd.org 2001/09/19 13:23:29 - [key.c] - key_read() now returns -1 on type mismatch, too - - stevesk@cvs.openbsd.org 2001/09/19 19:24:19 - [readconf.c readconf.h scp.c sftp.c ssh.1] - add ClearAllForwardings ssh option and set it in scp and sftp; ok - markus@ - - stevesk@cvs.openbsd.org 2001/09/19 19:35:30 - [authfd.c] - use sizeof addr vs. SUN_LEN(addr) for sockaddr_un. Stevens - blesses this and we do it this way elsewhere. this helps in - portable because not all systems have SUN_LEN() and - sockaddr_un.sun_len. ok markus@ - - stevesk@cvs.openbsd.org 2001/09/19 21:04:53 - [sshd.8] - missing -t in usage - - stevesk@cvs.openbsd.org 2001/09/19 21:41:57 - [sshd.8] - don't advertise -V in usage; ok markus@ - - (bal) openbsd-compat/vis.[ch] is dead wood. Removed. - -20010918 - - (djm) Configure support for smartcards. Based on Ben's work. - - (djm) Revert setgroups call, it causes problems on OS-X - - (djm) Avoid warning on BSDgetopt - - (djm) More makefile infrastructre for smartcard support, also based - on Ben's work - - (djm) Specify --datadir in RPM spec files so smartcard applet gets - put somewhere sane. Add Ssh.bin to manifest. - - (djm) Make smartcard support conditional in Redhat RPM spec - - (bal) LICENCE update. Has not been done in a while. - - (stevesk) nchan.c: we use X/Open Sockets on HP-UX now so shutdown(2) - returns ENOTCONN vs. EINVAL for socket not connected; remove EINVAL - check. ok Lutz Jaenicke + - markus@cvs.openbsd.org 2002/04/10 08:21:47 + [auth1.c compat.c compat.h] + strip '@' from username only for KerbV and known broken clients, + bug #204 + - markus@cvs.openbsd.org 2002/04/10 08:56:01 + [version.h] + OpenSSH_3.2 + - Added p1 to idenify Portable release version. + +20020408 + - (bal) Minor OpenSC updates. Fix up header locations and update + README.smartcard provided by Juha Yrjölä + +20020407 + - (stevesk) HAVE_CONTROL_IN_MSGHDR; not used right now. + Future: we may want to test if fd passing works correctly. + - (stevesk) [monitor_fdpass.c] fatal() for UsePrivilegeSeparation=yes + and no fd passing support. + - (stevesk) HAVE_MMAP and HAVE_SYS_MMAN_H and use them in + monitor_mm.c + - (stevesk) remove configure support for poll.h; it was removed + from sshd.c a long time ago. + - (stevesk) --with-privsep-user; default sshd + - (stevesk) wrap munmap() with HAVE_MMAP also. + +20020406 + - (djm) Typo in Suse SPEC file. Fix from Carsten Grohmann + + - (bal) Added MAP_FAILED to allow AIX and Trusted HP to compile. - (bal) OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/09/17 17:57:57 - [scp.1 scp.c sftp.1 sftp.c] - add -Fssh_config option; ok markus@ - - stevesk@cvs.openbsd.org 2001/09/17 19:27:15 - [kexdh.c kexgex.c key.c key.h ssh-dss.c ssh-keygen.c ssh-rsa.c] - u_char*/char* cleanup; ok markus - - markus@cvs.openbsd.org 2001/09/17 20:22:14 - [scard.c] - never keep a connection to the smartcard open. - allows ssh-keygen -D U while the agent is running; report from - jakob@ - - stevesk@cvs.openbsd.org 2001/09/17 20:38:09 - [sftp.1 sftp.c] - cleanup and document -1, -s and -S; ok markus@ - - markus@cvs.openbsd.org 2001/09/17 20:50:22 - [key.c ssh-keygen.c] - better error handling if you try to export a bad key to ssh.com - - markus@cvs.openbsd.org 2001/09/17 20:52:47 - [channels.c channels.h clientloop.c] - try to fix agent-forwarding-backconnection-bug, as seen on HPUX, - for example; with Lutz.Jaenicke@aet.TU-Cottbus.DE, - - markus@cvs.openbsd.org 2001/09/17 21:04:02 - [channels.c serverloop.c] - don't send fake dummy packets on CR (\r) - bugreport from yyua@cs.sfu.ca via solar@@openwall.com - - markus@cvs.openbsd.org 2001/09/17 21:09:47 - [compat.c] - more versions suffering the SSH_BUG_DEBUG bug; - 3.0.x reported by dbutts@maddog.storability.com - - stevesk@cvs.openbsd.org 2001/09/17 23:56:07 - [scp.1] - missing -B in usage string - -20010917 - - (djm) x11-ssh-askpass-1.2.4 in RPM spec, revert workarounds - - (tim) [includes.h openbsd-compat/getopt.c openbsd-compat/getopt.h] - rename getopt() to BSDgetopt() to keep form conflicting with - system getopt(). - [Makefile.in configure.in] disable filepriv until I can add - missing procpriv calls. - -20010916 - - (djm) Workaround XFree breakage in RPM spec file + - djm@cvs.openbsd.org 2002/04/06 00:30:08 + [sftp-client.c] + Fix occasional corruption on upload due to bad reuse of request + id, spotted by chombier@mac.com; ok markus@ + - mouring@cvs.openbsd.org 2002/04/06 18:24:09 + [scp.c] + Fixes potental double // within path. + http://bugzilla.mindrot.org/show_bug.cgi?id=76 + - (bal) Slight update to OpenSC support. Better version checking. patch + by Juha Yrjölä + - (bal) Revered out of runtime IRIX detection of joblimits. Code is + incomplete. + - (bal) Quiet down configure.ac if /bin/test does not exist. + - (bal) We no longer use atexit()/xatexit()/on_exit() + +20020405 + - (bal) Patch for OpenSC SmartCard library; ok markus@; patch by + Juha Yrjölä + - (bal) Minor documentation update to reflect smartcard library + support changes. + - (bal) Too many issues. Remove all workarounds and + using internal version only. - (bal) OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/09/16 14:46:54 - [session.c] - calls krb_afslog() after setting $HOME; mattiasa@e.kth.se; fixes - pr 1943b - -20010915 - - (djm) Make do_pre_login static to avoid prototype #ifdef hell - - (djm) Sync scard/ stuff - - (djm) Redhat spec file cleanups from Pekka Savola and - Redhat - - (djm) Redhat initscript config sanity checking from Pekka Savola - - - (djm) Clear supplemental groups at sshd start to prevent them from - being propogated to random PAM modules. Based on patch from Redhat via - Pekka Savola - - (djm) Make sure rijndael.c picks config.h - - (djm) Ensure that u_char gets defined + - stevesk@cvs.openbsd.org 2002/04/05 20:56:21 + [sshd.8] + clarify sshrc some and handle X11UseLocalhost=yes; ok markus@ -20010914 +20020404 + - (stevesk) [auth-pam.c auth-pam.h auth-passwd.c auth-sia.c auth-sia.h + auth1.c auth2.c] PAM, OSF_SIA password auth cleanup; from djm. - (bal) OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/09/13 - [rijndael.c rijndael.h] - missing $OpenBSD - - markus@cvs.openbsd.org 2001/09/14 + - markus@cvs.openbsd.org 2002/04/03 09:26:11 + [cipher.c myproposal.h] + re-add rijndael-cbc@lysator.liu.se for MacSSH; ash@lab.poc.net + +20020402 + - (bal) Hand Sync of scp.c (reverted to upstream code) + - deraadt@cvs.openbsd.org 2002/03/30 17:45:46 + [scp.c] + stretch banners + - (bal) CVS ID sync of uidswap.c + - (bal) OpenBSD CVS Sync (now for the real sync) + - markus@cvs.openbsd.org 2002/03/27 22:21:45 + [ssh-keygen.c] + try to import keys with extra trailing === (seen with ssh.com < + 2.0.12) + - markus@cvs.openbsd.org 2002/03/28 15:34:51 [session.c] - command=xxx overwrites subsystems, too - - markus@cvs.openbsd.org 2001/09/14 - [sshd.c] - typo - -20010913 - - (bal) OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/08/23 11:31:59 - [cipher.c cipher.h] - switch to the optimised AES reference code from - http://www.esat.kuleuven.ac.be/~rijmen/rijndael/rijndael-fst-3.0.zip - -20010912 + do not call record_login twice (for use_privsep) + - markus@cvs.openbsd.org 2002/03/29 18:59:32 + [session.c session.h] + retrieve last login time before the pty is allocated, store per + session + - stevesk@cvs.openbsd.org 2002/03/29 19:16:22 + [sshd.8] + RSA key modulus size minimum 768; ok markus@ + - stevesk@cvs.openbsd.org 2002/03/29 19:18:33 + [auth-rsa.c ssh-rsa.c ssh.h] + make RSA modulus minimum #define; ok markus@ + - markus@cvs.openbsd.org 2002/03/30 18:51:15 + [monitor.c serverloop.c sftp-int.c sftp.c sshd.c] + check waitpid for EINTR; based on patch from peter@ifm.liu.se + - markus@cvs.openbsd.org 2002/04/01 22:02:16 + [sftp-client.c] + 20480 is an upper limit for older server + - markus@cvs.openbsd.org 2002/04/01 22:07:17 + [sftp-client.c] + fallback to stat if server does not support lstat + - markus@cvs.openbsd.org 2002/04/02 11:49:39 + [ssh-agent.c] + check $SHELL for -k and -d, too; + http://bugzilla.mindrot.org/show_bug.cgi?id=199 + - markus@cvs.openbsd.org 2002/04/02 17:37:48 + [sftp.c] + always call log_init() + - markus@cvs.openbsd.org 2002/04/02 20:11:38 + [ssh-rsa.c] + ignore SSH_BUG_SIGBLOB for ssh-rsa; #187 + - (bal) mispelling in uidswap.c (portable only) + +20020401 + - (stevesk) [monitor.c] PAM should work again; will *not* work with + UsePrivilegeSeparation=yes. + - (stevesk) [auth1.c] fix password auth for protocol 1 when + !USE_PAM && !HAVE_OSF_SIA; merge issue. + +20020331 + - (tim) [configure.ac] use /bin/test -L to work around broken builtin on + Solaris 8 + - (tim) [sshconnect2.c] change uint32_t to u_int32_t + +20020330 + - (stevesk) [configure.ac] remove header check for sys/ttcompat.h + bug 167 + +20020327 + - (bal) 'pw' should be 'authctxt->pw' in auth1.c spotted by + kent@lysator.liu.se - (bal) OpenBSD CVS Sync - - jakob@cvs.openbsd.org 2001/08/16 19:18:34 - [servconf.c servconf.h session.c sshd.8] - deprecate CheckMail. ok markus@ - - stevesk@cvs.openbsd.org 2001/08/16 20:14:57 - [ssh.1 sshd.8] - document case sensitivity for ssh, sshd and key file - options and arguments; ok markus@ - - stevesk@cvs.openbsd.org 2001/08/17 18:59:47 - [servconf.h] - typo in comment - - stevesk@cvs.openbsd.org 2001/08/21 21:47:42 + - markus@cvs.openbsd.org 2002/03/26 11:34:49 [ssh.1 sshd.8] - minor typos and cleanup - - stevesk@cvs.openbsd.org 2001/08/22 16:21:21 - [ssh.1] - hostname not optional; ok markus@ - - stevesk@cvs.openbsd.org 2001/08/22 16:30:02 - [sshd.8] - no rexd; ok markus@ - - stevesk@cvs.openbsd.org 2001/08/22 17:45:16 - [ssh.1] - document cipher des for protocol 1; ok deraadt@ - - camield@cvs.openbsd.org 2001/08/23 17:59:31 + update to recent drafts + - markus@cvs.openbsd.org 2002/03/26 11:37:05 + [ssh.c] + update Copyright + - markus@cvs.openbsd.org 2002/03/26 15:23:40 + [bufaux.c] + do not talk about packets in bufaux + - rees@cvs.openbsd.org 2002/03/26 18:46:59 + [scard.c] + try_AUT0 in read_pubkey too, for those paranoid few who want to + acl 'sh' + - markus@cvs.openbsd.org 2002/03/26 22:50:39 + [channels.h] + CHANNEL_EFD_OUTPUT_ACTIVE is false for CHAN_CLOSE_RCVD, too + - markus@cvs.openbsd.org 2002/03/26 23:13:03 + [auth-rsa.c] + disallow RSA keys < 768 for protocol 1, too (rhosts-rsa and rsa auth) + - markus@cvs.openbsd.org 2002/03/26 23:14:51 + [kex.c] + generate a new cookie for each SSH2_MSG_KEXINIT message we send out + - mouring@cvs.openbsd.org 2002/03/27 11:45:42 + [monitor.c] + monitor_allowed_key() returns int instead of pointer. ok markus@ + +20020325 + - (stevesk) import OpenBSD as "openbsd-compat/tree.h" + - (bal) OpenBSD CVS Sync + - stevesk@cvs.openbsd.org 2002/03/23 20:57:26 [sshd.c] - end request with 0, not NULL - ok markus@ - - stevesk@cvs.openbsd.org 2001/08/23 18:02:48 - [ssh-agent.1] - fix usage; ok markus@ - - stevesk@cvs.openbsd.org 2001/08/23 18:08:59 - [ssh-add.1 ssh-keyscan.1] - minor cleanup - - danh@cvs.openbsd.org 2001/08/27 22:02:13 - [ssh-keyscan.c] - fix memory fault if non-existent filename is given to the -f option - ok markus@ - - markus@cvs.openbsd.org 2001/08/28 09:51:26 - [readconf.c] - don't set DynamicForward unless Host matches - - markus@cvs.openbsd.org 2001/08/28 15:39:48 - [ssh.1 ssh.c] - allow: ssh -F configfile host - - markus@cvs.openbsd.org 2001/08/29 20:44:03 - [scp.c] - clear the malloc'd buffer, otherwise source() will leak malloc'd - memory; ok theo@ - - stevesk@cvs.openbsd.org 2001/08/29 23:02:21 - [sshd.8] - add text about -u0 preventing DNS requests; ok markus@ - - stevesk@cvs.openbsd.org 2001/08/29 23:13:10 - [ssh.1 ssh.c] - document -D and DynamicForward; ok markus@ - - stevesk@cvs.openbsd.org 2001/08/29 23:27:23 + setproctitle() after preauth child; ok markus@ + - markus@cvs.openbsd.org 2002/03/24 16:00:27 + [serverloop.c] + remove unused debug + - markus@cvs.openbsd.org 2002/03/24 16:01:13 + [packet.c] + debug->debug3 for extra padding + - stevesk@cvs.openbsd.org 2002/03/24 17:27:03 + [kexgex.c] + typo; ok markus@ + - stevesk@cvs.openbsd.org 2002/03/24 17:53:16 + [monitor_fdpass.c] + minor cleanup and more error checking; ok markus@ + - markus@cvs.openbsd.org 2002/03/24 18:05:29 + [scard.c] + we need to figure out AUT0 for sc_private_encrypt, too + - stevesk@cvs.openbsd.org 2002/03/24 23:20:00 + [monitor.c] + remove "\n" from fatal() + - markus@cvs.openbsd.org 2002/03/25 09:21:13 + [auth-rsa.c] + return 0 (not NULL); tomh@po.crl.go.jp + - markus@cvs.openbsd.org 2002/03/25 09:25:06 + [auth-rh-rsa.c] + rm bogus comment + - markus@cvs.openbsd.org 2002/03/25 17:34:27 + [scard.c scard.h ssh-agent.c ssh-keygen.c ssh.c] + change sc_get_key to sc_get_keys and hide smartcard details in scard.c + - stevesk@cvs.openbsd.org 2002/03/25 20:12:10 + [monitor_mm.c monitor_wrap.c] + ssize_t args use "%ld" and cast to (long) + size_t args use "%lu" and cast to (u_long) + ok markus@ and thanks millert@ + - markus@cvs.openbsd.org 2002/03/25 21:04:02 [ssh.c] - validate ports for -L/-R; ok markus@ - - stevesk@cvs.openbsd.org 2001/08/29 23:39:40 - [ssh.1 sshd.8] - additional documentation for GatewayPorts; ok markus@ - - naddy@cvs.openbsd.org 2001/08/30 15:42:36 - [ssh.1] - add -D to synopsis line; ok markus@ - - stevesk@cvs.openbsd.org 2001/08/30 16:04:35 - [readconf.c ssh.1] - validate ports for LocalForward/RemoteForward. - add host/port alternative syntax for IPv6 (like -L/-R). - ok markus@ - - stevesk@cvs.openbsd.org 2001/08/30 20:36:34 - [auth-options.c sshd.8] - validate ports for permitopen key file option. add host/port - alternative syntax for IPv6. ok markus@ - - markus@cvs.openbsd.org 2001/08/30 22:22:32 - [ssh-keyscan.c] - do not pass pointers to longjmp; fix from wayne@blorf.net - - markus@cvs.openbsd.org 2001/08/31 11:46:39 - [sshconnect2.c] - disable kbd-interactive if we don't get SSH2_MSG_USERAUTH_INFO_REQUEST - messages - - stevesk@cvs.openbsd.org 2001/09/03 20:58:33 - [readconf.c readconf.h ssh.c] - fatal() for nonexistent -Fssh_config. ok markus@ - - deraadt@cvs.openbsd.org 2001/09/05 06:23:07 - [scp.1 sftp.1 ssh.1 ssh-agent.1 sshd.8 ssh-keygen.1 ssh-keyscan.1] - avoid first person in manual pages - - stevesk@cvs.openbsd.org 2001/09/12 18:18:25 - [scp.c] - don't forward agent for non third-party copies; ok markus@ - -20010815 - - (bal) Fixed stray code in readconf.c that went in by mistake. - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/08/07 10:37:46 - [authfd.c authfd.h] - extended failure messages from galb@vandyke.com - - deraadt@cvs.openbsd.org 2001/08/08 07:16:58 - [scp.1] - when describing the -o option, give -o Protocol=1 as the specific example - since we are SICK AND TIRED of clueless people who cannot have difficulty - thinking on their own. - - markus@cvs.openbsd.org 2001/08/08 18:20:15 - [uidswap.c] - permanently_set_uid is a noop if user is not privilegued; - fixes bug on solaris; from sbi@uchicago.edu - - markus@cvs.openbsd.org 2001/08/08 21:34:19 - [uidswap.c] - undo last change; does not work for sshd - - jakob@cvs.openbsd.org 2001/08/11 22:51:27 - [ssh.c tildexpand.c] - fix more paths beginning with "//"; . - ok markus@ - - stevesk@cvs.openbsd.org 2001/08/13 23:38:54 - [scp.c] - don't need main prototype (also sync with rcp); ok markus@ - - markus@cvs.openbsd.org 2001/08/14 09:23:02 - [sftp.1 sftp-int.c] - "bye"; hk63a@netscape.net - - stevesk@cvs.openbsd.org 2001/08/14 17:54:29 - [scp.1 sftp.1 ssh.1] - consistent documentation and example of ``-o ssh_option'' for sftp and - scp; document keyword=argument for ssh. - - (bal) QNX resync. OK tim@ - -20010814 - - (stevesk) sshpty.c, cray.[ch]: whitespace, formatting and cleanup - for some #ifdef _CRAY code; ok wendyp@cray.com - - (stevesk) sshpty.c: return 0 on error in cray pty code; - ok wendyp@cray.com - - (stevesk) bsd-cray.c: utmp strings are not C strings - - (stevesk) bsd-cray.c: more cleanup; ok wendyp@cray.com - -20010812 - - (djm) Fix detection of long long int support. Based on patch from - Michael Stone . ok stevesk, tim - -20010808 - - (bal) Minor correction to inet_ntop.h. _BSD_RRESVPORT_H should be - _BSD_INET_NTOP_H. Pointed out by Mark Miller - -20010807 - - (tim) [configure.in sshconnect.c openbsd-compat/Makefile.in - openbsd-compat/openbsd-compat.h ] Add inet_ntop.c inet_ntop.h back - in. Needed for sshconnect.c - [sshconnect.c] fix INET6_ADDRSTRLEN for non IPv6 machines - [configure.in] make tests with missing libraries fail - patch by Wendy Palm - Added openbsd-compat/bsd-cray.h. Selective patches from - William L. Jones + simplify num_identity_files handling + - markus@cvs.openbsd.org 2002/03/25 21:13:51 + [channels.c channels.h compat.c compat.h nchan.c] + don't send stderr data after EOF, accept this from older known + (broken) sshd servers only, fixes + http://bugzilla.mindrot.org/show_bug.cgi?id=179 + - stevesk@cvs.openbsd.org 2002/03/26 03:24:01 + [monitor.h monitor_fdpass.h monitor_mm.h monitor_wrap.h] + $OpenBSD$ -20010806 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/07/22 21:32:27 - [sshpty.c] - update comment - - pvalchev@cvs.openbsd.org 2001/07/22 21:32:42 - [ssh.1] - There is no option "Compress", point to "Compression" instead; ok - markus - - markus@cvs.openbsd.org 2001/07/22 22:04:19 - [readconf.c ssh.1] - enable challenge-response auth by default; ok millert@ - - markus@cvs.openbsd.org 2001/07/22 22:24:16 - [sshd.8] - Xr login.conf - - markus@cvs.openbsd.org 2001/07/23 09:06:28 - [sshconnect2.c] - reorder default sequence of userauth methods to match ssh behaviour: - hostbased,publickey,keyboard-interactive,password - - markus@cvs.openbsd.org 2001/07/23 12:47:05 - [ssh.1] - sync PreferredAuthentications - - aaron@cvs.openbsd.org 2001/07/23 14:14:18 - [ssh-keygen.1] - Fix typo. - - stevesk@cvs.openbsd.org 2001/07/23 18:14:58 - [auth2.c auth-rsa.c] - use %lu; ok markus@ - - stevesk@cvs.openbsd.org 2001/07/23 18:21:46 - [xmalloc.c] - no zero size xstrdup() error; ok markus@ - - markus@cvs.openbsd.org 2001/07/25 11:59:35 +20020324 + - (stevesk) [session.c] disable LOGIN_NEEDS_TERM until we are sure + it can be removed. only used on solaris. will no longer compile with + privsep shuffling. + +20020322 + - (stevesk) HAVE_ACCRIGHTS_IN_MSGHDR configure support + - (stevesk) [monitor.c monitor_wrap.c] #ifdef HAVE_PW_CLASS_IN_PASSWD + - (stevesk) configure and cpp __FUNCTION__ gymnastics to handle nielsisms + - (stevesk) [monitor_fdpass.c] support for access rights style file + descriptor passing + - (stevesk) [auth2.c] merge cleanup/sync + - (stevesk) [defines.h] hp-ux 11 has ancillary data style fd passing, but + is missing CMSG_LEN() and CMSG_SPACE() macros. + - (stevesk) [defines.h] #define MAP_ANON MAP_ANONYMOUS for HP-UX; other + platforms may need this--I'm not sure. mmap() issues will need to be + addressed further. + - (tim) [cipher.c] fix problem with OpenBSD sync + - (stevesk) [LICENCE] OpenBSD sync + +20020321 + - (bal) OpenBSD CVS Sync + - itojun@cvs.openbsd.org 2002/03/08 06:10:16 + [sftp-client.c] + printf type mismatch + - itojun@cvs.openbsd.org 2002/03/11 03:18:49 + [sftp-client.c] + correct type mismatches (u_int64_t != unsigned long long) + - itojun@cvs.openbsd.org 2002/03/11 03:19:53 + [sftp-client.c] + indent + - markus@cvs.openbsd.org 2002/03/14 15:24:27 + [sshconnect1.c] + don't trust size sent by (rogue) server; noted by + s.esser@e-matters.de + - markus@cvs.openbsd.org 2002/03/14 16:38:26 + [sshd.c] + split out ssh1 session key decryption; ok provos@ + - markus@cvs.openbsd.org 2002/03/14 16:56:33 + [auth-rh-rsa.c auth-rsa.c auth.h] + split auth_rsa() for better readability and privsep; ok provos@ + - itojun@cvs.openbsd.org 2002/03/15 11:00:38 + [auth.c] + fix file type checking (use S_ISREG). ok by markus + - markus@cvs.openbsd.org 2002/03/16 11:24:53 + [compress.c] + skip inflateEnd if inflate fails; ok provos@ + - markus@cvs.openbsd.org 2002/03/16 17:22:09 + [auth-rh-rsa.c auth.h] + split auth_rhosts_rsa(), ok provos@ + - stevesk@cvs.openbsd.org 2002/03/16 17:41:25 + [auth-krb5.c] + BSD license. from Daniel Kouril via Dug Song. ok markus@ + - 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@ + - dugsong@cvs.openbsd.org 2002/03/18 01:30:10 + [auth-krb4.c] + set client to NULL after xfree(), from Rolf Braun + + - provos@cvs.openbsd.org 2002/03/18 03:41:08 + [auth.c session.c] + move auth_approval into getpwnamallow with help from millert@ + - markus@cvs.openbsd.org 2002/03/18 17:13:15 + [cipher.c cipher.h] + export/import cipher states; needed by ssh-privsep + - markus@cvs.openbsd.org 2002/03/18 17:16:38 + [packet.c packet.h] + export/import cipher state, iv and ssh2 seqnr; needed by ssh-privsep + - markus@cvs.openbsd.org 2002/03/18 17:23:31 + [key.c key.h] + add key_demote() for ssh-privsep + - provos@cvs.openbsd.org 2002/03/18 17:25:29 + [bufaux.c bufaux.h] + buffer_skip_string and extra sanity checking; needed by ssh-privsep + - provos@cvs.openbsd.org 2002/03/18 17:31:54 + [compress.c] + export compression streams for ssh-privsep + - provos@cvs.openbsd.org 2002/03/18 17:50:31 + [auth-bsdauth.c auth-options.c auth-rh-rsa.c auth-rsa.c] + [auth-skey.c auth.h auth1.c auth2-chall.c auth2.c kex.c kex.h kexdh.c] + [kexgex.c servconf.c] + [session.h servconf.h serverloop.c session.c sshd.c] + integrate privilege separated openssh; its turned off by default + for now. work done by me and markus@ + - provos@cvs.openbsd.org 2002/03/18 17:53:08 + [sshd.8] + credits for privsep + - provos@cvs.openbsd.org 2002/03/18 17:59:09 + [sshd.8] + document UsePrivilegeSeparation + - stevesk@cvs.openbsd.org 2002/03/18 23:52:51 + [servconf.c] + UnprivUser/UnprivGroup usable now--specify numeric user/group; ok + provos@ + - stevesk@cvs.openbsd.org 2002/03/19 03:03:43 + [pathnames.h servconf.c servconf.h sshd.c] + _PATH_PRIVSEP_CHROOT_DIR; ok provos@ + - stevesk@cvs.openbsd.org 2002/03/19 05:23:08 + [sshd.8] + Banner has no default. + - mpech@cvs.openbsd.org 2002/03/19 06:32:56 + [sftp-int.c] + use xfree() after xstrdup(). + + markus@ ok + - markus@cvs.openbsd.org 2002/03/19 10:35:39 + [auth-options.c auth.h session.c session.h sshd.c] + clean up prototypes + - markus@cvs.openbsd.org 2002/03/19 10:49:35 + [auth-krb5.c auth-rh-rsa.c auth.c cipher.c key.c misc.h] + [packet.c session.c sftp-client.c sftp-glob.h sftp.c ssh-add.c ssh.c] + [sshconnect2.c sshd.c ttymodes.c] + KNF whitespace + - markus@cvs.openbsd.org 2002/03/19 14:27:39 + [auth.c auth1.c auth2.c] + make getpwnamallow() allways call pwcopy() + - markus@cvs.openbsd.org 2002/03/19 15:31:47 + [auth.c] + check for NULL; from provos@ + - stevesk@cvs.openbsd.org 2002/03/20 19:12:25 + [servconf.c servconf.h ssh.h sshd.c] + for unprivileged user, group do: + pw=getpwnam(SSH_PRIVSEP_USER); do_setusercontext(pw). ok provos@ + - stevesk@cvs.openbsd.org 2002/03/20 21:08:08 + [sshd.c] + strerror() on chdir() fail; ok provos@ + - markus@cvs.openbsd.org 2002/03/21 10:21:20 + [ssh-add.c] + ignore errors for nonexisting default keys in ssh-add, + fixes http://bugzilla.mindrot.org/show_bug.cgi?id=158 + - jakob@cvs.openbsd.org 2002/03/21 15:17:26 + [clientloop.c ssh.1] + add built-in command line for adding new port forwardings on the fly. + based on a patch from brian wellington. ok markus@. + - markus@cvs.openbsd.org 2002/03/21 16:38:06 [scard.c] - typo in comment - - markus@cvs.openbsd.org 2001/07/25 14:35:18 - [readconf.c ssh.1 ssh.c sshconnect.c] - cleanup connect(); connection_attempts 4 -> 1; from - eivind@freebsd.org - - stevesk@cvs.openbsd.org 2001/07/26 17:18:22 - [sshd.8 sshd.c] - add -t option to test configuration file and keys; pekkas@netcore.fi - ok markus@ - - rees@cvs.openbsd.org 2001/07/26 20:04:27 - [scard.c ssh-keygen.c] - Inquire Cyberflex class for 0xf0 cards - change aid to conform to 7816-5 - remove gratuitous fid selects - - millert@cvs.openbsd.org 2001/07/27 14:50:45 - [ssh.c] - If smart card support is compiled in and a smart card is being used - for authentication, make it the first method used. markus@ OK - - deraadt@cvs.openbsd.org 2001/07/27 17:26:16 - [scp.c] - shorten lines - - markus@cvs.openbsd.org 2001/07/28 09:21:15 - [sshd.8] - cleanup some RSA vs DSA vs SSH1 vs SSH2 notes - - mouring@cvs.openbsd.org 2001/07/29 17:02:46 - [scp.1] - Clarified -o option in scp.1 OKed by Markus@ - - jakob@cvs.openbsd.org 2001/07/30 16:06:07 - [scard.c scard.h] - better errorcodes from sc_*; ok markus@ - - stevesk@cvs.openbsd.org 2001/07/30 16:23:30 - [rijndael.c rijndael.h] - new BSD-style license: - Brian Gladman : - >I have updated my code at: - >http://fp.gladman.plus.com/cryptography_technology/rijndael/index.htm - >with a copyright notice as follows: - >[...] - >I am not sure which version of my old code you are using but I am - >happy for the notice above to be substituted for my existing copyright - >intent if this meets your purpose. - - jakob@cvs.openbsd.org 2001/07/31 08:41:10 + make compile w/ openssl 0.9.7 + - markus@cvs.openbsd.org 2002/03/21 16:54:53 + [scard.c scard.h ssh-keygen.c] + move key upload to scard.[ch] + - markus@cvs.openbsd.org 2002/03/21 16:57:15 [scard.c] - do not complain about missing smartcards. ok markus@ - - jakob@cvs.openbsd.org 2001/07/31 09:28:44 - [readconf.c readconf.h ssh.1 ssh.c] - add 'SmartcardDevice' client option to specify which smartcard device - is used to access a smartcard used for storing the user's private RSA - key. ok markus@. - - jakob@cvs.openbsd.org 2001/07/31 12:42:50 - [sftp-int.c sftp-server.c] - avoid paths beginning with "//"; - ok markus@ - - jakob@cvs.openbsd.org 2001/07/31 12:53:34 + remove const + - markus@cvs.openbsd.org 2002/03/21 16:58:13 + [clientloop.c] + remove unused + - rees@cvs.openbsd.org 2002/03/21 18:08:15 [scard.c] - close smartcard connection if card is missing - - markus@cvs.openbsd.org 2001/08/01 22:03:33 - [authfd.c authfd.h readconf.c readconf.h scard.c scard.h ssh-add.c - ssh-agent.c ssh.c] - use strings instead of ints for smartcard reader ids - - markus@cvs.openbsd.org 2001/08/01 22:16:45 - [ssh.1 sshd.8] - refer to current ietf drafts for protocol v2 - - markus@cvs.openbsd.org 2001/08/01 23:33:09 - [ssh-keygen.c] - allow uploading RSA keys for non-default AUT0 (sha1 over passphrase - like sectok). - - markus@cvs.openbsd.org 2001/08/01 23:38:45 - [scard.c ssh.c] - support finish rsa keys. - free public keys after login -> call finish -> close smartcard. - - markus@cvs.openbsd.org 2001/08/02 00:10:17 - [ssh-keygen.c] - add -D readerid option (download, i.e. print public RSA key to stdout). - check for card present when uploading keys. - use strings instead of ints for smartcard reader ids, too. - - jakob@cvs.openbsd.org 2001/08/02 08:58:35 - [ssh-keygen.c] - change -u (upload smartcard key) to -U. ok markus@ - - jakob@cvs.openbsd.org 2001/08/02 15:06:52 - [ssh-keygen.c] - more verbose usage(). ok markus@ - - jakob@cvs.openbsd.org 2001/08/02 15:07:23 - [ssh-keygen.1] - document smartcard upload/download. ok markus@ - - jakob@cvs.openbsd.org 2001/08/02 15:32:10 - [ssh.c] - add smartcard to usage(). ok markus@ - - jakob@cvs.openbsd.org 2001/08/02 15:43:57 - [ssh-agent.c ssh.c ssh-keygen.c] - add /* SMARTCARD */ to #else/#endif. ok markus@ - - jakob@cvs.openbsd.org 2001/08/02 16:14:05 - [scard.c ssh-agent.c ssh.c ssh-keygen.c] - clean up some /* SMARTCARD */. ok markus@ - - mpech@cvs.openbsd.org 2001/08/02 18:37:35 - [ssh-keyscan.1] - o) .Sh AUTHOR -> .Sh AUTHORS; - o) .Sh EXAMPLE -> .Sh EXAMPLES; - o) Delete .Sh OPTIONS. Text moved to .Sh DESCRIPTION; - - millert@ ok - - jakob@cvs.openbsd.org 2001/08/03 10:31:19 - [ssh-add.1] - document smartcard options. ok markus@ - - jakob@cvs.openbsd.org 2001/08/03 10:31:30 - [ssh-add.c ssh-agent.c ssh-keyscan.c] - improve usage(). ok markus@ - - markus@cvs.openbsd.org 2001/08/05 23:18:20 - [ssh-keyscan.1 ssh-keyscan.c] - ssh 2 support; from wayned@users.sourceforge.net - - markus@cvs.openbsd.org 2001/08/05 23:29:58 - [ssh-keyscan.c] - make -t dsa work with commercial servers, too - - stevesk@cvs.openbsd.org 2001/08/06 19:47:05 - [scp.c] - use alarm vs. setitimer for portable; ok markus@ - - (bal) ssh-keyscan double -lssh hack due to seed_rng(). - - (bal) Second around of UNICOS patches. A few other things left. - Patches by William L. Jones - -20010803 - - (djm) Fix interrupted read in entropy gatherer. Spotted by markus@ on - a fast UltraSPARC. - -20010726 - - (stevesk) use mysignal() in protocol 1 loop now that the SIGCHLD - handler has converged. - -20010725 - - (bal) Added 'install-nokeys' to Makefile to assist package builders. - -20010724 - - (bal) 4711 not 04711 for ssh binary. - -20010722 - - (bal) Starting the Unicossmk merger. File merged TODO, configure.in, - myproposal.h, ssh_prng_cmds.in, and openbsd-compat/Makefile.in. - Added openbsd-compat/bsd-cray.c. Rest will be merged after - approval. Selective patches from William L. Jones - - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/07/18 21:10:43 - [sshpty.c] - pr #1946, allow sshd if /dev is readonly - - stevesk@cvs.openbsd.org 2001/07/18 21:40:40 - [ssh-agent.c] - chdir("/") from bbraun@synack.net; ok markus@ - - stevesk@cvs.openbsd.org 2001/07/19 00:41:44 - [ssh.1] - escape chars are below now - - markus@cvs.openbsd.org 2001/07/20 14:46:11 - [ssh-agent.c] - do not exit() from signal handlers; ok deraadt@ - - stevesk@cvs.openbsd.org 2001/07/20 18:41:51 - [ssh.1] - "the" command line - -20010719 - - (tim) [configure.in] put inet_aton back in AC_CHECK_FUNCS. - report from Mark Miller - -20010718 - - OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/07/14 15:10:17 - [readpass.c sftp-client.c sftp-common.c sftp-glob.c] - delete spurious #includes; ok deraadt@ markus@ - - markus@cvs.openbsd.org 2001/07/15 16:17:08 - [serverloop.c] - schedule client alive for ssh2 only, greg@cheers.bungi.com - - stevesk@cvs.openbsd.org 2001/07/15 16:57:21 - [ssh-agent.1] - -d will not fork; ok markus@ - - stevesk@cvs.openbsd.org 2001/07/15 16:58:29 - [ssh-agent.c] - typo in usage; ok markus@ - - markus@cvs.openbsd.org 2001/07/17 20:48:42 - [ssh-agent.c] - update maxfd if maxfd is closed; report from jmcelroy@dtgnet.com - - markus@cvs.openbsd.org 2001/07/17 21:04:58 - [channels.c channels.h clientloop.c nchan.c serverloop.c] - keep track of both maxfd and the size of the malloc'ed fdsets. - update maxfd if maxfd gets closed. - - mouring@cvs.openbsd.org 2001/07/18 16:45:52 - [scp.c] - Missing -o in scp usage() - - (bal) Cleaned up trailing spaces in ChangeLog. - - (bal) Allow sshd to switch user context without password for Cygwin. - Patch by Corinna Vinschen - - (bal) Updated cygwin README and ssh-host-config. Patch by - Corinna Vinschen - -20010715 - - (bal) Set "BROKEN_GETADDRINFO" for darwin platform. Reported by - Josh Larios - - (tim) put openssh/openbsd-compat/inet_aton.[ch] back in. - needed by openbsd-compat/fake-getaddrinfo.c - -20010714 - - (stevesk) change getopt() declaration - - (stevesk) configure.in: use ll suffix for long long constant - in snprintf() test - -20010713 - - (djm) Enable /etc/nologin check on PAM systems, as some lack the - pam_nologin module. Report from William Yodlowsky - - - (djm) Revert dirname fix, a better one is on its way. - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/07/04 22:47:19 - [ssh-agent.c] - ignore SIGPIPE when debugging, too - - markus@cvs.openbsd.org 2001/07/04 23:13:10 - [scard.c scard.h ssh-agent.c] - handle card removal more gracefully, add sc_close() to scard.h - - markus@cvs.openbsd.org 2001/07/04 23:39:07 - [ssh-agent.c] - for smartcards remove both RSA1/2 keys - - markus@cvs.openbsd.org 2001/07/04 23:49:27 - [ssh-agent.c] - handle mutiple adds of the same smartcard key - - espie@cvs.openbsd.org 2001/07/05 11:43:33 - [sftp-glob.c] - Directly cast to the right type. Ok markus@ - - stevesk@cvs.openbsd.org 2001/07/05 20:32:47 - [sshconnect1.c] - statement after label; ok dugsong@ - - stevesk@cvs.openbsd.org 2001/07/08 15:23:38 - [servconf.c] - fix ``MaxStartups max''; ok markus@ - - fgsch@cvs.openbsd.org 2001/07/09 05:58:47 - [ssh.c] - Use getopt(3); markus@ ok. - - deraadt@cvs.openbsd.org 2001/07/09 07:04:53 - [session.c sftp-int.c] - correct type on last arg to execl(); nordin@cse.ogi.edu - - markus@cvs.openbsd.org 2001/07/10 21:49:12 - [readpass.c] - don't panic if fork or pipe fail (just return an empty passwd). - - itojun@cvs.openbsd.org 2001/07/11 00:24:53 - [servconf.c] - make it compilable in all 4 combination of KRB4/KRB5 settings. - dugsong ok - XXX isn't it sensitive to the order of -I/usr/include/kerberosIV and - -I/usr/include/kerberosV? - - markus@cvs.openbsd.org 2001/07/11 16:29:59 - [ssh.c] - sort options string, fix -p, add -k - - markus@cvs.openbsd.org 2001/07/11 18:26:15 - [auth.c] - no need to call dirname(pw->pw_dir). - note that dirname(3) modifies its argument on some systems. - - (djm) Reorder Makefile.in so clean targets work a little better when - run directly from Makefile.in - - (djm) Pull in getopt(3) from OpenBSD libc for the optreset extension. - -20010711 - - (djm) dirname(3) may modify its argument on glibc and other systems. - Patch from markus@, spotted by Tom Holroyd - -20010704 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/06/25 08:25:41 - [channels.c channels.h cipher.c clientloop.c compat.c compat.h - hostfile.c kex.c kex.h key.c key.h nchan.c packet.c serverloop.c - session.c session.h sftp-server.c ssh-add.c ssh-agent.c uuencode.h] - update copyright for 2001 - - markus@cvs.openbsd.org 2001/06/25 17:18:27 - [ssh-keygen.1] - sshd(8) will never read the private keys, but ssh(1) does; - hugh@mimosa.com - - provos@cvs.openbsd.org 2001/06/25 17:54:47 - [auth.c auth.h auth-rsa.c] - terminate secure_filename checking after checking homedir. that way - it works on AFS. okay markus@ - - stevesk@cvs.openbsd.org 2001/06/25 20:26:37 - [auth2.c sshconnect2.c] - prototype cleanup; ok markus@ - - markus@cvs.openbsd.org 2001/06/26 02:47:07 - [ssh-keygen.c] - allow loading a private RSA key to a cyberflex card. - - markus@cvs.openbsd.org 2001/06/26 04:07:06 - [ssh-agent.1 ssh-agent.c] - add debug flag - - markus@cvs.openbsd.org 2001/06/26 04:59:59 - [authfd.c authfd.h ssh-add.c] - initial support for smartcards in the agent - - markus@cvs.openbsd.org 2001/06/26 05:07:43 - [ssh-agent.c] - update usage - - markus@cvs.openbsd.org 2001/06/26 05:33:34 - [ssh-agent.c] - more smartcard support. - - mpech@cvs.openbsd.org 2001/06/26 05:48:07 - [sshd.8] - remove unnecessary .Pp between .It; - millert@ ok - - markus@cvs.openbsd.org 2001/06/26 05:50:11 - [auth2.c] - new interface for secure_filename() - - itojun@cvs.openbsd.org 2001/06/26 06:32:58 - [atomicio.h authfd.h authfile.h auth.h auth-options.h bufaux.h - buffer.h canohost.h channels.h cipher.h clientloop.h compat.h - compress.h crc32.h deattack.h dh.h dispatch.h groupaccess.h - hostfile.h kex.h key.h log.h mac.h match.h misc.h mpaux.h packet.h - radix.h readconf.h readpass.h rsa.h] - prototype pedant. not very creative... - - () -> (void) - - no variable names - - itojun@cvs.openbsd.org 2001/06/26 06:33:07 - [servconf.h serverloop.h session.h sftp-client.h sftp-common.h - sftp-glob.h sftp-int.h sshconnect.h ssh-dss.h sshlogin.h sshpty.h - ssh-rsa.h tildexpand.h uidswap.h uuencode.h xmalloc.h] - prototype pedant. not very creative... - - () -> (void) - - no variable names - - dugsong@cvs.openbsd.org 2001/06/26 16:15:25 - [auth1.c auth.h auth-krb4.c auth-passwd.c readconf.c readconf.h - servconf.c servconf.h session.c sshconnect1.c sshd.c] - Kerberos v5 support for SSH1, mostly from Assar Westerlund - and Bjorn Gronvall . markus@ ok - - markus@cvs.openbsd.org 2001/06/26 17:25:34 - [ssh.1] - document SSH_ASKPASS; fubob@MIT.EDU - - markus@cvs.openbsd.org 2001/06/26 17:27:25 - [authfd.h authfile.h auth.h auth-options.h bufaux.h buffer.h - canohost.h channels.h cipher.h clientloop.h compat.h compress.h - crc32.h deattack.h dh.h dispatch.h groupaccess.c groupaccess.h - hostfile.h kex.h key.h log.c log.h mac.h misc.c misc.h mpaux.h - packet.h radix.h readconf.h readpass.h rsa.h servconf.h serverloop.h - session.h sftp-common.c sftp-common.h sftp-glob.h sftp-int.h - sshconnect.h ssh-dss.h sshlogin.h sshpty.h ssh-rsa.h sshtty.h - tildexpand.h uidswap.h uuencode.h xmalloc.h] - remove comments from .h, since they are cut&paste from the .c files - and out of sync - - dugsong@cvs.openbsd.org 2001/06/26 17:41:49 - [servconf.c] - #include - - markus@cvs.openbsd.org 2001/06/26 20:14:11 - [key.c key.h ssh.c sshconnect1.c sshconnect2.c] - add smartcard support to the client, too (now you can use both - the agent and the client). - - markus@cvs.openbsd.org 2001/06/27 02:12:54 - [serverloop.c serverloop.h session.c session.h] - quick hack to make ssh2 work again. - - markus@cvs.openbsd.org 2001/06/27 04:48:53 - [auth.c match.c sshd.8] - tridge@samba.org - - markus@cvs.openbsd.org 2001/06/27 05:35:42 - [ssh-keygen.c] - use cyberflex_inq_class to inquire class. - - markus@cvs.openbsd.org 2001/06/27 05:42:25 - [rsa.c rsa.h ssh-agent.c ssh-keygen.c] - s/generate_additional_parameters/rsa_generate_additional_parameters/ - http://www.humppa.com/ - - markus@cvs.openbsd.org 2001/06/27 06:26:36 - [ssh-add.c] - convert to getopt(3) - - stevesk@cvs.openbsd.org 2001/06/28 19:57:35 - [ssh-keygen.c] - '\0' terminated data[] is ok; ok markus@ - - markus@cvs.openbsd.org 2001/06/29 07:06:34 - [ssh-keygen.c] - new error handling for cyberflex_* - - markus@cvs.openbsd.org 2001/06/29 07:11:01 - [ssh-keygen.c] - initialize early - - stevesk@cvs.openbsd.org 2001/06/29 18:38:44 - [clientloop.c] - sync function definition with declaration; ok markus@ - - stevesk@cvs.openbsd.org 2001/06/29 18:40:28 - [channels.c] - use socklen_t for getsockopt arg #5; ok markus@ - - stevesk@cvs.openbsd.org 2001/06/30 18:08:40 - [channels.c channels.h clientloop.c] - adress -> address; ok markus@ - - markus@cvs.openbsd.org 2001/07/02 13:59:15 - [serverloop.c session.c session.h] - wait until !session_have_children(); bugreport from - Lutz.Jaenicke@aet.TU-Cottbus.DE - - markus@cvs.openbsd.org 2001/07/02 22:29:20 - [readpass.c] - do not return NULL, use "" instead. - - markus@cvs.openbsd.org 2001/07/02 22:40:18 - [ssh-keygen.c] - update for sectok.h interface changes. - - markus@cvs.openbsd.org 2001/07/02 22:52:57 - [channels.c channels.h serverloop.c] - improve cleanup/exit logic in ssh2: - stop listening to channels, detach channel users (e.g. sessions). - wait for children (i.e. dying sessions), send exit messages, - cleanup all channels. - - (bal) forget a few new files in sync up. - - (bal) Makefile fix up requires scard.c - - (stevesk) sync misc.h - - (stevesk) more sync for session.c - - (stevesk) sync servconf.h (comments) - - (tim) [contrib/caldera/openssh.spec] sync with Caldera - - (tim) [openbsd-compat/dirname.h] Remove ^M causing some compilers to - issue warning (line 1: tokens ignored at end of directive line) - - (tim) [sshconnect1.c] give the compiler something to do for success: - if KRB5 and AFS are not defined - (ERROR: "sshconnect1.c", line 1274: Syntax error before or at: }) - -20010629 - - (bal) Removed net_aton() since we don't use it any more - - (bal) Fixed _DISABLE_VPOSIX in readpassphrase.c. - - (bal) Updated zlib's home. Thanks to David Howe . - - (stevesk) remove _REENTRANT #define - - (stevesk) session.c: use u_int for envsize - - (stevesk) remove cli.[ch] - -20010628 - - (djm) Sync openbsd-compat with -current libc - - (djm) Fix from Lutz Jaenicke for my - broken makefile - - (bal) Removed strtok_r() and inet_ntop() since they are no longer used. - - (bal) Remove getusershell() since it's no longer used. - -20010627 - - (djm) Reintroduce pam_session call for non-pty sessions. - - (djm) Remove redundant and incorrect test for max auth attempts in - PAM kbdint code. Based on fix from Matthew Melvin - - - (djm) Rename sysconfdir/primes => sysconfdir/moduli - - (djm) Oops, forgot make logic for primes=>moduli. Also try to rename - existing primes->moduli if it exists. - - (djm) Sync with -current openbsd-compat/readpassphrase.c: - - djm@cvs.openbsd.org 2001/06/27 13:23:30 - typo, spotted by Tom Holroyd ; ok deraadt@ - - (djm) Turn up warnings if gcc or egcs detected - - (stevesk) for HP-UX 11.X use X/Open socket interface; - pulls in modern socket prototypes and eliminates a number of compiler - warnings. see xopen_networking(7). - - (stevesk) fix x11 forwarding from _PATH_XAUTH change - - (stevesk) use X/Open socket interface for HP-UX 10.X also - -20010625 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/06/21 21:08:25 - [session.c] - don't reset forced_command (we allow multiple login shells in - ssh2); dwd@bell-labs.com - - mpech@cvs.openbsd.org 2001/06/22 10:17:51 - [ssh.1 sshd.8 ssh-keyscan.1] - o) .Sh AUTHOR -> .Sh AUTHORS; - o) remove unnecessary .Pp; - o) better -mdoc style; - o) typo; - o) sort SEE ALSO; - aaron@ ok - - provos@cvs.openbsd.org 2001/06/22 21:27:08 - [dh.c pathnames.h] - use /etc/moduli instead of /etc/primes, okay markus@ - - provos@cvs.openbsd.org 2001/06/22 21:28:53 - [sshd.8] - document /etc/moduli - - markus@cvs.openbsd.org 2001/06/22 21:55:49 - [auth2.c auth-rsa.c pathnames.h ssh.1 sshd.8 sshd_config - ssh-keygen.1] - merge authorized_keys2 into authorized_keys. - authorized_keys2 is used for backward compat. - (just append authorized_keys2 to authorized_keys). - - provos@cvs.openbsd.org 2001/06/22 21:57:59 - [dh.c] - increase linebuffer to deal with larger moduli; use rewind instead of - close/open - - markus@cvs.openbsd.org 2001/06/22 22:21:20 - [sftp-server.c] - allow long usernames/groups in readdir - - markus@cvs.openbsd.org 2001/06/22 23:35:21 - [ssh.c] - don't overwrite argv (fixes ssh user@host in 'ps'), report by ericj@ - - deraadt@cvs.openbsd.org 2001/06/23 00:16:16 - [scp.c] - slightly better care - - markus@cvs.openbsd.org 2001/06/23 00:20:57 - [auth2.c auth.c auth.h auth-rh-rsa.c] - *known_hosts2 is obsolete for hostbased authentication and - only used for backward compat. merge ssh1/2 hostkey check - and move it to auth.c - - deraadt@cvs.openbsd.org 2001/06/23 02:33:05 - [sftp.1 sftp-server.8 ssh-keygen.1] - join .%A entries; most by bk@rt.fm - - markus@cvs.openbsd.org 2001/06/23 02:34:33 - [kexdh.c kexgex.c kex.h pathnames.h readconf.c servconf.h ssh.1 - sshconnect1.c sshconnect2.c sshconnect.c sshconnect.h sshd.8] - get rid of known_hosts2, use it for hostkey lookup, but do not - modify. - - markus@cvs.openbsd.org 2001/06/23 03:03:59 - [sshd.8] - draft-ietf-secsh-dh-group-exchange-01.txt - - markus@cvs.openbsd.org 2001/06/23 03:04:42 - [auth2.c auth-rh-rsa.c] - restore correct ignore_user_known_hosts logic. - - markus@cvs.openbsd.org 2001/06/23 05:26:02 - [key.c] - handle sigature of size 0 (some broken clients send this). - - deraadt@cvs.openbsd.org 2001/06/23 05:57:09 - [sftp.1 sftp-server.8 ssh-keygen.1] - ok, tmac is now fixed - - markus@cvs.openbsd.org 2001/06/23 06:41:10 - [ssh-keygen.c] - try to decode ssh-3.0.0 private rsa keys - (allow migration to openssh, not vice versa), #910 - - itojun@cvs.openbsd.org 2001/06/23 15:12:20 - [auth1.c auth2.c auth2-chall.c authfd.c authfile.c auth-rhosts.c - canohost.c channels.c cipher.c clientloop.c deattack.c dh.c - hostfile.c kex.c kexdh.c kexgex.c key.c nchan.c packet.c radix.c - readpass.c scp.c servconf.c serverloop.c session.c sftp.c - sftp-client.c sftp-glob.c sftp-int.c sftp-server.c ssh-add.c - ssh-agent.c ssh.c sshconnect1.c sshconnect2.c sshconnect.c sshd.c - ssh-keygen.c ssh-keyscan.c] - more strict prototypes. raise warning level in Makefile.inc. - markus ok'ed - TODO; cleanup headers - - markus@cvs.openbsd.org 2001/06/23 17:05:22 - [ssh-keygen.c] - fix import for (broken?) ssh.com/f-secure private keys - (i tested > 1000 RSA keys) - - itojun@cvs.openbsd.org 2001/06/23 17:48:18 - [sftp.1 ssh.1 sshd.8 ssh-keyscan.1] - kill whitespace at EOL. - - markus@cvs.openbsd.org 2001/06/23 19:12:43 - [sshd.c] - pidfile/sigterm race; bbraun@synack.net - - markus@cvs.openbsd.org 2001/06/23 22:37:46 - [sshconnect1.c] - consistent with ssh2: skip key if empty passphrase is entered, - retry num_of_passwd_prompt times if passphrase is wrong. ok fgsch@ - - markus@cvs.openbsd.org 2001/06/24 05:25:10 - [auth-options.c match.c match.h] - move ip+hostname check to match.c - - markus@cvs.openbsd.org 2001/06/24 05:35:33 - [readpass.c readpass.h ssh-add.c sshconnect2.c ssh-keygen.c] - switch to readpassphrase(3) - 2.7/8-stable needs readpassphrase.[ch] from libc - - markus@cvs.openbsd.org 2001/06/24 05:47:13 - [sshconnect2.c] - oops, missing format string - - markus@cvs.openbsd.org 2001/06/24 17:18:31 - [ttymodes.c] - passing modes works fine: debug2->3 - - (djm) -Wall fix for session.c - - (djm) Bring in readpassphrase() from OpenBSD libc. Compiles OK on Linux and - Solaris - -20010622 - - (stevesk) handle systems without pw_expire and pw_change. - -20010621 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/06/16 08:49:38 - [misc.c] - typo; dunlap@apl.washington.edu - - markus@cvs.openbsd.org 2001/06/16 08:50:39 - [channels.h] - bad //-style comment; thx to stevev@darkwing.uoregon.edu - - markus@cvs.openbsd.org 2001/06/16 08:57:35 - [scp.c] - no stdio or exit() in signal handlers. - - markus@cvs.openbsd.org 2001/06/16 08:58:34 - [misc.c] - copy pw_expire and pw_change, too. - - markus@cvs.openbsd.org 2001/06/19 12:34:09 - [session.c] - cleanup forced command handling, from dwd@bell-labs.com - - markus@cvs.openbsd.org 2001/06/19 14:09:45 - [session.c sshd.8] - disable x11-fwd if use_login is enabled; from lukem@wasabisystems.com - - markus@cvs.openbsd.org 2001/06/19 15:40:45 - [session.c] - allocate and free at the same level. - - markus@cvs.openbsd.org 2001/06/20 13:56:39 - [channels.c channels.h clientloop.c packet.c serverloop.c] - move from channel_stop_listening to channel_free_all, - call channel_free_all before calling waitpid() in serverloop. - fixes the utmp handling; report from Lutz.Jaenicke@aet.TU-Cottbus.DE - -20010615 - - (stevesk) don't set SA_RESTART and set SIGCHLD to SIG_DFL - around grantpt(). - - (stevesk) update TODO: STREAMS pty systems don't call vhangup() now - -20010614 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/06/13 09:10:31 - [session.c] - typo, use pid not s->pid, mstone@cs.loyola.edu - -20010613 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/06/12 10:58:29 - [session.c] - merge session_free into session_close() - merge pty_cleanup_proc into session_pty_cleanup() - - markus@cvs.openbsd.org 2001/06/12 16:10:38 - [session.c] - merge ssh1/ssh2 tty msg parse and alloc code - - markus@cvs.openbsd.org 2001/06/12 16:11:26 - [packet.c] - do not log() packet_set_maxsize - - markus@cvs.openbsd.org 2001/06/12 21:21:29 - [session.c] - remove xauth-cookie-in-tmp handling. use default $XAUTHORITY, since - we do already trust $HOME/.ssh - you can use .ssh/sshrc and .ssh/environment if you want to customize - the location of the xauth cookies - - markus@cvs.openbsd.org 2001/06/12 21:30:57 - [session.c] - unused - -20010612 - - scp.c ID update (upstream synced vfsprintf() from us) - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/06/10 11:29:20 - [dispatch.c] - we support rekeying - protocol errors are fatal. - - markus@cvs.openbsd.org 2001/06/11 10:18:24 - [session.c] - reset pointer to NULL after xfree(); report from solar@openwall.com - - markus@cvs.openbsd.org 2001/06/11 16:04:38 - [sshd.8] - typo; bdubreuil@crrel.usace.army.mil - -20010611 - - (bal) NeXT/MacOS X lack libgen.h and dirname(). Patch by Mark Miller - - - (bal) Handle broken krb4 issues on Solaris with multiple defined u_*_t - types. Patch by Jan IVEN - - (bal) Fixed Makefile.in so that 'configure; make install' works. - -20010610 - - (bal) Missed two files in major resync. auth-bsdauth.c and auth-skey.c - -20010609 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/05/30 12:55:13 - [auth-options.c auth2.c channels.c channels.h clientloop.c nchan.c - packet.c serverloop.c session.c ssh.c ssh1.h] - channel layer cleanup: merge header files and split .c files - - markus@cvs.openbsd.org 2001/05/30 15:20:10 - [ssh.c] - merge functions, simplify. - - markus@cvs.openbsd.org 2001/05/31 10:30:17 - [auth-options.c auth2.c channels.c channels.h clientloop.c nchan.c - packet.c serverloop.c session.c ssh.c] - undo the .c file split, just merge the header and keep the cvs - history - - (bal) Channels.c and Channels.h -- "Merge Functions, simplify" (draged - out of ssh Attic) - - (bal) Ooops.. nchan.c (and remove nchan.h) resync from OpenBSD ssh - Attic. - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/05/31 13:08:04 - [sshd_config] - group options and add some more comments - - markus@cvs.openbsd.org 2001/06/03 14:55:39 - [channels.c channels.h session.c] - use fatal_register_cleanup instead of atexit, sync with x11 authdir - handling - - markus@cvs.openbsd.org 2001/06/03 19:36:44 - [ssh-keygen.1] - 1-2 bits of entrophy per character (not per word), ok stevesk@ - - markus@cvs.openbsd.org 2001/06/03 19:38:42 - [scp.c] - pass -v to ssh; from slade@shore.net - - markus@cvs.openbsd.org 2001/06/03 20:06:11 - [auth2-chall.c] - the challenge response device decides how to handle non-existing - users. - -> fake challenges for skey and cryptocard - - markus@cvs.openbsd.org 2001/06/04 21:59:43 - [channels.c channels.h session.c] - switch uid when cleaning up tmp files and sockets; reported by - zen-parse@gmx.net on bugtraq - - markus@cvs.openbsd.org 2001/06/04 23:07:21 - [clientloop.c serverloop.c sshd.c] - set flags in the signal handlers, do real work in the main loop, - ok provos@ - - markus@cvs.openbsd.org 2001/06/04 23:16:16 - [session.c] - merge ssh1/2 x11-fwd setup, create listener after tmp-dir - - pvalchev@cvs.openbsd.org 2001/06/05 05:05:39 - [ssh-keyscan.1 ssh-keyscan.c] - License clarification from David Mazieres, ok deraadt@ - - markus@cvs.openbsd.org 2001/06/05 10:24:32 - [channels.c] - don't delete the auth socket in channel_stop_listening() - auth_sock_cleanup_proc() will take care of this. - - markus@cvs.openbsd.org 2001/06/05 16:46:19 - [session.c] - let session_close() delete the pty. deny x11fwd if xauthfile is set. - - markus@cvs.openbsd.org 2001/06/06 23:13:54 - [ssh-dss.c ssh-rsa.c] - cleanup, remove old code - - markus@cvs.openbsd.org 2001/06/06 23:19:35 - [ssh-add.c] - remove debug message; Darren.Moffat@eng.sun.com - - markus@cvs.openbsd.org 2001/06/07 19:57:53 - [auth2.c] - style is used for bsdauth. - disconnect on user/service change (ietf-drafts) - - markus@cvs.openbsd.org 2001/06/07 20:23:05 - [authfd.c authfile.c channels.c kexdh.c kexgex.c packet.c ssh.c - sshconnect.c sshconnect1.c] - use xxx_put_cstring() - - markus@cvs.openbsd.org 2001/06/07 22:25:02 - [session.c] - don't overwrite errno - delay deletion of the xauth cookie - - markus@cvs.openbsd.org 2001/06/08 15:25:40 - [includes.h pathnames.h readconf.c servconf.c] - move the path for xauth to pathnames.h - - (bal) configure.in fix for Tru64 (forgeting to reset $LIB) - - (bal) ANSIify strmode() - - (bal) --with-catman should be --with-mantype patch by Dave - Dykstra - -20010606 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/05/17 21:34:15 - [ssh.1] - no spaces in PreferredAuthentications; - meixner@rbg.informatik.tu-darmstadt.de - - markus@cvs.openbsd.org 2001/05/18 14:13:29 - [auth-chall.c auth.h auth1.c auth2-chall.c auth2.c readconf.c - readconf.h servconf.c servconf.h sshconnect1.c sshconnect2.c sshd.c] - improved kbd-interactive support. work by per@appgate.com and me - - djm@cvs.openbsd.org 2001/05/19 00:36:40 - [session.c] - Disable X11 forwarding if xauth binary is not found. Patch from Nalin - Dahyabhai ; ok markus@ - - markus@cvs.openbsd.org 2001/05/19 16:05:41 - [scp.c] - ftruncate() instead of open()+O_TRUNC like rcp.c does - allows scp /path/to/file localhost:/path/to/file - - markus@cvs.openbsd.org 2001/05/19 16:08:43 - [sshd.8] - sort options; Matthew.Stier@fnc.fujitsu.com - - markus@cvs.openbsd.org 2001/05/19 16:32:16 - [ssh.1 sshconnect2.c] - change preferredauthentication order to - publickey,hostbased,password,keyboard-interactive - document that hostbased defaults to no, document order - - markus@cvs.openbsd.org 2001/05/19 16:46:19 - [ssh.1 sshd.8] - document MACs defaults with .Dq - - stevesk@cvs.openbsd.org 2001/05/19 19:43:57 - [misc.c misc.h servconf.c sshd.8 sshd.c] - sshd command-line arguments and configuration file options that - specify time may be expressed using a sequence of the form: - time[qualifier], where time is a positive integer value and qualifier - is one of the following: - ,s,m,h,d,w - Examples: - 600 600 seconds (10 minutes) - 10m 10 minutes - 1h30m 1 hour 30 minutes (90 minutes) - ok markus@ - - stevesk@cvs.openbsd.org 2001/05/19 19:57:09 - [channels.c] - typo in error message - - markus@cvs.openbsd.org 2001/05/20 17:20:36 - [auth-rsa.c auth.c auth.h auth2.c servconf.c servconf.h sshd.8 - sshd_config] - configurable authorized_keys{,2} location; originally from peter@; - ok djm@ - - markus@cvs.openbsd.org 2001/05/24 11:12:42 - [auth.c] - fix comment; from jakob@ - - stevesk@cvs.openbsd.org 2001/05/24 18:57:53 - [clientloop.c readconf.c ssh.c ssh.h] - don't perform escape processing when ``EscapeChar none''; ok markus@ - - markus@cvs.openbsd.org 2001/05/25 14:37:32 - [ssh-keygen.c] - use -P for -e and -y, too. - - markus@cvs.openbsd.org 2001/05/28 08:04:39 - [ssh.c] - fix usage() - - markus@cvs.openbsd.org 2001/05/28 10:08:55 - [authfile.c] - key_load_private: set comment to filename for PEM keys - - markus@cvs.openbsd.org 2001/05/28 22:51:11 - [cipher.c cipher.h] - simpler 3des for ssh1 - - markus@cvs.openbsd.org 2001/05/28 23:14:49 - [channels.c channels.h nchan.c] - undo broken channel fix and try a different one. there - should be still some select errors... - - markus@cvs.openbsd.org 2001/05/28 23:25:24 - [channels.c] - cleanup, typo - - markus@cvs.openbsd.org 2001/05/28 23:58:35 - [packet.c packet.h sshconnect.c sshd.c] - remove some lines, simplify. - - markus@cvs.openbsd.org 2001/05/29 12:31:27 - [authfile.c] - typo - -20010528 - - (tim) [conifgure.in] add setvbuf test needed for sftp-int.c - Patch by Corinna Vinschen - -20010517 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/05/12 19:53:13 - [sftp-server.c] - readlink does not NULL-terminate; mhe@home.se - - deraadt@cvs.openbsd.org 2001/05/15 22:04:01 - [ssh.1] - X11 forwarding details improved - - markus@cvs.openbsd.org 2001/05/16 20:51:57 - [authfile.c] - return comments for private pem files, too; report from nolan@naic.edu - - markus@cvs.openbsd.org 2001/05/16 21:53:53 - [clientloop.c] - check for open sessions before we call select(); fixes the x11 client - bug reported by bowman@math.ualberta.ca - - markus@cvs.openbsd.org 2001/05/16 22:09:21 - [channels.c nchan.c] - more select() error fixes (don't set rfd/wfd to -1). - - (bal) Enabled USE_PIPES for Cygwin on Corinna Vinschen - - (bal) Corrected on_exit() emulation via atexit(). - -20010512 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/05/11 14:59:56 - [clientloop.c misc.c misc.h] - add unset_nonblock for stdout/err flushing in client_loop(). - - (bal) Patch to partial sync up contrib/solaris/ packaging software. - Patch by pete - -20010511 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/05/09 22:51:57 - [channels.c] - fix -R for protocol 2, noticed by greg@nest.cx. - bug was introduced with experimental dynamic forwarding. - - markus@cvs.openbsd.org 2001/05/09 23:01:31 - [rijndael.h] - fix prototype; J.S.Peatfield@damtp.cam.ac.uk - -20010509 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/05/06 21:23:31 - [cli.c] - cli_read() fails to catch SIGINT + overflow; from obdb@zzlevo.net - - markus@cvs.openbsd.org 2001/05/08 19:17:31 - [channels.c serverloop.c clientloop.c] - adds correct error reporting to async connect()s - fixes the server-discards-data-before-connected-bug found by - onoe@sm.sony.co.jp - - mouring@cvs.openbsd.org 2001/05/08 19:45:25 - [misc.c misc.h scp.c sftp.c] - Use addargs() in sftp plus some clean up of addargs(). OK Markus - - markus@cvs.openbsd.org 2001/05/06 21:45:14 - [clientloop.c] - use atomicio for flushing stdout/stderr bufs. thanks to - jbw@izanami.cee.hw.ac.uk - - markus@cvs.openbsd.org 2001/05/08 22:48:07 - [atomicio.c] - no need for xmalloc.h, thanks to espie@ - - (bal) UseLogin patch for Solaris/UNICOS. Patch by Wayne Davison - - - (bal) ./configure support to disable SIA on OSF1. Patch by - Chris Adams - - (bal) Updates from the Sony NEWS-OS platform by NAKAJI Hiroyuki - - -20010508 - - (bal) Fixed configure test for USE_SIA. - -20010506 - - (djm) Update config.guess and config.sub with latest versions (from - ftp://ftp.gnu.org/gnu/config/) to allow configure on ia64-hpux. - Suggested by Jason Mader - - (bal) White Space and #ifdef sync with OpenBSD - - (bal) Add 'seed_rng()' to ssh-add.c - - (bal) CVS ID updates for readpass.c, readpass.h, cli.c, and cli.h - - OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/05/05 13:42:52 - [sftp.1 ssh-add.1 ssh-keygen.1] - typos, grammar - -20010505 - - OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/05/04 14:21:56 - [ssh.1 sshd.8] - typos - - markus@cvs.openbsd.org 2001/05/04 14:34:34 - [channels.c] - channel_new() reallocs channels[], we cannot use Channel *c after - calling channel_new(), XXX fix this in the future... - - markus@cvs.openbsd.org 2001/05/04 23:47:34 - [channels.c channels.h clientloop.c nchan.c nchan.h serverloop.c ssh.c] - move to Channel **channels (instead of Channel *channels), fixes realloc - problems. channel_new now returns a Channel *, favour Channel * over - channel id. remove old channel_allocate interface. - -20010504 - - OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/05/03 15:07:39 - [channels.c] - typo in debug() string - - markus@cvs.openbsd.org 2001/05/03 15:45:15 - [session.c] - exec shell -c /bin/sh .ssh/sshrc, from abartlet@pcug.org.au - - stevesk@cvs.openbsd.org 2001/05/03 21:43:01 - [servconf.c] - remove "\n" from fatal() - - mouring@cvs.openbsd.org 2001/05/03 23:09:53 - [misc.c misc.h scp.c sftp.c] - Move colon() and cleanhost() to misc.c where I should I have put it in - the first place - - (bal) Updated Cygwin README by Corinna Vinschen - - (bal) Avoid socket file security issues in ssh-agent for Cygwin. - Patch by Egor Duda - -20010503 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/05/02 16:41:20 - [ssh-add.c] - fix prompt for ssh-add. - -20010502 - - OpenBSD CVS Sync - - mouring@cvs.openbsd.org 2001/05/02 01:25:39 - [readpass.c] - Put the 'const' back into ssh_askpass() function. Pointed out - by Mark Miller . OK Markus - -20010501 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/04/30 11:18:52 - [readconf.c readconf.h ssh.1 ssh.c sshconnect.c] - implement 'ssh -b bind_address' like 'telnet -b' - - markus@cvs.openbsd.org 2001/04/30 15:50:46 - [compat.c compat.h kex.c] - allow interop with weaker key generation used by ssh-2.0.x, x < 10 - - markus@cvs.openbsd.org 2001/04/30 16:02:49 - [compat.c] - ssh-2.0.10 has the weak-key-bug, too. - - (tim) [contrib/caldera/openssh.spec] add Requires line for Caldera 3.1 - -20010430 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/04/29 18:32:52 - [serverloop.c] - fix whitespace - - markus@cvs.openbsd.org 2001/04/29 19:16:52 - [channels.c clientloop.c compat.c compat.h serverloop.c] - more ssh.com-2.0.x bug-compat; from per@appgate.com - - (tim) New version of mdoc2man.pl from Mark D. Roth - - (djm) Add .cvsignore files, suggested by Wayne Davison - -20010429 - - (bal) Updated INSTALL. PCRE moved to a new place. - - (djm) Release OpenSSH-2.9p1 - -20010427 - - (bal) Fixed uidswap.c so it should work on non-posix complient systems. - patch based on 2.5.2 version by djm. - - (bal) Build manpages and config files once unless changed. Patch by - Carson Gaspar - - (bal) arpa/nameser.h does not exist on Cygwin. Patch by Corinna - Vinschen - - (bal) Add /etc/sysconfig/sshd support to redhat's sshd.init. Patch by - Pekka Savola - - (bal) Cygwin lacks setgroups() API. Patch by Corinna Vinschen - - - (bal) version.h synced, RPM specs updated for 2.9 - - (tim) update contrib/caldera files with what Caldera is using. - - -20010425 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/04/23 21:57:07 - [ssh-keygen.1 ssh-keygen.c] - allow public key for -e, too - - markus@cvs.openbsd.org 2001/04/23 22:14:13 - [ssh-keygen.c] - remove debug - - (bal) Whitespace resync w/ OpenBSD for uidswap.c - - (djm) Add new server configuration directive 'PAMAuthenticationViaKbdInt' - (default: off), implies KbdInteractiveAuthentication. Suggestion from - markus@ - - (djm) Include crypt.h if available in auth-passwd.c - - tim@mindrot.org 2001/04/25 21:38:01 [configure.in] - man page detection fixes for SCO - -20010424 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/04/22 23:58:36 - [ssh-keygen.1 ssh.1 sshd.8] - document hostbased and other cleanup - - (stevesk) start_pam() doesn't use DNS now for sshd -u0. - - (stevesk) auth-pam.c: use PERMIT_NO_PASSWD - - (bal) sys/queue.h is bogus for NCR platform. Patch by Daniel Carroll - - - (bal) Fixed contrib/postinstall.in. Patch by wsanders@wsanders.net - -20010422 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/04/20 16:32:22 - [uidswap.c] - set non-privileged gid before uid; tholo@ and deraadt@ - - mouring@cvs.openbsd.org 2001/04/21 00:55:57 - [sftp.1] - Spelling - - djm@cvs.openbsd.org 2001/04/22 08:13:30 - [ssh.1] - typos spotted by stevesk@; ok deraadt@ - - markus@cvs.openbsd.org 2001/04/22 12:34:05 - [scp.c] - scp > 2GB; niles@scyld.com; ok deraadt@, djm@ - - markus@cvs.openbsd.org 2001/04/22 13:25:37 - [ssh-keygen.1 ssh-keygen.c] - rename arguments -x -> -e (export key), -X -> -i (import key) - xref draft-ietf-secsh-publickeyfile-01.txt - - markus@cvs.openbsd.org 2001/04/22 13:32:27 - [sftp-server.8 sftp.1 ssh.1 sshd.8] - xref draft-ietf-secsh-* - - markus@cvs.openbsd.org 2001/04/22 13:41:02 - [ssh-keygen.1 ssh-keygen.c] - style, noted by stevesk; sort flags in usage - -20010421 - - OpenBSD CVS Sync - - djm@cvs.openbsd.org 2001/04/20 07:17:51 - [clientloop.c ssh.1] - Split out and improve escape character documentation, mention ~R in - ~? help text; ok markus@ - - Update RPM spec files for CVS version.h - - (stevesk) set the default PAM service name to __progname instead - of the hard-coded value "sshd"; from Mark D. Roth - - (stevesk) document PAM service name change in INSTALL - - tim@mindrot.org 2001/04/21 14:25:57 [Makefile.in configure.in] - fix perl test, fix nroff test, fix Makefile to build outside source tree - -20010420 - - OpenBSD CVS Sync - - ian@cvs.openbsd.org 2001/04/18 16:21:05 - [ssh-keyscan.1] - Fix typo reported in PR/1779 - - markus@cvs.openbsd.org 2001/04/18 21:57:42 - [readpass.c ssh-add.c] - call askpass from ssh, too, based on work by roth@feep.net, ok deraadt - - markus@cvs.openbsd.org 2001/04/18 22:03:45 - [auth2.c sshconnect2.c] - use FDQN with trailing dot in the hostbased auth packets, ok deraadt@ - - markus@cvs.openbsd.org 2001/04/18 22:48:26 - [auth2.c] - no longer const - - markus@cvs.openbsd.org 2001/04/18 23:43:26 - [auth2.c compat.c sshconnect2.c] - more ssh v2 hostbased-auth interop: ssh.com >= 2.1.0 works now - (however the 2.1.0 server seems to work only if debug is enabled...) - - markus@cvs.openbsd.org 2001/04/18 23:44:51 - [authfile.c] - error->debug; noted by fries@ - - markus@cvs.openbsd.org 2001/04/19 00:05:11 - [auth2.c] - use local variable, no function call needed. - (btw, hostbased works now with ssh.com >= 2.0.13) - - (bal) Put scp-common.h back into scp.c (it exists in the upstream - tree) pointed out by Tom Holroyd - -20010418 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/04/17 19:34:25 - [session.c] - move auth_approval to do_authenticated(). - do_child(): nuke hostkeys from memory - don't source .ssh/rc for subsystems. - - markus@cvs.openbsd.org 2001/04/18 14:15:00 - [canohost.c] - debug->debug3 - - (bal) renabled 'catman-do:' and fixed it. So now catman pages should - be working again. - - (bal) Makfile day... Cleaned up multiple mantype support (Patch by - Mark D. Roth ), and fixed PIDDIR support. - -20010417 - - (bal) Add perl5 check for HP/UX, Removed GNUness from Makefile.in - and temporary commented out 'catman-do:' since it is broken. Patches - for the first two by Lutz Jaenicke - - OpenBSD CVS Sync - - deraadt@cvs.openbsd.org 2001/04/16 08:26:04 - [key.c] - better safe than sorry in later mods; yongari@kt-is.co.kr - - markus@cvs.openbsd.org 2001/04/17 08:14:01 - [sshconnect1.c] - check for key!=NULL, thanks to costa - - markus@cvs.openbsd.org 2001/04/17 09:52:48 - [clientloop.c] - handle EINTR/EAGAIN on read; ok deraadt@ - - markus@cvs.openbsd.org 2001/04/17 10:53:26 - [key.c key.h readconf.c readconf.h ssh.1 sshconnect2.c] - add HostKeyAlgorithms; based on patch from res@shore.net; ok provos@ - - markus@cvs.openbsd.org 2001/04/17 12:55:04 - [channels.c ssh.c] - undo socks5 and https support since they are not really used and - only bloat ssh. remove -D from usage(), since '-D' is experimental. - -20010416 - - OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/04/15 01:35:22 - [ttymodes.c] - fix comments - - markus@cvs.openbsd.org 2001/04/15 08:43:47 - [dh.c sftp-glob.c sftp-glob.h sftp-int.c sshconnect2.c sshd.c] - some unused variable and typos; from tomh@po.crl.go.jp - - markus@cvs.openbsd.org 2001/04/15 16:58:03 - [authfile.c ssh-keygen.c sshd.c] - don't use errno for key_{load,save}_private; discussion w/ solar@openwall - - markus@cvs.openbsd.org 2001/04/15 17:16:00 - [clientloop.c] - set stdin/out/err to nonblocking in SSH proto 1, too. suggested by ho@ - should fix some of the blocking problems for rsync over SSH-1 - - stevesk@cvs.openbsd.org 2001/04/15 19:41:21 - [sshd.8] - some ClientAlive cleanup; ok markus@ - - stevesk@cvs.openbsd.org 2001/04/15 21:28:35 - [readconf.c servconf.c] - use fatal() or error() vs. fprintf(); ok markus@ - - (djm) Convert mandoc manpages to man automatically. Patch from Mark D. - Roth - - (bal) CVS ID fix up and slight manpage fix from OpenBSD tree. - - (djm) OpenBSD CVS Sync - - mouring@cvs.openbsd.org 2001/04/16 02:31:44 - [scp.c sftp.c] - IPv6 support for sftp (which I bungled in my last patch) which is - borrowed from scp.c. Thanks to Markus@ for pointing it out. - - deraadt@cvs.openbsd.org 2001/04/16 08:05:34 - [xmalloc.c] - xrealloc dealing with ptr == nULL; mouring - - djm@cvs.openbsd.org 2001/04/16 08:19:31 - [session.c] - Split motd and hushlogin checks into seperate functions, helps for - portable. From Chris Adams ; ok markus@ - - Fix OSF SIA support displaying too much information for quiet - logins and logins where access was denied by SIA. Patch from Chris Adams - - -20010415 - - OpenBSD CVS Sync - - deraadt@cvs.openbsd.org 2001/04/14 04:31:01 - [ssh-add.c] - do not double free - - markus@cvs.openbsd.org 2001/04/14 16:17:14 - [channels.c] - remove some channels that are not appropriate for keepalive. - - markus@cvs.openbsd.org 2001/04/14 16:27:57 - [ssh-add.c] - use clear_pass instead of xfree() - - stevesk@cvs.openbsd.org 2001/04/14 16:33:20 - [clientloop.c packet.h session.c ssh.c ttymodes.c ttymodes.h] - protocol 2 tty modes support; ok markus@ - - stevesk@cvs.openbsd.org 2001/04/14 17:04:42 - [scp.c] - 'T' handling rcp/scp sync; ok markus@ - - Missed sshtty.[ch] in Sync. - -20010414 - - Sync with OpenBSD glob.c, strlcat.c and vis.c changes - - Cygwin sftp/sftp-server binary mode patch from Corinna Vinschen - - - OpenBSD CVS Sync - - beck@cvs.openbsd.org 2001/04/13 22:46:54 - [channels.c channels.h servconf.c servconf.h serverloop.c sshd.8] - Add options ClientAliveInterval and ClientAliveCountMax to sshd. - This gives the ability to do a "keepalive" via the encrypted channel - which can't be spoofed (unlike TCP keepalives). Useful for when you want - to use ssh connections to authenticate people for something, and know - relatively quickly when they are no longer authenticated. Disabled - by default (of course). ok markus@ - -20010413 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/04/12 14:29:09 - [ssh.c] - show debug output during option processing, report from - pekkas@netcore.fi - - markus@cvs.openbsd.org 2001/04/12 19:15:26 - [auth-rhosts.c auth.h auth2.c buffer.c canohost.c canohost.h - compat.c compat.h hostfile.c pathnames.h readconf.c readconf.h - servconf.c servconf.h ssh.c sshconnect.c sshconnect.h sshconnect1.c - sshconnect2.c sshd_config] - implement HostbasedAuthentication (= RhostRSAAuthentication for ssh v2) - similar to RhostRSAAuthentication unless you enable (the experimental) - HostbasedUsesNameFromPacketOnly option. please test. :) - - markus@cvs.openbsd.org 2001/04/12 19:39:27 - [readconf.c] - typo - - stevesk@cvs.openbsd.org 2001/04/12 20:09:38 - [misc.c misc.h readconf.c servconf.c ssh.c sshd.c] - robust port validation; ok markus@ jakob@ - - mouring@cvs.openbsd.org 2001/04/12 23:17:54 - [sftp-int.c sftp-int.h sftp.1 sftp.c] - Add support for: - sftp [user@]host[:file [file]] - Fetch remote file(s) - sftp [user@]host[:dir[/]] - Start in remote dir/ - OK deraadt@ - - stevesk@cvs.openbsd.org 2001/04/13 01:26:17 - [ssh.c] - missing \n in error message - - (bal) Added openbsd-compat/inet_ntop.[ch] since HP/UX (and others) - lack it. - -20010412 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/04/10 07:46:58 - [channels.c] - cleanup socks4 handling - - itojun@cvs.openbsd.org 2001/04/10 09:13:22 - [ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh.1 sshd.8] - document id_rsa{.pub,}. markus ok - - markus@cvs.openbsd.org 2001/04/10 12:15:23 - [channels.c] - debug cleanup - - djm@cvs.openbsd.org 2001/04/11 07:06:22 - [sftp-int.c] - 'mget' and 'mput' aliases; ok markus@ - - markus@cvs.openbsd.org 2001/04/11 10:59:01 - [ssh.c] - use strtol() for ports, thanks jakob@ - - markus@cvs.openbsd.org 2001/04/11 13:56:13 - [channels.c ssh.c] - https-connect and socks5 support. i feel so bad. - - lebel@cvs.openbsd.org 2001/04/11 16:25:30 - [sshd.8 sshd.c] - implement the -e option into sshd: - -e When this option is specified, sshd will send the output to the - standard error instead of the system log. - markus@ OK. - -20010410 - - OpenBSD CVS Sync - - deraadt@cvs.openbsd.org 2001/04/08 20:52:55 - [sftp.c] - do not modify an actual argv[] entry - - stevesk@cvs.openbsd.org 2001/04/08 23:28:27 - [sshd.8] - spelling - - stevesk@cvs.openbsd.org 2001/04/09 00:42:05 - [sftp.1] - spelling - - markus@cvs.openbsd.org 2001/04/09 15:12:23 - [ssh-add.c] - passphrase caching: ssh-add tries last passphrase, clears passphrase if - not successful and after last try. - based on discussions with espie@, jakob@, ... and code from jakob@ and - wolfgang@wsrcc.com - - markus@cvs.openbsd.org 2001/04/09 15:19:49 - [ssh-add.1] - ssh-add retries the last passphrase... - - stevesk@cvs.openbsd.org 2001/04/09 18:00:15 - [sshd.8] - ListenAddress mandoc from aaron@ - -20010409 - - (stevesk) use setresgid() for setegid() if needed - - (stevesk) configure.in: typo - - OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/04/08 16:01:36 - [sshd.8] - document ListenAddress addr:port - - markus@cvs.openbsd.org 2001/04/08 13:03:00 - [ssh-add.c] - init pointers with NULL, thanks to danimal@danimal.org - - markus@cvs.openbsd.org 2001/04/08 11:27:33 - [clientloop.c] - leave_raw_mode if ssh2 "session" is closed - - markus@cvs.openbsd.org 2001/04/06 21:00:17 - [auth-rh-rsa.c auth-rhosts.c auth-rsa.c auth2.c channels.c session.c - ssh.c sshconnect.c sshconnect.h uidswap.c uidswap.h] - do gid/groups-swap in addition to uid-swap, should help if /home/group - is chmod 750 + chgrp grp /home/group/, work be deraadt and me, thanks - to olar@openwall.com is comments. we had many requests for this. - - markus@cvs.openbsd.org 2001/04/07 08:55:18 - [buffer.c channels.c channels.h readconf.c ssh.c] - allow the ssh client act as a SOCKS4 proxy (dynamic local - portforwarding). work by Dan Kaminsky and me. - thanks to Dan for this great patch: use 'ssh -D 1080 host' and make - netscape use localhost:1080 as a socks proxy. - - markus@cvs.openbsd.org 2001/04/08 11:24:33 - [uidswap.c] - KNF - -20010408 - - OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/04/06 22:12:47 - [hostfile.c] - unused; typo in comment - - stevesk@cvs.openbsd.org 2001/04/06 22:25:25 - [servconf.c] - in addition to: - ListenAddress host|ipv4_addr|ipv6_addr - permit: - ListenAddress [host|ipv4_addr|ipv6_addr]:port - ListenAddress host|ipv4_addr:port - sshd.8 updates coming. ok markus@ - -20010407 - - (bal) CVS ID Resync of version.h - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/04/05 23:39:20 - [serverloop.c] - keep the ssh session even if there is no active channel. - this is more in line with the protocol spec and makes - ssh -N -L 1234:server:110 host - more useful. - based on discussion with long time ago - and recent mail from - - deraadt@cvs.openbsd.org 2001/04/06 16:46:59 - [scp.c] - remove trailing / from source paths; fixes pr#1756 - -20010406 - - (stevesk) logintest.c: fix for systems without __progname - - (stevesk) Makefile.in: log.o is in libssh.a - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/04/05 10:00:06 - [compat.c] - 2.3.x does old GEX, too; report jakob@ - - markus@cvs.openbsd.org 2001/04/05 10:39:03 - [compress.c compress.h packet.c] - reset compress state per direction when rekeying. - - markus@cvs.openbsd.org 2001/04/05 10:39:48 - [version.h] - temporary version 2.5.4 (supports rekeying). - this is not an official release. - - markus@cvs.openbsd.org 2001/04/05 10:42:57 - [auth-chall.c authfd.c channels.c clientloop.c kex.c kexgex.c key.c - mac.c packet.c serverloop.c sftp-client.c sftp-client.h sftp-glob.c - sftp-glob.h sftp-int.c sftp-server.c sftp.c ssh-keygen.c sshconnect.c - sshconnect2.c sshd.c] - fix whitespace: unexpand + trailing spaces. - - markus@cvs.openbsd.org 2001/04/05 11:09:17 - [clientloop.c compat.c compat.h] - add SSH_BUG_NOREKEY and detect broken (=all old) openssh versions. - - markus@cvs.openbsd.org 2001/04/05 15:45:43 - [ssh.1] - ssh defaults to protocol v2; from quisar@quisar.ambre.net - - stevesk@cvs.openbsd.org 2001/04/05 15:48:18 - [canohost.c canohost.h session.c] - move get_remote_name_or_ip() to canohost.[ch]; for portable. ok markus@ - - markus@cvs.openbsd.org 2001/04/05 20:01:10 - [clientloop.c] - for ~R print message if server does not support rekeying. (and fix ~R). - - markus@cvs.openbsd.org 2001/04/05 21:02:46 - [buffer.c] - better error message - - markus@cvs.openbsd.org 2001/04/05 21:05:24 - [clientloop.c ssh.c] - don't request a session for 'ssh -N', pointed out slade@shore.net - -20010405 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/04/04 09:48:35 - [kex.c kex.h kexdh.c kexgex.c packet.c sshconnect2.c sshd.c] - don't sent multiple kexinit-requests. - send newkeys, block while waiting for newkeys. - fix comments. - - markus@cvs.openbsd.org 2001/04/04 14:34:58 - [clientloop.c kex.c kex.h serverloop.c sshconnect2.c sshd.c] - enable server side rekeying + some rekey related clientup. - todo: we should not send any non-KEX messages after we send KEXINIT - - markus@cvs.openbsd.org 2001/04/04 15:50:55 - [compat.c] - f-secure 1.3.2 does not handle IGNORE; from milliondl@ornl.gov - - markus@cvs.openbsd.org 2001/04/04 20:25:38 - [channels.c channels.h clientloop.c kex.c kex.h serverloop.c - sshconnect2.c sshd.c] - more robust rekeying - don't send channel data after rekeying is started. - - markus@cvs.openbsd.org 2001/04/04 20:32:56 - [auth2.c] - we don't care about missing bannerfiles; from tsoome@ut.ee, ok deraadt@ - - markus@cvs.openbsd.org 2001/04/04 22:04:35 - [kex.c kexgex.c serverloop.c] - parse full kexinit packet. - make server-side more robust, too. - - markus@cvs.openbsd.org 2001/04/04 23:09:18 - [dh.c kex.c packet.c] - clear+free keys,iv for rekeying. - + fix DH mem leaks. ok niels@ - - (stevesk) don't use vhangup() if defined(HAVE_DEV_PTMX); also removes - BROKEN_VHANGUP - -20010404 - - OpenBSD CVS Sync - - deraadt@cvs.openbsd.org 2001/04/02 17:32:23 - [ssh-agent.1] - grammar; slade@shore.net - - stevesk@cvs.openbsd.org 2001/04/03 13:56:11 - [sftp-glob.c ssh-agent.c ssh-keygen.c] - free() -> xfree() - - markus@cvs.openbsd.org 2001/04/03 19:53:29 - [dh.c dh.h kex.c kex.h sshconnect2.c sshd.c] - move kex to kex*.c, used dispatch_set() callbacks for kex. should - make rekeying easier. - - todd@cvs.openbsd.org 2001/04/03 21:19:38 - [ssh_config] - id_rsa1/2 -> id_rsa; ok markus@ - - markus@cvs.openbsd.org 2001/04/03 23:32:12 - [kex.c kex.h packet.c sshconnect2.c sshd.c] - undo parts of recent my changes: main part of keyexchange does not - need dispatch-callbacks, since application data is delayed until - the keyexchange completes (if i understand the drafts correctly). - add some infrastructure for re-keying. - - markus@cvs.openbsd.org 2001/04/04 00:06:54 - [clientloop.c sshconnect2.c] - enable client rekeying - (1) force rekeying with ~R, or - (2) if the server requests rekeying. - works against ssh-2.0.12/2.0.13/2.1.0/2.2.0/2.3.0/2.3.1/2.4.0 - - (bal) Oops.. Missed including kexdh.c and kexgex.c in OpenBSD sync. - -20010403 - - OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/04/02 14:15:31 - [sshd.8] - typo; ok markus@ - - stevesk@cvs.openbsd.org 2001/04/02 14:20:23 - [readconf.c servconf.c] - correct comment; ok markus@ - - (stevesk) nchan.c: remove ostate checks and add EINVAL to - shutdown(SHUT_RD) error() bypass for HP-UX. - -20010402 - - (stevesk) log.c openbsd sync; missing newlines - - (stevesk) sshpty.h openbsd sync; PTY_H -> SSHPTY_H - -20010330 - - (djm) Another openbsd-compat/glob.c sync - - (djm) OpenBSD CVS Sync - - provos@cvs.openbsd.org 2001/03/28 21:59:41 - [kex.c kex.h sshconnect2.c sshd.c] - forgot to include min and max params in hash, okay markus@ - - provos@cvs.openbsd.org 2001/03/28 22:04:57 - [dh.c] - more sanity checking on primes file - - markus@cvs.openbsd.org 2001/03/28 22:43:31 - [auth.h auth2.c auth2-chall.c] - check auth_root_allowed for kbd-int auth, too. - - provos@cvs.openbsd.org 2001/03/29 14:24:59 - [sshconnect2.c] - use recommended defaults - - stevesk@cvs.openbsd.org 2001/03/29 21:06:21 - [sshconnect2.c sshd.c] - need to set both STOC and CTOS for SSH_BUG_BIGENDIANAES; ok markus@ - - markus@cvs.openbsd.org 2001/03/29 21:17:40 - [dh.c dh.h kex.c kex.h] - prepare for rekeying: move DH code to dh.c - - djm@cvs.openbsd.org 2001/03/29 23:42:01 - [sshd.c] - Protocol 1 key regeneration log => verbose, some KNF; ok markus@ - -20010329 - - OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/03/26 15:47:59 - [ssh.1] - document more defaults; misc. cleanup. ok markus@ - - markus@cvs.openbsd.org 2001/03/26 23:12:42 - [authfile.c] - KNF - - markus@cvs.openbsd.org 2001/03/26 23:23:24 - [rsa.c rsa.h ssh-agent.c ssh-keygen.c] - try to read private f-secure ssh v2 rsa keys. - - markus@cvs.openbsd.org 2001/03/27 10:34:08 - [ssh-rsa.c sshd.c] - use EVP_get_digestbynid, reorder some calls and fix missing free. - - markus@cvs.openbsd.org 2001/03/27 10:57:00 - [compat.c compat.h ssh-rsa.c] - some older systems use NID_md5 instead of NID_sha1 for RSASSA-PKCS1-v1_5 - signatures in SSH protocol 2, ok djm@ - - provos@cvs.openbsd.org 2001/03/27 17:46:50 - [compat.c compat.h dh.c dh.h ssh2.h sshconnect2.c sshd.c version.h] - make dh group exchange more flexible, allow min and max group size, - okay markus@, deraadt@ - - stevesk@cvs.openbsd.org 2001/03/28 19:56:23 - [scp.c] - start to sync scp closer to rcp; ok markus@ - - stevesk@cvs.openbsd.org 2001/03/28 20:04:38 - [scp.c] - usage more like rcp and add missing -B to usage; ok markus@ - - markus@cvs.openbsd.org 2001/03/28 20:50:45 - [sshd.c] - call refuse() before close(); from olemx@ans.pl - -20010328 - - (djm) Reorder tests and library inclusion for Krb4/AFS to try to - resolve linking conflicts with libcrypto. Report and suggested fix - from Holger Trapp - - (djm) Work around Solaris' broken struct dirent. Diagnosis and suggested - fix from Philippe Levan - - (djm) Rework krbIV tests to get us closer to building on Redhat. Still - doesn't work because of conflicts between krbIV's and OpenSSL's des.h - - (djm) Sync openbsd-compat/glob.c - -20010327 - - Attempt sync with sshlogin.c w/ OpenBSD (mainly CVS ID) - - Fix pointer issues in waitpid() and wait() replaces. Patch by Lutz - Jaenicke - - OpenBSD CVS Sync - - djm@cvs.openbsd.org 2001/03/25 00:01:34 - [session.c] - shorten; ok markus@ - - stevesk@cvs.openbsd.org 2001/03/25 13:16:11 - [servconf.c servconf.h session.c sshd.8 sshd_config] - PrintLastLog option; from chip@valinux.com with some minor - changes by me. ok markus@ - - markus@cvs.openbsd.org 2001/03/26 08:07:09 - [authfile.c authfile.h ssh-add.c ssh-keygen.c ssh.c sshconnect.c - sshconnect.h sshconnect1.c sshconnect2.c sshd.c] - simpler key load/save interface, see authfile.h - - (djm) Reestablish PAM credentials (which can be supplemental group - memberships) after initgroups() blows them away. Report and suggested - fix from Nalin Dahyabhai - -20010324 - - Fixed permissions ssh-keyscan. Thanks to Christopher Linn . - - OpenBSD CVS Sync - - djm@cvs.openbsd.org 2001/03/23 11:04:07 - [compat.c compat.h sshconnect2.c sshd.c] - Compat for OpenSSH with broken Rijndael/AES. ok markus@ - - markus@cvs.openbsd.org 2001/03/23 12:02:49 - [auth1.c] - authctxt is now passed to do_authenticated - - markus@cvs.openbsd.org 2001/03/23 13:10:57 - [sftp-int.c] - fix put, upload to _absolute_ path, ok djm@ - - markus@cvs.openbsd.org 2001/03/23 14:28:32 - [session.c sshd.c] - ignore SIGPIPE, restore in child, fixes x11-fwd crashes; with djm@ - - (djm) Pull out our own SIGPIPE hacks - -20010323 - - OpenBSD CVS Sync - - deraadt@cvs.openbsd.org 2001/03/22 20:22:55 - [sshd.c] - do not place linefeeds in buffer - -20010322 - - (djm) Better AIX no tty fix, spotted by Gert Doering - - (bal) version.c CVS ID resync - - (bal) auth-chall.c auth-passwd.c auth.h auth1.c auth2.c session.c CVS ID - resync - - (bal) scp.c CVS ID resync - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/03/20 19:10:16 - [readconf.c] - default to SSH protocol version 2 - - markus@cvs.openbsd.org 2001/03/20 19:21:21 - [session.c] - remove unused arg - - markus@cvs.openbsd.org 2001/03/20 19:21:21 - [session.c] - remove unused arg - - markus@cvs.openbsd.org 2001/03/21 11:43:45 - [auth1.c auth2.c session.c session.h] - merge common ssh v1/2 code - - jakob@cvs.openbsd.org 2001/03/21 14:20:45 - [ssh-keygen.c] - add -B flag to usage - - markus@cvs.openbsd.org 2001/03/21 21:06:30 - [session.c] - missing init; from mib@unimelb.edu.au - -20010321 - - (djm) Fix ttyname breakage for AIX and Tru64. Patch from Steve - VanDevender - - (djm) Make sure pam_retval is initialised on call to pam_end. Patch - from Solar Designer - - (djm) Don't loop forever when changing password via PAM. Patch - from Solar Designer - - (djm) Generate config files before build - - (djm) Correctly handle SIA and AIX when no tty present. Spotted and - suggested fix from Mike Battersby - -20010320 - - (bal) glob.c update to added GLOB_LIMITS (OpenBSD CVS). - - (bal) glob.c update to set gl_pathv to NULL (OpenBSD CVS). - - (bal) Oops. Missed globc.h change (OpenBSD CVS). - - (djm) OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/03/19 17:07:23 - [auth.c readconf.c] - undo /etc/shell and proto 2,1 change for openssh-2.5.2 - - markus@cvs.openbsd.org 2001/03/19 17:12:10 - [version.h] - version 2.5.2 - - (djm) Update RPM spec version - - (djm) Release 2.5.2p1 -- tim@mindrot.org 2001/03/19 18:33:47 [defines.h] - change S_ISLNK macro to work for UnixWare 2.03 -- tim@mindrot.org 2001/03/19 20:45:11 [openbsd-compat/glob.c] - add get_arg_max(). Use sysconf() if ARG_MAX is not defined - -20010319 - - (djm) Seed PRNG at startup, rather than waiting for arc4random calls to - do it implicitly. - - (djm) Add getusershell() functions from OpenBSD CVS - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/03/18 12:07:52 - [auth-options.c] - ignore permitopen="host:port" if AllowTcpForwarding==no - - (djm) Make scp work on systems without 64-bit ints - - tim@mindrot.org 2001/03/18 18:28:39 [defines.h] - move HAVE_LONG_LONG_INT where it works - - (bal) Use 'NGROUPS' for NeXT Since 'MAX_NGROUPS' is wrapped up in -lposix - stuff. Change suggested by Mark Miller - - (bal) Small fix to scp. %lu vs %ld - - (bal) NeXTStep lacks S_ISLNK. Plus split up S_IS* - - (djm) OpenBSD CVS Sync - - djm@cvs.openbsd.org 2001/03/19 03:52:51 - [sftp-client.c] - Report ssh connection closing correctly; ok deraadt@ - - deraadt@cvs.openbsd.org 2001/03/18 23:30:55 - [compat.c compat.h sshd.c] - specifically version match on ssh scanners. do not log scan - information to the console - - djm@cvs.openbsd.org 2001/03/19 12:10:17 - [sshd.8] - Document permitopen authorized_keys option; ok markus@ - - djm@cvs.openbsd.org 2001/03/19 05:49:52 - [ssh.1] - document PreferredAuthentications option; ok markus@ - - (bal) Minor NeXT fixed. Forgot to #undef NGROUPS_MAX - -20010318 - - (bal) Fixed scp type casing issue which causes "scp: protocol error: - size not delimited" fatal errors when tranfering. - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/03/17 17:27:59 - [auth.c] - check /etc/shells, too - - tim@mindrot.org 2001/03/17 18:45:25 [compat.c] - openbsd-compat/fake-regex.h - -20010317 - - Support usrinfo() on AIX. Based on patch from Gert Doering - - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/03/15 15:05:59 - [scp.c] - use %lld in printf, ok millert@/deraadt@; report from ssh@client.fi - - markus@cvs.openbsd.org 2001/03/15 22:07:08 - [session.c] - pass Session to do_child + KNF - - djm@cvs.openbsd.org 2001/03/16 08:16:18 - [sftp-client.c sftp-client.h sftp-glob.c sftp-int.c] - Revise globbing for get/put to be more shell-like. In particular, - "get/put file* directory/" now works. ok markus@ - - markus@cvs.openbsd.org 2001/03/16 09:55:53 - [sftp-int.c] - fix memset and whitespace - - markus@cvs.openbsd.org 2001/03/16 13:44:24 - [sftp-int.c] - discourage strcat/strcpy - - markus@cvs.openbsd.org 2001/03/16 19:06:30 - [auth-options.c channels.c channels.h serverloop.c session.c] - implement "permitopen" key option, restricts -L style forwarding to - to specified host:port pairs. based on work by harlan@genua.de - - Check for gl_matchc support in glob_t and fall back to the - openbsd-compat/glob.[ch] support if it does not exist. - -20010315 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/03/14 08:57:14 - [sftp-client.c] - Wall - - markus@cvs.openbsd.org 2001/03/14 15:15:58 - [sftp-int.c] - add version command - - deraadt@cvs.openbsd.org 2001/03/14 22:50:25 - [sftp-server.c] - note no getopt() - - (stevesk) ssh-keyscan.c: specify "openbsd-compat/fake-queue.h" - - (bal) Cygwin README change by Corinna Vinschen - -20010314 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/03/13 17:34:42 - [auth-options.c] - missing xfree, deny key on parse error; ok stevesk@ - - djm@cvs.openbsd.org 2001/03/13 22:42:54 - [sftp-client.c sftp-client.h sftp-glob.c sftp-glob.h sftp-int.c] - sftp client filename globbing for get, put, ch{mod,grp,own}. ok markus@ - - (bal) Fix strerror() in bsd-misc.c - - (djm) Add replacement glob() from OpenBSD libc if the system glob is - missing or lacks the GLOB_ALTDIRFUNC extension - - (djm) Remove -I$(srcdir)/openbsd-compat from CFLAGS, refer to headers - relatively. Avoids conflict between glob.h and /usr/include/glob.h - -20010313 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/03/12 22:02:02 - [key.c key.h ssh-add.c ssh-keygen.c sshconnect.c sshconnect2.c] - remove old key_fingerprint interface, s/_ex// - -20010312 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/03/11 13:25:36 - [auth2.c key.c] - debug - - jakob@cvs.openbsd.org 2001/03/11 15:03:16 - [key.c key.h] - add improved fingerprint functions. based on work by Carsten - Raskgaard and modified by me. ok markus@. - - jakob@cvs.openbsd.org 2001/03/11 15:04:16 - [ssh-keygen.1 ssh-keygen.c] - print both md5, sha1 and bubblebabble fingerprints when using - ssh-keygen -l -v. ok markus@. - - jakob@cvs.openbsd.org 2001/03/11 15:13:09 - [key.c] - cleanup & shorten some var names key_fingerprint_bubblebabble. - - deraadt@cvs.openbsd.org 2001/03/11 16:39:03 - [ssh-keygen.c] - KNF, and SHA1 binary output is just creeping featurism - - tim@mindrot.org 2001/03/11 17:29:32 [configure.in] - test if snprintf() supports %ll - add /dev to search path for PRNGD/EGD socket - fix my mistake in USER_PATH test program - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/03/11 18:29:51 - [key.c] - style+cleanup - - markus@cvs.openbsd.org 2001/03/11 22:33:24 - [ssh-keygen.1 ssh-keygen.c] - remove -v again. use -B instead for bubblebabble. make -B consistent - with -l and make -B work with /path/to/known_hosts. ok deraadt@ - - (djm) Bump portable version number for generating test RPMs - - (djm) Add "static_openssl" RPM build option, remove rsh build dependency - - (bal) Reorder includes in Makefile. - -20010311 - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/03/10 12:48:27 - [sshconnect2.c] - ignore nonexisting private keys; report rjmooney@mediaone.net - - deraadt@cvs.openbsd.org 2001/03/10 12:53:51 - [readconf.c ssh_config] - default to SSH2, now that m68k runs fast - - stevesk@cvs.openbsd.org 2001/03/10 15:02:05 - [ttymodes.c ttymodes.h] - remove unused sgtty macros; ok markus@ - - deraadt@cvs.openbsd.org 2001/03/10 15:31:00 - [compat.c compat.h sshconnect.c] - all known netscreen ssh versions, and older versions of OSU ssh cannot - handle password padding (newer OSU is fixed) - - tim@mindrot.org 2001/03/10 16:33:42 [configure.in Makefile.in sshd_config] - make sure $bindir is in USER_PATH so scp will work - - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/03/10 17:51:04 - [kex.c match.c match.h readconf.c readconf.h sshconnect2.c] - add PreferredAuthentications - -20010310 - - OpenBSD CVS Sync - - deraadt@cvs.openbsd.org 2001/03/09 03:14:39 - [ssh-keygen.c] - create *.pub files with umask 0644, so that you can mv them to - authorized_keys - - deraadt@cvs.openbsd.org 2001/03/09 12:30:29 - [sshd.c] - typo; slade@shore.net - - Removed log.o from sftp client. Not needed. - -20010309 - - OpenBSD CVS Sync - - stevesk@cvs.openbsd.org 2001/03/08 18:47:12 - [auth1.c] - unused; ok markus@ - - stevesk@cvs.openbsd.org 2001/03/08 20:44:48 - [sftp.1] - spelling, cleanup; ok deraadt@ - - markus@cvs.openbsd.org 2001/03/08 21:42:33 - [compat.c compat.h readconf.h ssh.c sshconnect1.c sshconnect2.c] - implement client side of SSH2_MSG_USERAUTH_PK_OK (test public key -> - no need to do enter passphrase or do expensive sign operations if the - server does not accept key). - -20010308 - - OpenBSD CVS Sync - - djm@cvs.openbsd.org 2001/03/07 10:11:23 - [sftp-client.c sftp-client.h sftp-int.c sftp-server.c sftp.1 sftp.c sftp.h] - Support for new draft (draft-ietf-secsh-filexfer-01). New symlink handling - functions and small protocol change. - - markus@cvs.openbsd.org 2001/03/08 00:15:48 - [readconf.c ssh.1] - turn off useprivilegedports by default. only rhost-auth needs - this. older sshd's may need this, too. - - (stevesk) Reliant Unix (SNI) needs HAVE_BOGUS_SYS_QUEUE_H; - Dirk Markwardt - -20010307 - - (bal) OpenBSD CVS Sync - - deraadt@cvs.openbsd.org 2001/03/06 06:11:18 - [ssh-keyscan.c] - appease gcc - - deraadt@cvs.openbsd.org 2001/03/06 06:11:44 - [sftp-int.c sftp.1 sftp.c] - sftp -b batchfile; mouring@etoh.eviladmin.org - - deraadt@cvs.openbsd.org 2001/03/06 15:10:42 - [sftp.1] - order things - - deraadt@cvs.openbsd.org 2001/03/07 01:19:06 - [ssh.1 sshd.8] - the name "secure shell" is boring, noone ever uses it - - deraadt@cvs.openbsd.org 2001/03/07 04:05:58 - [ssh.1] - removed dated comment - - Cygwin contrib improvements from Corinna Vinschen - -20010306 - - (bal) OpenBSD CVS Sync - - deraadt@cvs.openbsd.org 2001/03/05 14:28:47 - [sshd.8] - alpha order; jcs@rt.fm - - stevesk@cvs.openbsd.org 2001/03/05 15:44:51 - [servconf.c] - sync error message; ok markus@ - - deraadt@cvs.openbsd.org 2001/03/05 15:56:16 - [myproposal.h ssh.1] - switch to aes128-cbc/hmac-md5 by default in SSH2 -- faster; - provos & markus ok - - deraadt@cvs.openbsd.org 2001/03/05 16:07:15 - [sshd.8] - detail default hmac setup too - - markus@cvs.openbsd.org 2001/03/05 17:17:21 - [kex.c kex.h sshconnect2.c sshd.c] - generate a 2*need size (~300 instead of 1024/2048) random private - exponent during the DH key agreement. according to Niels (the great - german advisor) this is safe since /etc/primes contains strong - primes only. - - References: - P. C. van Oorschot and M. J. Wiener, On Diffie-Hellman key - agreement with short exponents, In Advances in Cryptology - - EUROCRYPT'96, LNCS 1070, Springer-Verlag, 1996, pp.332-343. - - stevesk@cvs.openbsd.org 2001/03/05 17:40:48 - [ssh.1] - more ssh_known_hosts2 documentation; ok markus@ - - stevesk@cvs.openbsd.org 2001/03/05 17:58:22 - [dh.c] - spelling - - deraadt@cvs.openbsd.org 2001/03/06 00:33:04 - [authfd.c cli.c ssh-agent.c] - EINTR/EAGAIN handling is required in more cases - - millert@cvs.openbsd.org 2001/03/06 01:06:03 - [ssh-keyscan.c] - Don't assume we wil get the version string all in one read(). - deraadt@ OK'd - - millert@cvs.openbsd.org 2001/03/06 01:08:27 - [clientloop.c] - If read() fails with EINTR deal with it the same way we treat EAGAIN - -20010305 - - (bal) CVS ID touch up on sshpty.[ch] and sshlogin.[ch] - - (bal) CVS ID touch up on sftp-int.c - - (bal) CVS ID touch up on uuencode.c - - (bal) CVS ID touch up on auth2.c, serverloop.c, session.c & sshd.c - - (bal) OpenBSD CVS Sync - - deraadt@cvs.openbsd.org 2001/02/17 23:48:48 - [sshd.8] - it's the OpenSSH one - - deraadt@cvs.openbsd.org 2001/02/21 07:37:04 - [ssh-keyscan.c] - inline -> __inline__, and some indent - - deraadt@cvs.openbsd.org 2001/02/21 09:05:54 - [authfile.c] - improve fd handling - - deraadt@cvs.openbsd.org 2001/02/21 09:12:56 - [sftp-server.c] - careful with & and &&; markus ok - - stevesk@cvs.openbsd.org 2001/02/21 21:14:04 - [ssh.c] - -i supports DSA identities now; ok markus@ - - deraadt@cvs.openbsd.org 2001/02/22 04:29:37 - [servconf.c] - grammar; slade@shore.net - - deraadt@cvs.openbsd.org 2001/02/22 06:43:55 - [ssh-keygen.1 ssh-keygen.c] - document -d, and -t defaults to rsa1 - - deraadt@cvs.openbsd.org 2001/02/22 08:03:51 - [ssh-keygen.1 ssh-keygen.c] - bye bye -d - - deraadt@cvs.openbsd.org 2001/02/22 18:09:06 - [sshd_config] - activate RSA 2 key - - markus@cvs.openbsd.org 2001/02/22 21:57:27 - [ssh.1 sshd.8] - typos/grammar from matt@anzen.com - - markus@cvs.openbsd.org 2001/02/22 21:59:44 - [auth.c auth.h auth1.c auth2.c misc.c misc.h ssh.c] - use pwcopy in ssh.c, too - - markus@cvs.openbsd.org 2001/02/23 15:34:53 - [serverloop.c] - debug2->3 - - markus@cvs.openbsd.org 2001/02/23 18:15:13 - [sshd.c] - the random session key depends now on the session_key_int - sent by the 'attacker' - dig1 = md5(cookie|session_key_int); - dig2 = md5(dig1|cookie|session_key_int); - fake_session_key = dig1|dig2; - this change is caused by a mail from anakin@pobox.com - patch based on discussions with my german advisor niels@openbsd.org - - deraadt@cvs.openbsd.org 2001/02/24 10:37:55 - [readconf.c] - look for id_rsa by default, before id_dsa - - deraadt@cvs.openbsd.org 2001/02/24 10:37:26 - [sshd_config] - ssh2 rsa key before dsa key - - markus@cvs.openbsd.org 2001/02/27 10:35:27 - [packet.c] - fix random padding - - markus@cvs.openbsd.org 2001/02/27 11:00:11 - [compat.c] - support SSH-2.0-2.1 ; from Christophe_Moret@hp.com - - deraadt@cvs.openbsd.org 2001/02/28 05:34:28 - [misc.c] - pull in protos - - deraadt@cvs.openbsd.org 2001/02/28 05:36:28 - [sftp.c] - do not kill the subprocess on termination (we will see if this helps - things or hurts things) - - markus@cvs.openbsd.org 2001/02/28 08:45:39 - [clientloop.c] - fix byte counts for ssh protocol v1 - - markus@cvs.openbsd.org 2001/02/28 08:54:55 - [channels.c nchan.c nchan.h] - make sure remote stderr does not get truncated. - remove closed fd's from the select mask. - - markus@cvs.openbsd.org 2001/02/28 09:57:07 - [packet.c packet.h sshconnect2.c] - in ssh protocol v2 use ignore messages for padding (instead of - trailing \0). - - markus@cvs.openbsd.org 2001/02/28 12:55:07 - [channels.c] - unify debug messages - - deraadt@cvs.openbsd.org 2001/02/28 17:52:54 - [misc.c] - for completeness, copy pw_gecos too - - markus@cvs.openbsd.org 2001/02/28 21:21:41 - [sshd.c] - generate a fake session id, too - - markus@cvs.openbsd.org 2001/02/28 21:27:48 - [channels.c packet.c packet.h serverloop.c] - use ignore message to simulate a SSH2_MSG_CHANNEL_DATA message - use random content in ignore messages. - - markus@cvs.openbsd.org 2001/02/28 21:31:32 - [channels.c] - typo - - deraadt@cvs.openbsd.org 2001/03/01 02:11:25 - [authfd.c] - split line so that p will have an easier time next time around - - deraadt@cvs.openbsd.org 2001/03/01 02:29:04 - [ssh.c] - shorten usage by a line - - deraadt@cvs.openbsd.org 2001/03/01 02:45:10 - [auth-rsa.c auth2.c deattack.c packet.c] - KNF - - deraadt@cvs.openbsd.org 2001/03/01 03:38:33 - [cli.c cli.h rijndael.h ssh-keyscan.1] - copyright notices on all source files - - markus@cvs.openbsd.org 2001/03/01 22:46:37 - [ssh.c] - don't truncate remote ssh-2 commands; from mkubita@securities.cz - use min, not max for logging, fixes overflow. - - deraadt@cvs.openbsd.org 2001/03/02 06:21:01 - [sshd.8] - explain SIGHUP better - - deraadt@cvs.openbsd.org 2001/03/02 09:42:49 - [sshd.8] - doc the dsa/rsa key pair files - - deraadt@cvs.openbsd.org 2001/03/02 18:54:31 - [atomicio.c atomicio.h auth-chall.c auth.c auth2-chall.c crc32.h - scp.c serverloop.c session.c sftp-server.8 sftp.1 ssh-add.1 ssh-add.c - ssh-agent.1 ssh-agent.c ssh-keygen.1 ssh.1 sshd.8] - make copyright lines the same format - - deraadt@cvs.openbsd.org 2001/03/03 06:53:12 - [ssh-keyscan.c] - standard theo sweep - - millert@cvs.openbsd.org 2001/03/03 21:19:41 - [ssh-keyscan.c] - Dynamically allocate read_wait and its copies. Since maxfd is - based on resource limits it is often (usually?) larger than FD_SETSIZE. - - millert@cvs.openbsd.org 2001/03/03 21:40:30 - [sftp-server.c] - Dynamically allocate fd_set; deraadt@ OK - - millert@cvs.openbsd.org 2001/03/03 21:41:07 - [packet.c] - Dynamically allocate fd_set; deraadt@ OK - - deraadt@cvs.openbsd.org 2001/03/03 22:07:50 - [sftp-server.c] - KNF - - markus@cvs.openbsd.org 2001/03/03 23:52:22 - [sftp.c] - clean up arg processing. based on work by Christophe_Moret@hp.com - - markus@cvs.openbsd.org 2001/03/03 23:59:34 - [log.c ssh.c] - log*.c -> log.c - - markus@cvs.openbsd.org 2001/03/04 00:03:59 - [channels.c] - debug1->2 - - stevesk@cvs.openbsd.org 2001/03/04 10:57:53 - [ssh.c] - add -m to usage; ok markus@ - - stevesk@cvs.openbsd.org 2001/03/04 11:04:41 - [sshd.8] - small cleanup and clarify for PermitRootLogin; ok markus@ - - stevesk@cvs.openbsd.org 2001/03/04 11:16:06 - [servconf.c sshd.8] - kill obsolete RandomSeed; ok markus@ deraadt@ - - stevesk@cvs.openbsd.org 2001/03/04 12:54:04 - [sshd.8] - spelling - - millert@cvs.openbsd.org 2001/03/04 17:42:28 - [authfd.c channels.c dh.c log.c readconf.c servconf.c sftp-int.c - ssh.c sshconnect.c sshd.c] - log functions should not be passed strings that end in newline as they - get passed on to syslog() and when logging to stderr, do_log() appends - its own newline. - - deraadt@cvs.openbsd.org 2001/03/04 18:21:28 - [sshd.8] - list SSH2 ciphers - - (bal) Put HAVE_PW_CLASS_IN_PASSWD back into pwcopy() - - (bal) Fix up logging since it changed. removed log-*.c - - (djm) Fix up LOG_AUTHPRIV for systems that have it - - (stevesk) OpenBSD sync: - - deraadt@cvs.openbsd.org 2001/03/05 08:37:27 - [ssh-keyscan.c] - skip inlining, why bother - - (stevesk) sftp.c: handle __progname - -20010304 - - (bal) Remove make-ssh-known-hosts.1 since it's no longer valid. - - (bal) Updated contrib/README to remove 'make-ssh-known-hosts' and - give Mark Roth credit for mdoc2man.pl - -20010303 - - (djm) Remove make-ssh-known-hosts.pl, ssh-keyscan is better. - - (djm) Document PAM ChallengeResponseAuthentication in sshd.8 - - (djm) Disable and comment ChallengeResponseAuthentication in sshd_config - - (djm) Allow PRNGd entropy collection from localhost TCP socket. Replace - "--with-egd-pool" configure option with "--with-prngd-socket" and - "--with-prngd-port" options. Debugged and improved by Lutz Jaenicke - - -20010301 - - (djm) Properly add -lcrypt if needed. - - (djm) Force standard PAM conversation function in a few more places. - Patch from Redhat 2.5.1p1-2 RPM, probably Nalin Dahyabhai - - - (djm) Cygwin needs pw->pw_gecos copied too. Patch from Corinna Vinschen - - - (djm) Released 2.5.1p2 - -20010228 - - (djm) Detect endianness in configure and use it in rijndael.c. Fixes - "Bad packet length" bugs. - - (djm) Fully revert PAM session patch (again). All PAM session init is - now done before the final fork(). - - (djm) EGD detection patch from Tim Rice - - (djm) Remove /tmp from EGD socket search list - -20010227 - - (bal) Applied shutdown() patch for sftp.c by Corinna Vinschen - - - (bal) OpenBSD Sync - - markus@cvs.openbsd.org 2001/02/23 15:37:45 - [session.c] - handle SSH_PROTOFLAG_SCREEN_NUMBER for buggy clients - - (bal) sshd.init support for all Redhat release. Patch by Jim Knoble - - - (djm) Fix up POSIX saved uid support. Report from Mark Miller - - - (djm) Search for -lcrypt on FreeBSD too - - (djm) fatal() on OpenSSL version mismatch - - (djm) Move PAM init to after fork for non-Solaris derived PAMs - - (djm) Warning fix on entropy.c saved uid stuff. Patch from Mark Miller - - - (djm) Fix PAM fix - - (djm) Remove 'noreplace' flag from sshd_config in RPM spec files. This - change is being made as 2.5.x configfiles are not back-compatible with - 2.3.x. - - (djm) Avoid warnings for missing broken IP_TOS. Patch from Mark Miller - - - (djm) Open Server 5 doesn't need BROKEN_SAVED_UIDS. Patch from Tim Rice - - - (djm) Avoid multiple definition of _PATH_LS. Patch from Tim Rice - - -20010226 - - (bal) Fixed bsd-snprinf.c so it now honors 'BROKEN_SNPRINTF' again. - - (djm) Some systems (SCO3, NeXT) have weird saved uid semantics. - Based on patch from Tim Rice - -20010225 - - (djm) Use %{_libexecdir} rather than hardcoded path in RPM specfile - Patch from Adrian Ho - - (bal) Replace 'unsigned long long' to 'u_int64_t' since not every - platform defines u_int64_t as being that. - -20010224 - - (bal) Missed part of the UNIX sockets patch. Patch by Corinna - Vinschen - - (bal) Reorder where 'strftime' is detected to resolve linking - issues on SCO. Patch by Tim Rice - -20010224 - - (bal) pam_stack fix to correctly detect between RH7 and older RHs. - Patch by Pekka Savola - - (bal) Renamed sigaction.[ch] to sigact.[ch]. Causes problems with - some platforms. - - (bal) Generalize lack of UNIX sockets since this also effects Cray - not just Cygwin. Based on patch by Wendy Palm - -20010223 - - (bal) Fix --define rh7 in openssh.spec file. Patch by Steve Tell - - - (bal) Patch to force OpenSSH rpm to require the same version of OpenSSL - that it was compiled against. Patch by Pekka Savola - - (bal) Double -I for OpenSSL on SCO. Patch by Tim Rice - - -20010222 - - (bal) Corrected SCO luid patch by svaughan - - (bal) Added mdoc2man.pl from Mark Roth - - (bal) Removed reference to liblogin from contrib/README. It was - integrated into OpenSSH a long while ago. - - (stevesk) remove erroneous #ifdef sgi code. - Michael Stone - -20010221 - - (bal) Removed -L/usr/ucblib -R/usr/ucblib for Solaris platform. - - (bal) Fixed OpenSSL rework to use $saved_*. Patch by Tim Rice - - - (bal) Reverted out of 2001/02/15 patch by djm below because it - breaks Solaris. - - (djm) Move PAM session setup back to before setuid to user. - fixes problems on Solaris-drived PAMs. - - (stevesk) session.c: back out to where we were before: - - (djm) Move PAM session initialisation until after fork in sshd. Patch - from Nalin Dahyabhai - -20010220 - - (bal) Fix mixed up params to memmove() from Jan 5th in setenv.c and - getcwd.c. - - (bal) OpenBSD CVS Sync: - - deraadt@cvs.openbsd.org 2001/02/19 23:09:05 - [sshd.c] - clarify message to make it not mention "ident" - -20010219 - - (bal) Markus' blessing to rename login.[ch] -> sshlogin.[ch] and - pty.[ch] -> sshpty.[ch] - - (djm) Rework search for OpenSSL location. Skip directories which don't - exist, don't add -L$ssldir/lib if it doesn't exist. Should help SCO - with its limit of 6 -L options. - - OpenBSD CVS Sync: - - reinhard@cvs.openbsd.org 2001/02/17 08:24:40 - [sftp.1] - typo - - deraadt@cvs.openbsd.org 2001/02/17 16:28:58 - [ssh.c] - cleanup -V output; noted by millert - - deraadt@cvs.openbsd.org 2001/02/17 16:48:48 - [sshd.8] - it's the OpenSSH one - - markus@cvs.openbsd.org 2001/02/18 11:33:54 - [dispatch.c] - typo, SSH2_MSG_KEXINIT, from aspa@kronodoc.fi - - markus@cvs.openbsd.org 2001/02/19 02:53:32 - [compat.c compat.h serverloop.c] - ssh-1.2.{18-22} has broken handling of ignore messages; report from - itojun@ - - markus@cvs.openbsd.org 2001/02/19 03:35:23 - [version.h] - OpenSSH_2.5.1 adds bug compat with 1.2.{18-22} - - deraadt@cvs.openbsd.org 2001/02/19 03:36:25 - [scp.c] - np is changed by recursion; vinschen@redhat.com - - Update versions in RPM spec files - - Release 2.5.1p1 - -20010218 - - (bal) Patch for fix FCHMOD reference in ftp-client.c by Tim Rice - - - (Bal) Patch for lack of RA_RESTART in misc.c for mysignal by - stevesk - - (djm) Fix my breaking of cygwin builds, Patch from Corinna Vinschen - and myself. - - (djm) Close listen_sock on bind() failures. Patch from Arkadiusz - Miskiewicz - - (djm) Robustify EGD/PRNGd code in face of socket closures. Patch from - Todd C. Miller - - (djm) Use ttyname() to determine name of tty returned by openpty() - rather then risking overflow. Patch from Marek Michalkiewicz - - - (djm) Swapped tests for no_libsocket and no_libnsl in configure.in. - Patch from Marek Michalkiewicz - - (djm) Doc fixes from Pekka Savola - - (djm) Use SA_INTERRUPT along SA_RESTART if present (equivalent for - SunOS) - - (djm) SCO needs librpc for libwrap. Patch from Tim Rice - - - (stevesk) misc.c: cpp rework of SA_(INTERRUPT|RESTART) handling. - - (stevesk) scp.c: use mysignal() for updateprogressmeter() handler. - - (djm) SA_INTERRUPT is the converse of SA_RESTART, apply it only for - SIGALRM. - - (djm) Move entropy.c over to mysignal() - - (djm) SunOS 4.x also needs to define HAVE_BOGUS_SYS_QUEUE_H as it has - a that lacks the TAILQ_* macros. Patch from Todd C. - Miller - - (djm) Update RPM spec files for 2.5.0p1 - - (djm) Merge BSD_AUTH support from Markus Friedl and David J. MacKenzie - enable with --with-bsd-auth. - - (stevesk) entropy.c: typo; should be SIGPIPE - -20010217 - - (bal) OpenBSD Sync: - - markus@cvs.openbsd.org 2001/02/16 13:38:18 - [channel.c] - remove debug - - markus@cvs.openbsd.org 2001/02/16 14:03:43 - [session.c] - proper payload-length check for x11 w/o screen-number - -20010216 - - (bal) added '--with-prce' to allow overriding of system regex when - required (tested by David Dulek ) - - (bal) Added DG/UX case and set that they have a broken IPTOS. - - (djm) Mini-configure reorder patch from Tim Rice - Fixes linking on SCO. - - (djm) Make gnome-ssh-askpass handle multi-line prompts. Patch from - Nalin Dahyabhai - - (djm) BSD license for gnome-ssh-askpass (was X11) - - (djm) KNF on gnome-ssh-askpass - - (djm) USE_PIPES for a few more sysv platforms - - (djm) Cleanup configure.in a little - - (djm) Ask users to check config.log when we can't find necessary libs - - (djm) Set "login ID" on systems with setluid. Only enabled for SCO - OpenServer for now. Based on patch from svaughan - - (djm) OpenBSD CVS: - - markus@cvs.openbsd.org 2001/02/15 16:19:59 - [channels.c channels.h serverloop.c sshconnect.c sshconnect.h] - [sshconnect1.c sshconnect2.c] - genericize password padding function for SSH1 and SSH2. - add stylized echo to 2, too. - - (djm) Add roundup() macro to defines.h - - (stevesk) set SA_RESTART flag in mysignal() for SIGCHLD; - needed on Unixware 2.x. - -20010215 - - (djm) Move PAM session setup back to before setuid to user. Fixes - problems on Solaris-derived PAMs. - - (djm) Clean up PAM namespace. Suggested by Darren Moffat - - - (bal) Sync w/ OpenSSH for new release - - markus@cvs.openbsd.org 2001/02/12 12:45:06 - [sshconnect1.c] - fix xmalloc(0), ok dugsong@ - - markus@cvs.openbsd.org 2001/02/11 12:59:25 - [Makefile.in sshd.8 sshconnect2.c readconf.h readconf.c packet.c - sshd.c ssh.c ssh.1 servconf.h servconf.c myproposal.h kex.h kex.c] - 1) clean up the MAC support for SSH-2 - 2) allow you to specify the MAC with 'ssh -m' - 3) or the 'MACs' keyword in ssh(d)_config - 4) add hmac-{md5,sha1}-96 - ok stevesk@, provos@ - - markus@cvs.openbsd.org 2001/02/12 16:16:23 - [auth-passwd.c auth.c auth.h auth1.c auth2.c servconf.c servconf.h - ssh-keygen.c sshd.8] - PermitRootLogin={yes,without-password,forced-commands-only,no} - (before this change, root could login even if PermitRootLogin==no) - - deraadt@cvs.openbsd.org 2001/02/12 22:56:09 - [clientloop.c packet.c ssh-keyscan.c] - deal with EAGAIN/EINTR selects which were skipped - - markus@cvs.openssh.org 2001/02/13 22:49:40 - [auth1.c auth2.c] - setproctitle(user) only if getpwnam succeeds - - markus@cvs.openbsd.org 2001/02/12 23:26:20 - [sshd.c] - missing memset; from solar@openwall.com - - stevesk@cvs.openbsd.org 2001/02/12 20:53:33 - [sftp-int.c] - lumask now works with 1 numeric arg; ok markus@, djm@ - - djm@cvs.openbsd.org 2001/02/14 9:46:03 - [sftp-client.c sftp-int.c sftp.1] - Fix and document 'preserve modes & times' option ('-p' flag in sftp); - ok markus@ - - (bal) replaced PATH_MAX in sftp-int.c w/ MAXPATHLEN. - - (djm) Move to Jim's 1.2.0 X11 askpass program - - (stevesk) OpenBSD sync: - - deraadt@cvs.openbsd.org 2001/02/15 01:38:04 - [serverloop.c] - indent - -20010214 - - (djm) Don't try to close PAM session or delete credentials if the - session has not been open or credentials not set. Based on patch from - Andrew Bartlett - - (djm) Move PAM session initialisation until after fork in sshd. Patch - from Nalin Dahyabhai - - (bal) Missing function prototype in bsd-snprintf.c patch by - Mark Miller - - (djm) Split out and improve OSF SIA auth code. Patch from Chris Adams - with a little modification and KNF. - - (stevesk) fix for SIA patch, misplaced session_setup_sia() - -20010213 - - (djm) Only test -S potential EGD sockets if they exist and are readable. - - (bal) Cleaned out bsd-snprintf.c. VARARGS have been banished and - I did a base KNF over the whe whole file to make it more acceptable. - (backed out of original patch and removed it from ChangeLog) - - (bal) Use chown() if fchown() does not exist in ftp-server.c patch by - Tim Rice - - (stevesk) auth1.c: fix PAM passwordless check. - -20010212 - - (djm) Update Redhat specfile to allow --define "skip_x11_askpass 1", - --define "skip_gnome_askpass 1", --define "rh7 1" and make the - implicit rpm-3.0.5 dependancy explicit. Patch and suggestions from - Pekka Savola - - (djm) Clean up PCRE text in INSTALL - - (djm) Fix OSF SIA auth NULL pointer deref. Report from Mike Battersby - - - (bal) NCR SVR4 compatiblity provide by Don Bragg - - (stevesk) session.c: remove debugging code. - -20010211 - - (bal) OpenBSD Sync - - markus@cvs.openbsd.org 2001/02/07 22:35:46 - [auth1.c auth2.c sshd.c] - move k_setpag() to a central place; ok dugsong@ - - markus@cvs.openbsd.org 2001/02/10 12:52:02 - [auth2.c] - offer passwd before s/key - - markus@cvs.openbsd.org 2001/02/8 22:37:10 - [canohost.c] - remove last call to sprintf; ok deraadt@ - - markus@cvs.openbsd.org 2001/02/10 1:33:32 - [canohost.c] - add debug message, since sshd blocks here if DNS is not available - - markus@cvs.openbsd.org 2001/02/10 12:44:02 - [cli.c] - don't call vis() for \r - - danh@cvs.openbsd.org 2001/02/10 0:12:43 - [scp.c] - revert a small change to allow -r option to work again; ok deraadt@ - - danh@cvs.openbsd.org 2001/02/10 15:14:11 - [scp.c] - fix memory leak; ok markus@ - - djm@cvs.openbsd.org 2001/02/10 0:45:52 - [scp.1] - Mention that you can quote pathnames with spaces in them - - markus@cvs.openbsd.org 2001/02/10 1:46:28 - [ssh.c] - remove mapping of argv[0] -> hostname - - markus@cvs.openbsd.org 2001/02/06 22:26:17 - [sshconnect2.c] - do not ask for passphrase in batch mode; report from ejb@ql.org - - itojun@cvs.opebsd.org 2001/02/08 10:47:05 - [sshconnect.c sshconnect1.c sshconnect2.c] - %.30s is too short for IPv6 numeric address. use %.128s for now. - markus ok - - markus@cvs.openbsd.org 2001/02/09 12:28:35 - [sshconnect2.c] - do not free twice, thanks to /etc/malloc.conf - - markus@cvs.openbsd.org 2001/02/09 17:10:53 - [sshconnect2.c] - partial success: debug->log; "Permission denied" if no more auth methods - - markus@cvs.openbsd.org 2001/02/10 12:09:21 - [sshconnect2.c] - remove some lines - - markus@cvs.openbsd.org 2001/02/09 13:38:07 - [auth-options.c] - reset options if no option is given; from han.holl@prismant.nl - - markus@cvs.openbsd.org 2001/02/08 21:58:28 - [channels.c] - nuke sprintf, ok deraadt@ - - markus@cvs.openbsd.org 2001/02/08 21:58:28 - [channels.c] - nuke sprintf, ok deraadt@ - - markus@cvs.openbsd.org 2001/02/06 22:43:02 - [clientloop.h] - remove confusing callback code - - deraadt@cvs.openbsd.org 2001/02/08 14:39:36 - [readconf.c] - snprintf - - itojun@cvs.openbsd.org 2001/02/08 19:30:52 - sync with netbsd tree changes. - - more strict prototypes, include necessary headers - - use paths.h/pathnames.h decls - - size_t typecase to int -> u_long - - itojun@cvs.openbsd.org 2001/02/07 18:04:50 - [ssh-keyscan.c] - fix size_t -> int cast (use u_long). markus ok - - markus@cvs.openbsd.org 2001/02/07 22:43:16 - [ssh-keyscan.c] - s/getline/Linebuf_getline/; from roumen.petrov@skalasoft.com - - itojun@cvs.openbsd.org 2001/02/09 9:04:59 - [ssh-keyscan.c] - do not assume malloc() returns zero-filled region. found by - malloc.conf=AJ. - - markus@cvs.openbsd.org 2001/02/08 22:35:30 - [sshconnect.c] - don't connect if batch_mode is true and stricthostkeychecking set to - 'ask' - - djm@cvs.openbsd.org 2001/02/04 21:26:07 - [sshd_config] - type: ok markus@ - - deraadt@cvs.openbsd.org 2001/02/06 22:07:50 - [sshd_config] - enable sftp-server by default - - deraadt 2001/02/07 8:57:26 - [xmalloc.c] - deal with new ANSI malloc stuff - - markus@cvs.openbsd.org 2001/02/07 16:46:08 - [xmalloc.c] - typo in fatal() - - itojun@cvs.openbsd.org 2001/02/07 18:04:50 - [xmalloc.c] - fix size_t -> int cast (use u_long). markus ok - - 1.47 Thu Feb 8 23:11:42 GMT 2001 by dugsong - [serverloop.c sshconnect1.c] - mitigate SSH1 traffic analysis - from Solar Designer - , ok provos@ - - (bal) fixed sftp-client.c. Return 'status' instead of '0' - (from the OpenBSD tree) - - (bal) Synced ssh.1, ssh-add.1 and sshd.8 w/ OpenBSD - - (bal) sftp-sever.c '%8lld' to '%8llu' (OpenBSD Sync) - - (bal) uuencode.c resync w/ OpenBSD tree, plus whitespace. - - (bal) A bit more whitespace cleanup - - (djm) Set PAM_RHOST earlier, patch from Andrew Bartlett - - - (stevesk) misc.c: ssh.h not needed. - - (stevesk) compat.c: more friendly cpp error - - (stevesk) OpenBSD sync: - - stevesk@cvs.openbsd.org 2001/02/11 06:15:57 - [LICENSE] - typos and small cleanup; ok deraadt@ - -20010210 - - (djm) Sync sftp and scp stuff from OpenBSD: - - djm@cvs.openbsd.org 2001/02/07 03:55:13 - [sftp-client.c] - Don't free handles before we are done with them. Based on work from - Corinna Vinschen . ok markus@ - - djm@cvs.openbsd.org 2001/02/06 22:32:53 - [sftp.1] - Punctuation fix from Pekka Savola - - deraadt@cvs.openbsd.org 2001/02/07 04:07:29 - [sftp.1] - pretty up significantly - - itojun@cvs.openbsd.org 2001/02/07 06:49:42 - [sftp.1] - .Bl-.El mismatch. markus ok - - djm@cvs.openbsd.org 2001/02/07 06:12:30 - [sftp-int.c] - Check that target is a directory before doing ls; ok markus@ - - itojun@cvs.openbsd.org 2001/02/07 11:01:18 - [scp.c sftp-client.c sftp-server.c] - unsigned long long -> %llu, not %qu. markus ok - - stevesk@cvs.openbsd.org 2001/02/07 11:10:39 - [sftp.1 sftp-int.c] - more man page cleanup and sync of help text with man page; ok markus@ - - markus@cvs.openbsd.org 2001/02/07 14:58:34 - [sftp-client.c] - older servers reply with SSH2_FXP_NAME + count==0 instead of EOF - - djm@cvs.openbsd.org 2001/02/07 15:27:19 - [sftp.c] - Don't forward agent and X11 in sftp. Suggestion from Roumen Petrov - - - stevesk@cvs.openbsd.org 2001/02/07 15:36:04 - [sftp-int.c] - portable; ok markus@ - - stevesk@cvs.openbsd.org 2001/02/07 15:55:47 - [sftp-int.c] - lowercase cmds[].c also; ok markus@ - - markus@cvs.openbsd.org 2001/02/07 17:04:52 - [pathnames.h sftp.c] - allow sftp over ssh protocol 1; ok djm@ - - deraadt@cvs.openbsd.org 2001/02/08 07:38:55 - [scp.c] - memory leak fix, and snprintf throughout - - deraadt@cvs.openbsd.org 2001/02/08 08:02:02 - [sftp-int.c] - plug a memory leak - - stevesk@cvs.openbsd.org 2001/02/08 10:11:23 - [session.c sftp-client.c] - %i -> %d - - stevesk@cvs.openbsd.org 2001/02/08 10:57:59 - [sftp-int.c] - typo - - stevesk@cvs.openbsd.org 2001/02/08 15:28:07 - [sftp-int.c pathnames.h] - _PATH_LS; ok markus@ - - djm@cvs.openbsd.org 2001/02/09 04:46:25 - [sftp-int.c] - Check for NULL attribs for chown, chmod & chgrp operations, only send - relevant attribs back to server; ok markus@ - - djm@cvs.openbsd.org 2001/02/06 15:05:25 - [sftp.c] - Use getopt to process commandline arguments - - djm@cvs.openbsd.org 2001/02/06 15:06:21 - [sftp.c ] - Wait for ssh subprocess at exit - - djm@cvs.openbsd.org 2001/02/06 15:18:16 - [sftp-int.c] - stat target for remote chdir before doing chdir - - djm@cvs.openbsd.org 2001/02/06 15:32:54 - [sftp.1] - Punctuation fix from Pekka Savola - - provos@cvs.openbsd.org 2001/02/05 22:22:02 - [sftp-int.c] - cleanup get_pathname, fix pwd after failed cd. okay djm@ - - (djm) Update makefile.in for _PATH_SFTP_SERVER - - (bal) sftp-client.c replace NULL w/ 0 in do_ls() (pending in OpenBSD tree) - -20010209 - - (bal) patch to vis.c to deal with HAVE_VIS right by Robert Mooney - - - (bal) .c.o rule in openbsd-compat/Makefile.in did not make it to the - main tree while porting forward. Pointed out by Lutz Jaenicke - - - (bal) double entry in configure.in. Pointed out by Lutz Jaenicke - - - (stevesk) OpenBSD sync: - - markus@cvs.openbsd.org 2001/02/08 11:20:01 - [auth2.c] - strict checking - - markus@cvs.openbsd.org 2001/02/08 11:15:22 - [version.h] - update to 2.3.2 - - markus@cvs.openbsd.org 2001/02/08 11:12:30 - [auth2.c] - fix typo - - (djm) Update spec files - - (bal) OpenBSD sync: - - deraadt@cvs.openbsd.org 2001/02/08 14:38:54 - [scp.c] - memory leak fix, and snprintf throughout - - markus@cvs.openbsd.org 2001/02/06 22:43:02 - [clientloop.c] - remove confusing callback code - - (djm) Add CVS Id's to files that we have missed - - (bal) OpenBSD Sync (more): - - itojun@cvs.openbsd.org 2001/02/08 19:30:52 - sync with netbsd tree changes. - - more strict prototypes, include necessary headers - - use paths.h/pathnames.h decls - - size_t typecase to int -> u_long - - markus@cvs.openbsd.org 2001/02/06 22:07:42 - [ssh.c] - fatal() if subsystem fails - - markus@cvs.openbsd.org 2001/02/06 22:43:02 - [ssh.c] - remove confusing callback code - - jakob@cvs.openbsd.org 2001/02/06 23:03:24 - [ssh.c] - add -1 option (force protocol version 1). ok markus@ - - jakob@cvs.openbsd.org 2001/02/06 23:06:21 - [ssh.c] - reorder -{1,2,4,6} options. ok markus@ - - (bal) Missing 'const' in readpass.h - - (bal) OpenBSD Sync (so at least the thing compiles for 2.3.2 =) - - djm@cvs.openbsd.org 2001/02/06 23:30:28 - [sftp-client.c] - replace arc4random with counter for request ids; ok markus@ - - (djm) Define _PATH_TTY for systems that don't. Report from Lutz - Jaenicke - -20010208 - - (djm) Don't delete external askpass program in make uninstall target. - Report and fix from Roumen Petrov - - (djm) Fix linking of sftp, don't need arc4random any more. - - (djm) Try to use shell that supports "test -S" for EGD socket search. - Based on patch from Tim Rice - -20010207 - - (bal) Save the whole path to AR in configure. Some Solaris 2.7 installs - seem lose track of it while in openbsd-compat/ (two confirmed reports) - - (djm) Much KNF on PAM code - - (djm) Revise auth-pam.c conversation function to be a little more - readable. - - (djm) Revise kbd-int PAM conversation function to fold all text messages - to before first prompt. Fixes hangs if last pam_message did not require - a reply. - - (djm) Fix password changing when using PAM kbd-int authentication - -20010205 - - (bal) Disable groupaccess by setting NGROUPS_MAX to 0 for platforms - that don't have NGROUPS_MAX. - - (bal) AIX patch for auth1.c by William L. Jones - - (stevesk) OpenBSD sync: - - stevesk@cvs.openbsd.org 2001/02/04 08:32:27 - [many files; did this manually to our top-level source dir] - unexpand and remove end-of-line whitespace; ok markus@ - - stevesk@cvs.openbsd.org 2001/02/04 15:21:19 - [sftp-server.c] - SSH2_FILEXFER_ATTR_UIDGID support; ok markus@ - - deraadt@cvs.openbsd.org 2001/02/04 17:02:32 - [sftp-int.c] - ? == help - - deraadt@cvs.openbsd.org 2001/02/04 16:47:46 - [sftp-int.c] - sort commands, so that abbreviations work as expected - - stevesk@cvs.openbsd.org 2001/02/04 15:17:52 - [sftp-int.c] - debugging sftp: precedence and missing break. chmod, chown, chgrp - seem to be working now. - - markus@cvs.openbsd.org 2001/02/04 14:41:21 - [sftp-int.c] - use base 8 for umask/chmod - - markus@cvs.openbsd.org 2001/02/04 11:11:54 - [sftp-int.c] - fix LCD - - markus@cvs.openbsd.org 2001/02/04 08:10:44 - [ssh.1] - typo; dpo@club-internet.fr - - stevesk@cvs.openbsd.org 2001/02/04 06:30:12 - [auth2.c authfd.c packet.c] - remove duplicate #include's; ok markus@ - - deraadt@cvs.openbsd.org 2001/02/04 16:56:23 - [scp.c sshd.c] - alpha happiness - - stevesk@cvs.openbsd.org 2001/02/04 15:12:17 - [sshd.c] - precedence; ok markus@ - - deraadt@cvs.openbsd.org 2001/02/04 08:14:15 - [ssh.c sshd.c] - make the alpha happy - - markus@cvs.openbsd.org 2001/01/31 13:37:24 - [channels.c channels.h serverloop.c ssh.c] - do not disconnect if local port forwarding fails, e.g. if port is - already in use - - markus@cvs.openbsd.org 2001/02/01 14:58:09 - [channels.c] - use ipaddr in channel messages, ietf-secsh wants this - - markus@cvs.openbsd.org 2001/01/31 12:26:20 - [channels.c] - ssh.com-2.0.1x does not send additional info in CHANNEL_OPEN_FAILURE - messages; bug report from edmundo@rano.org - - markus@cvs.openbsd.org 2001/01/31 13:48:09 - [sshconnect2.c] - unused - - deraadt@cvs.openbsd.org 2001/02/04 08:23:08 - [sftp-client.c sftp-server.c] - make gcc on the alpha even happier - -20010204 - - (bal) I think this is the last of the bsd-*.h that don't belong. - - (bal) Minor Makefile fix - - (bal) openbsd-compat/Makefile minor fix. Ensure dependancies are done - right. - - (bal) Changed order of LIB="" in -with-skey due to library resolving. - - (bal) next-posix.h changed to bsd-nextstep.h - - (djm) OpenBSD CVS sync: - - markus@cvs.openbsd.org 2001/02/03 03:08:38 - [auth-options.c auth-rh-rsa.c auth-rhosts.c auth.c canohost.c] - [canohost.h servconf.c servconf.h session.c sshconnect1.c sshd.8] - [sshd_config] - make ReverseMappingCheck optional in sshd_config; ok djm@,dugsong@ - - markus@cvs.openbsd.org 2001/02/03 03:19:51 - [ssh.1 sshd.8 sshd_config] - Skey is now called ChallengeResponse - - markus@cvs.openbsd.org 2001/02/03 03:43:09 - [sshd.8] - use no-pty option in .ssh/authorized_keys* if you need a 8-bit clean - channel. note from Erik.Anggard@cygate.se (pr/1659) - - stevesk@cvs.openbsd.org 2001/02/03 10:03:06 - [ssh.1] - typos; ok markus@ - - djm@cvs.openbsd.org 2001/02/04 04:11:56 - [scp.1 sftp-server.c ssh.1 sshd.8 sftp-client.c sftp-client.h] - [sftp-common.c sftp-common.h sftp-int.c sftp-int.h sftp.1 sftp.c] - Basic interactive sftp client; ok theo@ - - (djm) Update RPM specs for new sftp binary - - (djm) Update several bits for new optional reverse lookup stuff. I - think I got them all. - - (djm) Makefile.in fixes - - (stevesk) add mysignal() wrapper and use it for the protocol 2 - SIGCHLD handler. - - (djm) Use setvbuf() instead of setlinebuf(). Suggest from stevesk@ - -20010203 - - (bal) Cygwin clean up by Corinna Vinschen - - (bal) renamed queue.h to fake-queue.h (even if it's an OpenBSD - based file) to ensure #include space does not get confused. - - (bal) Minor Makefile.in tweak. dirname may not exist on some - platforms so builds fail. (NeXT being a well known one) - -20010202 - - (bal) Makefile fix where sourcedir != builddir by Corinna Vinschen - - - (bal) Makefile fix to use $(MAKE) instead of 'make' for platforms - that use 'gmake'. Patch by Tim Rice - -20010201 - - (bal) Minor fix to Makefile to stop rebuilding executables if no - changes have occured to any of the supporting code. Patch by - Roumen Petrov - -20010131 - - (djm) OpenBSD CVS Sync: - - djm@cvs.openbsd.org 2001/01/30 15:48:53 - [sshconnect.c] - Make warning message a little more consistent. ok markus@ - - (djm) Fix autoconf logic for --with-lastlog=no Report and diagnosis from - Philipp Buehler and Kevin Steves - respectively. - - (djm) Don't log SSH2 PAM KbdInt responses to debug, they may contain - passwords. - - (bal) Reorder. Move all bsd-*, fake-*, next-*, and cygwin* stuff to - openbsd-compat/. And resolve all ./configure and Makefile.in issues - assocated. - -20010130 - - (djm) OpenBSD CVS Sync: - - markus@cvs.openbsd.org 2001/01/29 09:55:37 - [channels.c channels.h clientloop.c serverloop.c] - fix select overflow; ok deraadt@ and stevesk@ - - markus@cvs.openbsd.org 2001/01/29 12:42:35 - [canohost.c canohost.h channels.c clientloop.c] - add get_peer_ipaddr(socket), x11-fwd in ssh2 requires ipaddr, not DNS - - markus@cvs.openbsd.org 2001/01/29 12:47:32 - [rsa.c rsa.h ssh-agent.c sshconnect1.c sshd.c] - handle rsa_private_decrypt failures; helps against the Bleichenbacher - pkcs#1 attack - - djm@cvs.openbsd.org 2001/01/29 05:36:11 - [ssh.1 ssh.c] - Allow invocation of sybsystem by commandline (-s); ok markus@ - - (stevesk) configure.in: remove duplicate PROG_LS - -20010129 - - (stevesk) sftp-server.c: use %lld vs. %qd - -20010128 - - (bal) Put USE_PIPES back into sco3.2v5 - - (bal) OpenBSD Sync - - markus@cvs.openbsd.org 2001/01/28 10:15:34 - [dispatch.c] - re-keying is not supported; ok deraadt@ - - markus@cvs.openbsd.org 2001/01/28 10:24:04 - [ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh.1 sshd.8] - cleanup AUTHORS sections - - markus@cvs.openbsd.org 2001/01/28 10:37:26 - [sshd.c sshd.8] - remove -Q, no longer needed - - stevesk@cvs.openbsd.org 2001/01/28 20:36:16 - [readconf.c ssh.1] - ``StrictHostKeyChecking ask'' documentation and small cleanup. - ok markus@ - - stevesk@cvs.openbsd.org 2001/01/28 20:43:25 - [sshd.8] - spelling. ok markus@ - - stevesk@cvs.openbsd.org 2001/01/28 20:53:21 - [xmalloc.c] - use size_t for strlen() return. ok markus@ - - stevesk@cvs.openbsd.org 2001/01/28 22:27:05 - [authfile.c] - spelling. use sizeof vs. strlen(). ok markus@ - - niklas@cvs.openbsd.org 2001/01/29 1:59:14 - [atomicio.h canohost.h clientloop.h deattack.h dh.h dispatch.h - groupaccess.c groupaccess.h hmac.h hostfile.h includes.h kex.h - key.h log.h login.h match.h misc.h myproposal.h nchan.ms pathnames.h - radix.h readpass.h rijndael.h serverloop.h session.h sftp.h ssh-add.1 - ssh-dss.h ssh-keygen.1 ssh-keyscan.1 ssh-rsa.h ssh1.h ssh_config - sshconnect.h sshd_config tildexpand.h uidswap.h uuencode.h] - $OpenBSD$ - - (bal) Minor auth2.c resync. Whitespace and moving of an #include. - -20010126 - - (bal) SSH_PROGRAM vs _PATH_SSH_PROGRAM fix pointed out by Roumen - Petrov - - (bal) OpenBSD Sync - - deraadt@cvs.openbsd.org 2001/01/25 8:06:33 - [ssh-agent.c] - call _exit() in signal handler - -20010125 - - (djm) Sync bsd-* support files: - - deraadt@cvs.openbsd.org 2000/01/26 03:43:20 - [rresvport.c bindresvport.c] - new bindresvport() semantics that itojun, shin, jean-luc and i have - agreed on, which will be happy for the future. bindresvport_sa() for - sockaddr *, too. docs later.. - - deraadt@cvs.openbsd.org 2000/01/24 02:24:21 - [bindresvport.c] - in bindresvport(), if sin is non-NULL, example sin->sin_family for - the actual family being processed - - (djm) Mention PRNGd in documentation, it is nicer than EGD - - (djm) Automatically search for "well-known" EGD/PRNGd sockets in autoconf - - (bal) AC_FUNC_STRFTIME added to autoconf - - (bal) OpenBSD Resync - - stevesk@cvs.openbsd.org 2001/01/24 21:03:50 - [channels.c] - missing freeaddrinfo(); ok markus@ - -20010124 - - (bal) OpenBSD Resync - - markus@cvs.openbsd.org 2001/01/23 10:45:10 - [ssh.h] - nuke comment - - (bal) no 64bit support patch from Tim Rice - - (bal) #ifdef around S_IFSOCK if platform does not support it. - patch by Tim Rice - - (bal) fake-regex.h cleanup based on Tim Rice's patch. - - (stevesk) sftp-server.c: fix chmod() mode mask - -20010123 - - (bal) regexp.h typo in configure.in. Should have been regex.h - - (bal) SSH_USER_DIR to _PATH_SSH_USER_DIR patch by stevesk@ - - (bal) SSH_ASKPASS_DEFAULT to _PATH_SSH_ASKPASS_DEFAULT - - (bal) OpenBSD Resync - - markus@cvs.openbsd.org 2001/01/22 8:15:00 - [auth-krb4.c sshconnect1.c] - only AFS needs radix.[ch] - - markus@cvs.openbsd.org 2001/01/22 8:32:53 - [auth2.c] - no need to include; from mouring@etoh.eviladmin.org - - stevesk@cvs.openbsd.org 2001/01/22 16:55:21 - [key.c] - free() -> xfree(); ok markus@ - - stevesk@cvs.openbsd.org 2001/01/22 17:22:28 - [sshconnect2.c sshd.c] - fix memory leaks in SSH2 key exchange; ok markus@ - - markus@cvs.openbsd.org 2001/01/22 23:06:39 - [auth1.c auth2.c readconf.c readconf.h servconf.c servconf.h - sshconnect1.c sshconnect2.c sshd.c] - rename skey -> challenge response. - auto-enable kbd-interactive for ssh2 if challenge-reponse is enabled. - - -20010122 - - (bal) OpenBSD Resync - - markus@cvs.openbsd.org 2001/01/19 12:45:26 GMT 2001 by markus - [servconf.c ssh.h sshd.c] - only auth-chall.c needs #ifdef SKEY - - markus@cvs.openbsd.org 2001/01/19 15:55:10 GMT 2001 by markus - [auth-krb4.c auth-options.c auth-rh-rsa.c auth-rhosts.c auth-rsa.c - auth1.c auth2.c channels.c clientloop.c dh.c dispatch.c nchan.c - packet.c pathname.h readconf.c scp.c servconf.c serverloop.c - session.c ssh-add.c ssh-keygen.c ssh-keyscan.c ssh.c ssh.h - ssh1.h sshconnect1.c sshd.c ttymodes.c] - move ssh1 definitions to ssh1.h, pathnames to pathnames.h - - markus@cvs.openbsd.org 2001/01/19 16:48:14 - [sshd.8] - fix typo; from stevesk@ - - markus@cvs.openbsd.org 2001/01/19 16:50:58 - [ssh-dss.c] - clear and free digest, make consistent with other code (use dlen); from - stevesk@ - - markus@cvs.openbsd.org 2001/01/20 15:55:20 GMT 2001 by markus - [auth-options.c auth-options.h auth-rsa.c auth2.c] - pass the filename to auth_parse_options() - - markus@cvs.openbsd.org 2001/01/20 17:59:40 GMT 2001 - [readconf.c] - fix SIGSEGV from -o ""; problem noted by jehsom@togetherweb.com - - stevesk@cvs.openbsd.org 2001/01/20 18:20:29 - [sshconnect2.c] - dh_new_group() does not return NULL. ok markus@ - - markus@cvs.openbsd.org 2001/01/20 21:33:42 - [ssh-add.c] - do not loop forever if askpass does not exist; from - andrew@pimlott.ne.mediaone.net - - djm@cvs.openbsd.org 2001/01/20 23:00:56 - [servconf.c] - Check for NULL return from strdelim; ok markus - - djm@cvs.openbsd.org 2001/01/20 23:02:07 - [readconf.c] - KNF; ok markus - - jakob@cvs.openbsd.org 2001/01/21 9:00:33 - [ssh-keygen.1] - remove -R flag; ok markus@ - - markus@cvs.openbsd.org 2001/01/21 19:05:40 - [atomicio.c automicio.h auth-chall.c auth-krb4.c auth-options.c - auth-options.h auth-passwd.c auth-rh-rsa.c auth-rhosts.c auth-rsa.c - auth.c auth.h auth1.c auth2-chall.c auth2.c authfd.c authfile.c - bufaux.c bufaux.h buffer.c canahost.c canahost.h channels.c - cipher.c cli.c clientloop.c clientloop.h compat.c compress.c - deattack.c dh.c dispatch.c groupaccess.c hmac.c hostfile.c kex.c - key.c key.h log-client.c log-server.c log.c log.h login.c login.h - match.c misc.c misc.h nchan.c packet.c pty.c radix.h readconf.c - readpass.c readpass.h rsa.c scp.c servconf.c serverloop.c serverloop.h - session.c sftp-server.c ssh-add.c ssh-agent.c ssh-dss.c ssh-keygen.c - ssh-keyscan.c ssh-rsa.c ssh.c ssh.h sshconnect.c sshconnect.h - sshconnect1.c sshconnect2.c sshd.c tildexpand.c tildexpand.h - ttysmodes.c uidswap.c xmalloc.c] - split ssh.h and try to cleanup the #include mess. remove unnecessary - #includes. rename util.[ch] -> misc.[ch] - - (bal) renamed 'PIDDIR' to '_PATH_SSH_PIDDIR' to match OpenBSD tree - - (bal) Moved #ifdef KRB4 in auth-krb4.c above the #include to resolve - conflict when compiling for non-kerb install - - (bal) removed the #ifdef SKEY in auth1.c to match Markus' changes - on 1/19. - -20010120 - - (bal) OpenBSD Resync - - markus@cvs.openbsd.org 2001/01/19 12:45:26 - [ssh-chall.c servconf.c servconf.h ssh.h sshd.c] - only auth-chall.c needs #ifdef SKEY - - (bal) Slight auth2-pam.c clean up. - - (bal) Includes a fake-regexp.h to be only used if regcomp() is found, - but no 'regexp.h' found (SCO OpenServer 3 lacks the header). - -20010119 - - (djm) Update versions in RPM specfiles - - (bal) OpenBSD Resync - - markus@cvs.openbsd.org 2001/01/18 16:20:21 - [log-client.c log-server.c log.c readconf.c servconf.c ssh.1 ssh.h - sshd.8 sshd.c] - log() is at pri=LOG_INFO, since LOG_NOTICE goes to /dev/console on many - systems - - markus@cvs.openbsd.org 2001/01/18 16:59:59 - [auth-passwd.c auth.c auth.h auth1.c auth2.c serverloop.c session.c - session.h sshconnect1.c] - 1) removes fake skey from sshd, since this will be much - harder with /usr/libexec/auth/login_XXX - 2) share/unify code used in ssh-1 and ssh-2 authentication (server side) - 3) make addition of BSD_AUTH and other challenge reponse methods - easier. - - markus@cvs.openbsd.org 2001/01/18 17:12:43 - [auth-chall.c auth2-chall.c] - rename *-skey.c *-chall.c since the files are not skey specific - - (djm) Merge patch from Tim Waugh (via Nalin Dahyabhai ) - to fix NULL pointer deref and fake authloop breakage in PAM code. - - (bal) Updated contrib/cygwin/ by Corinna Vinschen - - (bal) Minor cygwin patch to auth1.c. Suggested by djm. - -20010118 - - (bal) Super Sized OpenBSD Resync - - markus@cvs.openbsd.org 2001/01/11 22:14:20 GMT 2001 by markus - [sshd.c] - maxfd+1 - - markus@cvs.openbsd.org 2001/01/13 17:59:18 - [ssh-keygen.1] - small ssh-keygen manpage cleanup; stevesk@pobox.com - - markus@cvs.openbsd.org 2001/01/13 18:03:07 - [scp.c ssh-keygen.c sshd.c] - getopt() returns -1 not EOF; stevesk@pobox.com - - markus@cvs.openbsd.org 2001/01/13 18:06:54 - [ssh-keyscan.c] - use SSH_DEFAULT_PORT; from stevesk@pobox.com - - markus@cvs.openbsd.org 2001/01/13 18:12:47 - [ssh-keyscan.c] - free() -> xfree(); fix memory leak; from stevesk@pobox.com - - markus@cvs.openbsd.org 2001/01/13 18:14:13 - [ssh-add.c] - typo, from stevesk@sweden.hp.com - - markus@cvs.openbsd.org 2001/01/13 18:32:50 - [packet.c session.c ssh.c sshconnect.c sshd.c] - split out keepalive from packet_interactive (from dale@accentre.com) - set IPTOS_LOWDELAY TCP_NODELAY IPTOS_THROUGHPUT for ssh2, too. - - markus@cvs.openbsd.org 2001/01/13 18:36:45 - [packet.c packet.h] - reorder, typo - - markus@cvs.openbsd.org 2001/01/13 18:38:00 - [auth-options.c] - fix comment - - markus@cvs.openbsd.org 2001/01/13 18:43:31 - [session.c] - Wall - - markus@cvs.openbsd.org 2001/01/13 19:14:08 - [clientloop.h clientloop.c ssh.c] - move callback to headerfile - - markus@cvs.openbsd.org 2001/01/15 21:40:10 - [ssh.c] - use log() instead of stderr - - markus@cvs.openbsd.org 2001/01/15 21:43:51 - [dh.c] - use error() not stderr! - - markus@cvs.openbsd.org 2001/01/15 21:45:29 - [sftp-server.c] - rename must fail if newpath exists, debug off by default - - markus@cvs.openbsd.org 2001/01/15 21:46:38 - [sftp-server.c] - readable long listing for sftp-server, ok deraadt@ - - markus@cvs.openbsd.org 2001/01/16 19:20:06 - [key.c ssh-rsa.c] - make "ssh-rsa" key format for ssh2 confirm to the ietf-drafts; from - galb@vandyke.com. note that you have to delete older ssh2-rsa keys, - since they are in the wrong format, too. they must be removed from - .ssh/authorized_keys2 and .ssh/known_hosts2, etc. - (cd; grep -v ssh-rsa .ssh/authorized_keys2 > TMP && mv TMP - .ssh/authorized_keys2) additionally, we now check that - BN_num_bits(rsa->n) >= 768. - - markus@cvs.openbsd.org 2001/01/16 20:54:27 - [sftp-server.c] - remove some statics. simpler handles; idea from nisse@lysator.liu.se - - deraadt@cvs.openbsd.org 2001/01/16 23:58:08 - [bufaux.c radix.c sshconnect.h sshconnect1.c] - indent - - (bal) Added bsd-strmode.[ch] since some non-OpenBSD platforms may - be missing such feature. - - -20010117 - - (djm) Only write random seed file at exit - - (djm) Make PAM support optional, enable with --with-pam - - (djm) Try to use libcrypt on Linux, but link it after OpenSSL (which - provides a crypt() of its own) - - (djm) Avoid a warning in bsd-bindresvport.c - - (djm) Try to avoid adding -I/usr/include to CPPFLAGS during SSL tests. This - can cause weird segfaults errors on Solaris - - (djm) Avoid warning in PAM code by making read_passphrase arguments const - - (djm) Add --with-pam to RPM spec files - -20010115 - - (bal) sftp-server.c change to use chmod() if fchmod() does not exist. - - (bal) utimes() support via utime() interface on machine that lack utimes(). - -20010114 - - (stevesk) initial work for OpenBSD "support supplementary group in - {Allow,Deny}Groups" patch: - - import getgrouplist.c from OpenBSD (bsd-getgrouplist.c) - - add bsd-getgrouplist.h - - new files groupaccess.[ch] - - build but don't use yet (need to merge auth.c changes) - - (stevesk) complete: - - markus@cvs.openbsd.org 2001/01/13 11:56:48 - [auth.c sshd.8] - support supplementary group in {Allow,Deny}Groups - from stevesk@pobox.com - -20010112 - - (bal) OpenBSD Sync - - markus@cvs.openbsd.org 2001/01/10 22:56:22 - [bufaux.h bufaux.c sftp-server.c sftp.h getput.h] - cleanup sftp-server implementation: - add buffer_get_int64, buffer_put_int64, GET_64BIT, PUT_64BIT - parse SSH2_FILEXFER_ATTR_EXTENDED - send SSH2_FX_EOF if readdir returns no more entries - reply to SSH2_FXP_EXTENDED message - use #defines from the draft - move #definations to sftp.h - more info: - http://www.ietf.org/internet-drafts/draft-ietf-secsh-filexfer-00.txt - - markus@cvs.openbsd.org 2001/01/10 19:43:20 - [sshd.c] - XXX - generate_empheral_server_key() is not safe against races, - because it calls log() - - markus@cvs.openbsd.org 2001/01/09 21:19:50 - [packet.c] - allow TCP_NDELAY for ipv6; from netbsd via itojun@ - -20010110 - - (djm) SNI/Reliant Unix needs USE_PIPES and $DISPLAY hack. Report from - Bladt Norbert - -20010109 - - (bal) Resync CVS ID of cli.c - - (stevesk) auth1.c: free should be after WITH_AIXAUTHENTICATE - code. - - (bal) OpenBSD Sync - - markus@cvs.openbsd.org 2001/01/08 22:29:05 - [auth2.c compat.c compat.h servconf.c servconf.h sshd.8 - sshd_config version.h] - implement option 'Banner /etc/issue.net' for ssh2, move version to - 2.3.1 (needed for bugcompat detection, 2.3.0 would fail if Banner - is enabled). - - markus@cvs.openbsd.org 2001/01/08 22:03:23 - [channels.c ssh-keyscan.c] - O_NDELAY -> O_NONBLOCK; thanks stevesk@pobox.com - - markus@cvs.openbsd.org 2001/01/08 21:55:41 - [sshconnect1.c] - more cleanups and fixes from stevesk@pobox.com: - 1) try_agent_authentication() for loop will overwrite key just - allocated with key_new(); don't alloc - 2) call ssh_close_authentication_connection() before exit - try_agent_authentication() - 3) free mem on bad passphrase in try_rsa_authentication() - - markus@cvs.openbsd.org 2001/01/08 21:48:17 - [kex.c] - missing free; thanks stevesk@pobox.com - - (bal) Detect if clock_t structure exists, if not define it. - - (bal) Detect if O_NONBLOCK exists, if not define it. - - (bal) removed news4-posix.h (now empty) - - (bal) changed bsd-bindresvport.c and bsd-rresvport.c to use 'socklen_t' - instead of 'int' - - (stevesk) sshd_config: sync - - (stevesk) defines.h: remove spurious ``;'' - -20010108 - - (bal) Fixed another typo in cli.c - - (bal) OpenBSD Sync - - markus@cvs.openbsd.org 2001/01/07 21:26:55 - [cli.c] - typo - - markus@cvs.openbsd.org 2001/01/07 21:26:55 - [cli.c] - missing free, stevesk@pobox.com - - markus@cvs.openbsd.org 2001/01/07 19:06:25 - [auth1.c] - missing free, stevesk@pobox.com - - markus@cvs.openbsd.org 2001/01/07 11:28:04 - [log-client.c log-server.c log.c readconf.c servconf.c ssh.1 - ssh.h sshd.8 sshd.c] - rename SYSLOG_LEVEL_INFO->SYSLOG_LEVEL_NOTICE - syslog priority changes: - fatal() LOG_ERR -> LOG_CRIT - log() LOG_INFO -> LOG_NOTICE - - Updated TODO - -20010107 - - (bal) OpenBSD Sync - - markus@cvs.openbsd.org 2001/01/06 11:23:27 - [ssh-rsa.c] - remove unused - - itojun@cvs.openbsd.org 2001/01/05 08:23:29 - [ssh-keyscan.1] - missing .El - - markus@cvs.openbsd.org 2001/01/04 22:41:03 - [session.c sshconnect.c] - consistent use of _PATH_BSHELL; from stevesk@pobox.com - - djm@cvs.openbsd.org 2001/01/04 22:35:32 - [ssh.1 sshd.8] - Mention AES as available SSH2 Cipher; ok markus - - markus@cvs.openbsd.org 2001/01/04 22:25:58 - [sshd.c] - sync usage()/man with defaults; from stevesk@pobox.com - - markus@cvs.openbsd.org 2001/01/04 22:21:26 - [sshconnect2.c] - handle SSH2_MSG_USERAUTH_BANNER; fixes bug when connecting to a server - that prints a banner (e.g. /etc/issue.net) - -20010105 - - (bal) contrib/caldera/ provided by Tim Rice - - (bal) bsd-getcwd.c and bsd-setenv.c changed from bcopy() to memmove() - -20010104 - - (djm) Fix memory leak on systems with BROKEN_GETADDRINFO. Based on - work by Chris Vaughan - -20010103 - - (bal) fixed up sshconnect.c so it was closer inline with the OpenBSD - tree (mainly positioning) - - (bal) OpenSSH CVS Update - - markus@cvs.openbsd.org 2001/01/02 20:41:02 - [packet.c] - log remote ip on disconnect; PR 1600 from jcs@rt.fm - - markus@cvs.openbsd.org 2001/01/02 20:50:56 - [sshconnect.c] - strict_host_key_checking for host_status != HOST_CHANGED && - ip_status == HOST_CHANGED - - (bal) authfile.c: Synced CVS ID tag - - (bal) UnixWare 2.0 fixes by Tim Rice - - (bal) Disable sftp-server if no 64bit int support exists. Based on - patch by Tim Rice - - (bal) Makefile.in changes to uninstall: target to remove sftp-server - and sftp-server.8 manpage. - -20010102 - - (bal) OpenBSD CVS Update - - markus@cvs.openbsd.org 2001/01/01 14:52:49 - [scp.c] - use shared fatal(); from stevesk@pobox.com - -20001231 - - (bal) Reverted out of MAXHOSTNAMELEN. This should be set per OS. - for multiple reasons. - - (bal) Reverted out of a partial NeXT patch. - -20001230 - - (bal) OpenBSD CVS Update - - markus@cvs.openbsd.org 2000/12/28 18:58:30 - [ssh-keygen.c] - enable 'ssh-keygen -l -f ~/.ssh/{authorized_keys,known_hosts}{,2} - - markus@cvs.openbsd.org 2000/12/29 22:19:13 - [channels.c] - missing xfree; from vaughan99@yahoo.com - - (bal) Resynced CVS ID with OpenBSD for channel.c and uidswap.c - - (bal) if no MAXHOSTNAMELEN is defined. Default to 64 character defination. - Suggested by Christian Kurz - - (bal) Add in '.c.o' section to Makefile.in to address make programs that - don't honor CPPFLAGS by default. Suggested by Lutz Jaenicke - - -20001229 - - (bal) Fixed spelling of 'authorized_keys' in ssh-copy-id.1 by Christian - Kurz - - (bal) OpenBSD CVS Update - - markus@cvs.openbsd.org 2000/12/28 14:25:51 - [auth.h auth2.c] - count authentication failures only - - markus@cvs.openbsd.org 2000/12/28 14:25:03 - [sshconnect.c] - fingerprint for MITM attacks, too. - - markus@cvs.openbsd.org 2000/12/28 12:03:57 - [sshd.8 sshd.c] - document -D - - markus@cvs.openbsd.org 2000/12/27 14:19:21 - [serverloop.c] - less chatty - - markus@cvs.openbsd.org 2000/12/27 12:34 - [auth1.c sshconnect2.c sshd.c] - typo - - markus@cvs.openbsd.org 2000/12/27 12:30:19 - [readconf.c readconf.h ssh.1 sshconnect.c] - new option: HostKeyAlias: allow the user to record the host key - under a different name. This is useful for ssh tunneling over - forwarded connections or if you run multiple sshd's on different - ports on the same machine. - - markus@cvs.openbsd.org 2000/12/27 11:51:53 - [ssh.1 ssh.c] - multiple -t force pty allocation, document ORIGINAL_COMMAND - - markus@cvs.openbsd.org 2000/12/27 11:41:31 - [sshd.8] - update for ssh-2 - - (stevesk) compress.[ch] sync with openbsd; missed in prototype - fix merge. - -20001228 - - (bal) Patch to add libutil.h to loginrec.c only if the platform has - libutil.h. Suggested by Pekka Savola - - (djm) Update to new x11-askpass in RPM spec - - (bal) SCO patch to not include since it's unrelated - header. Patch by Tim Rice - - Updated TODO w/ known HP/UX issue - - (bal) removed extra noticed by Kevin Steves and removed the - bad reference to 'NeXT including it else were' on the #ifdef version. - -20001227 - - (bal) Typo in configure.in: entut?ent should be endut?ent. Suggested by - Takumi Yamane - - (bal) Checks for getrlimit(), sysconf(), and setdtablesize(). Patch - by Corinna Vinschen - - (djm) Fix catman-do target for non-bash - - (bal) Typo in configure.in: entut?ent should be endut?ent. Suggested by - Takumi Yamane - - (bal) Checks for getrlimit(), sysconf(), and setdtablesize(). Patch - by Corinna Vinschen - - (djm) Fix catman-do target for non-bash - - (bal) Fixed NeXT's lack of CPPFLAGS honoring. - - (bal) ssh-keyscan.c: NeXT (and older BSDs) don't support getrlimit() w/ - 'RLIMIT_NOFILE' - - (djm) Remove *.Ylonen files. They are no longer in the OpenBSD tree, - the info in COPYING.Ylonen has been moved to the start of each - SSH1-derived file and README.Ylonen is well out of date. - -20001223 - - (bal) Fixed Makefile.in to support recompile of all ssh and sshd objects - if a change to config.h has occurred. Suggested by Gert Doering - - - (bal) OpenBSD CVS Update: - - markus@cvs.openbsd.org 2000/12/22 16:49:40 - [ssh-keygen.c] - fix ssh-keygen -x -t type > file; from Roumen.Petrov@skalasoft.com - -20001222 - - Updated RCSID for pty.c - - (bal) OpenBSD CVS Updates: - - markus@cvs.openbsd.org 2000/12/21 15:10:16 - [auth-rh-rsa.c hostfile.c hostfile.h sshconnect.c] - print keyfile:line for changed hostkeys, for deraadt@, ok deraadt@ - - markus@cvs.openbsd.org 2000/12/20 19:26:56 - [authfile.c] - allow ssh -i userkey for root - - markus@cvs.openbsd.org 2000/12/20 19:37:21 - [authfd.c authfd.h kex.c sshconnect2.c sshd.c uidswap.c uidswap.h] - fix prototypes; from stevesk@pobox.com - - markus@cvs.openbsd.org 2000/12/20 19:32:08 - [sshd.c] - init pointer to NULL; report from Jan.Ivan@cern.ch - - markus@cvs.openbsd.org 2000/12/19 23:17:54 - [auth-krb4.c auth-options.c auth-options.h auth-rhosts.c auth-rsa.c - auth1.c auth2-skey.c auth2.c authfd.c authfd.h authfile.c bufaux.c - bufaux.h buffer.c canohost.c channels.c clientloop.c compress.c - crc32.c deattack.c getput.h hmac.c hmac.h hostfile.c kex.c kex.h - key.c key.h log.c login.c match.c match.h mpaux.c mpaux.h packet.c - packet.h radix.c readconf.c rsa.c scp.c servconf.c servconf.h - serverloop.c session.c sftp-server.c ssh-agent.c ssh-dss.c ssh-dss.h - ssh-keygen.c ssh-keyscan.c ssh-rsa.c ssh-rsa.h ssh.c ssh.h uuencode.c - uuencode.h sshconnect1.c sshconnect2.c sshd.c tildexpand.c] - replace 'unsigned bla' with 'u_bla' everywhere. also replace 'char - unsigned' with u_char. - -20001221 - - (stevesk) OpenBSD CVS updates: - - markus@cvs.openbsd.org 2000/12/19 15:43:45 - [authfile.c channels.c sftp-server.c ssh-agent.c] - remove() -> unlink() for consistency - - markus@cvs.openbsd.org 2000/12/19 15:48:09 - [ssh-keyscan.c] - replace with - - markus@cvs.openbsd.org 2000/12/17 02:33:40 - [uidswap.c] - typo; from wsanchez@apple.com - -20001220 - - (djm) Workaround PAM inconsistencies between Solaris derived PAM code - and Linux-PAM. Based on report and fix from Andrew Morgan - - -20001218 - - (stevesk) rsa.c: entropy.h not needed. - - (bal) split CFLAGS into CFLAGS and CPPFLAGS in configure.in and Makefile. - Suggested by Wilfredo Sanchez - -20001216 - - (stevesk) OpenBSD CVS updates: - - markus@cvs.openbsd.org 2000/12/16 02:53:57 - [scp.c] - allow + in usernames; request from Florian.Weimer@RUS.Uni-Stuttgart.DE - - markus@cvs.openbsd.org 2000/12/16 02:39:57 - [scp.c] - unused; from stevesk@pobox.com - -20001215 - - (stevesk) Old OpenBSD patch wasn't completely applied: - - markus@cvs.openbsd.org 2000/01/24 22:11:20 - [scp.c] - allow '.' in usernames; from jedgar@fxp.org - - (stevesk) OpenBSD CVS updates: - - markus@cvs.openbsd.org 2000/12/13 16:26:53 - [ssh-keyscan.c] - fatal already adds \n; from stevesk@pobox.com - - markus@cvs.openbsd.org 2000/12/13 16:25:44 - [ssh-agent.c] - remove redundant spaces; from stevesk@pobox.com - - ho@cvs.openbsd.org 2000/12/12 15:50:21 - [pty.c] - When failing to set tty owner and mode on a read-only filesystem, don't - abort if the tty already has correct owner and reasonably sane modes. - Example; permit 'root' to login to a firewall with read-only root fs. - (markus@ ok) - - deraadt@cvs.openbsd.org 2000/12/13 06:36:05 - [pty.c] - KNF - - markus@cvs.openbsd.org 2000/12/12 14:45:21 - [sshd.c] - source port < 1024 is no longer required for rhosts-rsa since it - adds no additional security. - - markus@cvs.openbsd.org 2000/12/12 16:11:49 - [ssh.1 ssh.c] - rhosts-rsa is no longer automagically disabled if ssh is not privileged. - UsePrivilegedPort=no disables rhosts-rsa _only_ for old servers. - these changes should not change the visible default behaviour of the ssh client. - - deraadt@cvs.openbsd.org 2000/12/11 10:27:33 - [scp.c] - when copying 0-sized files, do not re-print ETA time at completion - - provos@cvs.openbsd.org 2000/12/15 10:30:15 - [kex.c kex.h sshconnect2.c sshd.c] - compute diffie-hellman in parallel between server and client. okay markus@ - -20001213 - - (djm) Make sure we reset the SIGPIPE disposition after we fork. Report - from Andreas M. Kirchwitz - - (stevesk) OpenBSD CVS update: - - markus@cvs.openbsd.org 2000/12/12 15:30:02 - [ssh-keyscan.c ssh.c sshd.c] - consistently use __progname; from stevesk@pobox.com - -20001211 - - (bal) Applied patch to include ssh-keyscan into Redhat's package, and - patch to install ssh-keyscan manpage. Patch by Pekka Savola - - - (bal) OpenbSD CVS update - - markus@cvs.openbsd.org 2000/12/10 17:01:53 - [sshconnect1.c] - always request new challenge for skey/tis-auth, fixes interop with - other implementations; report from roth@feep.net - -20001210 - - (bal) OpenBSD CVS updates - - markus@cvs.openbsd.org 2000/12/09 13:41:51 - [cipher.c cipher.h rijndael.c rijndael.h rijndael_boxes.h] - undo rijndael changes - - markus@cvs.openbsd.org 2000/12/09 13:48:31 - [rijndael.c] - fix byte order bug w/o introducing new implementation - - markus@cvs.openbsd.org 2000/12/09 14:08:27 - [sftp-server.c] - "" -> "." for realpath; from vinschen@redhat.com - - markus@cvs.openbsd.org 2000/12/09 14:06:54 - [ssh-agent.c] - extern int optind; from stevesk@sweden.hp.com - - provos@cvs.openbsd.org 2000/12/09 23:51:11 - [compat.c] - remove unnecessary '\n' - -20001209 - - (bal) OpenBSD CVS updates: - - djm@cvs.openbsd.org 2000/12/07 4:24:59 - [ssh.1] - Typo fix from Wilfredo Sanchez ; ok theo - -20001207 - - (bal) OpenBSD CVS updates: - - markus@cvs.openbsd.org 2000/12/06 22:58:14 - [compat.c compat.h packet.c] - disable debug messages for ssh.com/f-secure 2.0.1x, 2.1.0 - - markus@cvs.openbsd.org 2000/12/06 23:10:39 - [rijndael.c] - unexpand(1) - - markus@cvs.openbsd.org 2000/12/06 23:05:43 - [cipher.c cipher.h rijndael.c rijndael.h rijndael_boxes.h] - new rijndael implementation. fixes endian bugs - -20001206 - - (bal) OpenBSD CVS updates: - - markus@cvs.openbsd.org 2000/12/05 20:34:09 - [channels.c channels.h clientloop.c serverloop.c] - async connects for -R/-L; ok deraadt@ - - todd@cvs.openssh.org 2000/12/05 16:47:28 - [sshd.c] - tweak comment to reflect real location of pid file; ok provos@ - - (stevesk) Import from OpenBSD for systems that don't - have it (used in ssh-keyscan). - - (stevesk) OpenBSD CVS update: - - markus@cvs.openbsd.org 2000/12/06 19:57:48 - [ssh-keyscan.c] - err(3) -> internal error(), from stevesk@sweden.hp.com - -20001205 - - (bal) OpenBSD CVS updates: - - markus@cvs.openbsd.org 2000/12/04 19:24:02 - [ssh-keyscan.c ssh-keyscan.1] - David Maziere's ssh-keyscan, ok niels@ - - (bal) Updated Makefile.in to include ssh-keyscan that was just added - to the recent OpenBSD source tree. - - (stevesk) fix typos in contrib/hpux/README - -20001204 - - (bal) More C functions defined in NeXT that are unaccessable without - defining -POSIX. - - (bal) OpenBSD CVS updates: - - markus@cvs.openbsd.org 2000/12/03 11:29:04 - [compat.c] - remove fallback to SSH_BUG_HMAC now that the drafts are updated - - markus@cvs.openbsd.org 2000/12/03 11:27:55 - [compat.c] - correctly match "2.1.0.pl2 SSH" etc; from - pekkas@netcore.fi/bugzilla.redhat - - markus@cvs.openbsd.org 2000/12/03 11:15:03 - [auth2.c compat.c compat.h sshconnect2.c] - support f-secure/ssh.com 2.0.12; ok niels@ - -20001203 - - (bal) OpenBSD CVS updates: - - markus@cvs.openbsd.org 2000/11/30 22:54:31 - [channels.c] - debug->warn if tried to do -R style fwd w/o client requesting this; - ok neils@ - - markus@cvs.openbsd.org 2000/11/29 20:39:17 - [cipher.c] - des_cbc_encrypt -> des_ncbc_encrypt since it already updates the IV - - markus@cvs.openbsd.org 2000/11/30 18:33:05 - [ssh-agent.c] - agents must not dump core, ok niels@ - - markus@cvs.openbsd.org 2000/11/30 07:04:02 - [ssh.1] - T is for both protocols - - markus@cvs.openbsd.org 2000/12/01 00:00:51 - [ssh.1] - typo; from green@FreeBSD.org - - markus@cvs.openbsd.org 2000/11/30 07:02:35 - [ssh.c] - check -T before isatty() - - provos@cvs.openbsd.org 2000/11/29 13:51:27 - [sshconnect.c] - show IP address and hostname when new key is encountered. okay markus@ - - markus@cvs.openbsd.org 2000/11/30 22:53:35 - [sshconnect.c] - disable agent/x11/port fwding if hostkey has changed; ok niels@ - - marksu@cvs.openbsd.org 2000/11/29 21:11:59 - [sshd.c] - sshd -D, startup w/o deamon(), for monitoring scripts or inittab; - from handler@sub-rosa.com and eric@urbanrange.com; ok niels@ - - (djm) Added patch from Nalin Dahyabhai to enable - PAM authentication using KbdInteractive. - - (djm) Added another TODO - -20001202 - - (bal) Backed out of part of Alain St-Denis' loginrec.c patch. - - (bal) Irix need some sort of mansubdir, patch by Michael Stone - - -20001129 - - (djm) Back out all the serverloop.c hacks. sshd will now hang again - if there are background children with open fds. - - (djm) bsd-rresvport.c bzero -> memset - - (djm) Don't fail in defines.h on absence of 64 bit types (we will - still fail during compilation of sftp-server). - - (djm) Fail if ar is not found during configure - - (djm) OpenBSD CVS updates: - - provos@cvs.openbsd.org 2000/11/22 08:38:31 - [sshd.8] - talk about /etc/primes, okay markus@ - - markus@cvs.openbsd.org 2000/11/23 14:03:48 - [ssh.c sshconnect1.c sshconnect2.c] - complain about invalid ciphers for ssh1/ssh2, fall back to reasonable - defaults - - markus@cvs.openbsd.org 2000/11/25 09:42:53 - [sshconnect1.c] - reorder check for illegal ciphers, bugreport from espie@ - - markus@cvs.openbsd.org 2000/11/25 10:19:34 - [ssh-keygen.c ssh.h] - print keytype when generating a key. - reasonable defaults for RSA1/RSA/DSA keys. - - (djm) Patch from Pekka Savola to include a few - more manpage paths in fixpaths calls - - (djm) Also add xauth path at Pekka's suggestion. - - (djm) Add Redhat RPM patch for AUTHPRIV SyslogFacility - -20001125 - - (djm) Give up privs when reading seed file - -20001123 - - (bal) Merge OpenBSD changes: - - markus@cvs.openbsd.org 2000/11/15 22:31:36 - [auth-options.c] - case insensitive key options; from stevesk@sweeden.hp.com - - markus@cvs.openbsd.org 2000/11/16 17:55:43 - [dh.c] - do not use perror() in sshd, after child is forked() - - markus@cvs.openbsd.org 2000/11/14 23:42:40 - [auth-rsa.c] - parse option only if key matches; fix some confusing seen by the client - - markus@cvs.openbsd.org 2000/11/14 23:44:19 - [session.c] - check no_agent_forward_flag for ssh-2, too - - markus@cvs.openbsd.org 2000/11/15 - [ssh-agent.1] - reorder SYNOPSIS; typo, use .It - - markus@cvs.openbsd.org 2000/11/14 23:48:55 - [ssh-agent.c] - do not reorder keys if a key is removed - - markus@cvs.openbsd.org 2000/11/15 19:58:08 - [ssh.c] - just ignore non existing user keys - - millert@cvs.openbsd.org 200/11/15 20:24:43 - [ssh-keygen.c] - Add missing \n at end of error message. - -20001122 - - (bal) Minor patch to ensure platforms lacking IRIX job limit supports - are compilable. - - (bal) Updated TODO as of 11/18/2000 with known things to resolve. - -20001117 - - (bal) Changed from 'primes' to 'primes.out' for consistancy sake. It - has no affect the output. Patch by Corinna Vinschen - - (stevesk) Reworked progname support. - - (bal) Misplaced #include "includes.h" in bsd-setproctitle.c. Patch by - Shinichi Maruyama - -20001116 - - (bal) Added in MAXSYMLINK test in bsd-realpath.c. Required for some SCO - releases. - - (bal) Make builds work outside of source tree. Patch by Mark D. Roth - - -20001113 - - (djm) Add pointer to http://www.imasy.or.jp/~gotoh/connect.c to - contrib/README - - (djm) Merge OpenBSD changes: - - markus@cvs.openbsd.org 2000/11/06 16:04:56 - [channels.c channels.h clientloop.c nchan.c serverloop.c] - [session.c ssh.c] - agent forwarding and -R for ssh2, based on work from - jhuuskon@messi.uku.fi - - markus@cvs.openbsd.org 2000/11/06 16:13:27 - [ssh.c sshconnect.c sshd.c] - do not disabled rhosts(rsa) if server port > 1024; from - pekkas@netcore.fi - - markus@cvs.openbsd.org 2000/11/06 16:16:35 - [sshconnect.c] - downgrade client to 1.3 if server is 1.4; help from mdb@juniper.net - - markus@cvs.openbsd.org 2000/11/09 18:04:40 - [auth1.c] - typo; from mouring@pconline.com - - markus@cvs.openbsd.org 2000/11/12 12:03:28 - [ssh-agent.c] - off-by-one when removing a key from the agent - - markus@cvs.openbsd.org 2000/11/12 12:50:39 - [auth-rh-rsa.c auth2.c authfd.c authfd.h] - [authfile.c hostfile.c kex.c kex.h key.c key.h myproposal.h] - [readconf.c readconf.h rsa.c rsa.h servconf.c servconf.h ssh-add.c] - [ssh-agent.c ssh-keygen.1 ssh-keygen.c ssh.1 ssh.c ssh_config] - [sshconnect1.c sshconnect2.c sshd.8 sshd.c sshd_config ssh-dss.c] - [ssh-dss.h ssh-rsa.c ssh-rsa.h dsa.c dsa.h] - add support for RSA to SSH2. please test. - there are now 3 types of keys: RSA1 is used by ssh-1 only, - RSA and DSA are used by SSH2. - you can use 'ssh-keygen -t rsa -f ssh2_rsa_file' to generate RSA - keys for SSH2 and use the RSA keys for hostkeys or for user keys. - SSH2 RSA or DSA keys are added to .ssh/authorised_keys2 as before. - - (djm) Fix up Makefile and Redhat init script to create RSA host keys - - (djm) Change to interim version - - (djm) Fix RPM spec file stupidity - - (djm) fixpaths to DSA and RSA keys too - -20001112 - - (bal) SCO Patch to add needed libraries for configure.in. Patch by - Phillips Porch - - (bal) IRIX patch to adding Job Limits. Patch by Denis Parker - - - (stevesk) pty.c: HP-UX 10 and 11 don't define TIOCSCTTY. Add error() to - failed ioctl(TIOCSCTTY) call. - -20001111 - - (djm) Added /etc/primes for kex DH group neg, fixup Makefile.in and - packaging files - - (djm) Fix new Makefile.in warnings - - (djm) Fix vsprintf("%h") in bsd-snprintf.c, short int va_args are - promoted to type int. Report and fix from Dan Astoorian - - - (djm) Hardwire sysconfdir in RPM spec files as some RPM versions get - it wrong. Report from Bennett Todd - -20001110 - - (bal) Fixed dropped answer from skey_keyinfo() in auth1.c - - (bal) Changed from --with-skey to --with-skey=PATH in configure.in - - (bal) Added in check to verify S/Key library is being detected in - configure.in - - (bal) next-posix.h - added another prototype wrapped in POSIX ifdef/endif. - Patch by Mark Miller - - (bal) Added 'util.h' header to loginrec.c only if HAVE_UTIL_H is defined - to remove warnings under MacOS X. Patch by Mark Miller - - (bal) Fixed LDFLAG mispelling in configure.in for --with-afs - -20001107 - - (bal) acconfig.in - removed the double "USE_PIPES" entry. Patch by - Mark Miller - - (bal) sshd.init files corrected to assign $? to RETVAL. Patch by - Jarno Huuskonen - - (bal) fixpaths fixed to stop it from quitely failing. Patch by - Mark D. Roth - -20001106 - - (djm) Use Jim's new 1.0.3 askpass in Redhat RPMs - - (djm) Manually fix up missed diff hunks (mainly RCS idents) - - (djm) Remove UPGRADING document in favour of a link to the better - maintained FAQ on www.openssh.com - - (djm) Fix multiple dependancy on gnome-libs from Pekka Savola - - - (djm) Don't need X11-askpass in RPM spec file if building without it - from Pekka Savola - - (djm) Release 2.3.0p1 - - (bal) typo in configure.in in regards to --with-ldflags from Marko - Asplund - - (bal) fixed next-posix.h. Forgot prototype of getppid(). - -20001105 - - (bal) Sync with OpenBSD: - - markus@cvs.openbsd.org 2000/10/31 9:31:58 - [compat.c] - handle all old openssh versions - - markus@cvs.openbsd.org 2000/10/31 13:1853 - [deattack.c] - so that large packets do not wrap "n"; from netbsd - - (bal) rijndel.c - fix up RCSID to match OpenBSD tree - - (bal) auth2-skey.c - Checked in. Missing from portable tree. - - (bal) Reworked NEWS-OS and NeXT ports to extract waitpid() and - setsid() into more common files - - (stevesk) pty.c: use __hpux to identify HP-UX. - - (bal) Missed auth-skey.o in Makefile.in and minor correction to - bsd-waitpid.c - -20001029 - - (stevesk) Fix typo in auth.c: USE_PAM not PAM - - (stevesk) Create contrib/cygwin/ directory; patch from - Corinna Vinschen - - (bal) Resolved more $xno and $xyes issues in configure.in - - (bal) next-posix.h - spelling and forgot a prototype - -20001028 - - (djm) fix select hack in serverloop.c from Philippe WILLEM - - - (djm) Fix mangled AIXAUTHENTICATE code - - (djm) authctxt->pw may be NULL. Fix from Markus Friedl - - - (djm) Sync with OpenBSD: - - markus@cvs.openbsd.org 2000/10/16 15:46:32 - [ssh.1] - fixes from pekkas@netcore.fi - - markus@cvs.openbsd.org 2000/10/17 14:28:11 - [atomicio.c] - return number of characters processed; ok deraadt@ - - markus@cvs.openbsd.org 2000/10/18 12:04:02 - [atomicio.c] - undo - - markus@cvs.openbsd.org 2000/10/18 12:23:02 - [scp.c] - replace atomicio(read,...) with read(); ok deraadt@ - - markus@cvs.openbsd.org 2000/10/18 12:42:00 - [session.c] - restore old record login behaviour - - deraadt@cvs.openbsd.org 2000/10/19 10:41:13 - [auth-skey.c] - fmt string problem in unused code - - provos@cvs.openbsd.org 2000/10/19 10:45:16 - [sshconnect2.c] - don't reference freed memory. okay deraadt@ - - markus@cvs.openbsd.org 2000/10/21 11:04:23 - [canohost.c] - typo, eramore@era-t.ericsson.se; ok niels@ - - markus@cvs.openbsd.org 2000/10/23 13:31:55 - [cipher.c] - non-alignment dependent swap_bytes(); from - simonb@wasabisystems.com/netbsd - - markus@cvs.openbsd.org 2000/10/26 12:38:28 - [compat.c] - add older vandyke products - - markus@cvs.openbsd.org 2000/10/27 01:32:19 - [channels.c channels.h clientloop.c serverloop.c session.c] - [ssh.c util.c] - enable non-blocking IO on channels, and tty's (except for the - client ttys). - -20001027 - - (djm) Increase REKEY_BYTES to 2^24 for arc4random - -20001025 - - (djm) Added WARNING.RNG file and modified configure to ask users of the - builtin entropy code to read it. - - (djm) Prefer builtin regex to PCRE. - - (bal) Added USE_PIPS defined to NeXT configure.in since scp hangs randomly. - - (bal) Apply fixes to configure.in pointed out by Pavel Roskin - - -20001020 - - (djm) Don't define _REENTRANT for SNI/Reliant Unix - - (bal) Imported NEWS-OS waitpid() macros into NeXT. Since implementation - is more correct then current version. - -20001018 - - (stevesk) Add initial support for setproctitle(). Current - support is for the HP-UX pstat(PSTAT_SETCMD, ...) method. - - (stevesk) Add egd startup scripts to contrib/hpux/ - -20001017 - - (djm) Add -lregex to cywin libs from Corinna Vinschen - - - (djm) Don't rely on atomicio's retval to determine length of askpass - supplied passphrase. Problem report from Lutz Jaenicke - - - (bal) Changed from GNU rx to PCRE on suggestion from djm. - - (bal) Integrated Sony NEWS-OS patches from NAKAJI Hirouyuki - - -20001016 - - (djm) Sync with OpenBSD: - - markus@cvs.openbsd.org 2000/10/14 04:01:15 - [cipher.c] - debug3 - - markus@cvs.openbsd.org 2000/10/14 04:07:23 - [scp.c] - remove spaces from arguments; from djm@mindrot.org - - markus@cvs.openbsd.org 2000/10/14 06:09:46 - [ssh.1] - Cipher is for SSH-1 only - - markus@cvs.openbsd.org 2000/10/14 06:12:09 - [servconf.c servconf.h serverloop.c session.c sshd.8] - AllowTcpForwarding; from naddy@ - - markus@cvs.openbsd.org 2000/10/14 06:16:56 - [auth2.c compat.c compat.h sshconnect2.c version.h] - OpenSSH_2.3; note that is is not complete, but the version number - needs to be changed for interoperability reasons - - markus@cvs.openbsd.org 2000/10/14 06:19:45 - [auth-rsa.c] - do not send RSA challenge if key is not allowed by key-options; from - eivind@ThinkSec.com - - markus@cvs.openbsd.org 2000/10/15 08:14:01 - [rijndael.c session.c] - typos; from stevesk@sweden.hp.com - - markus@cvs.openbsd.org 2000/10/15 08:18:31 - [rijndael.c] - typo - - (djm) Copy manpages back over from OpenBSD - too tedious to wade - through diffs - - (djm) Added condrestart to Redhat init script. Patch from Pekka Savola - - - (djm) Update version in Redhat spec file - - (djm) Merge some of Nalin Dahyabhai changes from the - Redhat 7.0 spec file - - (djm) Make inability to read/write PRNG seedfile non-fatal - - -20001015 - - (djm) Fix ssh2 hang on background processes at logout. - -20001014 - - (bal) Add support for realpath and getcwd for platforms with broken - or missing realpath implementations for sftp-server. - - (bal) Corrected mistake in INSTALL in regards to GNU rx library - - (bal) Add support for GNU rx library for those lacking regexp support - - (djm) Don't accept PAM_PROMPT_ECHO_ON messages during initial auth - - (djm) Revert SSH2 serverloop hack, will find a better way. - - (djm) Add workaround for Linux 2.4's gratuitious errno change. Patch - from Martin Johansson - - (djm) Big OpenBSD sync: - - markus@cvs.openbsd.org 2000/09/30 10:27:44 - [log.c] - allow loglevel debug - - markus@cvs.openbsd.org 2000/10/03 11:59:57 - [packet.c] - hmac->mac - - markus@cvs.openbsd.org 2000/10/03 12:03:03 - [auth-krb4.c auth-passwd.c auth-rh-rsa.c auth-rhosts.c auth-rsa.c auth1.c] - move fake-auth from auth1.c to individual auth methods, disables s/key in - debug-msg - - markus@cvs.openbsd.org 2000/10/03 12:16:48 - ssh.c - do not resolve canonname, i have no idea why this was added oin ossh - - markus@cvs.openbsd.org 2000/10/09 15:30:44 - ssh-keygen.1 ssh-keygen.c - -X now reads private ssh.com DSA keys, too. - - markus@cvs.openbsd.org 2000/10/09 15:32:34 - auth-options.c - clear options on every call. - - markus@cvs.openbsd.org 2000/10/09 15:51:00 - authfd.c authfd.h - interop with ssh-agent2, from - - markus@cvs.openbsd.org 2000/10/10 14:20:45 - compat.c - use rexexp for version string matching - - provos@cvs.openbsd.org 2000/10/10 22:02:18 - [kex.c kex.h myproposal.h ssh.h ssh2.h sshconnect2.c sshd.c dh.c dh.h] - First rough implementation of the diffie-hellman group exchange. The - client can ask the server for bigger groups to perform the diffie-hellman - in, thus increasing the attack complexity when using ciphers with longer - keys. University of Windsor provided network, T the company. - - markus@cvs.openbsd.org 2000/10/11 13:59:52 - [auth-rsa.c auth2.c] - clear auth options unless auth sucessfull - - markus@cvs.openbsd.org 2000/10/11 14:00:27 - [auth-options.h] - clear auth options unless auth sucessfull - - markus@cvs.openbsd.org 2000/10/11 14:03:27 - [scp.1 scp.c] - support 'scp -o' with help from mouring@pconline.com - - markus@cvs.openbsd.org 2000/10/11 14:11:35 - [dh.c] - Wall - - markus@cvs.openbsd.org 2000/10/11 14:14:40 - [auth.h auth2.c readconf.c readconf.h readpass.c servconf.c servconf.h] - [ssh.h sshconnect2.c sshd_config auth2-skey.c cli.c cli.h] - add support for s/key (kbd-interactive) to ssh2, based on work by - mkiernan@avantgo.com and me - - markus@cvs.openbsd.org 2000/10/11 14:27:24 - [auth.c auth1.c auth2.c authfile.c cipher.c cipher.h kex.c kex.h] - [myproposal.h packet.c readconf.c session.c ssh.c ssh.h sshconnect1.c] - [sshconnect2.c sshd.c] - new cipher framework - - markus@cvs.openbsd.org 2000/10/11 14:45:21 - [cipher.c] - remove DES - - markus@cvs.openbsd.org 2000/10/12 03:59:20 - [cipher.c cipher.h sshconnect1.c sshconnect2.c sshd.c] - enable DES in SSH-1 clients only - - markus@cvs.openbsd.org 2000/10/12 08:21:13 - [kex.h packet.c] - remove unused - - markus@cvs.openbsd.org 2000/10/13 12:34:46 - [sshd.c] - Kludge for F-Secure Macintosh < 1.0.2; appro@fy.chalmers.se - - markus@cvs.openbsd.org 2000/10/13 12:59:15 - [cipher.c cipher.h myproposal.h rijndael.c rijndael.h] - rijndael/aes support - - markus@cvs.openbsd.org 2000/10/13 13:10:54 - [sshd.8] - more info about -V - - markus@cvs.openbsd.org 2000/10/13 13:12:02 - [myproposal.h] - prefer no compression - - (djm) Fix scp user@host handling - - (djm) Don't clobber ssh_prng_cmds on install - - (stevesk) Include config.h in rijndael.c so we define intXX_t and - u_intXX_t types on all platforms. - - (stevesk) rijndael.c: cleanup missing declaration warnings. - - (stevesk) ~/.hushlogin shouldn't cause required password change to - be bypassed. - - (stevesk) Display correct path to ssh-askpass in configure output. - Report from Lutz Jaenicke. - -20001007 - - (stevesk) Print PAM return value in PAM log messages to aid - with debugging. - - (stevesk) Fix detection of pw_class struct member in configure; - patch from KAMAHARA Junzo - -20001002 - - (djm) Fix USER_PATH, report from Kevin Steves - - (djm) Add host system and CC to end-of-configure report. Suggested by - Lutz Jaenicke - -20000931 - - (djm) Cygwin fixes from Corinna Vinschen - -20000930 - - (djm) Irix ssh_prng_cmds path fix from Pekka Savola - - (djm) Support in bsd-snprintf.c for long long conversions from - Ben Lindstrom - - (djm) Cleanup NeXT support from Ben Lindstrom - - (djm) Ignore SIGPIPEs from serverloop to child. Fixes crashes with - very short lived X connections. Bug report from Tobias Oetiker - . Fix from Markus Friedl - - (djm) Add recent InitScripts as a RPM dependancy for openssh-server - patch from Pekka Savola - - (djm) Forgot to cvs add LICENSE file - - (djm) Add LICENSE to RPM spec files - - (djm) CVS OpenBSD sync: - - markus@cvs.openbsd.org 2000/09/26 13:59:59 - [clientloop.c] - use debug2 - - markus@cvs.openbsd.org 2000/09/27 15:41:34 - [auth2.c sshconnect2.c] - use key_type() - - markus@cvs.openbsd.org 2000/09/28 12:03:18 - [channels.c] - debug -> debug2 cleanup - - (djm) Irix strips "/dev/tty" from [uw]tmp entries (other systems only - strip "/dev/"). Fix loginrec.c based on patch from Alain St-Denis - - - (djm) Fix 9 character passphrase failure with gnome-ssh-askpass. - Problem was caused by interrupted read in ssh-add. Report from Donald - J. Barry - -20000929 - - (djm) Fix SSH2 not terminating until all background tasks done problem. - - (djm) Another off-by-one fix from Pavel Kankovsky - - - (djm) Clean up. Strip some unnecessary differences with OpenBSD's code, - tidy necessary differences. Use Markus' new debugN() in entropy.c - - (djm) Merged big SCO portability patch from Tim Rice - - -20000926 - - (djm) Update X11-askpass to 1.0.2 in RPM spec file - - (djm) Define _REENTRANT to pickup strtok_r() on HP/UX - - (djm) Security: fix off-by-one buffer overrun in fake-getnameinfo.c. - Report and fix from Pavel Kankovsky - -20000924 - - (djm) Merged cleanup patch from Mark Miller - - (djm) A bit more cleanup - created cygwin_util.h - - (djm) Include strtok_r() from OpenBSD libc. Fixes report from Mark Miller - - -20000923 - - (djm) Fix address logging in utmp from Kevin Steves - - - (djm) Redhat spec and manpage fixes from Pekka Savola - - (djm) Seperate tests for int64_t and u_int64_t types - - (djm) Tweak password expiry checking at suggestion of Kevin Steves - - - (djm) NeXT patch from Ben Lindstrom - - (djm) Use printf %lld instead of %qd in sftp-server.c. Fix from - Michael Stone - - (djm) OpenBSD CVS sync: - - markus@cvs.openbsd.org 2000/09/17 09:38:59 - [sshconnect2.c sshd.c] - fix DEBUG_KEXDH - - markus@cvs.openbsd.org 2000/09/17 09:52:51 - [sshconnect.c] - yes no; ok niels@ - - markus@cvs.openbsd.org 2000/09/21 04:55:11 - [sshd.8] - typo - - markus@cvs.openbsd.org 2000/09/21 05:03:54 - [serverloop.c] - typo - - markus@cvs.openbsd.org 2000/09/21 05:11:42 - scp.c - utime() to utimes(); mouring@pconline.com - - markus@cvs.openbsd.org 2000/09/21 05:25:08 - sshconnect2.c - change login logic in ssh2, allows plugin of other auth methods - - markus@cvs.openbsd.org 2000/09/21 05:25:35 - [auth2.c channels.c channels.h clientloop.c dispatch.c dispatch.h] - [serverloop.c] - add context to dispatch_run - - markus@cvs.openbsd.org 2000/09/21 05:07:52 - authfd.c authfd.h ssh-agent.c - bug compat for old ssh.com software - -20000920 - - (djm) Fix bad path substitution. Report from Andrew Miner - - -20000916 - - (djm) Fix SSL search order from Lutz Jaenicke - - - (djm) New SuSE spec from Corinna Vinschen - - (djm) Update CygWin support from Corinna Vinschen - - (djm) Use a real struct sockaddr inside the fake struct sockaddr_storage. - Patch from Larry Jones - - (djm) Add Steve VanDevender's PAM - password change patch. - - (djm) Bring licenses on my stuff in line with OpenBSD's - - (djm) Cleanup auth-passwd.c and unify HP/UX authentication. Patch from - Kevin Steves - - (djm) Shadow expiry check fix from Pavel Troller - - (djm) Re-enable int64_t types - we need them for sftp - - (djm) Use libexecdir from configure , rather than libexecdir/ssh - - (djm) Update Redhat SPEC file accordingly - - (djm) Add Kevin Steves HP/UX contrib files - - (djm) Add Charles Levert getpgrp patch - - (djm) Fix password auth on HP/UX 10.20. Patch from Dirk De Wachter - - - (djm) Fixprogs and entropy list fixes from Larry Jones - - - (djm) Fix for SuSE spec file from Takashi YOSHIDA - - - (djm) Merge OpenBSD changes: - - markus@cvs.openbsd.org 2000/09/05 02:59:57 - [session.c] - print hostname (not hushlogin) - - markus@cvs.openbsd.org 2000/09/05 13:18:48 - [authfile.c ssh-add.c] - enable ssh-add -d for DSA keys - - markus@cvs.openbsd.org 2000/09/05 13:20:49 - [sftp-server.c] - cleanup - - markus@cvs.openbsd.org 2000/09/06 03:46:41 - [authfile.h] - prototype - - deraadt@cvs.openbsd.org 2000/09/07 14:27:56 - [ALL] - cleanup copyright notices on all files. I have attempted to be - accurate with the details. everything is now under Tatu's licence - (which I copied from his readme), and/or the core-sdi bsd-ish thing - for deattack, or various openbsd developers under a 2-term bsd - licence. We're not changing any rules, just being accurate. - - markus@cvs.openbsd.org 2000/09/07 14:40:30 - [channels.c channels.h clientloop.c serverloop.c ssh.c] - cleanup window and packet sizes for ssh2 flow control; ok niels - - markus@cvs.openbsd.org 2000/09/07 14:53:00 - [scp.c] - typo - - markus@cvs.openbsd.org 2000/09/07 15:13:37 - [auth-options.c auth-options.h auth-rh-rsa.c auth-rsa.c auth.c] - [authfile.h canohost.c channels.h compat.c hostfile.h log.c match.h] - [pty.c readconf.c] - some more Copyright fixes - - markus@cvs.openbsd.org 2000/09/08 03:02:51 - [README.openssh2] - bye bye - - deraadt@cvs.openbsd.org 2000/09/11 18:38:33 - [LICENCE cipher.c] - a few more comments about it being ARC4 not RC4 - - markus@cvs.openbsd.org 2000/09/12 14:53:11 - [log-client.c log-server.c log.c ssh.1 ssh.c ssh.h sshd.8 sshd.c] - multiple debug levels - - markus@cvs.openbsd.org 2000/09/14 14:25:15 - [clientloop.c] - typo - - deraadt@cvs.openbsd.org 2000/09/15 01:13:51 - [ssh-agent.c] - check return value for setenv(3) for failure, and deal appropriately - -20000913 - - (djm) Fix server not exiting with jobs in background. - -20000905 - - (djm) Import OpenBSD CVS changes - - markus@cvs.openbsd.org 2000/08/31 15:52:24 - [Makefile sshd.8 sshd_config sftp-server.8 sftp-server.c] - implement a SFTP server. interops with sftp2, scp2 and the windows - client from ssh.com - - markus@cvs.openbsd.org 2000/08/31 15:56:03 - [README.openssh2] - sync - - markus@cvs.openbsd.org 2000/08/31 16:05:42 - [session.c] - Wall - - markus@cvs.openbsd.org 2000/08/31 16:09:34 - [authfd.c ssh-agent.c] - add a flag to SSH2_AGENTC_SIGN_REQUEST for future extensions - - deraadt@cvs.openbsd.org 2000/09/01 09:25:13 - [scp.1 scp.c] - cleanup and fix -S support; stevesk@sweden.hp.com - - markus@cvs.openbsd.org 2000/09/01 16:29:32 - [sftp-server.c] - portability fixes - - markus@cvs.openbsd.org 2000/09/01 16:32:41 - [sftp-server.c] - fix cast; mouring@pconline.com - - itojun@cvs.openbsd.org 2000/09/03 09:23:28 - [ssh-add.1 ssh.1] - add missing .El against .Bl. - - markus@cvs.openbsd.org 2000/09/04 13:03:41 - [session.c] - missing close; ok theo - - markus@cvs.openbsd.org 2000/09/04 13:07:21 - [session.c] - fix get_last_login_time order; from andre@van-veen.de - - markus@cvs.openbsd.org 2000/09/04 13:10:09 - [sftp-server.c] - more cast fixes; from mouring@pconline.com - - markus@cvs.openbsd.org 2000/09/04 13:06:04 - [session.c] - set SSH_ORIGINAL_COMMAND; from Leakin@dfw.nostrum.com, bet@rahul.net - - (djm) Cleanup after import. Fix sftp-server compilation, Makefile - - (djm) Merge cygwin support from Corinna Vinschen - -20000903 - - (djm) Fix Redhat init script - -20000901 - - (djm) Pick up Jim's new X11-askpass - - (djm) Release 2.2.0p1 - -20000831 - - (djm) Workaround SIGPIPE problems on SCO. Fix from Aran Cox - - - (djm) Pick up new version (2.2.0) from OpenBSD CVS - -20000830 - - (djm) Compile warning fixes from Mark Miller - - (djm) Periodically rekey arc4random - - (djm) Clean up diff against OpenBSD. - - (djm) HPUX 11 needs USE_PIPES as well: Kevin Steves - - - (djm) Quieten the pam delete credentials error message - - (djm) Fix printing of $DISPLAY hack if set by system type. Report from - Kevin Steves - - (djm) NeXT patch from Ben Lindstrom - - (djm) Fix doh in bsd-arc4random.c - -20000829 - - (djm) Fix ^C ignored issue on Solaris. Diagnosis from Gert - Doering , John Horne and - Garrick James - - (djm) Check for SCO pty naming style (ptyp%d/ttyp%d). Based on fix from - Bastian Trompetter - - (djm) NeXT tweaks from Ben Lindstrom - - More OpenBSD updates: - - deraadt@cvs.openbsd.org 2000/08/24 15:46:59 - [scp.c] - off_t in sink, to fix files > 2GB, i think, test is still running ;-) - - deraadt@cvs.openbsd.org 2000/08/25 10:10:06 - [session.c] - Wall - - markus@cvs.openbsd.org 2000/08/26 04:33:43 - [compat.c] - ssh.com-2.3.0 - - markus@cvs.openbsd.org 2000/08/27 12:18:05 - [compat.c] - compatibility with future ssh.com versions - - deraadt@cvs.openbsd.org 2000/08/27 21:50:55 - [auth-krb4.c session.c ssh-add.c sshconnect.c uidswap.c] - print uid/gid as unsigned - - markus@cvs.openbsd.org 2000/08/28 13:51:00 - [ssh.c] - enable -n and -f for ssh2 - - markus@cvs.openbsd.org 2000/08/28 14:19:53 - [ssh.c] - allow combination of -N and -f - - markus@cvs.openbsd.org 2000/08/28 14:20:56 - [util.c] - util.c - - markus@cvs.openbsd.org 2000/08/28 14:22:02 - [util.c] - undo - - markus@cvs.openbsd.org 2000/08/28 14:23:38 - [util.c] - don't complain if setting NONBLOCK fails with ENODEV - -20000823 - - (djm) Define USE_PIPES to avoid socketpair problems on HPUX 10 and SunOS 4 - Avoids "scp never exits" problem. Reports from Lutz Jaenicke - and Tamito KAJIYAMA - - - (djm) Pick up LOGIN_PROGRAM from environment or PATH if not set by headers - - (djm) Add local version to version.h - - (djm) Don't reseed arc4random everytime it is used - - (djm) OpenBSD CVS updates: - - deraadt@cvs.openbsd.org 2000/08/18 20:07:23 - [ssh.c] - accept remsh as a valid name as well; roman@buildpoint.com - - deraadt@cvs.openbsd.org 2000/08/18 20:17:13 - [deattack.c crc32.c packet.c] - rename crc32() to ssh_crc32() to avoid zlib name clash. do not move to - libz crc32 function yet, because it has ugly "long"'s in it; - oneill@cs.sfu.ca - - deraadt@cvs.openbsd.org 2000/08/18 20:26:08 - [scp.1 scp.c] - -S prog support; tv@debian.org - - deraadt@cvs.openbsd.org 2000/08/18 20:50:07 - [scp.c] - knf - - deraadt@cvs.openbsd.org 2000/08/18 20:57:33 - [log-client.c] - shorten - - markus@cvs.openbsd.org 2000/08/19 12:48:11 - [channels.c channels.h clientloop.c ssh.c ssh.h] - support for ~. in ssh2 - - deraadt@cvs.openbsd.org 2000/08/19 15:29:40 - [crc32.h] - proper prototype - - markus@cvs.openbsd.org 2000/08/19 15:34:44 - [authfd.c authfd.h key.c key.h ssh-add.1 ssh-add.c ssh-agent.1] - [ssh-agent.c ssh-keygen.c sshconnect1.c sshconnect2.c Makefile] - [fingerprint.c fingerprint.h] - add SSH2/DSA support to the agent and some other DSA related cleanups. - (note that we cannot talk to ssh.com's ssh2 agents) - - markus@cvs.openbsd.org 2000/08/19 15:55:52 - [channels.c channels.h clientloop.c] - more ~ support for ssh2 - - markus@cvs.openbsd.org 2000/08/19 16:21:19 - [clientloop.c] - oops - - millert@cvs.openbsd.org 2000/08/20 12:25:53 - [session.c] - We have to stash the result of get_remote_name_or_ip() before we - close our socket or getpeername() will get EBADF and the process - will exit. Only a problem for "UseLogin yes". - - millert@cvs.openbsd.org 2000/08/20 12:30:59 - [session.c] - Only check /etc/nologin if "UseLogin no" since login(1) may have its - own policy on determining who is allowed to login when /etc/nologin - is present. Also use the _PATH_NOLOGIN define. - - millert@cvs.openbsd.org 2000/08/20 12:42:43 - [auth1.c auth2.c session.c ssh.c] - Add calls to setusercontext() and login_get*(). We basically call - setusercontext() in most places where previously we did a setlogin(). - Add default login.conf file and put root in the "daemon" login class. - - millert@cvs.openbsd.org 2000/08/21 10:23:31 - [session.c] - Fix incorrect PATH setting; noted by Markus. - -20000818 - - (djm) OpenBSD CVS changes: - - markus@cvs.openbsd.org 2000/07/22 03:14:37 - [servconf.c servconf.h sshd.8 sshd.c sshd_config] - random early drop; ok theo, niels - - deraadt@cvs.openbsd.org 2000/07/26 11:46:51 - [ssh.1] - typo - - deraadt@cvs.openbsd.org 2000/08/01 11:46:11 - [sshd.8] - many fixes from pepper@mail.reppep.com - - provos@cvs.openbsd.org 2000/08/01 13:01:42 - [Makefile.in util.c aux.c] - rename aux.c to util.c to help with cygwin port - - deraadt@cvs.openbsd.org 2000/08/02 00:23:31 - [authfd.c] - correct sun_len; Alexander@Leidinger.net - - provos@cvs.openbsd.org 2000/08/02 10:27:17 - [readconf.c sshd.8] - disable kerberos authentication by default - - provos@cvs.openbsd.org 2000/08/02 11:27:05 - [sshd.8 readconf.c auth-krb4.c] - disallow kerberos authentication if we can't verify the TGT; from - dugsong@ - kerberos authentication is on by default only if you have a srvtab. - - markus@cvs.openbsd.org 2000/08/04 14:30:07 - [auth.c] - unused - - markus@cvs.openbsd.org 2000/08/04 14:30:35 + In sc_put_key(), sc_reader_id should be id. + - markus@cvs.openbsd.org 2002/03/21 20:51:12 [sshd_config] - MaxStartups - - markus@cvs.openbsd.org 2000/08/15 13:20:46 - [authfd.c] - cleanup; ok niels@ - - markus@cvs.openbsd.org 2000/08/17 14:05:10 - [session.c] - cleanup login(1)-like jobs, no duplicate utmp entries - - markus@cvs.openbsd.org 2000/08/17 14:06:34 - [session.c sshd.8 sshd.c] - sshd -u len, similar to telnetd - - (djm) Lastlog was not getting closed after writing login entry - - (djm) Add Solaris package support from Rip Loomis - -20000816 - - (djm) Replacement for inet_ntoa for Irix (which breaks on gcc) - - (djm) Fix strerror replacement for old SunOS. Based on patch from - Charles Levert - - (djm) Seperate arc4random into seperate file and use OpenSSL's RC4 - implementation. - - (djm) SUN_LEN macro for systems which lack it - -20000815 - - (djm) More SunOS 4.1.x fixes from Nate Itkin - - (djm) Avoid failures on Irix when ssh is not setuid. Fix from - Michael Stone - - (djm) Don't seek in directory based lastlogs - - (djm) Fix --with-ipaddr-display configure option test. Patch from - Jarno Huuskonen - - (djm) Fix AIX limits from Alexandre Oliva - -20000813 - - (djm) Add $(srcdir) to includes when compiling (for VPATH). Report from - Fabrice bacchella - -20000809 - - (djm) Define AIX hard limits if headers don't. Report from - Bill Painter - - (djm) utmp direct write & SunOS 4 patch from Charles Levert - - -20000808 - - (djm) Cleanup Redhat RPMs. Generate keys at runtime rather than install - time, spec file cleanup. - -20000807 - - (djm) Set 0755 on binaries during install. Report from Lutz Jaenicke - - (djm) Suppress error messages on channel close shutdown() failurs - works around Linux bug. Patch from Zack Weinberg - - (djm) Add some more entropy collection commands from Lutz Jaenicke - -20000725 - - (djm) Fix autoconf typo: HAVE_BINRESVPORT_AF -> HAVE_BINDRESVPORT_AF - -20000721 - - (djm) OpenBSD CVS updates: - - markus@cvs.openbsd.org 2000/07/16 02:27:22 - [authfd.c authfd.h channels.c clientloop.c ssh-add.c ssh-agent.c ssh.c] - [sshconnect1.c sshconnect2.c] - make ssh-add accept dsa keys (the agent does not) - - djm@cvs.openbsd.org 2000/07/17 19:25:02 - [sshd.c] - Another closing of stdin; ok deraadt - - markus@cvs.openbsd.org 2000/07/19 18:33:12 - [dsa.c] - missing free, reorder - - markus@cvs.openbsd.org 2000/07/20 16:23:14 - [ssh-keygen.1] - document input and output files - -20000720 - - (djm) Spec file fix from Petr Novotny - -20000716 - - (djm) Release 2.1.1p4 - -20000715 - - (djm) OpenBSD CVS updates - - provos@cvs.openbsd.org 2000/07/13 16:53:22 - [aux.c readconf.c servconf.c ssh.h] - allow multiple whitespace but only one '=' between tokens, bug report from - Ralf S. Engelschall but different fix. okay deraadt@ - - provos@cvs.openbsd.org 2000/07/13 17:14:09 + add privsep (off) + - markus@cvs.openbsd.org 2002/03/21 21:23:34 + [sshd.c] + add privsep_preauth() and remove 1 goto; ok provos@ + - rees@cvs.openbsd.org 2002/03/21 21:54:34 + [scard.c scard.h ssh-keygen.c] + Add PIN-protection for secret key. + - rees@cvs.openbsd.org 2002/03/21 22:44:05 + [authfd.c authfd.h ssh-add.c ssh-agent.c ssh.c] + Add PIN-protection for secret key. + - markus@cvs.openbsd.org 2002/03/21 23:07:37 [clientloop.c] - typo; todd@fries.net - - provos@cvs.openbsd.org 2000/07/13 17:19:31 - [scp.c] - close can fail on AFS, report error; from Greg Hudson - - markus@cvs.openbsd.org 2000/07/14 16:59:46 - [readconf.c servconf.c] - allow leading whitespace. ok niels - - djm@cvs.openbsd.org 2000/07/14 22:01:38 - [ssh-keygen.c ssh.c] - Always create ~/.ssh with mode 700; ok Markus - - Fixes for SunOS 4.1.4 from Gordon Atwood - - Include floatingpoint.h for entropy.c - - strerror replacement - -20000712 - - (djm) Remove -lresolve for Reliant Unix - - (djm) OpenBSD CVS Updates: - - deraadt@cvs.openbsd.org 2000/07/11 02:11:34 - [session.c sshd.c ] - make MaxStartups code still work with -d; djm - - deraadt@cvs.openbsd.org 2000/07/11 13:17:45 - [readconf.c ssh_config] - disable FallBackToRsh by default - - (djm) Replace in_addr_t with u_int32_t in bsd-inet_aton.c. Report from - Ben Lindstrom - - (djm) Make building of X11-Askpass and GNOME-Askpass optional in RPM - spec file. - - (djm) Released 2.1.1p3 - -20000711 - - (djm) Fixup for AIX getuserattr() support from Tom Bertelson - - - (djm) ReliantUNIX support from Udo Schweigert - - (djm) NeXT: dirent structures to get scp working from Ben Lindstrom - - - (djm) Fix broken inet_ntoa check and ut_user/ut_name confusion, report - from Jim Watt - - (djm) Replaced bsd-snprintf.c with one from Mutt source tree, it is known - to compile on more platforms (incl NeXT). - - (djm) Added bsd-inet_aton and configure support for NeXT - - (djm) Misc NeXT fixes from Ben Lindstrom - - (djm) OpenBSD CVS updates: - - markus@cvs.openbsd.org 2000/06/26 03:22:29 - [authfd.c] - cleanup, less cut&paste - - markus@cvs.openbsd.org 2000/06/26 15:59:19 - [servconf.c servconf.h session.c sshd.8 sshd.c] - MaxStartups: limit number of unauthenticated connections, work by - theo and me - - deraadt@cvs.openbsd.org 2000/07/05 14:18:07 - [session.c] - use no_x11_forwarding_flag correctly; provos ok - - provos@cvs.openbsd.org 2000/07/05 15:35:57 - [sshd.c] - typo - - aaron@cvs.openbsd.org 2000/07/05 22:06:58 - [scp.1 ssh-agent.1 ssh-keygen.1 sshd.8] - Insert more missing .El directives. Our troff really should identify - these and spit out a warning. - - todd@cvs.openbsd.org 2000/07/06 21:55:04 - [auth-rsa.c auth2.c ssh-keygen.c] - clean code is good code - - deraadt@cvs.openbsd.org 2000/07/07 02:14:29 - [serverloop.c] - sense of port forwarding flag test was backwards - - provos@cvs.openbsd.org 2000/07/08 17:17:31 - [compat.c readconf.c] - replace strtok with strsep; from David Young - - deraadt@cvs.openbsd.org 2000/07/08 19:21:15 - [auth.h] - KNF - - ho@cvs.openbsd.org 2000/07/08 19:27:33 - [compat.c readconf.c] - Better conditions for strsep() ending. - - ho@cvs.openbsd.org 2000/07/10 10:27:05 - [readconf.c] - Get the correct message on errors. (niels@ ok) - - ho@cvs.openbsd.org 2000/07/10 10:30:25 - [cipher.c kex.c servconf.c] - strtok() --> strsep(). (niels@ ok) - - (djm) Fix problem with debug mode and MaxStartups - - (djm) Don't generate host keys when $(DESTDIR) is set (e.g. during RPM - builds) - - (djm) Add strsep function from OpenBSD libc for systems that lack it - -20000709 - - (djm) Only enable PAM_TTY kludge for Linux. Problem report from - Kevin Steves - - (djm) Match prototype and function declaration for rresvport_af. - Problem report from Niklas Edmundsson - - (djm) Missing $(DESTDIR) on host-key target causing problems with RPM - builds. Problem report from Gregory Leblanc - - (djm) Replace ut_name with ut_user. Patch from Jim Watt - - - (djm) Fix pam sprintf fix - - (djm) Cleanup entropy collection code a little more. Split initialisation - from seeding, perform intialisation immediatly at start, be careful with - uids. Based on problem report from Jim Watt - - (djm) More NeXT compatibility from Ben Lindstrom - Including sigaction() et al. replacements - - (djm) AIX getuserattr() session initialisation from Tom Bertelson - - -20000708 - - (djm) Fix bad fprintf format handling in auth-pam.c. Patch from - Aaron Hopkins - - (djm) Fix incorrect configure handling of --with-rsh-path option. Fix from - Lutz Jaenicke - - (djm) Fixed undefined variables for OSF SIA. Report from - Baars, Henk - - (djm) Handle EWOULDBLOCK returns from read() and write() in atomicio.c - Fix from Marquess, Steve Mr JMLFDC - - (djm) Don't use inet_addr. - -20000702 - - (djm) Fix brace mismatch from Corinna Vinschen - - (djm) Stop shadow expiry checking from preventing logins with NIS. Based - on fix from HARUYAMA Seigo - - (djm) Use standard OpenSSL functions in auth-skey.c. Patch from - Chris, the Young One - - (djm) Fix scp progress meter on really wide terminals. Based on patch - from James H. Cloos Jr. - -20000701 - - (djm) Fix Tru64 SIA problems reported by John P Speno - - (djm) Login fixes from Tom Bertelson - - (djm) Replace "/bin/sh" with _PATH_BSHELL. Report from Corinna Vinschen - - - (djm) Replace "/usr/bin/login" with LOGIN_PROGRAM - - (djm) Added check for broken snprintf() functions which do not correctly - terminate output string and attempt to use replacement. - - (djm) Released 2.1.1p2 - -20000628 - - (djm) Fixes to lastlog code for Irix - - (djm) Use atomicio in loginrec - - (djm) Patch from Michael Stone to add support for - Irix 6.x array sessions, project id's, and system audit trail id. - - (djm) Added 'distprep' make target to simplify packaging - - (djm) Added patch from Chris Adams to add OSF SIA - support. Enable using "USE_SIA=1 ./configure [options]" - -20000627 - - (djm) Fixes to login code - not setting li->uid, cleanups - - (djm) Formatting - -20000626 - - (djm) Better fix to aclocal tests from Garrick James - - (djm) Account expiry support from Andreas Steinmetz - - (djm) Added password expiry checking (no password change support) - - (djm) Make EGD failures non-fatal if OpenSSL's entropy pool is still OK - based on patch from Lutz Jaenicke - - (djm) Fix fixed EGD code. - - OpenBSD CVS update - - provos@cvs.openbsd.org 2000/06/25 14:17:58 - [channels.c] - correct check for bad channel ids; from Wei Dai - -20000623 - - (djm) Use sa_family_t in prototype for rresvport_af. Patch from - Svante Signell - - (djm) Autoconf logic to define sa_family_t if it is missing - - OpenBSD CVS Updates: - - markus@cvs.openbsd.org 2000/06/22 10:32:27 - [sshd.c] - missing atomicio; report from Steve.Marquess@DET.AMEDD.ARMY.MIL - - djm@cvs.openbsd.org 2000/06/22 17:55:00 - [auth-krb4.c key.c radix.c uuencode.c] - Missing CVS idents; ok markus - -20000622 - - (djm) Automatically generate host key during "make install". Suggested - by Gary E. Miller - - (djm) Paranoia before kill() system call - - OpenBSD CVS Updates: - - markus@cvs.openbsd.org 2000/06/18 18:50:11 - [auth2.c compat.c compat.h sshconnect2.c] - make userauth+pubkey interop with ssh.com-2.2.0 - - markus@cvs.openbsd.org 2000/06/18 20:56:17 - [dsa.c] - mem leak + be more paranoid in dsa_verify. - - markus@cvs.openbsd.org 2000/06/18 21:29:50 - [key.c] - cleanup fingerprinting, less hardcoded sizes - - markus@cvs.openbsd.org 2000/06/19 19:39:45 - [atomicio.c auth-options.c auth-passwd.c auth-rh-rsa.c auth-rhosts.c] - [auth-rsa.c auth-skey.c authfd.c authfd.h authfile.c bufaux.c bufaux.h] - [buffer.c buffer.h canohost.c channels.c channels.h cipher.c cipher.h] - [clientloop.c compat.c compat.h compress.c compress.h crc32.c crc32.h] - [deattack.c dispatch.c dsa.c fingerprint.c fingerprint.h getput.h hmac.c] - [kex.c log-client.c log-server.c login.c match.c mpaux.c mpaux.h nchan.c] - [nchan.h packet.c packet.h pty.c pty.h readconf.c readconf.h readpass.c] - [rsa.c rsa.h scp.c servconf.c servconf.h ssh-add.c ssh-keygen.c ssh.c] - [ssh.h tildexpand.c ttymodes.c ttymodes.h uidswap.c xmalloc.c xmalloc.h] - OpenBSD tag - - markus@cvs.openbsd.org 2000/06/21 10:46:10 - sshconnect2.c missing free; nuke old comment - -20000620 - - (djm) Replace use of '-o' and '-a' logical operators in configure tests - with '||' and '&&'. As suggested by Jim Knoble - to fix SCO Unixware problem reported by Gary E. Miller - - (djm) Typo in loginrec.c - -20000618 - - (djm) Add summary of configure options to end of ./configure run - - (djm) Not all systems define RUSAGE_SELF & RUSAGE_CHILDREN. Report from - Michael Stone - - (djm) rusage is a privileged operation on some Unices (incl. - Solaris 2.5.1). Report from Paul D. Smith - - (djm) Avoid PAM failures when running without a TTY. Report from - Martin Petrak - - (djm) Include sys/types.h when including netinet/in.h in configure tests. - Patch from Jun-ichiro itojun Hagino - - (djm) Started merge of Ben Lindstrom's NeXT support - - OpenBSD CVS updates: - - deraadt@cvs.openbsd.org 2000/06/17 09:58:46 - [channels.c] - everyone says "nix it" (remove protocol 2 debugging message) - - markus@cvs.openbsd.org 2000/06/17 13:24:34 - [sshconnect.c] - allow extended server banners - - markus@cvs.openbsd.org 2000/06/17 14:30:10 - [sshconnect.c] - missing atomicio, typo - - jakob@cvs.openbsd.org 2000/06/17 16:52:34 - [servconf.c servconf.h session.c sshd.8 sshd_config] - add support for ssh v2 subsystems. ok markus@. - - deraadt@cvs.openbsd.org 2000/06/17 18:57:48 - [readconf.c servconf.c] - include = in WHITESPACE; markus ok - - markus@cvs.openbsd.org 2000/06/17 19:09:10 - [auth2.c] - implement bug compatibility with ssh-2.0.13 pubkey, server side - - markus@cvs.openbsd.org 2000/06/17 21:00:28 - [compat.c] - initial support for ssh.com's 2.2.0 - - markus@cvs.openbsd.org 2000/06/17 21:16:09 - [scp.c] - typo - - markus@cvs.openbsd.org 2000/06/17 22:05:02 - [auth-rsa.c auth2.c serverloop.c session.c auth-options.c auth-options.h] - split auth-rsa option parsing into auth-options - add options support to authorized_keys2 - - markus@cvs.openbsd.org 2000/06/17 22:42:54 - [session.c] - typo - -20000613 - - (djm) Fixes from Andrew McGill : - - Platform define for SCO 3.x which breaks on /dev/ptmx - - Detect and try to fix missing MAXPATHLEN - - (djm) Fix short copy in loginrec.c (based on patch from Phill Camp - - -20000612 - - (djm) Glob manpages in RPM spec files to catch compressed files - - (djm) Full license in auth-pam.c - - (djm) Configure fixes from SAKAI Kiyotaka - - (andre) AIX, lastlog, configure fixes from Tom Bertelson : - - Don't try to retrieve lastlog from wtmp/wtmpx if DISABLE_LASTLOG is - def'd - - Set AIX to use preformatted manpages - -20000610 - - (djm) Minor doc tweaks - - (djm) Fix for configure on bash2 from Jim Knoble - -20000609 - - (djm) Patch from Kenji Miyake to disable utmp usage - (in favour of utmpx) on Solaris 8 - -20000606 - - (djm) Cleanup of entropy.c. Reorganised code, removed second pass through - list of commands (by default). Removed verbose debugging (by default). - - (djm) Increased command entropy estimates and default entropy collection - timeout - - (djm) Remove duplicate headers from loginrec.c - - (djm) Don't add /usr/local/lib to library search path on Irix - - (djm) Fix rsh path in RPMs. Report from Jason L Tibbitts III - - - (djm) Warn user if grabs fail in GNOME askpass. Patch from Zack Weinberg - - - (djm) OpenBSD CVS updates: - - todd@cvs.openbsd.org - [sshconnect2.c] - teach protocol v2 to count login failures properly and also enable an - explanation of why the password prompt comes up again like v1; this is NOT - crypto - - markus@cvs.openbsd.org - [readconf.c readconf.h servconf.c servconf.h session.c ssh.1 ssh.c sshd.8] - xauth_location support; pr 1234 - [readconf.c sshconnect2.c] - typo, unused - [session.c] - allow use_login only for login sessions, otherwise remote commands are - execed with uid==0 - [sshd.8] - document UseLogin better - [version.h] - OpenSSH 2.1.1 - [auth-rsa.c] - fix match_hostname() logic for auth-rsa: deny access if we have a - negative match or no match at all - [channels.c hostfile.c match.c] - don't panic if mkdtemp fails for authfwd; jkb@yahoo-inc.com via - kris@FreeBSD.org - -20000606 - - (djm) Added --with-cflags, --with-ldflags and --with-libs options to - configure. - -20000604 - - Configure tweaking for new login code on Irix 5.3 - - (andre) login code changes based on djm feedback - -20000603 - - (andre) New login code - - Remove bsd-login.[ch] and all the OpenBSD-derived code in login.c - - Add loginrec.[ch], logintest.c and autoconf code - -20000531 - - Cleanup of auth.c, login.c and fake-* - - Cleanup of auth-pam.c, save and print "account expired" error messages - - Fix EGD read bug by IWAMURO Motonori - - Rewrote bsd-login to use proper utmp API if available. Major cleanup - of fallback DIY code. - -20000530 - - Define atexit for old Solaris - - Fix buffer overrun in login.c for systems which use syslen in utmpx. - patch from YOSHIFUJI Hideaki - - OpenBSD CVS updates: - - markus@cvs.openbsd.org - [session.c] - make x11-fwd work w/ localhost (xauth add host/unix:11) - [cipher.c compat.c readconf.c servconf.c] - check strtok() != NULL; ok niels@ - [key.c] - fix key_read() for uuencoded keys w/o '=' - [serverloop.c] - group ssh1 vs. ssh2 in serverloop - [kex.c kex.h myproposal.h sshconnect2.c sshd.c] - split kexinit/kexdh, factor out common code - [readconf.c ssh.1 ssh.c] - forwardagent defaults to no, add ssh -A - - theo@cvs.openbsd.org - [session.c] - just some line shortening - - Released 2.1.0p3 - -20000520 - - Xauth fix from Markus Friedl - - Don't touch utmp if USE_UTMPX defined - - SunOS 4.x support from Todd C. Miller - - SIGCHLD fix for AIX and HPUX from Tom Bertelson - - HPUX and Configure fixes from Lutz Jaenicke - - - Use mkinstalldirs script to make directories instead of non-portable - "install -d". Suggested by Lutz Jaenicke - - Doc cleanup - -20000518 - - Include Andre Lucas' fixprogs script. Forgot to "cvs add" it yesterday - - OpenBSD CVS updates: - - markus@cvs.openbsd.org - [sshconnect.c] - copy only ai_addrlen bytes; misiek@pld.org.pl - [auth.c] - accept an empty shell in authentication; bug reported by - chris@tinker.ucr.edu - [serverloop.c] - we don't have stderr for interactive terminal sessions (fcntl errors) - -20000517 - - Fix from Andre Lucas - - Fixes command line printing segfaults (spotter: Bladt Norbert) - - Fixes erroneous printing of debug messages to syslog - - Fixes utmp for MacOS X (spotter: Aristedes Maniatis) - - Gives useful error message if PRNG initialisation fails - - Reduced ssh startup delay - - Measures cumulative command time rather than the time between reads - after select() - - 'fixprogs' perl script to eliminate non-working entropy commands, and - optionally run 'ent' to measure command entropy - - Applied Tom Bertelson's AIX authentication fix - - Avoid WCOREDUMP complation errors for systems that lack it - - Avoid SIGCHLD warnings from entropy commands - - Fix HAVE_PAM_GETENVLIST setting from Simon Wilkinson - - OpenBSD CVS update: - - markus@cvs.openbsd.org - [ssh.c] - fix usage() - [ssh2.h] - draft-ietf-secsh-architecture-05.txt - [ssh.1] - document ssh -T -N (ssh2 only) - [channels.c serverloop.c ssh.h sshconnect.c sshd.c aux.c] - enable nonblocking IO for sshd w/ proto 1, too; split out common code - [aux.c] - missing include - - Several patches from SAKAI Kiyotaka - - INSTALL typo and URL fix - - Makefile fix - - Solaris fixes - - Checking for ssize_t and memmove. Based on patch from SAKAI Kiyotaka - - - RSAless operation patch from kevin_oconnor@standardandpoors.com - - Detect OpenSSL seperatly from RSA - - Better test for RSA (more compatible with RSAref). Based on work by - Ed Eden - -20000513 - - Fix for non-recognised DSA keys from Arkadiusz Miskiewicz - - -20000511 - - Fix for prng_seed permissions checking from Lutz Jaenicke - - - "make host-key" fix for Irix - -20000509 - - OpenBSD CVS update - - markus@cvs.openbsd.org - [cipher.h myproposal.h readconf.c readconf.h servconf.c ssh.1 ssh.c] - [ssh.h sshconnect1.c sshconnect2.c sshd.8] - - complain about invalid ciphers in SSH1 (e.g. arcfour is SSH2 only) - - hugh@cvs.openbsd.org - [ssh.1] - - zap typo - [ssh-keygen.1] - - One last nit fix. (markus approved) - [sshd.8] - - some markus certified spelling adjustments - - markus@cvs.openbsd.org - [auth2.c channels.c clientloop.c compat compat.h dsa.c kex.c] - [sshconnect2.c ] - - bug compat w/ ssh-2.0.13 x11, split out bugs - [nchan.c] - - no drain if ibuf_empty, fixes x11fwd problems; tests by fries@ - [ssh-keygen.c] - - handle escapes in real and original key format, ok millert@ - [version.h] - - OpenSSH-2.1 - - Moved all the bsd-* and fake-* stuff into new libopenbsd-compat.a - - Doc updates - - Cleanup of bsd-base64 headers, bugfix definitions of __b64_*. Reported - by Andre Lucas - -20000508 - - Makefile and RPM spec fixes - - Generate DSA host keys during "make key" or RPM installs - - OpenBSD CVS update - - markus@cvs.openbsd.org - [clientloop.c sshconnect2.c] - - make x11-fwd interop w/ ssh-2.0.13 - [README.openssh2] - - interop w/ SecureFX - - Release 2.0.0beta2 - - - Configure caching and cleanup patch from Andre Lucas' - - -20000507 - - Remove references to SSLeay. - - Big OpenBSD CVS update - - markus@cvs.openbsd.org - [clientloop.c] - - typo - [session.c] - - update proctitle on pty alloc/dealloc, e.g. w/ windows client - [session.c] - - update proctitle for proto 1, too - [channels.h nchan.c serverloop.c session.c sshd.c] - - use c-style comments - - deraadt@cvs.openbsd.org - [scp.c] - - more atomicio - - markus@cvs.openbsd.org - [channels.c] - - set O_NONBLOCK - [ssh.1] - - update AUTHOR - [readconf.c ssh-keygen.c ssh.h] - - default DSA key file ~/.ssh/id_dsa - [clientloop.c] - - typo, rm verbose debug - - deraadt@cvs.openbsd.org - [ssh-keygen.1] - - document DSA use of ssh-keygen - [sshd.8] - - a start at describing what i understand of the DSA side - [ssh-keygen.1] - - document -X and -x - [ssh-keygen.c] - - simplify usage - - markus@cvs.openbsd.org - [sshd.8] - - there is no rhosts_dsa - [ssh-keygen.1] - - document -y, update -X,-x - [nchan.c] - - fix close for non-open ssh1 channels - [servconf.c servconf.h ssh.h sshd.8 sshd.c ] - - s/DsaKey/HostDSAKey/, document option - [sshconnect2.c] - - respect number_of_password_prompts - [channels.c channels.h servconf.c servconf.h session.c sshd.8] - - GatewayPorts for sshd, ok deraadt@ - [ssh-add.1 ssh-agent.1 ssh.1] - - more doc on: DSA, id_dsa, known_hosts2, authorized_keys2 - [ssh.1] - - more info on proto 2 - [sshd.8] - - sync AUTHOR w/ ssh.1 - [key.c key.h sshconnect.c] - - print key type when talking about host keys - [packet.c] - - clear padding in ssh2 - [dsa.c key.c radix.c ssh.h sshconnect1.c uuencode.c uuencode.h] - - replace broken uuencode w/ libc b64_ntop - [auth2.c] - - log failure before sending the reply - [key.c radix.c uuencode.c] - - remote trailing comments before calling __b64_pton - [auth2.c readconf.c readconf.h servconf.c servconf.h ssh.1] - [sshconnect2.c sshd.8] - - add DSAAuthetication option to ssh/sshd, document SSH2 in sshd.8 - - Bring in b64_ntop and b64_pton from OpenBSD libc (bsd-base64.[ch]) - -20000502 - - OpenBSD CVS update - [channels.c] - - init all fds, close all fds. - [sshconnect2.c] - - check whether file exists before asking for passphrase - [servconf.c servconf.h sshd.8 sshd.c] - - PidFile, pr 1210 - [channels.c] - - EINTR - [channels.c] - - unbreak, ok niels@ - [sshd.c] - - unlink pid file, ok niels@ - [auth2.c] - - Add missing #ifdefs; ok - markus - - Add Andre Lucas' patch to read entropy - gathering commands from a text file - - Release 2.0.0beta1 - -20000501 - - OpenBSD CVS update - [packet.c] - - send debug messages in SSH2 format - [scp.c] - - fix very rare EAGAIN/EINTR issues; based on work by djm - [packet.c] - - less debug, rm unused - [auth2.c] - - disable kerb,s/key in ssh2 - [sshd.8] - - Minor tweaks and typo fixes. - [ssh-keygen.c] - - Put -d into usage and reorder. markus ok. - - Include missing headers for OpenSSL tests. Fix from Phil Karn - - - Fixed __progname symbol collisions reported by Andre Lucas - - - Merged bsd-login ttyslot and AIX utmp patch from Gert Doering - - - Add some missing ifdefs to auth2.c - - Deprecate perl-tk askpass. - - Irix portability fixes - don't include netinet headers more than once - - Make sure we don't save PRNG seed more than once - -20000430 - - Merge HP-UX fixes and TCB support from Ged Lodder - - Integrate Andre Lucas' entropy collection - patch. - - Adds timeout to entropy collection - - Disables slow entropy sources - - Load and save seed file - - Changed entropy seed code to user per-user seeds only (server seed is - saved in root's .ssh directory) - - Use atexit() and fatal cleanups to save seed on exit - - More OpenBSD updates: - [session.c] - - don't call chan_write_failed() if we are not writing - [auth-rsa.c auth1.c authfd.c hostfile.c ssh-agent.c] - - keysize warnings error() -> log() - -20000429 - - Merge big update to OpenSSH-2.0 from OpenBSD CVS - [README.openssh2] - - interop w/ F-secure windows client - - sync documentation - - ssh_host_dsa_key not ssh_dsa_key - [auth-rsa.c] - - missing fclose - [auth.c authfile.c compat.c dsa.c dsa.h hostfile.c key.c key.h radix.c] - [readconf.c readconf.h ssh-add.c ssh-keygen.c ssh.c ssh.h sshconnect.c] - [sshd.c uuencode.c uuencode.h authfile.h] - - add DSA pubkey auth and other SSH2 fixes. use ssh-keygen -[xX] - for trading keys with the real and the original SSH, directly from the - people who invented the SSH protocol. - [auth.c auth.h authfile.c sshconnect.c auth1.c auth2.c sshconnect.h] - [sshconnect1.c sshconnect2.c] - - split auth/sshconnect in one file per protocol version - [sshconnect2.c] - - remove debug - [uuencode.c] - - add trailing = - [version.h] - - OpenSSH-2.0 - [ssh-keygen.1 ssh-keygen.c] - - add -R flag: exit code indicates if RSA is alive - [sshd.c] - - remove unused - silent if -Q is specified - [ssh.h] - - host key becomes /etc/ssh_host_dsa_key - [readconf.c servconf.c ] - - ssh/sshd default to proto 1 and 2 - [uuencode.c] - - remove debug - [auth2.c ssh-keygen.c sshconnect2.c sshd.c] - - xfree DSA blobs - [auth2.c serverloop.c session.c] - - cleanup logging for sshd/2, respect PasswordAuth no - [sshconnect2.c] - - less debug, respect .ssh/config - [README.openssh2 channels.c channels.h] - - clientloop.c session.c ssh.c - - support for x11-fwding, client+server - -20000421 - - Merge fix from OpenBSD CVS - [ssh-agent.c] - - Fix memory leak per connection. Report from Andy Spiegl - via Debian bug #59926 - - Define __progname in session.c if libc doesn't - - Remove indentation on autoconf #include statements to avoid bug in - DEC Tru64 compiler. Report and fix from David Del Piero - - -20000420 - - Make fixpaths work with perl4, patch from Andre Lucas - - - Sync with OpenBSD CVS: - [clientloop.c login.c serverloop.c ssh-agent.c ssh.h sshconnect.c sshd.c] - - pid_t - [session.c] - - remove bogus chan_read_failed. this could cause data - corruption (missing data) at end of a SSH2 session. - - Merge fixes from Debian patch from Phil Hands - - Allow setting of PAM service name through CFLAGS (SSHD_PAM_SERVICE) - - Use vhangup to clean up Linux ttys - - Force posix getopt processing on GNU libc systems - - Debian bug #55910 - remove references to ssl(8) manpages - - Debian bug #58031 - ssh_config lies about default cipher - -20000419 - - OpenBSD CVS updates - [channels.c] - - fix pr 1196, listen_port and port_to_connect interchanged - [scp.c] - - after completion, replace the progress bar ETA counter with a final - elapsed time; my idea, aaron wrote the patch - [ssh_config sshd_config] - - show 'Protocol' as an example, ok markus@ - [sshd.c] - - missing xfree() - - Add missing header to bsd-misc.c - -20000416 - - Reduce diff against OpenBSD source - - All OpenSSL includes are now unconditionally referenced as - openssl/foo.h - - Pick up formatting changes - - Other minor changed (typecasts, etc) that I missed - -20000415 - - OpenBSD CVS updates. - [ssh.1 ssh.c] - - ssh -2 - [auth.c channels.c clientloop.c packet.c packet.h serverloop.c] - [session.c sshconnect.c] - - check payload for (illegal) extra data - [ALL] - whitespace cleanup - -20000413 - - INSTALL doc updates - - Merged OpenBSD updates to include paths. - -20000412 - - OpenBSD CVS updates: - - [channels.c] - repair x11-fwd - - [sshconnect.c] - fix passwd prompt for ssh2, less debugging output. - - [clientloop.c compat.c dsa.c kex.c sshd.c] - less debugging output - - [kex.c kex.h sshconnect.c sshd.c] - check for reasonable public DH values - - [README.openssh2 cipher.c cipher.h compat.c compat.h readconf.c] - [readconf.h servconf.c servconf.h ssh.c ssh.h sshconnect.c sshd.c] - add Cipher and Protocol options to ssh/sshd, e.g.: - ssh -o 'Protocol 1,2' if you prefer proto 1, ssh -o 'Ciphers - arcfour,3des-cbc' - - [sshd.c] - print 1.99 only if server supports both - -20000408 - - Avoid some compiler warnings in fake-get*.c - - Add IPTOS macros for systems which lack them - - Only set define entropy collection macros if they are found - - More large OpenBSD CVS updates: - - [auth.c auth.h servconf.c servconf.h serverloop.c session.c] - [session.h ssh.h sshd.c README.openssh2] - ssh2 server side, see README.openssh2; enable with 'sshd -2' - - [channels.c] - no adjust after close - - [sshd.c compat.c ] - interop w/ latest ssh.com windows client. - -20000406 - - OpenBSD CVS update: - - [channels.c] - close efd on eof - - [clientloop.c compat.c ssh.c sshconnect.c myproposal.h] - ssh2 client implementation, interops w/ ssh.com and lsh servers. - - [sshconnect.c] - missing free. - - [authfile.c cipher.c cipher.h packet.c sshconnect.c sshd.c] - remove unused argument, split cipher_mask() - - [clientloop.c] - re-order: group ssh1 vs. ssh2 - - Make Redhat spec require openssl >= 0.9.5a - -20000404 - - Add tests for RAND_add function when searching for OpenSSL - - OpenBSD CVS update: - - [packet.h packet.c] - ssh2 packet format - - [packet.h packet.c nchan2.ms nchan.h compat.h compat.c] - [channels.h channels.c] - channel layer support for ssh2 - - [kex.h kex.c hmac.h hmac.c dsa.c dsa.h] - DSA, keyexchange, algorithm agreement for ssh2 - - Generate manpages before make install not at the end of make all - - Don't seed the rng quite so often - - Always reseed rng when requested - -20000403 - - Wrote entropy collection routines for systems that lack /dev/random - and EGD - - Disable tests and typedefs for 64 bit types. They are currently unused. - -20000401 - - Big OpenBSD CVS update (mainly beginnings of SSH2 infrastructure) - - [auth.c session.c sshd.c auth.h] - split sshd.c -> auth.c session.c sshd.c plus cleanup and goto-removal - - [bufaux.c bufaux.h] - support ssh2 bignums - - [channels.c channels.h clientloop.c sshd.c nchan.c nchan.h packet.c] - [readconf.c ssh.c ssh.h serverloop.c] - replace big switch() with function tables (prepare for ssh2) - - [ssh2.h] - ssh2 message type codes - - [sshd.8] - reorder Xr to avoid cutting - - [serverloop.c] - close(fdin) if fdin != fdout, shutdown otherwise, ok theo@ - - [channels.c] - missing close - allow bigger packets - - [cipher.c cipher.h] - support ssh2 ciphers - - [compress.c] - cleanup, less code - - [dispatch.c dispatch.h] - function tables for different message types - - [log-server.c] - do not log() if debuggin to stderr - rename a cpp symbol, to avoid param.h collision - - [mpaux.c] - KNF - - [nchan.c] - sync w/ channels.c - -20000326 - - Better tests for OpenSSL w/ RSAref - - Added replacement setenv() function from OpenBSD libc. Suggested by - Ben Lindstrom - - OpenBSD CVS update - - [auth-krb4.c] - -Wall - - [auth-rh-rsa.c auth-rsa.c hostfile.c hostfile.h key.c key.h match.c] - [match.h ssh.c ssh.h sshconnect.c sshd.c] - initial support for DSA keys. ok deraadt@, niels@ - - [cipher.c cipher.h] - remove unused cipher_attack_detected code - - [scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh.1 sshd.8] - Fix some formatting problems I missed before. - - [ssh.1 sshd.8] - fix spelling errors, From: FreeBSD - - [ssh.c] - switch to raw mode only if he _get_ a pty (not if we _want_ a pty). - -20000324 - - Released 1.2.3 - -20000317 - - Clarified --with-default-path option. - - Added -blibpath handling for AIX to work around stupid runtime linking. - Problem elucidated by gshapiro@SENDMAIL.ORG by way of Jim Knoble - - - Checks for 64 bit int types. Problem report from Mats Fredholm - - - OpenBSD CVS updates: - - [atomicio.c auth-krb4.c bufaux.c channels.c compress.c fingerprint.c] - [packet.h radix.c rsa.c scp.c ssh-agent.c ssh-keygen.c sshconnect.c] - [sshd.c] - pedantic: signed vs. unsigned, void*-arithm, etc - - [ssh.1 sshd.8] - Various cleanups and standardizations. - - Runtime error fix for HPUX from Otmar Stahl - - -20000316 - - Fixed configure not passing LDFLAGS to Solaris. Report from David G. - Hesprich - - Propogate LD through to Makefile - - Doc cleanups - - Added blurb about "scp: command not found" errors to UPGRADING - -20000315 - - Fix broken CFLAGS handling during search for OpenSSL. Fixes va_list - problems with gcc/Solaris. - - Don't free argument to putenv() after use (in setenv() replacement). - Report from Seigo Tanimura - - Created contrib/ subdirectory. Included helpers from Phil Hands' - Debian package, README file and chroot patch from Ricardo Cerqueira - - - Moved gnome-ssh-askpass.c to contrib directory and removed config - option. - - Slight cleanup to doc files - - Configure fix from Bratislav ILICH - -20000314 - - Include macro for IN6_IS_ADDR_V4MAPPED. Report from - peter@frontierflying.com - - Include /usr/local/include and /usr/local/lib for systems that don't - do it themselves - - -R/usr/local/lib for Solaris - - Fix RSAref detection - - Fix IN6_IS_ADDR_V4MAPPED macro - -20000311 - - Detect RSAref - - OpenBSD CVS change - [sshd.c] - - disallow guessing of root password - - More configure fixes - - IPv6 workarounds from Hideaki YOSHIFUJI - -20000309 - - OpenBSD CVS updates to v1.2.3 - [ssh.h atomicio.c] - - int atomicio -> ssize_t (for alpha). ok deraadt@ - [auth-rsa.c] - - delay MD5 computation until client sends response, free() early, cleanup. - [cipher.c] - - void* -> unsigned char*, ok niels@ - [hostfile.c] - - remove unused variable 'len'. fix comments. - - remove unused variable - [log-client.c log-server.c] - - rename a cpp symbol, to avoid param.h collision - [packet.c] - - missing xfree() - - getsockname() requires initialized tolen; andy@guildsoftware.com - - use getpeername() in packet_connection_is_on_socket(), fixes sshd -i; - from Holger.Trapp@Informatik.TU-Chemnitz.DE - [pty.c pty.h] - - register cleanup for pty earlier. move code for pty-owner handling to - pty.c ok provos@, dugsong@ - [readconf.c] - - turn off x11-fwd for the client, too. - [rsa.c] - - PKCS#1 padding - [scp.c] - - allow '.' in usernames; from jedgar@fxp.org - [servconf.c] - - typo: ignore_user_known_hosts int->flag; naddy@mips.rhein-neckar.de - - sync with sshd_config - [ssh-keygen.c] - - enable ssh-keygen -l -f ~/.ssh/known_hosts, ok deraadt@ - [ssh.1] - - Change invalid 'CHAT' loglevel to 'VERBOSE' - [ssh.c] - - suppress AAAA query host when '-4' is used; from shin@nd.net.fujitsu.co.jp - - turn off x11-fwd for the client, too. - [sshconnect.c] - - missing xfree() - - retry rresvport_af(), too. from sumikawa@ebina.hitachi.co.jp. - - read error vs. "Connection closed by remote host" - [sshd.8] - - ie. -> i.e., - - do not link to a commercial page.. - - sync with sshd_config - [sshd.c] - - no need for poll.h; from bright@wintelcom.net - - log with level log() not fatal() if peer behaves badly. - - don't panic if client behaves strange. ok deraadt@ - - make no-port-forwarding for RSA keys deny both -L and -R style fwding - - delay close() of pty until the pty has been chowned back to root - - oops, fix comment, too. - - missing xfree() - - move XAUTHORITY to subdir. ok dugsong@. fixes debian bug #57907, too. - (http://cgi.debian.org/cgi-bin/bugreport.cgi?archive=no&bug=57907) - - register cleanup for pty earlier. move code for pty-owner handling to - pty.c ok provos@, dugsong@ - - create x11 cookie file - - fix pr 1113, fclose() -> pclose(), todo: remote popen() - - version 1.2.3 - - Cleaned up - - Removed warning workaround for Linux and devpts filesystems (no longer - required after OpenBSD updates) - -20000308 - - Configure fix from Hiroshi Takekawa - -20000307 - - Released 1.2.2p1 - -20000305 - - Fix DEC compile fix - - Explicitly seed OpenSSL's PRNG before checking rsa_alive() - - Check for getpagesize in libucb.a if not found in libc. Fix for old - Solaris from Andre Lucas - - Check for libwrap if --with-tcp-wrappers option specified. Suggestion - Mate Wierdl - -20000303 - - Added "make host-key" target, Suggestion from Dominik Brettnacher - - - Don't permanently fail on bind() if getaddrinfo has more choices left for - us. Needed to work around messy IPv6 on Linux. Patch from Arkadiusz - Miskiewicz - - DEC Unix compile fix from David Del Piero - - Manpage fix from David Del Piero - -20000302 - - Big cleanup of autoconf code - - Rearranged to be a little more logical - - Added -R option for Solaris - - Rewrote OpenSSL detection code. Now uses AC_TRY_RUN with a test program - to detect library and header location _and_ ensure library has proper - RSA support built in (this is a problem with OpenSSL 0.9.5). - - Applied pty cleanup patch from markus.friedl@informatik.uni-erlangen.de - - Avoid warning message with Unix98 ptys - - Warning was valid - possible race condition on PTYs. Avoided using - platform-specific code. - - Document some common problems - - Allow root access to any key. Patch from - markus.friedl@informatik.uni-erlangen.de - -20000207 - - Removed SOCKS code. Will support through a ProxyCommand. - -20000203 - - Fixed SEGVs in authloop, fix from vbzoli@hbrt.hu - - Add --with-ssl-dir option - -20000202 - - Fix lastlog code for directory based lastlogs. Fix from Josh Durham - - - Documentation fixes from HARUYAMA Seigo - - Added URLs to Japanese translations of documents by HARUYAMA Seigo - - -20000201 - - Use socket pairs by default (instead of pipes). Prevents race condition - on several (buggy) OSs. Report and fix from tridge@linuxcare.com - -20000127 - - Seed OpenSSL's random number generator before generating RSA keypairs - - Split random collector into seperate file - - Compile fix from Andre Lucas - -20000126 - - Released 1.2.2 stable - - - NeXT keeps it lastlog in /usr/adm. Report from - mouring@newton.pconline.com - - Added note in UPGRADING re interop with commercial SSH using idea. - Report from Jim Knoble - - Fix linking order for Kerberos/AFS. Fix from Holget Trapp - - -20000125 - - Fix NULL pointer dereference in login.c. Fix from Andre Lucas - - - Reorder PAM initialisation so it does not mess up lastlog. Reported - by Andre Lucas - - Use preformatted manpages on SCO, report from Gary E. Miller - - - New URL for x11-ssh-askpass. - - Fixpaths was missing /etc/ssh_known_hosts. Report from Jim Knoble - - - Added 'DESTDIR' option to Makefile to ease package building. Patch from - Jim Knoble - - Updated RPM spec files to use DESTDIR - -20000124 - - Pick up version 1.2.2 from OpenBSD CVS (no changes, just version number - increment) - -20000123 - - OpenBSD CVS: - - [packet.c] - getsockname() requires initialized tolen; andy@guildsoftware.com - - AIX patch from Matt Richards and David Rankin - - - Fix lastlog support, patch from Andre Lucas - -20000122 - - Fix compilation of bsd-snprintf.c on Solaris, fix from Ben Taylor - - - Merge preformatted manpage patch from Andre Lucas - - - Make IPv4 use the default in RPM packages - - Irix uses preformatted manpages - - Missing htons() in bsd-bindresvport.c, fix from Holger Trapp - - - OpenBSD CVS updates: - - [packet.c] - use getpeername() in packet_connection_is_on_socket(), fixes sshd -i; - from Holger.Trapp@Informatik.TU-Chemnitz.DE - - [sshd.c] - log with level log() not fatal() if peer behaves badly. - - [readpass.c] - instead of blocking SIGINT, catch it ourselves, so that we can clean - the tty modes up and kill ourselves -- instead of our process group - leader (scp, cvs, ...) going away and leaving us in noecho mode. - people with cbreak shells never even noticed.. - - [ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh.1 sshd.8] - ie. -> i.e., - -20000120 - - Don't use getaddrinfo on AIX - - Update to latest OpenBSD CVS: - - [auth-rsa.c] - - fix user/1056, sshd keeps restrictions; dbt@meat.net - - [sshconnect.c] - - disable agent fwding for proto 1.3, remove abuse of auth-rsa flags. - - destroy keys earlier - - split key exchange (kex) and user authentication (user-auth), - ok: provos@ - - [sshd.c] - - no need for poll.h; from bright@wintelcom.net - - disable agent fwding for proto 1.3, remove abuse of auth-rsa flags. - - split key exchange (kex) and user authentication (user-auth), - ok: provos@ - - Big manpage and config file cleanup from Andre Lucas - - - Re-added latest (unmodified) OpenBSD manpages - - Doc updates - - NetBSD patch from David Rankin and - Christos Zoulas - -20000119 - - SCO compile fixes from Gary E. Miller - - Compile fix from Darren_Hall@progressive.com - - Linux/glibc-2.1.2 takes a *long* time to look up names for AF_UNSPEC - addresses using getaddrinfo(). Added a configure switch to make the - default lookup mode AF_INET - -20000118 - - Fixed --with-pid-dir option - - Makefile fix from Gary E. Miller - - Compile fix for HPUX and Solaris from Andre Lucas - - -20000117 - - Clean up bsd-bindresvport.c. Use arc4random() for picking initial - port, ignore EINVAL errors (Linux) when searching for free port. - - Revert __snprintf -> snprintf aliasing. Apparently Solaris - __snprintf isn't. Report from Theo de Raadt - - Document location of Redhat PAM file in INSTALL. - - Fixed X11 forwarding bug on Linux. libc advertises AF_INET6 - INADDR_ANY_INIT addresses via getaddrinfo, but may not be able to - deliver (no IPv6 kernel support) - - Released 1.2.1pre27 - - - Fix rresvport_af failure errors (logic error in bsd-bindresvport.c) - - Fix --with-ipaddr-display option test. Fix from Jarno Huuskonen - - - Fix hang on logout if processes are still using the pty. Needs - further testing. - - Patch from Christos Zoulas - - Try $prefix first when looking for OpenSSL. - - Include sys/types.h when including sys/socket.h in test programs - - Substitute PID directory in sshd.8. Suggestion from Andrew - Stribblehill - -20000116 - - Renamed --with-xauth-path to --with-xauth - - Added --with-pid-dir option - - Released 1.2.1pre26 - - - Compilation fix from Kiyokazu SUTO - - Fixed broken bugfix for /dev/ptmx on Linux systems which lack - openpty(). Report from Kiyokazu SUTO - -20000115 - - Add --with-xauth-path configure directive and explicit test for - /usr/openwin/bin/xauth for Solaris systems. Report from Anders - Nordby - - Fix incorrect detection of /dev/ptmx on Linux systems that lack - openpty. Report from John Seifarth - - Look for intXX_t and u_intXX_t in sys/bitypes.h if they are not in - sys/types.h. Fixes problems on SCO, report from Gary E. Miller - - - Use __snprintf and __vnsprintf if they are found where snprintf and - vnsprintf are lacking. Suggested by Ben Taylor - and others. - -20000114 - - Merged OpenBSD IPv6 patch: - - [sshd.c sshd.8 sshconnect.c ssh.h ssh.c servconf.h servconf.c scp.1] - [scp.c packet.h packet.c login.c log.c canohost.c channels.c] - [hostfile.c sshd_config] - ipv6 support: mostly gethostbyname->getaddrinfo/getnameinfo, new - features: sshd allows multiple ListenAddress and Port options. note - that libwrap is not IPv6-ready. (based on patches from - fujiwara@rcac.tdi.co.jp) - - [ssh.c canohost.c] - more hints (hints.ai_socktype=SOCK_STREAM) for getaddrinfo, - from itojun@ - - [channels.c] - listen on _all_ interfaces for X11-Fwd (hints.ai_flags = AI_PASSIVE) - - [packet.h] - allow auth-kerberos for IPv4 only - - [scp.1 sshd.8 servconf.h scp.c] - document -4, -6, and 'ssh -L 2022/::1/22' - - [ssh.c] - 'ssh @host' is illegal (null user name), from - karsten@gedankenpolizei.de - - [sshconnect.c] - better error message - - [sshd.c] - allow auth-kerberos for IPv4 only - - Big IPv6 merge: - - Cleanup overrun in sockaddr copying on RHL 6.1 - - Replacements for getaddrinfo, getnameinfo, etc based on versions - from patch from KIKUCHI Takahiro - - Replacement for missing structures on systems that lack IPv6 - - record_login needed to know about AF_INET6 addresses - - Borrowed more code from OpenBSD: rresvport_af and requisites - -20000110 - - Fixes to auth-skey to enable it to use the standard OpenSSL libraries - -20000107 - - New config.sub and config.guess to fix problems on SCO. Supplied - by Gary E. Miller - - SCO build fix from Gary E. Miller - - Released 1.2.1pre25 - -20000106 - - Documentation update & cleanup - - Better KrbIV / AFS detection, based on patch from: - Holger Trapp - -20000105 - - Fixed annoying DES corruption problem. libcrypt has been - overriding symbols in libcrypto. Removed libcrypt and crypt.h - altogether (libcrypto includes its own crypt(1) replacement) - - Added platform-specific rules for Irix 6.x. Included warning that - they are untested. - -20000103 - - Add explicit make rules for files proccessed by fixpaths. - - Fix "make install" in RPM spec files. Report from Tenkou N. Hattori - - - Removed "nullok" directive from default PAM configuration files. - Added information on enabling EmptyPasswords on openssh+PAM in - UPGRADING file. - - OpenBSD CVS updates - - [ssh-agent.c] - cleanup_exit() for SIGTERM/SIGHUP, too. from fgsch@ and - dgaudet@arctic.org - - [sshconnect.c] - compare correct version for 1.3 compat mode - -20000102 - - Prevent multiple inclusion of config.h and defines.h. Suggested - by Andre Lucas - - Properly clean up on exit of ssh-agent. Patch from Dean Gaudet - - -19991231 - - Fix password support on systems with a mixture of shadowed and - non-shadowed passwords (e.g. NIS). Report and fix from - HARUYAMA Seigo - - Fix broken autoconf typedef detection. Report from Marc G. - Fournier - - Fix occasional crash on LinuxPPC. Patch from Franz Sirl - - - Prevent typedefs from being compiled more than once. Report from - Marc G. Fournier - - Fill in ut_utaddr utmp field. Report from Benjamin Charron - - - Really fix broken default path. Fix from Jim Knoble - - - Remove test for quad_t. No longer needed. - - Released 1.2.1pre24 - - - Added support for directory-based lastlogs - - Really fix typedefs, patch from Ben Taylor - -19991230 - - OpenBSD CVS updates: - - [auth-passwd.c] - check for NULL 1st - - Removed most of the pam code into its own file auth-pam.[ch]. This - cleaned up sshd.c up significantly. - - PAM authentication was incorrectly interpreting - "PermitRootLogin without-password". Report from Matthias Andree - - - Updated documentation with ./configure options - - Released 1.2.1pre23 - -19991229 - - Applied another NetBSD portability patch from David Rankin - - - Fix --with-default-path option. - - Autodetect perl, patch from David Rankin - - - Print whether OpenSSH was compiled with RSARef, patch from - Nalin Dahyabhai - - Calls to pam_setcred, patch from Nalin Dahyabhai - - - Detect missing size_t and typedef it. - - Rename helper.[ch] to (more appropriate) bsd-misc.[ch] - - Minor Makefile cleaning - -19991228 - - Replacement for getpagesize() for systems which lack it - - NetBSD login.c compile fix from David Rankin - - - Fully set ut_tv if present in utmp or utmpx - - Portability fixes for Irix 5.3 (now compiles OK!) - - autoconf and other misc cleanups - - Merged AIX patch from Darren Hall - - Cleaned up defines.h - - Released 1.2.1pre22 - -19991227 - - Automatically correct paths in manpages and configuration files. Patch - and script from Andre Lucas - - Removed credits from README to CREDITS file, updated. - - Added --with-default-path to specify custom path for server - - Removed #ifdef trickery from acconfig.h into defines.h - - PAM bugfix. PermitEmptyPassword was being ignored. - - Fixed PAM config files to allow empty passwords if server does. - - Explained spurious PAM auth warning workaround in UPGRADING - - Use last few chars of tty line as ut_id - - New SuSE RPM spec file from Chris Saia - - OpenBSD CVS updates: - - [packet.h auth-rhosts.c] - check format string for packet_disconnect and packet_send_debug, too - - [channels.c] - use packet_get_maxsize for channels. consistence. - -19991226 - - Enabled utmpx support by default for Solaris - - Cleanup sshd.c PAM a little more - - Revised RPM package to include Jim Knoble's - X11 ssh-askpass program. - - Disable logging of PAM success and failures, PAM is verbose enough. - Unfortunatly there is currently no way to disable auth failure - messages. Mention this in UPGRADING file and sent message to PAM - developers - - OpenBSD CVS update: - - [ssh-keygen.1 ssh.1] - remove ref to .ssh/random_seed, mention .ssh/environment in - .Sh FILES, too - - Released 1.2.1pre21 - - Fixed implicit '.' in default path, report from Jim Knoble - - - Redhat RPM spec fixes from Jim Knoble - -19991225 - - More fixes from Andre Lucas - - Cleanup of auth-passwd.c for shadow and MD5 passwords - - Cleanup and bugfix of PAM authentication code - - Released 1.2.1pre20 - - - Merged fixes from Ben Taylor - - Fixed configure support for PAM. Reported by Naz <96na@eng.cam.ac.uk> - - Disabled logging of PAM password authentication failures when password - is empty. (e.g start of authentication loop). Reported by Naz - <96na@eng.cam.ac.uk>) - -19991223 - - Merged later HPUX patch from Andre Lucas - - - Above patch included better utmpx support from Ben Taylor - - -19991222 - - Fix undefined fd_set type in ssh.h from Povl H. Pedersen - - - Fix login.c breakage on systems which lack ut_host in struct - utmp. Reported by Willard Dawson - -19991221 - - Integration of large HPUX patch from Andre Lucas - . Integrating it had a few other - benefits: - - Ability to disable shadow passwords at configure time - - Ability to disable lastlog support at configure time - - Support for IP address in $DISPLAY - - OpenBSD CVS update: - - [sshconnect.c] - say "REMOTE HOST IDENTIFICATION HAS CHANGED" - - Fix DISABLE_SHADOW support - - Allow MD5 passwords even if shadow passwords are disabled - - Release 1.2.1pre19 - -19991218 - - Redhat init script patch from Chun-Chung Chen - - - Avoid breakage on systems without IPv6 headers - -19991216 - - Makefile changes for Solaris from Peter Kocks - - - Minor updates to docs - - Merged OpenBSD CVS changes: - - [authfd.c ssh-agent.c] - keysize warnings talk about identity files - - [packet.c] - "Connection closed by x.x.x.x": fatal() -> log() - - Correctly handle empty passwords in shadow file. Patch from: - "Chris, the Young One" - - Released 1.2.1pre18 - -19991215 - - Integrated patchs from Juergen Keil - - Avoid void* pointer arithmatic - - Use LDFLAGS correctly - - Fix SIGIO error in scp - - Simplify status line printing in scp - - Added better test for inline functions compiler support from - Darren_Hall@progressive.com - -19991214 - - OpenBSD CVS Changes - - [canohost.c] - fix get_remote_port() and friends for sshd -i; - Holger.Trapp@Informatik.TU-Chemnitz.DE - - [mpaux.c] - make code simpler. no need for memcpy. niels@ ok - - [pty.c] - namebuflen not sizeof namebuflen; bnd@ep-ag.com via djm@mindrot.org - fix proto; markus - - [ssh.1] - typo; mark.baushke@solipsa.com - - [channels.c ssh.c ssh.h sshd.c] - type conflict for 'extern Type *options' in channels.c; dot@dotat.at - - [sshconnect.c] - move checking of hostkey into own function. - - [version.h] - OpenSSH-1.2.1 - - Clean up broken includes in pty.c - - Some older systems don't have poll.h, they use sys/poll.h instead - - Doc updates - -19991211 - - Fix compilation on systems with AFS. Reported by - aloomis@glue.umd.edu - - Fix installation on Solaris. Reported by - Gordon Rowell - - Fix gccisms (__attribute__ and inline). Report by edgy@us.ibm.com, - patch from Markus Friedl - - Auto-locate xauth. Patch from David Agraz - - Compile fix from David Agraz - - Avoid compiler warning in bsd-snprintf.c - - Added pam_limits.so to default PAM config. Suggested by - Jim Knoble - -19991209 - - Import of patch from Ben Taylor : - - Improved PAM support - - "uninstall" rule for Makefile - - utmpx support - - Should fix PAM problems on Solaris - - OpenBSD CVS updates: - - [readpass.c] - avoid stdio; based on work by markus, millert, and I - - [sshd.c] - make sure the client selects a supported cipher - - [sshd.c] - fix sighup handling. accept would just restart and daemon handled - sighup only after the next connection was accepted. use poll on - listen sock now. - - [sshd.c] - make that a fatal - - Applied patch from David Rankin - to fix libwrap support on NetBSD - - Released 1.2pre17 - -19991208 - - Compile fix for Solaris with /dev/ptmx from - David Agraz - -19991207 - - sshd Redhat init script patch from Jim Knoble - fixes compatability with 4.x and 5.x - - Fixed default SSH_ASKPASS - - Fix PAM account and session being called multiple times. Problem - reported by Adrian Baugh - - Merged more OpenBSD changes: - - [atomicio.c authfd.c scp.c serverloop.c ssh.h sshconnect.c sshd.c] - move atomicio into it's own file. wrap all socket write()s which - were doing write(sock, buf, len) != len, with atomicio() calls. - - [auth-skey.c] - fd leak - - [authfile.c] - properly name fd variable - - [channels.c] - display great hatred towards strcpy - - [pty.c pty.h sshd.c] - use openpty() if it exists (it does on BSD4_4) - - [tildexpand.c] - check for ~ expansion past MAXPATHLEN - - Modified helper.c to use new atomicio function. - - Reformat Makefile a little - - Moved RC4 routines from rc4.[ch] into helper.c - - Added autoconf code to detect /dev/ptmx (Solaris) and /dev/ptc (AIX) - - Updated SuSE spec from Chris Saia - - Tweaked Redhat spec - - Clean up bad imports of a few files (forgot -kb) - - Released 1.2pre16 - -19991204 - - Small cleanup of PAM code in sshd.c - - Merged OpenBSD CVS changes: - - [auth-krb4.c auth-passwd.c auth-skey.c ssh.h] - move skey-auth from auth-passwd.c to auth-skey.c, same for krb4 - - [auth-rsa.c] - warn only about mismatch if key is _used_ - warn about keysize-mismatch with log() not error() - channels.c readconf.c readconf.h ssh.c ssh.h sshconnect.c - ports are u_short - - [hostfile.c] - indent, shorter warning - - [nchan.c] - use error() for internal errors - - [packet.c] - set loglevel for SSH_MSG_DISCONNECT to log(), not fatal() - serverloop.c - indent - - [ssh-add.1 ssh-add.c ssh.h] - document $SSH_ASKPASS, reasonable default - - [ssh.1] - CheckHostIP is not available for connects via proxy command - - [sshconnect.c] - typo - easier to read client code for passwd and skey auth - turn of checkhostip for proxy connects, since we don't know the remote ip - -19991126 - - Add definition for __P() - - Added [v]snprintf() replacement for systems that lack it - -19991125 - - More reformatting merged from OpenBSD CVS - - Merged OpenBSD CVS changes: - - [channels.c] - fix packet_integrity_check() for !have_hostname_in_open. - report from mrwizard@psu.edu via djm@ibs.com.au - - [channels.c] - set SO_REUSEADDR and SO_LINGER for forwarded ports. - chip@valinux.com via damien@ibs.com.au - - [nchan.c] - it's not an error() if shutdown_write failes in nchan. - - [readconf.c] - remove dead #ifdef-0-code - - [readconf.c servconf.c] - strcasecmp instead of tolower - - [scp.c] - progress meter overflow fix from damien@ibs.com.au - - [ssh-add.1 ssh-add.c] - SSH_ASKPASS support - - [ssh.1 ssh.c] - postpone fork_after_authentication until command execution, - request/patch from jahakala@cc.jyu.fi via damien@ibs.com.au - plus: use daemon() for backgrounding - - Added BSD compatible install program and autoconf test, thanks to - Niels Kristian Bech Jensen - - Solaris fixing, thanks to Ben Taylor - - Merged beginnings of AIX support from Tor-Ake Fransson - - Release 1.2pre15 - -19991124 - - Merged very large OpenBSD source code reformat - - OpenBSD CVS updates - - [channels.c cipher.c compat.c log-client.c scp.c serverloop.c] - [ssh.h sshd.8 sshd.c] - syslog changes: - * Unified Logmessage for all auth-types, for success and for failed - * Standard connections get only ONE line in the LOG when level==LOG: - Auth-attempts are logged only, if authentication is: - a) successfull or - b) with passwd or - c) we had more than AUTH_FAIL_LOG failues - * many log() became verbose() - * old behaviour with level=VERBOSE - - [readconf.c readconf.h ssh.1 ssh.h sshconnect.c sshd.c] - tranfer s/key challenge/response data in SSH_SMSG_AUTH_TIS_CHALLENGE - messages. allows use of s/key in windows (ttssh, securecrt) and - ssh-1.2.27 clients without 'ssh -v', ok: niels@ - - [sshd.8] - -V, for fallback to openssh in SSH2 compatibility mode - - [sshd.c] - fix sigchld race; cjc5@po.cwru.edu - -19991123 - - Added SuSE package files from Chris Saia - - Restructured package-related files under packages/* - - Added generic PAM config - - Numerous little Solaris fixes - - Add recommendation to use GNU make to INSTALL document - -19991122 - - Make close gnome-ssh-askpass (Debian bug #50299) - - OpenBSD CVS Changes - - [ssh-keygen.c] - don't create ~/.ssh only if the user wants to store the private - key there. show fingerprint instead of public-key after - keygeneration. ok niels@ - - Added OpenBSD bsd-strlcat.c, created bsd-strlcat.h - - Added timersub() macro - - Tidy RCSIDs of bsd-*.c - - Added autoconf test and macro to deal with old PAM libraries - pam_strerror definition (one arg vs two). - - Fix EGD problems (Thanks to Ben Taylor ) - - Retry /dev/urandom reads interrupted by signal (report from - Robert Hardy ) - - Added a setenv replacement for systems which lack it - - Only display public key comment when presenting ssh-askpass dialog - - Released 1.2pre14 - - - Configure, Make and changelog corrections from Tudor Bosman - and Niels Kristian Bech Jensen - -19991121 - - OpenBSD CVS Changes: - - [channels.c] - make this compile, bad markus - - [log.c readconf.c servconf.c ssh.h] - bugfix: loglevels are per host in clientconfig, - factor out common log-level parsing code. - - [servconf.c] - remove unused index (-Wall) - - [ssh-agent.c] - only one 'extern char *__progname' - - [sshd.8] - document SIGHUP, -Q to synopsis - - [sshconnect.c serverloop.c sshd.c packet.c packet.h] - [channels.c clientloop.c] - SSH_CMSG_MAX_PACKET_SIZE, some clients use this, some need this, niels@ - [hope this time my ISP stays alive during commit] - - [OVERVIEW README] typos; green@freebsd - - [ssh-keygen.c] - replace xstrdup+strcat with strlcat+fixed buffer, fixes OF (bad me) - exit if writing the key fails (no infinit loop) - print usage() everytime we get bad options - - [ssh-keygen.c] overflow, djm@mindrot.org - - [sshd.c] fix sigchld race; cjc5@po.cwru.edu - -19991120 - - Merged more Solaris support from Marc G. Fournier - - - Wrote autoconf tests for integer bit-types - - Fixed enabling kerberos support - - Fix segfault in ssh-keygen caused by buffer overrun in filename - handling. - -19991119 - - Merged PAM buffer overrun patch from Chip Salzenberg - - Merged OpenBSD CVS changes - - [auth-rhosts.c auth-rsa.c ssh-agent.c sshconnect.c sshd.c] - more %d vs. %s in fmt-strings - - [authfd.c] - Integers should not be printed with %s - - EGD uses a socket, not a named pipe. Duh. - - Fix includes in fingerprint.c - - Fix scp progress bar bug again. - - Move ssh-askpass from ${libdir}/ssh to ${libexecdir}/ssh at request of - David Rankin - - Added autoconf option to enable Kerberos 4 support (untested) - - Added autoconf option to enable AFS support (untested) - - Added autoconf option to enable S/Key support (untested) - - Added autoconf option to enable TCP wrappers support (compiles OK) - - Renamed BSD helper function files to bsd-* - - Added tests for login and daemon and enable OpenBSD replacements for - when they are absent. - - Added non-PAM MD5 password support patch from Tudor Bosman - -19991118 - - Merged OpenBSD CVS changes - - [scp.c] foregroundproc() in scp - - [sshconnect.h] include fingerprint.h - - [sshd.c] bugfix: the log() for passwd-auth escaped during logging - changes. - - [ssh.1] Spell my name right. - - Added openssh.com info to README - -19991117 - - Merged OpenBSD CVS changes - - [ChangeLog.Ylonen] noone needs this anymore - - [authfd.c] close-on-exec for auth-socket, ok deraadt - - [hostfile.c] - in known_hosts key lookup the entry for the bits does not need - to match, all the information is contained in n and e. This - solves the problem with buggy servers announcing the wrong - modulus length. markus and me. - - [serverloop.c] - bugfix: check for space if child has terminated, from: - iedowse@maths.tcd.ie - - [ssh-add.1 ssh-add.c ssh-keygen.1 ssh-keygen.c sshconnect.c] - [fingerprint.c fingerprint.h] - rsa key fingerprints, idea from Bjoern Groenvall - - [ssh-agent.1] typo - - [ssh.1] add OpenSSH information to AUTHOR section. okay markus@ - - [sshd.c] - force logging to stderr while loading private key file - (lost while converting to new log-levels) - -19991116 - - Fix some Linux libc5 problems reported by Miles Wilson - - Merged OpenBSD CVS changes: - - [auth-rh-rsa.c auth-rsa.c authfd.c authfd.h hostfile.c mpaux.c] - [mpaux.h ssh-add.c ssh-agent.c ssh.h ssh.c sshd.c] - the keysize of rsa-parameter 'n' is passed implizit, - a few more checks and warnings about 'pretended' keysizes. - - [cipher.c cipher.h packet.c packet.h sshd.c] - remove support for cipher RC4 - - [ssh.c] - a note for legay systems about secuity issues with permanently_set_uid(), - the private hostkey and ptrace() - - [sshconnect.c] - more detailed messages about adding and checking hostkeys - -19991115 - - Merged OpenBSD CVS changes: - - [ssh-add.c] change passphrase loop logic and remove ref to - $DISPLAY, ok niels - - Changed to ssh-add.c broke askpass support. Revised it to be a little more - modular. - - Revised autoconf support for enabling/disabling askpass support. - - Merged more OpenBSD CVS changes: - [auth-krb4.c] - - disconnect if getpeername() fails - - missing xfree(*client) - [canohost.c] - - disconnect if getpeername() fails - - fix comment: we _do_ disconnect if ip-options are set - [sshd.c] - - disconnect if getpeername() fails - - move checking of remote port to central place - [auth-rhosts.c] move checking of remote port to central place - [log-server.c] avoid extra fd per sshd, from millert@ - [readconf.c] print _all_ bad config-options in ssh(1), too - [readconf.h] print _all_ bad config-options in ssh(1), too - [ssh.c] print _all_ bad config-options in ssh(1), too - [sshconnect.c] disconnect if getpeername() fails - - OpenBSD's changes to sshd.c broke the PAM stuff, re-merged it. - - Various small cleanups to bring diff (against OpenBSD) size down. - - Merged more Solaris compability from Marc G. Fournier - - - Wrote autoconf tests for __progname symbol - - RPM spec file fixes from Jim Knoble - - Released 1.2pre12 - - - Another OpenBSD CVS update: - - [ssh-keygen.1] fix .Xr - -19991114 - - Solaris compilation fixes (still imcomplete) - -19991113 - - Build patch from Niels Kristian Bech Jensen - - Don't install config files if they already exist - - Fix inclusion of additional preprocessor directives from acconfig.h - - Removed redundant inclusions of config.h - - Added 'Obsoletes' lines to RPM spec file - - Merged OpenBSD CVS changes: - - [bufaux.c] save a view malloc/memcpy/memset/free's, ok niels - - [scp.c] fix overflow reported by damien@ibs.com.au: off_t - totalsize, ok niels,aaron - - Delay fork (-f option) in ssh until after port forwarded connections - have been initialised. Patch from Jani Hakala - - Added shadow password patch from Thomas Neumann - - Added ifdefs to auth-passwd.c to exclude it when PAM is enabled - - Tidied default config file some more - - Revised Redhat initscript to fix bug: sshd (re)start would fail - if executed from inside a ssh login. - -19991112 - - Merged changes from OpenBSD CVS - - [sshd.c] session_key_int may be zero - - [auth-rh-rsa.c servconf.c servconf.h ssh.h sshd.8 sshd.c sshd_config] - IgnoreUserKnownHosts(default=no), used for RhostRSAAuth, ok - deraadt,millert - - Brought default sshd_config more in line with OpenBSD's - - Grab server in gnome-ssh-askpass (Debian bug #49872) - - Released 1.2pre10 - - - Added INSTALL documentation - - Merged yet more changes from OpenBSD CVS - - [auth-rh-rsa.c auth-rhosts.c auth-rsa.c channels.c clientloop.c] - [ssh.c ssh.h sshconnect.c sshd.c] - make all access to options via 'extern Options options' - and 'extern ServerOptions options' respectively; - options are no longer passed as arguments: - * make options handling more consistent - * remove #include "readconf.h" from ssh.h - * readconf.h is only included if necessary - - [mpaux.c] clear temp buffer - - [servconf.c] print _all_ bad options found in configfile - - Make ssh-askpass support optional through autoconf - - Fix nasty division-by-zero error in scp.c - - Released 1.2pre11 - -19991111 - - Added (untested) Entropy Gathering Daemon (EGD) support - - Fixed /dev/urandom fd leak (Debian bug #49722) - - Merged OpenBSD CVS changes: - - [auth-rh-rsa.c] user/958: check ~/.ssh/known_hosts for rhosts-rsa, too - - [ssh.1] user/958: check ~/.ssh/known_hosts for rhosts-rsa, too - - [sshd.8] user/958: check ~/.ssh/known_hosts for rhosts-rsa, too - - Fix integer overflow which was messing up scp's progress bar for large - file transfers. Fix submitted to OpenBSD developers. Report and fix - from Kees Cook - - Merged more OpenBSD CVS changes: - - [auth-krb4.c auth-passwd.c] remove x11- and krb-cleanup from fatal() - + krb-cleanup cleanup - - [clientloop.c log-client.c log-server.c ] - [readconf.c readconf.h servconf.c servconf.h ] - [ssh.1 ssh.c ssh.h sshd.8] - add LogLevel {QUIET, FATAL, ERROR, INFO, CHAT, DEBUG} to ssh/sshd, - obsoletes QuietMode and FascistLogging in sshd. - - [sshd.c] fix fatal/assert() bug reported by damien@ibs.com.au: - allow session_key_int != sizeof(session_key) - [this should fix the pre-assert-removal-core-files] - - Updated default config file to use new LogLevel option and to improve - readability - -19991110 - - Merged several minor fixes: - - ssh-agent commandline parsing - - RPM spec file now installs ssh setuid root - - Makefile creates libdir - - Merged beginnings of Solaris compability from Marc G. Fournier - - -19991109 - - Autodetection of SSL/Crypto library location via autoconf - - Fixed location of ssh-askpass to follow autoconf - - Integrated Makefile patch from Niels Kristian Bech Jensen - - Autodetection of RSAref library for US users - - Minor doc updates - - Merged OpenBSD CVS changes: - - [rsa.c] bugfix: use correct size for memset() - - [sshconnect.c] warn if announced size of modulus 'n' != real size - - Added GNOME passphrase requestor (use --with-gnome-askpass) - - RPM build now creates subpackages - - Released 1.2pre9 - -19991108 - - Removed debian/ directory. This is now being maintained separately. - - Added symlinks for slogin in RPM spec file - - Fixed permissions on manpages in RPM spec file - - Added references to required libraries in README file - - Removed config.h.in from CVS - - Removed pwdb support (better pluggable auth is provided by glibc) - - Made PAM and requisite libdl optional - - Removed lots of unnecessary checks from autoconf - - Added support and autoconf test for openpty() function (Unix98 pty support) - - Fix for scp not finding ssh if not installed as /usr/bin/ssh - - Added TODO file - - Merged parts of Debian patch From Phil Hands : - - Added ssh-askpass program - - Added ssh-askpass support to ssh-add.c - - Create symlinks for slogin on install - - Fix "distclean" target in makefile - - Added example for ssh-agent to manpage - - Added support for PAM_TEXT_INFO messages - - Disable internal /etc/nologin support if PAM enabled - - Merged latest OpenBSD CVS changes: - - [all] replace assert() with error, fatal or packet_disconnect - - [sshd.c] don't send fail-msg but disconnect if too many authentication - failures - - [sshd.c] remove unused argument. ok dugsong - - [sshd.c] typo - - [rsa.c] clear buffers used for encryption. ok: niels - - [rsa.c] replace assert() with error, fatal or packet_disconnect - - [auth-krb4.c] remove unused argument. ok dugsong - - Fixed coredump after merge of OpenBSD rsa.c patch - - Released 1.2pre8 - -19991102 - - Merged change from OpenBSD CVS - - One-line cleanup in sshd.c - -19991030 - - Integrated debian package support from Dan Brosemer - - Merged latest updates for OpenBSD CVS: - - channels.[ch] - remove broken x11 fix and document istate/ostate - - ssh-agent.c - call setsid() regardless of argv[] - - ssh.c - save a few lines when disabling rhosts-{rsa-}auth - - Documentation cleanups - - Renamed README -> README.Ylonen - - Renamed README.openssh ->README - -19991029 - - Renamed openssh* back to ssh* at request of Theo de Raadt - - Incorporated latest changes from OpenBSD's CVS - - Integrated Makefile patch from Niels Kristian Bech Jensen - - Integrated PAM env patch from Nalin Dahyabhai - - Make distclean now removed configure script - - Improved PAM logging - - Added some debug() calls for PAM - - Removed redundant subdirectories - - Integrated part of a patch from Dan Brosemer for - building on Debian. - - Fixed off-by-one error in PAM env patch - - Released 1.2pre6 - -19991028 - - Further PAM enhancements. - - Much cleaner - - Now uses account and session modules for all logins. - - Integrated patch from Dan Brosemer - - Build fixes - - Autoconf - - Change binary names to open* - - Fixed autoconf script to detect PAM on RH6.1 - - Added tests for libpwdb, and OpenBSD functions to autoconf - - Released 1.2pre4 - - - Imported latest OpenBSD CVS code - - Updated README.openssh - - Released 1.2pre5 - -19991027 - - Adapted PAM patch. - - Released 1.0pre2 - - - Excised my buggy replacements for strlcpy and mkdtemp - - Imported correct OpenBSD strlcpy and mkdtemp routines. - - Reduced arc4random_stir entropy read to 32 bytes (256 bits) - - Picked up correct version number from OpenBSD - - Added sshd.pam PAM configuration file - - Added sshd.init Redhat init script - - Added openssh.spec RPM spec file - - Released 1.2pre3 - -19991026 - - Fixed include paths of OpenSSL functions - - Use OpenSSL MD5 routines - - Imported RC4 code from nanocrypt - - Wrote replacements for OpenBSD arc4random* functions - - Wrote replacements for strlcpy and mkdtemp - - Released 1.0pre1 + remove unused, sync w/ cmdline patch in my tree. + +20020317 + - (tim) [configure.ac] Assume path given with --with-pid-dir=PATH is + wanted, warn if directory does not exist. Put system directories in + front of PATH for finding entorpy commands. + - (tim) [contrib/aix/buildbff.sh contrib/aix/inventory.sh] AIX package + build fixes. Patch by Darren Tucker + [contrib/solaris/buildpkg.sh] add missing dirs to SYSTEM_DIR. Have + postinstall check for $piddir and add if necessary. + +20020311 + - (tim) [contrib/solaris/buildpkg.sh, contrib/solaris/README] Updated to + build on all platforms that support SVR4 style package tools. Now runs + from build dir. Parts are based on patches from Antonio Navarro, and + Darren Tucker. + +20020308 + - (djm) Revert bits of Markus' OpenSSL compat patch which was + accidentally committed. + - (djm) Add Markus' patch for compat wih OpenSSL < 0.9.6. + Known issue: Blowfish for SSH1 does not work + - (stevesk) entropy.c: typo in debug message + - (djm) ssh-keygen -i needs seeded RNG; report from markus@ $Id$ diff --git a/openssh/INSTALL b/openssh/INSTALL index c6ee3c8..84e7b47 100644 --- a/openssh/INSTALL +++ b/openssh/INSTALL @@ -6,9 +6,12 @@ You will need working installations of Zlib and OpenSSL. Zlib: http://www.gzip.org/zlib/ -OpenSSL 0.9.5a or greater: +OpenSSL 0.9.6 or greater: http://www.openssl.org/ +(OpenSSL 0.9.5a is partially supported, but some ciphers (SSH protocol 1 +Blowfish included) do not work correctly.) + RPMs of OpenSSL are available at http://violet.ibs.com.au/openssh/files/support. For Red Hat Linux 6.2, they have been released as errata. RHL7 includes these. @@ -17,6 +20,11 @@ OpenSSH can utilise Pluggable Authentication Modules (PAM) if your system supports it. PAM is standard on Redhat and Debian Linux, Solaris and HP-UX 11. +NB. If you operating system supports /dev/random, you should configure +OpenSSL to use it. OpenSSH relies on OpenSSL's direct support of +/dev/random. If you don't you will have to rely on ssh-rand-helper, which +is inferior to a good kernel-based solution. + PAM: http://www.kernel.org/pub/linux/libs/pam/ @@ -108,10 +116,6 @@ different name. need a working installation of GNOME, including the development headers, for this to work. ---with-random=/some/file allows you to specify an alternate source of -random numbers (the default is /dev/urandom). Unless you are absolutely -sure of what you are doing, it is best to leave this alone. - --with-prngd-socket=/some/file allows you to enable EGD or PRNGD support and to specify a PRNGd socket. Use this if your Unix lacks /dev/random and you don't want to use OpenSSH's builtin entropy @@ -178,6 +182,10 @@ are installed. --with-4in6 Check for IPv4 in IPv6 mapped addresses and convert them to real (AF_INET) IPv4 addresses. Works around some quirks on Linux. +--with-opensc=DIR +--with-sectok=DIR allows for OpenSC or sectok smartcard libraries to +be used with OpenSSH. See 'README.smartcard' for more details. + If you need to pass special options to the compiler or linker, you can specify these as environment variables before running ./configure. For example: diff --git a/openssh/LICENCE b/openssh/LICENCE index 1c98a1d..2824c09 100644 --- a/openssh/LICENCE +++ b/openssh/LICENCE @@ -190,6 +190,7 @@ OpenSSH contains no GPL code. Aaron Campbell Damien Miller Kevin Steves + Daniel Kouril * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/openssh/Makefile.in b/openssh/Makefile.in index 679e9c4..0061f93 100644 --- a/openssh/Makefile.in +++ b/openssh/Makefile.in @@ -1,5 +1,10 @@ # $Id$ +# uncomment if you run a non bourne compatable shell. Ie. csh +#SHELL = @SH@ + +AUTORECONF=autoreconf + prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ @@ -18,12 +23,14 @@ VPATH=@srcdir@ SSH_PROGRAM=@bindir@/ssh ASKPASS_PROGRAM=$(libexecdir)/ssh-askpass SFTP_SERVER=$(libexecdir)/sftp-server +PRIVSEP_PATH=@PRIVSEP_PATH@ PATHS= -DSSHDIR=\"$(sysconfdir)\" \ -D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \ -D_PATH_SSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" \ -D_PATH_SFTP_SERVER=\"$(SFTP_SERVER)\" \ -D_PATH_SSH_PIDDIR=\"$(piddir)\" \ + -D_PATH_PRIVSEP_CHROOT_DIR=\"$(PRIVSEP_PATH)\" \ -DSSH_RAND_HELPER=\"$(libexecdir)/ssh-rand-helper\" CC=@CC@ @@ -50,20 +57,21 @@ INSTALL_SSH_RAND_HELPER=@INSTALL_SSH_RAND_HELPER@ TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-agent$(EXEEXT) scp$(EXEEXT) ssh-rand-helper${EXEEXT} $(SFTP_PROGS) -LIBSSH_OBJS=atomicio.o authfd.o authfile.o bufaux.o buffer.o canohost.o channels.o cipher.o compat.o compress.o crc32.o deattack.o dh.o dispatch.o fatal.o mac.o hostfile.o key.o kex.o kexdh.o kexgex.o log.o match.o misc.o mpaux.o nchan.o packet.o radix.o rijndael.o entropy.o readpass.o rsa.o scard.o ssh-dss.o ssh-rsa.o tildexpand.o ttymodes.o uidswap.o uuencode.o xmalloc.o kexgss.o gss-genr.o +LIBSSH_OBJS=atomicio.o authfd.o authfile.o bufaux.o buffer.o canohost.o channels.o cipher.o compat.o compress.o crc32.o deattack.o dh.o dispatch.o fatal.o mac.o hostfile.o key.o kex.o kexdh.o kexgex.o log.o match.o misc.o mpaux.o nchan.o packet.o radix.o rijndael.o entropy.o readpass.o rsa.o scard.o scard-opensc.o ssh-dss.o ssh-rsa.o tildexpand.o ttymodes.o uidswap.o uuencode.o xmalloc.o monitor_wrap.o monitor_fdpass.o kexgss.o gss-genr.o SSHOBJS= ssh.o sshconnect.o sshconnect1.o sshconnect2.o sshtty.o readconf.o clientloop.o -SSHDOBJS= sshd.o auth.o auth1.o auth2.o auth-chall.o auth2-chall.o auth-rhosts.o auth-options.o auth-krb4.o auth-krb5.o auth-pam.o auth2-pam.o auth-passwd.o auth-rsa.o auth-rh-rsa.o auth-sia.o sshpty.o sshlogin.o loginrec.o servconf.o serverloop.o md5crypt.o session.o groupaccess.o auth-skey.o auth-bsdauth.o gss-serv.o +SSHDOBJS= sshd.o auth.o auth1.o auth2.o auth-chall.o auth2-chall.o auth-rhosts.o auth-options.o auth-krb4.o auth-krb5.o auth-pam.o auth2-pam.o auth-passwd.o auth-rsa.o auth-rh-rsa.o auth-sia.o sshpty.o sshlogin.o loginrec.o servconf.o serverloop.o md5crypt.o session.o groupaccess.o auth-skey.o auth-bsdauth.o monitor_mm.o monitor.o gss-serv.o -MANPAGES = scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out -MANPAGES_IN = scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 +MANPAGES = scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-rand-helper.8.out +MANPAGES_IN = scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-rand-helper.8 MANTYPE = @MANTYPE@ CONFIGFILES=sshd_config.out ssh_config.out moduli.out CONFIGFILES_IN=sshd_config ssh_config moduli PATHSUBS = \ + -D/etc/ssh/ssh_prng_cmds=$(sysconfdir)/ssh_prng_cmds \ -D/etc/ssh/ssh_config=$(sysconfdir)/ssh_config \ -D/etc/ssh/ssh_known_hosts=$(sysconfdir)/ssh_known_hosts \ -D/etc/ssh/sshd_config=$(sysconfdir)/sshd_config \ @@ -76,6 +84,7 @@ PATHSUBS = \ -D/etc/ssh/moduli=$(sysconfdir)/moduli \ -D/etc/ssh/sshrc=$(sysconfdir)/sshrc \ -D/usr/X11R6/bin/xauth=$(XAUTH_PATH) \ + -D/var/empty=$(PRIVSEP_PATH) \ -D/usr/bin:/bin:/usr/sbin:/sbin=@user_path@ FIXPATHSCMD = $(PERL) $(srcdir)/fixpaths $(PATHSUBS) @@ -180,7 +189,7 @@ catman-do: done distprep: catman-do - autoreconf + $(AUTORECONF) (cd scard && $(MAKE) -f Makefile.in distprep) install: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files host-key @@ -216,6 +225,9 @@ install-files: scard-install $(INSTALL) -m 644 ssh-keygen.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 $(INSTALL) -m 644 ssh-keyscan.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 $(INSTALL) -m 644 sshd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 + if [ ! -z "$(INSTALL_SSH_PRNG_CMDS)" ]; then \ + $(INSTALL) -m 644 ssh-rand-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-rand-helper.8 ; \ + fi @NO_SFTP@$(INSTALL) -m 644 sftp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 @NO_SFTP@$(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 -rm -f $(DESTDIR)$(bindir)/slogin @@ -309,5 +321,6 @@ uninstall: -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-rand-helper.8 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 diff --git a/openssh/README.privsep b/openssh/README.privsep new file mode 100644 index 0000000..63c4d4a --- /dev/null +++ b/openssh/README.privsep @@ -0,0 +1,57 @@ +Privilege separation, or privsep, is an experimental feature in +OpenSSH in which operations that require root privilege are performed +by a separate privileged monitor process. Its purpose is to prevent +privilege escalation by containing corruption to an unprivileged +process. More information is available at: + http://www.citi.umich.edu/u/provos/ssh/privsep.html + +Privilege separation is not enabled by default, and may be enabled by +specifying "UsePrivilegeSeparation yes" in sshd_config; see the +UsePrivilegeSeparation option in sshd(8). + +When privsep is enabled, the pre-authentication sshd process will +chroot(2) to "/var/empty" and change its privileges to the "sshd" user +and its primary group. You should do something like the following to +prepare the privsep preauth environment: + + # mkdir /var/empty + # chown root:sys /var/empty + # chmod 755 /var/empty + # groupadd sshd + # useradd -g sshd sshd + +If you are on UnixWare 7 or OpenUNIX 8 do this additional step. + # ln /usr/lib/.ns.so /usr/lib/ns.so.1 + +/var/empty should not contain any files. + +configure supports the following options to change the default +privsep user and chroot directory: + + --with-privsep-path=xxx Path for privilege separation chroot + --with-privsep-user=user Specify non-privileged user for privilege separation + +Privsep requires operating system support for file descriptor passing +and mmap(MAP_ANON). + +PAM-enabled OpenSSH is known to function with privsep on Linux and +Solaris 8. It does not function on HP-UX with a trusted system +configuration. PAMAuthenticationViaKbdInt does not function with +privsep. + +Note that for a normal interactive login with a shell, enabling privsep +will require 1 additional process per login session. + +Given the following process listing (from HP-UX): + + UID PID PPID C STIME TTY TIME COMMAND + root 1005 1 0 10:45:17 ? 0:08 /opt/openssh/sbin/sshd -u0 + root 6917 1005 0 15:19:16 ? 0:00 sshd: stevesk [priv] + stevesk 6919 6917 0 15:19:17 ? 0:03 sshd: stevesk@2 + stevesk 6921 6919 0 15:19:17 pts/2 0:00 -bash + +process 1005 is the sshd process listening for new connections. +process 6917 is the privileged monitor process, 6919 is the user owned +sshd process and 6921 is the shell process. + +$Id$ diff --git a/openssh/README.smartcard b/openssh/README.smartcard index 69dca15..29bec8d 100644 --- a/openssh/README.smartcard +++ b/openssh/README.smartcard @@ -1,25 +1,22 @@ How to use smartcards with OpenSSH? -OpenSSH contains experimental support for authentication using -Cyberflex smartcards and TODOS card readers. +OpenSSH contains experimental support for authentication using Cyberflex +smartcards and TODOS card readers, in addition to the cards with PKCS#15 +structure supported by OpenSC. -WARNING: Smartcard support is still in development. Keyfile formats, etc -are still subject to change. +WARNING: Smartcard support is still in development. +Keyfile formats, etc are still subject to change. -To enable this you need to: +To enable sectok support: -(1) install sectok +(1) install sectok: - Sources are instructions are available from + Sources and instructions are available from http://www.citi.umich.edu/projects/smartcard/sectok.html -(2) enable SMARTCARD support in OpenSSH: +(2) enable sectok support in OpenSSH: - $ ./configure --with-smartcard [options] - - You can also specify a path to libsectok: - - $ ./configure --with-smartcard=/path/to/libsectok [options] + $ ./configure --with-sectok[=/path/to/libsectok] [options] (3) load the Java Cardlet to the Cyberflex card: @@ -30,12 +27,11 @@ To enable this you need to: (4) load a RSA key to the card: - please don't use your production RSA keys, since + Please don't use your production RSA keys, since with the current version of sectok/ssh-keygen - the private key file is still readable + the private key file is still readable. - $ ssh-keygen -f /path/to/rsakey -U 1 - (where 1 is the reader number, you can also try 0) + $ ssh-keygen -f /path/to/rsakey -U In spite of the name, this does not generate a key. It just loads an already existing key on to the card. @@ -60,13 +56,30 @@ To enable this you need to: wrong passphrase three times in a row, you will destroy your card. -(6) tell the ssh client to use the card reader: +To enable OpenSC support: + +(1) install OpenSC: + + Sources and instructions are available from + http://www.opensc.org/ + +(2) enable OpenSC support in OpenSSH: + + $ ./configure --with-opensc[=/path/to/opensc] [options] + +(3) load a RSA key to the card: + + Not supported yet. + +Common smartcard options: + +(1) tell the ssh client to use the card reader: - $ ssh -I 1 otherhost + $ ssh -I otherhost -(7) or tell the agent (don't forget to restart) to use the smartcard: +(2) or tell the agent (don't forget to restart) to use the smartcard: - $ ssh-add -s 1 + $ ssh-add -s -markus, -Tue Jul 17 23:54:51 CEST 2001 +Sat Apr 13 13:48:10 EEST 2002 diff --git a/openssh/WARNING.RNG b/openssh/WARNING.RNG index 1b9137e..e5fd1ac 100644 --- a/openssh/WARNING.RNG +++ b/openssh/WARNING.RNG @@ -28,8 +28,12 @@ On to the description... The portable OpenSSH contains random number collection support for systems which lack a kernel entropy pool (/dev/random). -This collector operates by executing the programs listed in -($etcdir)/ssh_prng_cmds, reading their output and adding it to the +This collector (as of 3.1 and beyond) comes as an external application +that allows the local admin to decide on how to implement entropy +collection. + +The default entropy collector operates by executing the programs listed +in ($etcdir)/ssh_prng_cmds, reading their output and adding it to the PRNG supplied by OpenSSL (which is hash-based). It also stirs in the output of several system calls and timings from the execution of the programs that it runs. @@ -43,7 +47,7 @@ The random number code will also read and save a seed file to number generator at startup. The goal here is to maintain as much randomness between sessions as possible. -The entropy collection code has two main problems: +The default entropy collection code has two main problems: 1. It is slow. @@ -51,14 +55,13 @@ Executing each program in the list can take a large amount of time, especially on slower machines. Additionally some program can take a disproportionate time to execute. -This can be tuned by the administrator. To debug the entropy -collection is great detail, turn on full debugging ("ssh -v -v -v" or -"sshd -d -d -d"). This will list each program as it is executed, how -long it took to execute, its exit status and whether and how much data -it generated. You can the find the culprit programs which are causing -the real slow-downs. +Tuning the default entropy collection code is difficult at this point. +It requires doing 'times ./ssh-rand-helper' and modifying the +($etcdir)/ssh_prng_cmds until you have found the issue. In the next +release we will be looking at support '-v' for verbose output to allow +easier debugging. -The entropy collector will timeout programs which take too long +The default entropy collector will timeout programs which take too long to execute, the actual timeout used can be adjusted with the --with-entropy-timeout configure option. OpenSSH will not try to re-execute programs which have not been found, have had a non-zero @@ -79,5 +82,15 @@ up and various other factors. To make matters even more complex, some of the commands are reporting largely the same data as other commands (eg. the various "ps" calls). -$Id$ +How to avoid the default entropy code? + +The best way is to read the OpenSSL documentation and recompile OpenSSL +to use prngd or egd. Some platforms (like earily solaris) have 3rd +party /dev/random devices that can be also used for this task. + +If you are forced to use ssh-rand-helper consider still downloading +prngd/egd and configure OpenSSH using --with-prngd-port=xx or +--with-prngd-socket=xx (refer to INSTALL for more information). + +$Id$ diff --git a/openssh/acconfig.h b/openssh/acconfig.h index 3a39d09..b6c2d40 100644 --- a/openssh/acconfig.h +++ b/openssh/acconfig.h @@ -14,10 +14,9 @@ /* SCO workaround */ #undef BROKEN_SYS_TERMIO_H -#undef HAVE_BOGUS_SYS_QUEUE_H -/* Define if you have SCO protected password database */ -#undef HAVE_SCO_PROTECTED_PW +/* Define if you have SecureWare-based protected password database */ +#undef HAVE_SECUREWARE /* If your header files don't define LOGIN_PROGRAM, then use this (detected) */ /* from environment and PATH */ @@ -32,6 +31,12 @@ /* Define if your password has a pw_change field */ #undef HAVE_PW_CHANGE_IN_PASSWD +/* Define if your system uses access rights style file descriptor passing */ +#undef HAVE_ACCRIGHTS_IN_MSGHDR + +/* Define if your system uses ancillary data style file descriptor passing */ +#undef HAVE_CONTROL_IN_MSGHDR + /* Define if you system's inet_ntoa is busted (e.g. Irix gcc issue) */ #undef BROKEN_INET_NTOA @@ -95,6 +100,9 @@ /* Builtin PRNG command timeout */ #undef ENTROPY_TIMEOUT_MSEC +/* non-privileged user for privilege separation */ +#undef SSH_PRIVSEP_USER + /* Define if you want to install preformatted manpages.*/ #undef MANTYPE @@ -157,6 +165,9 @@ /* Some versions of /bin/login need the TERM supplied on the commandline */ #undef LOGIN_NEEDS_TERM +/* Define if your login program cannot handle end of options ("--") */ +#undef LOGIN_NO_ENDOPT + /* Define if you want to specify the path to your lastlog file */ #undef CONF_LASTLOG_FILE @@ -178,13 +189,19 @@ /* Define if libc defines __progname */ #undef HAVE___PROGNAME +/* Define if compiler implements __FUNCTION__ */ +#undef HAVE___FUNCTION__ + +/* Define if compiler implements __func__ */ +#undef HAVE___func__ + /* Define this is you want GSSAPI support in the version 2 protocol */ #undef GSSAPI /* Define if you want Kerberos 5 support */ #undef KRB5 -/* Define this if you are using Heimdal version of Kerberos V5 */ +/* Define this if you are using the Heimdal version of Kerberos V5 */ #undef HEIMDAL /* Define if you want Kerberos 4 support */ @@ -232,9 +249,6 @@ /* Define if you have getpwanam(3) [SunOS 4.x] */ #undef HAVE_GETPWANAM -/* Defined if in_systm.h needs to be included with netinet/ip.h (HPUX - ) */ -#undef NEED_IN_SYSTM_H - /* Define if you have an old version of PAM which takes only one argument */ /* to pam_strerror */ #undef HAVE_OLD_PAM @@ -287,9 +301,6 @@ /* Use IPv4 for connection by default, IPv6 can still if explicity asked */ #undef IPV4_DEFAULT -/* If you have no atexit() but xatexit(), and want to use xatexit() */ -#undef HAVE_XATEXIT - /* getaddrinfo is broken (if present) */ #undef BROKEN_GETADDRINFO @@ -332,13 +343,26 @@ /* Define if you want smartcard support */ #undef SMARTCARD +/* Define if you want smartcard support using sectok */ +#undef USE_SECTOK + +/* Define if you want smartcard support using OpenSC */ +#undef USE_OPENSC + /* Define if you want to use OpenSSL's internally seeded PRNG only */ #undef OPENSSL_PRNG_ONLY +/* Define if you shouldn't strip 'tty' from your ttyname in [uw]tmp */ +#undef WITH_ABBREV_NO_TTY + +/* Define if you want a different $PATH for the superuser */ +#undef SUPERUSER_PATH + +/* Path that unprivileged child will chroot() to in privep mode */ +#undef PRIVSEP_PATH + @BOTTOM@ /* ******************* Shouldn't need to edit below this line ************** */ -#include "defines.h" - #endif /* _CONFIG_H */ diff --git a/openssh/auth-bsdauth.c b/openssh/auth-bsdauth.c index b70d48f..fa06732 100644 --- a/openssh/auth-bsdauth.c +++ b/openssh/auth-bsdauth.c @@ -22,12 +22,13 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: auth-bsdauth.c,v 1.2 2001/12/19 07:18:56 deraadt Exp $"); +RCSID("$OpenBSD: auth-bsdauth.c,v 1.3 2002/03/18 17:50:31 provos Exp $"); #ifdef BSD_AUTH #include "xmalloc.h" #include "auth.h" #include "log.h" +#include "monitor_wrap.h" static void * bsdauth_init_ctx(Authctxt *authctxt) @@ -35,7 +36,7 @@ bsdauth_init_ctx(Authctxt *authctxt) return authctxt; } -static int +int bsdauth_query(void *ctx, char **name, char **infotxt, u_int *numprompts, char ***prompts, u_int **echo_on) { @@ -76,7 +77,7 @@ bsdauth_query(void *ctx, char **name, char **infotxt, return 0; } -static int +int bsdauth_respond(void *ctx, u_int numresponses, char **responses) { Authctxt *authctxt = ctx; @@ -113,4 +114,12 @@ KbdintDevice bsdauth_device = { bsdauth_respond, bsdauth_free_ctx }; + +KbdintDevice mm_bsdauth_device = { + "bsdauth", + bsdauth_init_ctx, + mm_bsdauth_query, + mm_bsdauth_respond, + bsdauth_free_ctx +}; #endif diff --git a/openssh/auth-krb4.c b/openssh/auth-krb4.c index f7a144f..2a3cf53 100644 --- a/openssh/auth-krb4.c +++ b/openssh/auth-krb4.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-krb4.c,v 1.25 2001/12/19 07:18:56 deraadt Exp $"); +RCSID("$OpenBSD: auth-krb4.c,v 1.26 2002/03/18 01:30:10 dugsong Exp $"); #include "ssh.h" #include "ssh1.h" @@ -253,6 +253,7 @@ auth_krb4(Authctxt *authctxt, KTEXT auth, char **client) log("Kerberos v4 .klogin authorization failed for %s to " "account %s", *client, authctxt->user); xfree(*client); + *client = NULL; return (0); } /* Increment the checksum, and return it encrypted with the diff --git a/openssh/auth-krb5.c b/openssh/auth-krb5.c index d1b8d45..76c2419 100644 --- a/openssh/auth-krb5.c +++ b/openssh/auth-krb5.c @@ -1,11 +1,34 @@ /* * Kerberos v5 authentication and ticket-passing routines. - * + * * $FreeBSD: src/crypto/openssh/auth-krb5.c,v 1.6 2001/02/13 16:58:04 assar Exp $ */ +/* + * Copyright (c) 2002 Daniel Kouril. 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-krb5.c,v 1.6 2002/03/04 17:27:39 stevesk Exp $"); +RCSID("$OpenBSD: auth-krb5.c,v 1.8 2002/03/19 10:49:35 markus Exp $"); #include "ssh.h" #include "ssh1.h" diff --git a/openssh/auth-options.c b/openssh/auth-options.c index 8df6a6d..2787d29 100644 --- a/openssh/auth-options.c +++ b/openssh/auth-options.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-options.c,v 1.21 2002/01/29 14:32:03 markus Exp $"); +RCSID("$OpenBSD: auth-options.c,v 1.24 2002/05/13 20:44:58 markus Exp $"); #include "packet.h" #include "xmalloc.h" @@ -20,7 +20,10 @@ RCSID("$OpenBSD: auth-options.c,v 1.21 2002/01/29 14:32:03 markus Exp $"); #include "channels.h" #include "auth-options.h" #include "servconf.h" +#include "bufaux.h" #include "misc.h" +#include "monitor_wrap.h" +#include "auth.h" /* Flags set authorized_keys flags */ int no_port_forwarding_flag = 0; @@ -54,6 +57,7 @@ auth_clear_options(void) forced_command = NULL; } channel_clear_permitted_opens(); + auth_debug_reset(); } /* @@ -75,28 +79,28 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) while (*opts && *opts != ' ' && *opts != '\t') { cp = "no-port-forwarding"; if (strncasecmp(opts, cp, strlen(cp)) == 0) { - packet_send_debug("Port forwarding disabled."); + auth_debug_add("Port forwarding disabled."); no_port_forwarding_flag = 1; opts += strlen(cp); goto next_option; } cp = "no-agent-forwarding"; if (strncasecmp(opts, cp, strlen(cp)) == 0) { - packet_send_debug("Agent forwarding disabled."); + auth_debug_add("Agent forwarding disabled."); no_agent_forwarding_flag = 1; opts += strlen(cp); goto next_option; } cp = "no-X11-forwarding"; if (strncasecmp(opts, cp, strlen(cp)) == 0) { - packet_send_debug("X11 forwarding disabled."); + auth_debug_add("X11 forwarding disabled."); no_x11_forwarding_flag = 1; opts += strlen(cp); goto next_option; } cp = "no-pty"; if (strncasecmp(opts, cp, strlen(cp)) == 0) { - packet_send_debug("Pty allocation disabled."); + auth_debug_add("Pty allocation disabled."); no_pty_flag = 1; opts += strlen(cp); goto next_option; @@ -119,14 +123,14 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) if (!*opts) { debug("%.100s, line %lu: missing end quote", file, linenum); - packet_send_debug("%.100s, line %lu: missing end quote", + auth_debug_add("%.100s, line %lu: missing end quote", file, linenum); xfree(forced_command); forced_command = NULL; goto bad_option; } forced_command[i] = 0; - packet_send_debug("Forced command: %.900s", forced_command); + auth_debug_add("Forced command: %.900s", forced_command); opts++; goto next_option; } @@ -151,13 +155,13 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) if (!*opts) { debug("%.100s, line %lu: missing end quote", file, linenum); - packet_send_debug("%.100s, line %lu: missing end quote", + auth_debug_add("%.100s, line %lu: missing end quote", file, linenum); xfree(s); goto bad_option; } s[i] = 0; - packet_send_debug("Adding to environment: %.900s", s); + auth_debug_add("Adding to environment: %.900s", s); debug("Adding to environment: %.900s", s); opts++; new_envstring = xmalloc(sizeof(struct envstring)); @@ -188,7 +192,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) if (!*opts) { debug("%.100s, line %lu: missing end quote", file, linenum); - packet_send_debug("%.100s, line %lu: missing end quote", + auth_debug_add("%.100s, line %lu: missing end quote", file, linenum); xfree(patterns); goto bad_option; @@ -202,7 +206,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) "correct key but not from a permitted " "host (host=%.200s, ip=%.200s).", pw->pw_name, remote_host, remote_ip); - packet_send_debug("Your host '%.200s' is not " + auth_debug_add("Your host '%.200s' is not " "permitted to use this key for login.", remote_host); /* deny access */ @@ -233,7 +237,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) if (!*opts) { debug("%.100s, line %lu: missing end quote", file, linenum); - packet_send_debug("%.100s, line %lu: missing end quote", + auth_debug_add("%.100s, line %lu: missing end quote", file, linenum); xfree(patterns); goto bad_option; @@ -244,7 +248,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) sscanf(patterns, "%255[^/]/%5[0-9]", host, sport) != 2) { debug("%.100s, line %lu: Bad permitopen specification " "<%.100s>", file, linenum, patterns); - packet_send_debug("%.100s, line %lu: " + auth_debug_add("%.100s, line %lu: " "Bad permitopen specification", file, linenum); xfree(patterns); goto bad_option; @@ -252,7 +256,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) if ((port = a2port(sport)) == 0) { debug("%.100s, line %lu: Bad permitopen port <%.100s>", file, linenum, sport); - packet_send_debug("%.100s, line %lu: " + auth_debug_add("%.100s, line %lu: " "Bad permitopen port", file, linenum); xfree(patterns); goto bad_option; @@ -276,14 +280,22 @@ next_option: opts++; /* Process the next option. */ } + + if (!use_privsep) + auth_debug_send(); + /* grant access */ return 1; bad_option: log("Bad options in %.100s file, line %lu: %.50s", file, linenum, opts); - packet_send_debug("Bad options in %.100s file, line %lu: %.50s", + auth_debug_add("Bad options in %.100s file, line %lu: %.50s", file, linenum, opts); + + if (!use_privsep) + auth_debug_send(); + /* deny access */ return 0; } diff --git a/openssh/auth-pam.c b/openssh/auth-pam.c index 1ff3c3c..eb4c616 100644 --- a/openssh/auth-pam.c +++ b/openssh/auth-pam.c @@ -28,6 +28,7 @@ #include "ssh.h" #include "xmalloc.h" #include "log.h" +#include "auth.h" #include "auth-pam.h" #include "servconf.h" #include "canohost.h" @@ -199,10 +200,11 @@ void do_pam_cleanup_proc(void *context) } /* Attempt password authentation using PAM */ -int auth_pam_password(struct passwd *pw, const char *password) +int auth_pam_password(Authctxt *authctxt, const char *password) { extern ServerOptions options; int pam_retval; + struct passwd *pw = authctxt->pw; do_pam_set_conv(&conv); @@ -247,15 +249,18 @@ int do_pam_account(char *username, char *remote_user) } pam_retval = pam_acct_mgmt(__pamh, 0); + debug2("pam_acct_mgmt() = %d", pam_retval); switch (pam_retval) { case PAM_SUCCESS: /* This is what we want */ break; +#if 0 case PAM_NEW_AUTHTOK_REQD: message_cat(&__pam_msg, NEW_AUTHTOK_MSG); /* flag that password change is necessary */ password_change_required = 1; break; +#endif default: log("PAM rejected by account configuration[%d]: " "%.200s", pam_retval, PAM_STRERROR(__pamh, @@ -294,6 +299,9 @@ void do_pam_setcred(int init) { int pam_retval; + if (__pamh == NULL) + return; + do_pam_set_conv(&conv); debug("PAM establishing creds"); diff --git a/openssh/auth-pam.h b/openssh/auth-pam.h index de27b83..71996d9 100644 --- a/openssh/auth-pam.h +++ b/openssh/auth-pam.h @@ -7,7 +7,7 @@ void start_pam(const char *user); void finish_pam(void); -int auth_pam_password(struct passwd *pw, const char *password); +int auth_pam_password(Authctxt *authctxt, const char *password); char **fetch_pam_environment(void); int do_pam_authenticate(int flags); int do_pam_account(char *username, char *remote_user); diff --git a/openssh/auth-passwd.c b/openssh/auth-passwd.c index 095b9ba..ad3bd35 100644 --- a/openssh/auth-passwd.c +++ b/openssh/auth-passwd.c @@ -36,49 +36,49 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-passwd.c,v 1.24 2002/03/04 12:43:06 markus Exp $"); - -#if !defined(USE_PAM) && !defined(HAVE_OSF_SIA) +RCSID("$OpenBSD: auth-passwd.c,v 1.26 2002/05/10 02:30:12 mouring Exp $"); #include "packet.h" #include "log.h" #include "servconf.h" #include "auth.h" -#ifdef HAVE_CRYPT_H -# include -#endif -#ifdef WITH_AIXAUTHENTICATE -# include -#endif -#ifdef __hpux -# include -# include -#endif -#ifdef HAVE_SCO_PROTECTED_PW -# include -# include -# include -#endif /* HAVE_SCO_PROTECTED_PW */ -#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) -# include -#endif -#if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) -# include -# include -# include -#endif -#if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) -# include "md5crypt.h" -#endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */ - -#ifdef HAVE_CYGWIN -#undef ERROR -#include -#include -#define is_winnt (GetVersion() < 0x80000000) -#endif - +#if !defined(USE_PAM) && !defined(HAVE_OSF_SIA) +/* Don't need any of these headers for the PAM or SIA cases */ +# ifdef HAVE_CRYPT_H +# include +# endif +# ifdef WITH_AIXAUTHENTICATE +# include +# endif +# ifdef __hpux +# include +# include +# endif +# ifdef HAVE_SECUREWARE +# include +# include +# include +# endif /* HAVE_SECUREWARE */ +# if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) +# include +# endif +# if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) +# include +# include +# include +# endif +# if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) +# include "md5crypt.h" +# endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */ + +# ifdef HAVE_CYGWIN +# undef ERROR +# include +# include +# define is_winnt (GetVersion() < 0x80000000) +# endif +#endif /* !USE_PAM && !HAVE_OSF_SIA */ extern ServerOptions options; @@ -89,16 +89,22 @@ extern ServerOptions options; int auth_password(Authctxt *authctxt, const char *password) { +#if defined(USE_PAM) + if (*password == '\0' && options.permit_empty_passwd == 0) + return 0; + return auth_pam_password(authctxt, password); +#elif defined(HAVE_OSF_SIA) + if (*password == '\0' && options.permit_empty_passwd == 0) + return 0; + return auth_sia_password(authctxt, password); +#else struct passwd * pw = authctxt->pw; char *encrypted_password; char *pw_password; char *salt; -#ifdef __hpux - struct pr_passwd *spw; -#endif -#ifdef HAVE_SCO_PROTECTED_PW +#if defined(__hpux) || defined(HAVE_SECUREWARE) struct pr_passwd *spw; -#endif /* HAVE_SCO_PROTECTED_PW */ +#endif /* __hpux || HAVE_SECUREWARE */ #if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) struct spwd *spw; #endif @@ -174,21 +180,20 @@ auth_password(Authctxt *authctxt, const char *password) pw_password = spw->sp_pwdp; #endif /* defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) */ -#ifdef HAVE_SCO_PROTECTED_PW - spw = getprpwnam(pw->pw_name); - if (spw != NULL) - pw_password = spw->ufld.fd_encrypt; -#endif /* HAVE_SCO_PROTECTED_PW */ - #if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) if (issecure() && (spw = getpwanam(pw->pw_name)) != NULL) pw_password = spw->pwa_passwd; #endif /* defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) */ -#if defined(__hpux) +#ifdef HAVE_SECUREWARE + if ((spw = getprpwnam(pw->pw_name)) != NULL) + pw_password = spw->ufld.fd_encrypt; +#endif /* HAVE_SECUREWARE */ + +#if defined(__hpux) && !defined(HAVE_SECUREWARE) if (iscomsec() && (spw = getprpwnam(pw->pw_name)) != NULL) pw_password = spw->ufld.fd_encrypt; -#endif /* defined(__hpux) */ +#endif /* defined(__hpux) && !defined(HAVE_SECUREWARE) */ /* Check for users with no password. */ if ((password[0] == '\0') && (pw_password[0] == '\0')) @@ -205,21 +210,21 @@ auth_password(Authctxt *authctxt, const char *password) else encrypted_password = crypt(password, salt); #else /* HAVE_MD5_PASSWORDS */ -# ifdef __hpux +# if defined(__hpux) && !defined(HAVE_SECUREWARE) if (iscomsec()) encrypted_password = bigcrypt(password, salt); else encrypted_password = crypt(password, salt); # else -# ifdef HAVE_SCO_PROTECTED_PW +# ifdef HAVE_SECUREWARE encrypted_password = bigcrypt(password, salt); # else encrypted_password = crypt(password, salt); -# endif /* HAVE_SCO_PROTECTED_PW */ -# endif /* __hpux */ +# endif /* HAVE_SECUREWARE */ +# endif /* __hpux && !defined(HAVE_SECUREWARE) */ #endif /* HAVE_MD5_PASSWORDS */ /* Authentication is accepted if the encrypted passwords are identical. */ return (strcmp(encrypted_password, pw_password) == 0); -} #endif /* !USE_PAM && !HAVE_OSF_SIA */ +} diff --git a/openssh/auth-rh-rsa.c b/openssh/auth-rh-rsa.c index d1b7ae9..d7848d0 100644 --- a/openssh/auth-rh-rsa.c +++ b/openssh/auth-rh-rsa.c @@ -13,7 +13,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rh-rsa.c,v 1.29 2002/03/04 12:43:06 markus Exp $"); +RCSID("$OpenBSD: auth-rh-rsa.c,v 1.34 2002/03/25 09:25:06 markus Exp $"); #include "packet.h" #include "uidswap.h" @@ -25,37 +25,48 @@ RCSID("$OpenBSD: auth-rh-rsa.c,v 1.29 2002/03/04 12:43:06 markus Exp $"); #include "auth.h" #include "canohost.h" -/* - * Tries to authenticate the user using the .rhosts file and the host using - * its host key. Returns true if authentication succeeds. - */ +#include "monitor_wrap.h" + +/* import */ +extern ServerOptions options; int -auth_rhosts_rsa(struct passwd *pw, const char *client_user, Key *client_host_key) +auth_rhosts_rsa_key_allowed(struct passwd *pw, char *cuser, char *chost, + Key *client_host_key) { - extern ServerOptions options; - const char *canonical_hostname; HostStatus host_status; - debug("Trying rhosts with RSA host authentication for client user %.100s", client_user); - - if (pw == NULL || client_host_key == NULL || client_host_key->rsa == NULL) - return 0; - /* Check if we would accept it using rhosts authentication. */ - if (!auth_rhosts(pw, client_user)) + if (!auth_rhosts(pw, cuser)) return 0; - canonical_hostname = get_canonical_hostname( - options.verify_reverse_mapping); - - debug("Rhosts RSA authentication: canonical host %.900s", canonical_hostname); - host_status = check_key_in_hostfiles(pw, client_host_key, - canonical_hostname, _PATH_SSH_SYSTEM_HOSTFILE, + chost, _PATH_SSH_SYSTEM_HOSTFILE, options.ignore_user_known_hosts ? NULL : _PATH_SSH_USER_HOSTFILE); - if (host_status != HOST_OK) { + return (host_status == HOST_OK); +} + +/* + * Tries to authenticate the user using the .rhosts file and the host using + * its host key. Returns true if authentication succeeds. + */ +int +auth_rhosts_rsa(struct passwd *pw, char *cuser, Key *client_host_key) +{ + char *chost; + + debug("Trying rhosts with RSA host authentication for client user %.100s", + cuser); + + if (pw == NULL || client_host_key == NULL || + client_host_key->rsa == NULL) + return 0; + + chost = (char *)get_canonical_hostname(options.verify_reverse_mapping); + debug("Rhosts RSA authentication: canonical host %.900s", chost); + + if (!PRIVSEP(auth_rhosts_rsa_key_allowed(pw, cuser, chost, client_host_key))) { debug("Rhosts with RSA host authentication denied: unknown or invalid host key"); packet_send_debug("Your host key cannot be verified: unknown or invalid host key."); return 0; @@ -63,9 +74,9 @@ auth_rhosts_rsa(struct passwd *pw, const char *client_user, Key *client_host_key /* A matching host key was found and is known. */ /* Perform the challenge-response dialog with the client for the host key. */ - if (!auth_rsa_challenge_dialog(client_host_key->rsa)) { + if (!auth_rsa_challenge_dialog(client_host_key)) { log("Client on %.800s failed to respond correctly to host authentication.", - canonical_hostname); + chost); return 0; } /* @@ -74,7 +85,7 @@ auth_rhosts_rsa(struct passwd *pw, const char *client_user, Key *client_host_key */ verbose("Rhosts with RSA host authentication accepted for %.100s, %.100s on %.700s.", - pw->pw_name, client_user, canonical_hostname); + pw->pw_name, cuser, chost); packet_send_debug("Rhosts with RSA host authentication accepted."); return 1; } diff --git a/openssh/auth-rhosts.c b/openssh/auth-rhosts.c index bd15261..afca1f7 100644 --- a/openssh/auth-rhosts.c +++ b/openssh/auth-rhosts.c @@ -14,7 +14,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rhosts.c,v 1.27 2002/03/04 12:43:06 markus Exp $"); +RCSID("$OpenBSD: auth-rhosts.c,v 1.28 2002/05/13 21:26:49 markus Exp $"); #include "packet.h" #include "uidswap.h" @@ -26,6 +26,7 @@ RCSID("$OpenBSD: auth-rhosts.c,v 1.27 2002/03/04 12:43:06 markus Exp $"); /* import */ extern ServerOptions options; +extern int use_privsep; /* * This function processes an rhosts-style file (.rhosts, .shosts, or @@ -69,7 +70,7 @@ check_rhosts_file(const char *filename, const char *hostname, */ switch (sscanf(buf, "%s %s %s", hostbuf, userbuf, dummy)) { case 0: - packet_send_debug("Found empty line in %.100s.", filename); + auth_debug_add("Found empty line in %.100s.", filename); continue; case 1: /* Host name only. */ @@ -79,7 +80,7 @@ check_rhosts_file(const char *filename, const char *hostname, /* Got both host and user name. */ break; case 3: - packet_send_debug("Found garbage in %.100s.", filename); + auth_debug_add("Found garbage in %.100s.", filename); continue; default: /* Weird... */ @@ -106,8 +107,8 @@ check_rhosts_file(const char *filename, const char *hostname, /* Check for empty host/user names (particularly '+'). */ if (!host[0] || !user[0]) { /* We come here if either was '+' or '-'. */ - packet_send_debug("Ignoring wild host/user names in %.100s.", - filename); + auth_debug_add("Ignoring wild host/user names in %.100s.", + filename); continue; } /* Verify that host name matches. */ @@ -130,8 +131,8 @@ check_rhosts_file(const char *filename, const char *hostname, /* If the entry was negated, deny access. */ if (negated) { - packet_send_debug("Matched negative entry in %.100s.", - filename); + auth_debug_add("Matched negative entry in %.100s.", + filename); return 0; } /* Accept authentication. */ @@ -153,16 +154,14 @@ int auth_rhosts(struct passwd *pw, const char *client_user) { const char *hostname, *ipaddr; - int ret; hostname = get_canonical_hostname(options.verify_reverse_mapping); ipaddr = get_remote_ipaddr(); - ret = auth_rhosts2(pw, client_user, hostname, ipaddr); - return ret; + return auth_rhosts2(pw, client_user, hostname, ipaddr); } -int -auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname, +static int +auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostname, const char *ipaddr) { char buf[1024]; @@ -205,13 +204,13 @@ auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname, if (pw->pw_uid != 0) { if (check_rhosts_file(_PATH_RHOSTS_EQUIV, hostname, ipaddr, client_user, pw->pw_name)) { - packet_send_debug("Accepted for %.100s [%.100s] by /etc/hosts.equiv.", + auth_debug_add("Accepted for %.100s [%.100s] by /etc/hosts.equiv.", hostname, ipaddr); return 1; } if (check_rhosts_file(_PATH_SSH_HOSTS_EQUIV, hostname, ipaddr, client_user, pw->pw_name)) { - packet_send_debug("Accepted for %.100s [%.100s] by %.100s.", + auth_debug_add("Accepted for %.100s [%.100s] by %.100s.", hostname, ipaddr, _PATH_SSH_HOSTS_EQUIV); return 1; } @@ -221,19 +220,19 @@ auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname, * not group or world writable. */ if (stat(pw->pw_dir, &st) < 0) { - log("Rhosts authentication refused for %.100s: no home directory %.200s", - pw->pw_name, pw->pw_dir); - packet_send_debug("Rhosts authentication refused for %.100s: no home directory %.200s", - pw->pw_name, pw->pw_dir); + log("Rhosts authentication refused for %.100s: " + "no home directory %.200s", pw->pw_name, pw->pw_dir); + auth_debug_add("Rhosts authentication refused for %.100s: " + "no home directory %.200s", pw->pw_name, pw->pw_dir); return 0; } if (options.strict_modes && ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || (st.st_mode & 022) != 0)) { - log("Rhosts authentication refused for %.100s: bad ownership or modes for home directory.", - pw->pw_name); - packet_send_debug("Rhosts authentication refused for %.100s: bad ownership or modes for home directory.", - pw->pw_name); + log("Rhosts authentication refused for %.100s: " + "bad ownership or modes for home directory.", pw->pw_name); + auth_debug_add("Rhosts authentication refused for %.100s: " + "bad ownership or modes for home directory.", pw->pw_name); return 0; } /* Temporarily use the user's uid. */ @@ -259,21 +258,23 @@ auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname, (st.st_mode & 022) != 0)) { log("Rhosts authentication refused for %.100s: bad modes for %.200s", pw->pw_name, buf); - packet_send_debug("Bad file modes for %.200s", buf); + auth_debug_add("Bad file modes for %.200s", buf); continue; } /* Check if we have been configured to ignore .rhosts and .shosts files. */ if (options.ignore_rhosts) { - packet_send_debug("Server has been configured to ignore %.100s.", - rhosts_files[rhosts_file_index]); + auth_debug_add("Server has been configured to ignore %.100s.", + rhosts_files[rhosts_file_index]); continue; } /* Check if authentication is permitted by the file. */ if (check_rhosts_file(buf, hostname, ipaddr, client_user, pw->pw_name)) { - packet_send_debug("Accepted by %.100s.", - rhosts_files[rhosts_file_index]); + auth_debug_add("Accepted by %.100s.", + rhosts_files[rhosts_file_index]); /* Restore the privileged uid. */ restore_uid(); + auth_debug_add("Accepted host %s ip %s client_user %s server_user %s", + hostname, ipaddr, client_user, pw->pw_name); return 1; } } @@ -282,3 +283,16 @@ auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname, restore_uid(); return 0; } + +int +auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname, + const char *ipaddr) +{ + int ret; + + auth_debug_reset(); + ret = auth_rhosts2_raw(pw, client_user, hostname, ipaddr); + if (!use_privsep) + auth_debug_send(); + return ret; +} diff --git a/openssh/auth-rsa.c b/openssh/auth-rsa.c index f7ae03c..493f14b 100644 --- a/openssh/auth-rsa.c +++ b/openssh/auth-rsa.c @@ -14,7 +14,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rsa.c,v 1.50 2001/12/28 14:50:54 markus Exp $"); +RCSID("$OpenBSD: auth-rsa.c,v 1.55 2002/03/29 19:18:33 stevesk Exp $"); #include #include @@ -32,6 +32,8 @@ RCSID("$OpenBSD: auth-rsa.c,v 1.50 2001/12/28 14:50:54 markus Exp $"); #include "servconf.h" #include "auth.h" #include "hostfile.h" +#include "monitor_wrap.h" +#include "ssh.h" /* import */ extern ServerOptions options; @@ -52,6 +54,58 @@ extern u_char session_id[16]; * description of the options. */ +BIGNUM * +auth_rsa_generate_challenge(Key *key) +{ + BIGNUM *challenge; + BN_CTX *ctx; + + if ((challenge = BN_new()) == NULL) + fatal("auth_rsa_generate_challenge: BN_new() failed"); + /* Generate a random challenge. */ + BN_rand(challenge, 256, 0, 0); + if ((ctx = BN_CTX_new()) == NULL) + fatal("auth_rsa_generate_challenge: BN_CTX_new() failed"); + BN_mod(challenge, challenge, key->rsa->n, ctx); + BN_CTX_free(ctx); + + return challenge; +} + +int +auth_rsa_verify_response(Key *key, BIGNUM *challenge, u_char response[16]) +{ + u_char buf[32], mdbuf[16]; + MD5_CTX md; + int len; + + /* don't allow short keys */ + if (BN_num_bits(key->rsa->n) < SSH_RSA_MINIMUM_MODULUS_SIZE) { + error("auth_rsa_verify_response: n too small: %d bits", + BN_num_bits(key->rsa->n)); + return (0); + } + + /* The response is MD5 of decrypted challenge plus session id. */ + len = BN_num_bytes(challenge); + if (len <= 0 || len > 32) + fatal("auth_rsa_verify_response: bad challenge length %d", len); + memset(buf, 0, 32); + BN_bn2bin(challenge, buf + 32 - len); + MD5_Init(&md); + MD5_Update(&md, buf, 32); + MD5_Update(&md, session_id, 16); + MD5_Final(mdbuf, &md); + + /* Verify that the response is the original challenge. */ + if (memcmp(response, mdbuf, 16) != 0) { + /* Wrong answer. */ + return (0); + } + /* Correct answer. */ + return (1); +} + /* * Performs the RSA authentication challenge-response dialog with the client, * and returns true (non-zero) if the client gave the correct answer to @@ -59,29 +113,19 @@ extern u_char session_id[16]; */ int -auth_rsa_challenge_dialog(RSA *pk) +auth_rsa_challenge_dialog(Key *key) { BIGNUM *challenge, *encrypted_challenge; - BN_CTX *ctx; - u_char buf[32], mdbuf[16], response[16]; - MD5_CTX md; - u_int i; - int len; + u_char response[16]; + int i, success; if ((encrypted_challenge = BN_new()) == NULL) fatal("auth_rsa_challenge_dialog: BN_new() failed"); - if ((challenge = BN_new()) == NULL) - fatal("auth_rsa_challenge_dialog: BN_new() failed"); - /* Generate a random challenge. */ - BN_rand(challenge, 256, 0, 0); - if ((ctx = BN_CTX_new()) == NULL) - fatal("auth_rsa_challenge_dialog: BN_CTX_new() failed"); - BN_mod(challenge, challenge, pk->n, ctx); - BN_CTX_free(ctx); + challenge = PRIVSEP(auth_rsa_generate_challenge(key)); /* Encrypt the challenge with the public key. */ - rsa_public_encrypt(encrypted_challenge, challenge, pk); + rsa_public_encrypt(encrypted_challenge, challenge, key->rsa); /* Send the encrypted challenge to the client. */ packet_start(SSH_SMSG_AUTH_RSA_CHALLENGE); @@ -96,48 +140,26 @@ auth_rsa_challenge_dialog(RSA *pk) response[i] = packet_get_char(); packet_check_eom(); - /* The response is MD5 of decrypted challenge plus session id. */ - len = BN_num_bytes(challenge); - if (len <= 0 || len > 32) - fatal("auth_rsa_challenge_dialog: bad challenge length %d", len); - memset(buf, 0, 32); - BN_bn2bin(challenge, buf + 32 - len); - MD5_Init(&md); - MD5_Update(&md, buf, 32); - MD5_Update(&md, session_id, 16); - MD5_Final(mdbuf, &md); + success = PRIVSEP(auth_rsa_verify_response(key, challenge, response)); BN_clear_free(challenge); - - /* Verify that the response is the original challenge. */ - if (memcmp(response, mdbuf, 16) != 0) { - /* Wrong answer. */ - return 0; - } - /* Correct answer. */ - return 1; + return (success); } /* - * Performs the RSA authentication dialog with the client. This returns - * 0 if the client could not be authenticated, and 1 if authentication was - * successful. This may exit if there is a serious protocol violation. + * check if there's user key matching client_n, + * return key if login is allowed, NULL otherwise */ int -auth_rsa(struct passwd *pw, BIGNUM *client_n) +auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey) { char line[8192], *file; - int authenticated; + int allowed = 0; u_int bits; FILE *f; u_long linenum = 0; struct stat st; Key *key; - char *fp; - - /* no user given */ - if (pw == NULL) - return 0; /* Temporarily use the user's uid. */ temporarily_use_uid(pw); @@ -151,29 +173,27 @@ auth_rsa(struct passwd *pw, BIGNUM *client_n) /* Restore the privileged uid. */ restore_uid(); xfree(file); - return 0; + return (0); } /* Open the file containing the authorized keys. */ f = fopen(file, "r"); if (!f) { /* Restore the privileged uid. */ restore_uid(); - packet_send_debug("Could not open %.900s for reading.", file); - packet_send_debug("If your home is on an NFS volume, it may need to be world-readable."); xfree(file); - return 0; + return (0); } if (options.strict_modes && secure_filename(f, file, pw, line, sizeof(line)) != 0) { xfree(file); fclose(f); log("Authentication refused: %s", line); - packet_send_debug("Authentication refused: %s", line); restore_uid(); - return 0; + return (0); } - /* Flag indicating whether authentication has succeeded. */ - authenticated = 0; + + /* Flag indicating whether the key is allowed. */ + allowed = 0; key = key_new(KEY_RSA1); @@ -238,32 +258,8 @@ auth_rsa(struct passwd *pw, BIGNUM *client_n) if (!auth_parse_options(pw, options, file, linenum)) continue; - /* Perform the challenge-response dialog for this key. */ - if (!auth_rsa_challenge_dialog(key->rsa)) { - /* Wrong response. */ - verbose("Wrong response to RSA authentication challenge."); - packet_send_debug("Wrong response to RSA authentication challenge."); - /* - * Break out of the loop. Otherwise we might send - * another challenge and break the protocol. - */ - break; - } - /* - * Correct response. The client has been successfully - * authenticated. Note that we have not yet processed the - * options; this will be reset if the options cause the - * authentication to be rejected. - * Break out of the loop if authentication was successful; - * otherwise continue searching. - */ - authenticated = 1; - - fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); - verbose("Found matching %s key: %s", - key_type(key), fp); - xfree(fp); - + /* break out, this key is allowed */ + allowed = 1; break; } @@ -274,13 +270,58 @@ auth_rsa(struct passwd *pw, BIGNUM *client_n) xfree(file); fclose(f); - key_free(key); - - if (authenticated) - packet_send_debug("RSA authentication accepted."); + /* return key if allowed */ + if (allowed && rkey != NULL) + *rkey = key; else + key_free(key); + return (allowed); +} + +/* + * Performs the RSA authentication dialog with the client. This returns + * 0 if the client could not be authenticated, and 1 if authentication was + * successful. This may exit if there is a serious protocol violation. + */ +int +auth_rsa(struct passwd *pw, BIGNUM *client_n) +{ + Key *key; + char *fp; + + /* no user given */ + if (pw == NULL) + return 0; + + if (!PRIVSEP(auth_rsa_key_allowed(pw, client_n, &key))) { auth_clear_options(); + return (0); + } + + /* Perform the challenge-response dialog for this key. */ + if (!auth_rsa_challenge_dialog(key)) { + /* Wrong response. */ + verbose("Wrong response to RSA authentication challenge."); + packet_send_debug("Wrong response to RSA authentication challenge."); + /* + * Break out of the loop. Otherwise we might send + * another challenge and break the protocol. + */ + key_free(key); + return (0); + } + /* + * Correct response. The client has been successfully + * authenticated. Note that we have not yet processed the + * options; this will be reset if the options cause the + * authentication to be rejected. + */ + fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); + verbose("Found matching %s key: %s", + key_type(key), fp); + xfree(fp); + key_free(key); - /* Return authentication result. */ - return authenticated; + packet_send_debug("RSA authentication accepted."); + return (1); } diff --git a/openssh/auth-sia.c b/openssh/auth-sia.c index 8585f5d..58b17c1 100644 --- a/openssh/auth-sia.c +++ b/openssh/auth-sia.c @@ -1,7 +1,32 @@ +/* + * Copyright (c) 2002 Chris Adams. 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" #ifdef HAVE_OSF_SIA #include "ssh.h" +#include "auth.h" #include "auth-sia.h" #include "log.h" #include "servconf.h" @@ -23,15 +48,16 @@ extern char **saved_argv; extern int errno; int -auth_sia_password(char *user, char *pass) +auth_sia_password(Authctxt *authctxt, char *pass) { int ret; SIAENTITY *ent = NULL; const char *host; + char *user = authctxt->user; host = get_canonical_hostname(options.verify_reverse_mapping); - if (!user || !pass) + if (!user || !pass || pass[0] == '\0') return(0); if (sia_ses_init(&ent, saved_argc, saved_argv, host, user, NULL, 0, @@ -39,7 +65,7 @@ auth_sia_password(char *user, char *pass) return(0); if ((ret = sia_ses_authent(NULL, pass, ent)) != SIASUCCESS) { - error("couldn't authenticate %s from %s", user, host); + error("Couldn't authenticate %s from %s", user, host); if (ret & SIASTOP) sia_ses_release(&ent); return(0); @@ -53,7 +79,6 @@ auth_sia_password(char *user, char *pass) void session_setup_sia(char *user, char *tty) { - int ret; struct passwd *pw; SIAENTITY *ent = NULL; const char *host; @@ -62,46 +87,38 @@ session_setup_sia(char *user, char *tty) if (sia_ses_init(&ent, saved_argc, saved_argv, host, user, tty, 0, NULL) != SIASUCCESS) { - error("sia_ses_init failed"); - exit(1); + fatal("sia_ses_init failed"); } if ((pw = getpwnam(user)) == NULL) { sia_ses_release(&ent); - error("getpwnam(%s) failed: %s", user, strerror(errno)); - exit(1); + fatal("getpwnam: no user: %s", user); } if (sia_make_entity_pwd(pw, ent) != SIASUCCESS) { sia_ses_release(&ent); - error("sia_make_entity_pwd failed"); - exit(1); + fatal("sia_make_entity_pwd failed"); } ent->authtype = SIA_A_NONE; if (sia_ses_estab(sia_collect_trm, ent) != SIASUCCESS) { - error("couldn't establish session for %s from %s", user, + fatal("Couldn't establish session for %s from %s", user, host); - exit(1); } if (setpriority(PRIO_PROCESS, 0, 0) == -1) { sia_ses_release(&ent); - error("setpriority failed: %s", strerror (errno)); - exit(1); + fatal("setpriority: %s", strerror (errno)); } if (sia_ses_launch(sia_collect_trm, ent) != SIASUCCESS) { - error("couldn't launch session for %s from %s", user, host); - exit(1); + fatal("Couldn't launch session for %s from %s", user, host); } sia_ses_release(&ent); if (setreuid(geteuid(), geteuid()) < 0) { - error("setreuid failed: %s", strerror (errno)); - exit(1); + fatal("setreuid: %s", strerror(errno)); } } #endif /* HAVE_OSF_SIA */ - diff --git a/openssh/auth-sia.h b/openssh/auth-sia.h index eaa9333..caa5841 100644 --- a/openssh/auth-sia.h +++ b/openssh/auth-sia.h @@ -1,8 +1,32 @@ +/* + * Copyright (c) 2002 Chris Adams. 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" #ifdef HAVE_OSF_SIA -int auth_sia_password(char *user, char *pass); +int auth_sia_password(Authctxt *authctxt, char *pass); void session_setup_sia(char *user, char *tty); #endif /* HAVE_OSF_SIA */ diff --git a/openssh/auth-skey.c b/openssh/auth-skey.c index df19f75..b645504 100644 --- a/openssh/auth-skey.c +++ b/openssh/auth-skey.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: auth-skey.c,v 1.16 2002/01/12 13:10:29 markus Exp $"); +RCSID("$OpenBSD: auth-skey.c,v 1.18 2002/05/13 02:37:39 itojun Exp $"); #ifdef SKEY @@ -30,6 +30,7 @@ RCSID("$OpenBSD: auth-skey.c,v 1.16 2002/01/12 13:10:29 markus Exp $"); #include "xmalloc.h" #include "auth.h" +#include "monitor_wrap.h" static void * skey_init_ctx(Authctxt *authctxt) @@ -37,9 +38,7 @@ skey_init_ctx(Authctxt *authctxt) return authctxt; } -#define PROMPT "\nS/Key Password: " - -static int +int skey_query(void *ctx, char **name, char **infotxt, u_int* numprompts, char ***prompts, u_int **echo_on) { @@ -58,16 +57,16 @@ skey_query(void *ctx, char **name, char **infotxt, *echo_on = xmalloc(*numprompts * sizeof(u_int)); (*echo_on)[0] = 0; - len = strlen(challenge) + strlen(PROMPT) + 1; + len = strlen(challenge) + strlen(SKEY_PROMPT) + 1; p = xmalloc(len); strlcpy(p, challenge, len); - strlcat(p, PROMPT, len); + strlcat(p, SKEY_PROMPT, len); (*prompts)[0] = p; return 0; } -static int +int skey_respond(void *ctx, u_int numresponses, char **responses) { Authctxt *authctxt = ctx; @@ -93,4 +92,12 @@ KbdintDevice skey_device = { skey_respond, skey_free_ctx }; + +KbdintDevice mm_skey_device = { + "skey", + skey_init_ctx, + mm_skey_query, + mm_skey_respond, + skey_free_ctx +}; #endif /* SKEY */ diff --git a/openssh/auth.c b/openssh/auth.c index 26dce5b..066b50d 100644 --- a/openssh/auth.c +++ b/openssh/auth.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth.c,v 1.35 2002/03/01 13:12:10 markus Exp $"); +RCSID("$OpenBSD: auth.c,v 1.43 2002/05/17 14:27:55 millert Exp $"); #ifdef HAVE_LOGIN_H #include @@ -48,10 +48,17 @@ RCSID("$OpenBSD: auth.c,v 1.35 2002/03/01 13:12:10 markus Exp $"); #include "bufaux.h" #include "uidswap.h" #include "tildexpand.h" +#include "misc.h" +#include "bufaux.h" +#include "packet.h" /* import */ extern ServerOptions options; +/* Debugging messages */ +Buffer auth_debug; +int auth_debug_init; + /* * Check if the user is allowed to log in via ssh. If user is listed * in DenyUsers or one of user's groups is listed in DenyGroups, false @@ -79,18 +86,35 @@ allowed_user(struct passwd * pw) if (!pw || !pw->pw_name) return 0; +#define DAY (24L * 60 * 60) /* 1 day in seconds */ spw = getspnam(pw->pw_name); if (spw != NULL) { - int days = time(NULL) / 86400; + time_t today = time(NULL) / DAY; + debug3("allowed_user: today %d sp_expire %d sp_lstchg %d" + " sp_max %d", (int)today, (int)spw->sp_expire, + (int)spw->sp_lstchg, (int)spw->sp_max); + + /* + * We assume account and password expiration occurs the + * day after the day specified. + */ + if (spw->sp_expire != -1 && today > spw->sp_expire) { + log("Account %.100s has expired", pw->pw_name); + return 0; + } - /* Check account expiry */ - if ((spw->sp_expire >= 0) && (days > spw->sp_expire)) + if (spw->sp_lstchg == 0) { + log("User %.100s password has expired (root forced)", + pw->pw_name); return 0; + } - /* Check password expiry */ - if ((spw->sp_lstchg >= 0) && (spw->sp_max >= 0) && - (days > (spw->sp_lstchg + spw->sp_max))) + if (spw->sp_max != -1 && + today > spw->sp_lstchg + spw->sp_max) { + log("User %.100s password has expired (password aged)", + pw->pw_name); return 0; + } } #else /* Shouldn't be called if pw is NULL, but better safe than sorry... */ @@ -110,7 +134,8 @@ allowed_user(struct passwd * pw) pw->pw_name, shell); return 0; } - if (!((st.st_mode & S_IFREG) && (st.st_mode & (S_IXOTH|S_IXUSR|S_IXGRP)))) { + if (S_ISREG(st.st_mode) == 0 || + (st.st_mode & (S_IXOTH|S_IXUSR|S_IXGRP)) == 0) { log("User %.100s not allowed because shell %.100s is not executable", pw->pw_name, shell); return 0; @@ -124,17 +149,17 @@ allowed_user(struct passwd * pw) /* Return false if user is listed in DenyUsers */ if (options.num_deny_users > 0) { for (i = 0; i < options.num_deny_users; i++) - if (match_user(pw->pw_name, hostname, ipaddr, + if (match_user(pw->pw_name, hostname, ipaddr, options.deny_users[i])) { - log("User %.100s not allowed because listed in DenyUsers", - pw->pw_name); + log("User %.100s not allowed because listed in DenyUsers", + pw->pw_name); return 0; } } /* Return false if AllowUsers isn't empty and user isn't listed there */ if (options.num_allow_users > 0) { for (i = 0; i < options.num_allow_users; i++) - if (match_user(pw->pw_name, hostname, ipaddr, + if (match_user(pw->pw_name, hostname, ipaddr, options.allow_users[i])) break; /* i < options.num_allow_users iff we break for loop */ @@ -438,3 +463,77 @@ secure_filename(FILE *f, const char *file, struct passwd *pw, } return 0; } + +struct passwd * +getpwnamallow(const char *user) +{ +#ifdef HAVE_LOGIN_CAP + extern login_cap_t *lc; +#ifdef BSD_AUTH + auth_session_t *as; +#endif +#endif + struct passwd *pw; + + pw = getpwnam(user); + if (pw == NULL || !allowed_user(pw)) + return (NULL); +#ifdef HAVE_LOGIN_CAP + if ((lc = login_getclass(pw->pw_class)) == NULL) { + debug("unable to get login class: %s", user); + return (NULL); + } +#ifdef BSD_AUTH + if ((as = auth_open()) == NULL || auth_setpwd(as, pw) != 0 || + auth_approval(as, lc, pw->pw_name, "ssh") <= 0) { + debug("Approval failure for %s", user); + pw = NULL; + } + if (as != NULL) + auth_close(as); +#endif +#endif + if (pw != NULL) + return (pwcopy(pw)); + return (NULL); +} + +void +auth_debug_add(const char *fmt,...) +{ + char buf[1024]; + va_list args; + + if (!auth_debug_init) + return; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + buffer_put_cstring(&auth_debug, buf); +} + +void +auth_debug_send(void) +{ + char *msg; + + if (!auth_debug_init) + return; + while (buffer_len(&auth_debug)) { + msg = buffer_get_string(&auth_debug, NULL); + packet_send_debug("%s", msg); + xfree(msg); + } +} + +void +auth_debug_reset(void) +{ + if (auth_debug_init) + buffer_clear(&auth_debug); + else { + buffer_init(&auth_debug); + auth_debug_init = 1; + } +} diff --git a/openssh/auth.h b/openssh/auth.h index cbf282c..6627f80 100644 --- a/openssh/auth.h +++ b/openssh/auth.h @@ -1,4 +1,4 @@ -/* $OpenBSD: auth.h,v 1.29 2002/03/04 17:27:39 stevesk Exp $ */ +/* $OpenBSD: auth.h,v 1.37 2002/05/13 20:44:58 markus Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -89,14 +89,21 @@ struct KbdintDevice void (*free_ctx)(void *ctx); }; -int auth_rhosts(struct passwd *, const char *); +int auth_rhosts(struct passwd *, const char *); int auth_rhosts2(struct passwd *, const char *, const char *, const char *); -int auth_rhosts_rsa(struct passwd *, const char *, Key *); +int auth_rhosts_rsa(struct passwd *, char *, Key *); int auth_password(Authctxt *, const char *); int auth_rsa(struct passwd *, BIGNUM *); -int auth_rsa_challenge_dialog(RSA *); +int auth_rsa_challenge_dialog(Key *); +BIGNUM *auth_rsa_generate_challenge(Key *); +int auth_rsa_verify_response(Key *, BIGNUM *, u_char[]); +int auth_rsa_key_allowed(struct passwd *, BIGNUM *, Key **); + +int auth_rhosts_rsa_key_allowed(struct passwd *, char *, char *, Key *); +int hostbased_key_allowed(struct passwd *, const char *, char *, Key *); +int user_key_allowed(struct passwd *, Key *); #ifdef KRB4 #include @@ -122,18 +129,27 @@ 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 *); void userauth_finish(Authctxt *, int, char *); int auth_root_allowed(char *); +char *auth2_read_banner(void); + +void privsep_challenge_enable(void); + int auth2_challenge(Authctxt *, char *); void auth2_challenge_stop(Authctxt *); +int bsdauth_query(void *, char **, char **, u_int *, char ***, u_int **); +int bsdauth_respond(void *, u_int, char **); +int skey_query(void *, char **, char **, u_int *, char ***, u_int **); +int skey_respond(void *, u_int, char **); int allowed_user(struct passwd *); +struct passwd * getpwnamallow(const char *user); char *get_challenge(Authctxt *); int verify_response(Authctxt *, const char *); @@ -151,8 +167,20 @@ HostStatus check_key_in_hostfiles(struct passwd *, Key *, const char *, const char *, const char *); +/* hostkey handling */ +Key *get_hostkey_by_index(int); +Key *get_hostkey_by_type(int); +int get_hostkey_index(Key *); +int ssh1_session_key(BIGNUM *); + +/* debug messages during authentication */ +void auth_debug_add(const char *fmt,...) __attribute__((format(printf, 1, 2))); +void auth_debug_send(void); +void auth_debug_reset(void); + #define AUTH_FAIL_MAX 6 #define AUTH_FAIL_LOG (AUTH_FAIL_MAX/2) #define AUTH_FAIL_MSG "Too many authentication failures for %.100s" +#define SKEY_PROMPT "\nS/Key Password: " #endif diff --git a/openssh/auth1.c b/openssh/auth1.c index 67b484b..8dddfc9 100644 --- a/openssh/auth1.c +++ b/openssh/auth1.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth1.c,v 1.35 2002/02/03 17:53:25 markus Exp $"); +RCSID("$OpenBSD: auth1.c,v 1.40 2002/04/10 08:21:47 markus Exp $"); #include "xmalloc.h" #include "rsa.h" @@ -25,8 +25,8 @@ RCSID("$OpenBSD: auth1.c,v 1.35 2002/02/03 17:53:25 markus Exp $"); #include "auth.h" #include "channels.h" #include "session.h" -#include "misc.h" #include "uidswap.h" +#include "monitor_wrap.h" /* import */ extern ServerOptions options; @@ -200,13 +200,7 @@ do_authloop(Authctxt *authctxt) #if defined(KRB4) || defined(KRB5) (!options.kerberos_authentication || options.kerberos_or_local_passwd) && #endif -#ifdef USE_PAM - auth_pam_password(pw, "")) { -#elif defined(HAVE_OSF_SIA) - 0) { -#else - auth_password(authctxt, "")) { -#endif + PRIVSEP(auth_password(authctxt, ""))) { auth_log(authctxt, 1, "without authentication", ""); return; } @@ -397,17 +391,8 @@ do_authloop(Authctxt *authctxt) password = packet_get_string(&dlen); packet_check_eom(); -#ifdef USE_PAM - /* Do PAM auth with password */ - authenticated = auth_pam_password(pw, password); -#elif defined(HAVE_OSF_SIA) - /* Do SIA auth with password */ - authenticated = auth_sia_password(authctxt->user, - password); -#else /* !USE_PAM && !HAVE_OSF_SIA */ /* Try authentication with the password. */ - authenticated = auth_password(authctxt, password); -#endif /* USE_PAM */ + authenticated = PRIVSEP(auth_password(authctxt, password)); memset(password, 0, strlen(password)); xfree(password); @@ -472,7 +457,8 @@ do_authloop(Authctxt *authctxt) authenticated = 0; #endif #ifdef USE_PAM - if (authenticated && !do_pam_account(pw->pw_name, client_user)) + if (!use_privsep && authenticated && + !do_pam_account(pw->pw_name, client_user)) authenticated = 0; #endif @@ -506,13 +492,12 @@ 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; - struct passwd *pw; u_int ulen; - char *p, *user, *style = NULL; + char *user, *style = NULL; /* Get the name of the user that we wish to log in as. */ packet_read_expect(SSH_CMSG_USER); @@ -529,29 +514,31 @@ do_authentication(void) if ((style = strchr(user, ':')) != NULL) *style++ = '\0'; +#ifdef KRB5 /* XXX - SSH.com Kerberos v5 braindeath. */ - if ((p = strchr(user, '@')) != NULL) - *p = '\0'; + if ((datafellows & SSH_BUG_K5USER) && + options.kerberos_authentication) { + char *p; + if ((p = strchr(user, '@')) != NULL) + *p = '\0'; + } +#endif authctxt = authctxt_new(); authctxt->user = user; authctxt->style = style; /* Verify that the user is a valid user. */ - pw = getpwnam(user); - if (pw && allowed_user(pw)) { + if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) authctxt->valid = 1; - pw = pwcopy(pw); - } else { + else debug("do_authentication: illegal user %s", user); - pw = NULL; - } - authctxt->pw = pw; - setproctitle("%s", pw ? user : "unknown"); + setproctitle("%s%s", authctxt->pw ? user : "unknown", + use_privsep ? " [net]" : ""); #ifdef USE_PAM - start_pam(pw == NULL ? "NOUSER" : user); + PRIVSEP(start_pam(authctxt->pw == NULL ? "NOUSER" : user)); #endif /* @@ -559,7 +546,8 @@ do_authentication(void) * the server. (Unless you are running Windows) */ #ifndef HAVE_CYGWIN - if (getuid() != 0 && pw && pw->pw_uid != getuid()) + if (!use_privsep && getuid() != 0 && authctxt->pw && + authctxt->pw->pw_uid != getuid()) packet_disconnect("Cannot change user when server not running as root."); #endif @@ -574,6 +562,5 @@ do_authentication(void) packet_send(); packet_write_wait(); - /* Perform session preparation. */ - do_authenticated(authctxt); + return (authctxt); } diff --git a/openssh/auth2-chall.c b/openssh/auth2-chall.c index 9f1d932..38f955a 100644 --- a/openssh/auth2-chall.c +++ b/openssh/auth2-chall.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: auth2-chall.c,v 1.16 2002/01/13 17:57:37 markus Exp $"); +RCSID("$OpenBSD: auth2-chall.c,v 1.17 2002/03/18 17:50:31 provos Exp $"); #include "ssh2.h" #include "auth.h" @@ -310,3 +310,22 @@ input_userauth_info_response(int type, u_int32_t seq, void *ctxt) userauth_finish(authctxt, authenticated, method); xfree(method); } + +void +privsep_challenge_enable(void) +{ +#ifdef BSD_AUTH + extern KbdintDevice mm_bsdauth_device; +#endif +#ifdef SKEY + extern KbdintDevice mm_skey_device; +#endif + /* As long as SSHv1 has devices[0] hard coded this is fine */ +#ifdef BSD_AUTH + devices[0] = &mm_bsdauth_device; +#else +#ifdef SKEY + devices[0] = &mm_skey_device; +#endif +#endif +} diff --git a/openssh/auth2.c b/openssh/auth2.c index 968e941..9067e22 100644 --- a/openssh/auth2.c +++ b/openssh/auth2.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2.c,v 1.85 2002/02/24 19:14:59 markus Exp $"); +RCSID("$OpenBSD: auth2.c,v 1.91 2002/05/13 02:37:39 itojun Exp $"); #include @@ -48,10 +48,11 @@ RCSID("$OpenBSD: auth2.c,v 1.85 2002/02/24 19:14:59 markus Exp $"); #include "pathnames.h" #include "uidswap.h" #include "auth-options.h" -#include "misc.h" #include "hostfile.h" #include "canohost.h" #include "match.h" +#include "monitor_wrap.h" +#include "atomicio.h" #ifdef GSSAPI #include "ssh-gss.h" @@ -67,7 +68,7 @@ extern ServerOptions options; extern u_char *session_id2; extern int session_id2_len; -static Authctxt *x_authctxt = NULL; +Authctxt *x_authctxt = NULL; static int one = 1; typedef struct Authmethod Authmethod; @@ -85,8 +86,8 @@ static void input_userauth_request(int, u_int32_t, void *); /* helper */ static Authmethod *authmethod_lookup(const char *); static char *authmethods_get(void); -static int user_key_allowed(struct passwd *, Key *); -static int hostbased_key_allowed(struct passwd *, const char *, char *, Key *); +int user_key_allowed(struct passwd *, Key *); +int hostbased_key_allowed(struct passwd *, const char *, char *, Key *); /* auth */ static void userauth_banner(void); @@ -132,7 +133,7 @@ Authmethod authmethods[] = { * loop until authctxt->success == TRUE */ -void +Authctxt * do_authentication2(void) { Authctxt *authctxt = authctxt_new(); @@ -144,11 +145,14 @@ do_authentication2(void) options.kbd_interactive_authentication = 1; if (options.pam_authentication_via_kbd_int) options.kbd_interactive_authentication = 1; + if (use_privsep) + options.pam_authentication_via_kbd_int = 0; 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 @@ -204,7 +208,6 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt) if(changeuser == 0 && (strcmp(method,"external-keyx") == 0 || strcmp(method,"gssapi") ==0) && strcmp(user,"") == 0) { char *gridmapped_name = NULL; struct passwd *pw = NULL; - gssapi_setup_env(); if(globus_gss_assist_gridmap(gssapi_client_name.value, &gridmapped_name) == 0) { user = gridmapped_name; @@ -245,25 +248,26 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt) if (authctxt->attempt++ == 0) { /* setup auth context */ - struct passwd *pw = NULL; - pw = getpwnam(user); - if (pw && allowed_user(pw) && strcmp(service, "ssh-connection")==0) { - authctxt->pw = pwcopy(pw); + authctxt->pw = PRIVSEP(getpwnamallow(user)); + if (authctxt->pw && strcmp(service, "ssh-connection")==0) { authctxt->valid = 1; debug2("input_userauth_request: setting up authctxt for %s", user); #ifdef USE_PAM - start_pam(pw->pw_name); + PRIVSEP(start_pam(authctxt->pw->pw_name)); #endif } else { log("input_userauth_request: illegal user %s", user); #ifdef USE_PAM - start_pam("NOUSER"); + PRIVSEP(start_pam("NOUSER")); #endif } - setproctitle("%s", pw ? user : "unknown"); + setproctitle("%s%s", authctxt->pw ? user : "unknown", + use_privsep ? " [net]" : ""); authctxt->user = xstrdup(user); authctxt->service = xstrdup(service); authctxt->style = style ? xstrdup(style) : NULL; + if (use_privsep) + mm_inform_authserv(service, style); } else if (strcmp(user, authctxt->user) != 0 || strcmp(service, authctxt->service) != 0) { packet_disconnect("Change of username or service not allowed: " @@ -308,8 +312,8 @@ userauth_finish(Authctxt *authctxt, int authenticated, char *method) authenticated = 0; #ifdef USE_PAM - if (authenticated && authctxt->user && !do_pam_account(authctxt->user, - NULL)) + if (!use_privsep && authenticated && authctxt->user && + !do_pam_account(authctxt->user, NULL)) authenticated = 0; #endif /* USE_PAM */ @@ -364,25 +368,45 @@ userauth_finish(Authctxt *authctxt, int authenticated, char *method) } } -static void -userauth_banner(void) +char * +auth2_read_banner(void) { struct stat st; char *banner = NULL; off_t len, n; int fd; - if (options.banner == NULL || (datafellows & SSH_BUG_BANNER)) - return; - if ((fd = open(options.banner, O_RDONLY)) < 0) - return; - if (fstat(fd, &st) < 0) - goto done; + if ((fd = open(options.banner, O_RDONLY)) == -1) + return (NULL); + if (fstat(fd, &st) == -1) { + close(fd); + return (NULL); + } len = st.st_size; banner = xmalloc(len + 1); - if ((n = read(fd, banner, len)) < 0) - goto done; + n = atomicio(read, fd, banner, len); + close(fd); + + if (n != len) { + free(banner); + return (NULL); + } banner[n] = '\0'; + + return (banner); +} + +static void +userauth_banner(void) +{ + char *banner = NULL; + + if (options.banner == NULL || (datafellows & SSH_BUG_BANNER)) + return; + + if ((banner = PRIVSEP(auth2_read_banner())) == NULL) + goto done; + packet_start(SSH2_MSG_USERAUTH_BANNER); packet_put_cstring(banner); packet_put_cstring(""); /* language, unused */ @@ -391,7 +415,6 @@ userauth_banner(void) done: if (banner) xfree(banner); - close(fd); return; } @@ -412,13 +435,7 @@ userauth_none(Authctxt *authctxt) if (check_nt_auth(1, authctxt->pw) == 0) return(0); #endif -#ifdef USE_PAM - return auth_pam_password(authctxt->pw, ""); -#elif defined(HAVE_OSF_SIA) - return 0; -#else /* !HAVE_OSF_SIA && !USE_PAM */ - return auth_password(authctxt, ""); -#endif /* USE_PAM */ + return PRIVSEP(auth_password(authctxt, "")); } static int @@ -437,13 +454,7 @@ userauth_passwd(Authctxt *authctxt) #ifdef HAVE_CYGWIN check_nt_auth(1, authctxt->pw) && #endif -#ifdef USE_PAM - auth_pam_password(authctxt->pw, password) == 1) -#elif defined(HAVE_OSF_SIA) - auth_sia_password(authctxt->user, password) == 1) -#else /* !USE_PAM && !HAVE_OSF_SIA */ - auth_password(authctxt, password) == 1) -#endif /* USE_PAM */ + PRIVSEP(auth_password(authctxt, password)) == 1) authenticated = 1; memset(password, 0, len); xfree(password); @@ -552,8 +563,10 @@ userauth_pubkey(Authctxt *authctxt) buffer_dump(&b); #endif /* test for correct signature */ - if (user_key_allowed(authctxt->pw, key) && - key_verify(key, sig, slen, buffer_ptr(&b), buffer_len(&b)) == 1) + authenticated = 0; + if (PRIVSEP(user_key_allowed(authctxt->pw, key)) && + PRIVSEP(key_verify(key, sig, slen, buffer_ptr(&b), + buffer_len(&b))) == 1) authenticated = 1; buffer_clear(&b); xfree(sig); @@ -569,7 +582,7 @@ userauth_pubkey(Authctxt *authctxt) * if a user is not allowed to login. is this an * issue? -markus */ - if (user_key_allowed(authctxt->pw, key)) { + if (PRIVSEP(user_key_allowed(authctxt->pw, key))) { packet_start(SSH2_MSG_USERAUTH_PK_OK); packet_put_string(pkalg, alen); packet_put_string(pkblob, blen); @@ -657,8 +670,10 @@ userauth_hostbased(Authctxt *authctxt) buffer_dump(&b); #endif /* test for allowed key and correct signature */ - if (hostbased_key_allowed(authctxt->pw, cuser, chost, key) && - key_verify(key, sig, slen, buffer_ptr(&b), buffer_len(&b)) == 1) + authenticated = 0; + if (PRIVSEP(hostbased_key_allowed(authctxt->pw, cuser, chost, key)) && + PRIVSEP(key_verify(key, sig, slen, buffer_ptr(&b), + buffer_len(&b))) == 1) authenticated = 1; buffer_clear(&b); @@ -815,7 +830,7 @@ user_key_allowed2(struct passwd *pw, Key *key, char *file) } /* check whether given key is in .ssh/authorized_keys* */ -static int +int user_key_allowed(struct passwd *pw, Key *key) { int success; @@ -835,7 +850,7 @@ user_key_allowed(struct passwd *pw, Key *key) } /* return 1 if given hostkey is allowed */ -static int +int hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost, Key *key) { diff --git a/openssh/authfd.c b/openssh/authfd.c index fa76435..f3050d6 100644 --- a/openssh/authfd.c +++ b/openssh/authfd.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfd.c,v 1.48 2002/02/24 19:14:59 markus Exp $"); +RCSID("$OpenBSD: authfd.c,v 1.49 2002/03/21 22:44:05 rees Exp $"); #include @@ -532,7 +532,7 @@ ssh_remove_identity(AuthenticationConnection *auth, Key *key) } int -ssh_update_card(AuthenticationConnection *auth, int add, const char *reader_id) +ssh_update_card(AuthenticationConnection *auth, int add, const char *reader_id, const char *pin) { Buffer msg; int type; @@ -541,6 +541,7 @@ ssh_update_card(AuthenticationConnection *auth, int add, const char *reader_id) buffer_put_char(&msg, add ? SSH_AGENTC_ADD_SMARTCARD_KEY : SSH_AGENTC_REMOVE_SMARTCARD_KEY); buffer_put_cstring(&msg, reader_id); + buffer_put_cstring(&msg, pin); if (ssh_request_reply(auth, &msg, &msg) == 0) { buffer_free(&msg); return 0; diff --git a/openssh/authfd.h b/openssh/authfd.h index 0f2ca7a..e8a0ec8 100644 --- a/openssh/authfd.h +++ b/openssh/authfd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: authfd.h,v 1.23 2002/03/04 17:27:39 stevesk Exp $ */ +/* $OpenBSD: authfd.h,v 1.24 2002/03/21 22:44:05 rees Exp $ */ /* * Author: Tatu Ylonen @@ -67,7 +67,7 @@ Key *ssh_get_next_identity(AuthenticationConnection *, char **, int); int ssh_add_identity(AuthenticationConnection *, Key *, const char *); int ssh_remove_identity(AuthenticationConnection *, Key *); int ssh_remove_all_identities(AuthenticationConnection *, int); -int ssh_update_card(AuthenticationConnection *, int, const char *); +int ssh_update_card(AuthenticationConnection *, int, const char *, const char *); int ssh_decrypt_challenge(AuthenticationConnection *, Key *, BIGNUM *, u_char[16], diff --git a/openssh/bufaux.c b/openssh/bufaux.c index 23bc0c8..79f8bbd 100644 --- a/openssh/bufaux.c +++ b/openssh/bufaux.c @@ -37,7 +37,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: bufaux.c,v 1.22 2002/01/18 18:14:17 stevesk Exp $"); +RCSID("$OpenBSD: bufaux.c,v 1.25 2002/04/20 09:14:58 markus Exp $"); #include #include "bufaux.h" @@ -137,10 +137,18 @@ buffer_get_bignum2(Buffer *buffer, BIGNUM *value) BN_bin2bn(bin, len, value); xfree(bin); } - /* - * Returns an integer from the buffer (4 bytes, msb first). + * Returns integers from the buffer (msb first). */ + +u_short +buffer_get_short(Buffer *buffer) +{ + u_char buf[2]; + buffer_get(buffer, (char *) buf, 2); + return GET_16BIT(buf); +} + u_int buffer_get_int(Buffer *buffer) { @@ -160,8 +168,16 @@ buffer_get_int64(Buffer *buffer) #endif /* - * Stores an integer in the buffer in 4 bytes, msb first. + * Stores integers in the buffer, msb first. */ +void +buffer_put_short(Buffer *buffer, u_short value) +{ + char buf[2]; + PUT_16BIT(buf, value); + buffer_append(buffer, buf, 2); +} + void buffer_put_int(Buffer *buffer, u_int value) { @@ -196,7 +212,7 @@ buffer_get_string(Buffer *buffer, u_int *length_ptr) /* Get the length. */ len = buffer_get_int(buffer); if (len > 256 * 1024) - fatal("Received packet with bad string length %d", len); + fatal("buffer_get_string: bad string length %d", len); /* Allocate space for the string. Add one byte for a null character. */ value = xmalloc(len + 1); /* Get the string. */ @@ -221,6 +237,8 @@ buffer_put_string(Buffer *buffer, const void *buf, u_int len) void buffer_put_cstring(Buffer *buffer, const char *s) { + if (s == NULL) + fatal("buffer_put_cstring: s == NULL"); buffer_put_string(buffer, s, strlen(s)); } diff --git a/openssh/bufaux.h b/openssh/bufaux.h index 4000134..80f35c1 100644 --- a/openssh/bufaux.h +++ b/openssh/bufaux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bufaux.h,v 1.16 2002/03/04 17:27:39 stevesk Exp $ */ +/* $OpenBSD: bufaux.h,v 1.18 2002/04/20 09:14:58 markus Exp $ */ /* * Author: Tatu Ylonen @@ -23,6 +23,9 @@ void buffer_put_bignum2(Buffer *, BIGNUM *); void buffer_get_bignum(Buffer *, BIGNUM *); void buffer_get_bignum2(Buffer *, BIGNUM *); +u_short buffer_get_short(Buffer *); +void buffer_put_short(Buffer *, u_short); + u_int buffer_get_int(Buffer *); void buffer_put_int(Buffer *, u_int); @@ -38,4 +41,7 @@ void *buffer_get_string(Buffer *, u_int *); void buffer_put_string(Buffer *, const void *, u_int); void buffer_put_cstring(Buffer *, const char *); +#define buffer_skip_string(b) \ + do { u_int l = buffer_get_int(b); buffer_consume(b, l); } while(0) + #endif /* BUFAUX_H */ diff --git a/openssh/channels.c b/openssh/channels.c index 2b1f33f..520bff8 100644 --- a/openssh/channels.c +++ b/openssh/channels.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: channels.c,v 1.171 2002/03/04 19:37:58 markus Exp $"); +RCSID("$OpenBSD: channels.c,v 1.173 2002/04/22 21:04:52 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -706,7 +706,11 @@ channel_pre_open(Channel *c, fd_set * readset, fd_set * writeset) if (buffer_len(&c->output) > 0) { FD_SET(c->wfd, writeset); } else if (c->ostate == CHAN_OUTPUT_WAIT_DRAIN) { - chan_obuf_empty(c); + if (CHANNEL_EFD_OUTPUT_ACTIVE(c)) + debug2("channel %d: obuf_empty delayed efd %d/(%d)", + c->self, c->efd, buffer_len(&c->extended)); + else + chan_obuf_empty(c); } } /** XXX check close conditions, too */ @@ -714,7 +718,8 @@ channel_pre_open(Channel *c, fd_set * readset, fd_set * writeset) if (c->extended_usage == CHAN_EXTENDED_WRITE && buffer_len(&c->extended) > 0) FD_SET(c->efd, writeset); - else if (c->extended_usage == CHAN_EXTENDED_READ && + else if (!(c->flags & CHAN_EOF_SENT) && + c->extended_usage == CHAN_EXTENDED_READ && buffer_len(&c->extended) < c->remote_window) FD_SET(c->efd, readset); } @@ -1632,12 +1637,18 @@ channel_output_poll(void) fatal("cannot happen: istate == INPUT_WAIT_DRAIN for proto 1.3"); /* * input-buffer is empty and read-socket shutdown: - * tell peer, that we will not send more data: send IEOF + * tell peer, that we will not send more data: send IEOF. + * hack for extended data: delay EOF if EFD still in use. */ - chan_ibuf_empty(c); + if (CHANNEL_EFD_INPUT_ACTIVE(c)) + debug2("channel %d: ibuf_empty delayed efd %d/(%d)", + c->self, c->efd, buffer_len(&c->extended)); + else + chan_ibuf_empty(c); } /* Send extended data, i.e. stderr */ if (compat20 && + !(c->flags & CHAN_EOF_SENT) && c->remote_window > 0 && (len = buffer_len(&c->extended)) > 0 && c->extended_usage == CHAN_EXTENDED_READ) { @@ -1726,6 +1737,13 @@ channel_input_extended_data(int type, u_int32_t seq, void *ctxt) log("channel %d: ext data for non open", id); return; } + if (c->flags & CHAN_EOF_RCVD) { + if (datafellows & SSH_BUG_EXTEOF) + debug("channel %d: accepting ext data after eof", id); + else + packet_disconnect("Received extended_data after EOF " + "on channel %d.", id); + } tcode = packet_get_int(); if (c->efd == -1 || c->extended_usage != CHAN_EXTENDED_WRITE || @@ -2112,7 +2130,7 @@ channel_request_remote_forwarding(u_short listen_port, const char *address_to_bind = "0.0.0.0"; packet_start(SSH2_MSG_GLOBAL_REQUEST); packet_put_cstring("tcpip-forward"); - packet_put_char(0); /* boolean: want reply */ + packet_put_char(1); /* boolean: want reply */ packet_put_cstring(address_to_bind); packet_put_int(listen_port); packet_send(); diff --git a/openssh/channels.h b/openssh/channels.h index 707d9a9..bd31c45 100644 --- a/openssh/channels.h +++ b/openssh/channels.h @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.h,v 1.65 2002/03/04 17:27:39 stevesk Exp $ */ +/* $OpenBSD: channels.h,v 1.67 2002/03/26 22:50:39 markus Exp $ */ /* * Author: Tatu Ylonen @@ -135,6 +135,18 @@ struct Channel { #define CHAN_CLOSE_SENT 0x01 #define CHAN_CLOSE_RCVD 0x02 +#define CHAN_EOF_SENT 0x04 +#define CHAN_EOF_RCVD 0x08 + +/* check whether 'efd' is still in use */ +#define CHANNEL_EFD_INPUT_ACTIVE(c) \ + (compat20 && c->extended_usage == CHAN_EXTENDED_READ && \ + (c->efd != -1 || \ + buffer_len(&c->extended) > 0)) +#define CHANNEL_EFD_OUTPUT_ACTIVE(c) \ + (compat20 && c->extended_usage == CHAN_EXTENDED_WRITE && \ + ((c->efd != -1 && !(c->flags & (CHAN_EOF_RCVD|CHAN_CLOSE_RCVD))) || \ + buffer_len(&c->extended) > 0)) /* channel management */ diff --git a/openssh/cipher.c b/openssh/cipher.c index 821543a..86d9234 100644 --- a/openssh/cipher.c +++ b/openssh/cipher.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: cipher.c,v 1.54 2002/03/19 10:49:35 markus Exp $"); +RCSID("$OpenBSD: cipher.c,v 1.55 2002/04/03 09:26:11 markus Exp $"); #include "xmalloc.h" #include "log.h" @@ -44,6 +44,11 @@ RCSID("$OpenBSD: cipher.c,v 1.54 2002/03/19 10:49:35 markus Exp $"); #include #include "rijndael.h" +#if OPENSSL_VERSION_NUMBER < 0x00906000L +#define SSH_OLD_EVP +#define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data) +#endif + static EVP_CIPHER *evp_ssh1_3des(void); static EVP_CIPHER *evp_ssh1_bf(void); static EVP_CIPHER *evp_rijndael(void); @@ -67,6 +72,8 @@ struct Cipher { { "aes128-cbc", SSH_CIPHER_SSH2, 16, 16, evp_rijndael }, { "aes192-cbc", SSH_CIPHER_SSH2, 16, 24, evp_rijndael }, { "aes256-cbc", SSH_CIPHER_SSH2, 16, 32, evp_rijndael }, + { "rijndael-cbc@lysator.liu.se", + SSH_CIPHER_SSH2, 16, 32, evp_rijndael }, { NULL, SSH_CIPHER_ILLEGAL, 0, 0, NULL } }; @@ -176,7 +183,11 @@ cipher_init(CipherContext *cc, Cipher *cipher, int encrypt) { static int dowarn = 1; +#ifdef SSH_OLD_EVP + EVP_CIPHER *type; +#else const EVP_CIPHER *type; +#endif int klen; if (cipher->number == SSH_CIPHER_DES) { @@ -201,6 +212,15 @@ cipher_init(CipherContext *cc, Cipher *cipher, type = (*cipher->evptype)(); EVP_CIPHER_CTX_init(&cc->evp); +#ifdef SSH_OLD_EVP + if (type->key_len > 0 && type->key_len != keylen) { + debug("cipher_init: set keylen (%d -> %d)", + type->key_len, keylen); + type->key_len = keylen; + } + EVP_CipherInit(&cc->evp, type, (u_char *)key, (u_char *)iv, + (encrypt == CIPHER_ENCRYPT)); +#else if (EVP_CipherInit(&cc->evp, type, NULL, (u_char *)iv, (encrypt == CIPHER_ENCRYPT)) == 0) fatal("cipher_init: EVP_CipherInit failed for %s", @@ -215,6 +235,7 @@ cipher_init(CipherContext *cc, Cipher *cipher, if (EVP_CipherInit(&cc->evp, NULL, (u_char *)key, NULL, -1) == 0) fatal("cipher_init: EVP_CipherInit: set key failed for %s", cipher->name); +#endif } void @@ -222,15 +243,23 @@ cipher_crypt(CipherContext *cc, u_char *dest, const u_char *src, u_int len) { if (len % cc->cipher->block_size) fatal("cipher_encrypt: bad plaintext length %d", len); +#ifdef SSH_OLD_EVP + EVP_Cipher(&cc->evp, dest, (u_char *)src, len); +#else if (EVP_Cipher(&cc->evp, dest, (u_char *)src, len) == 0) fatal("evp_crypt: EVP_Cipher failed"); +#endif } void cipher_cleanup(CipherContext *cc) { +#ifdef SSH_OLD_EVP + EVP_CIPHER_CTX_cleanup(&cc->evp); +#else if (EVP_CIPHER_CTX_cleanup(&cc->evp) == 0) error("cipher_cleanup: EVP_CIPHER_CTX_cleanup failed"); +#endif } /* @@ -301,6 +330,11 @@ ssh1_3des_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv, EVP_CIPHER_CTX_init(&c->k1); EVP_CIPHER_CTX_init(&c->k2); EVP_CIPHER_CTX_init(&c->k3); +#ifdef SSH_OLD_EVP + EVP_CipherInit(&c->k1, EVP_des_cbc(), k1, NULL, enc); + EVP_CipherInit(&c->k2, EVP_des_cbc(), k2, NULL, !enc); + EVP_CipherInit(&c->k3, EVP_des_cbc(), k3, NULL, enc); +#else if (EVP_CipherInit(&c->k1, EVP_des_cbc(), k1, NULL, enc) == 0 || EVP_CipherInit(&c->k2, EVP_des_cbc(), k2, NULL, !enc) == 0 || EVP_CipherInit(&c->k3, EVP_des_cbc(), k3, NULL, enc) == 0) { @@ -309,6 +343,7 @@ ssh1_3des_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv, EVP_CIPHER_CTX_set_app_data(ctx, NULL); return (0); } +#endif return (1); } static int @@ -320,10 +355,16 @@ ssh1_3des_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, u_int len) error("ssh1_3des_cbc: no context"); return (0); } +#ifdef SSH_OLD_EVP + EVP_Cipher(&c->k1, dest, (u_char *)src, len); + EVP_Cipher(&c->k2, dest, dest, len); + EVP_Cipher(&c->k3, dest, dest, len); +#else if (EVP_Cipher(&c->k1, dest, (u_char *)src, len) == 0 || EVP_Cipher(&c->k2, dest, dest, len) == 0 || EVP_Cipher(&c->k3, dest, dest, len) == 0) return (0); +#endif return (1); } static int @@ -351,7 +392,9 @@ evp_ssh1_3des(void) ssh1_3des.init = ssh1_3des_init; ssh1_3des.cleanup = ssh1_3des_cleanup; ssh1_3des.do_cipher = ssh1_3des_cbc; +#ifndef SSH_OLD_EVP ssh1_3des.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH; +#endif return (&ssh1_3des); } @@ -499,8 +542,10 @@ evp_rijndael(void) rijndal_cbc.init = ssh_rijndael_init; rijndal_cbc.cleanup = ssh_rijndael_cleanup; rijndal_cbc.do_cipher = ssh_rijndael_cbc; +#ifndef SSH_OLD_EVP rijndal_cbc.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_ALWAYS_CALL_INIT; +#endif return (&rijndal_cbc); } @@ -538,15 +583,15 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len) if (evplen == 0) return; if (evplen != len) - fatal("cipher_get_keyiv: wrong iv length %d != %d", + fatal("%s: wrong iv length %d != %d", __FUNCTION__, evplen, len); - if (strncmp(c->name, "aes", 3) == 0) { + if (c->evptype == evp_rijndael) { struct ssh_rijndael_ctx *aesc; aesc = EVP_CIPHER_CTX_get_app_data(&cc->evp); if (aesc == NULL) - fatal("cipher_get_keyiv: no rijndael context"); + fatal("%s: no rijndael context", __FUNCTION__); civ = aesc->r_iv; } else { civ = cc->evp.iv; @@ -555,18 +600,18 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len) case SSH_CIPHER_3DES: { struct ssh1_3des_ctx *desc; if (len != 24) - fatal("cipher_get_keyiv: bad 3des iv length: %d", len); + fatal("%s: bad 3des iv length: %d", __FUNCTION__, len); desc = EVP_CIPHER_CTX_get_app_data(&cc->evp); if (desc == NULL) - fatal("cipher_get_keyiv: no 3des context"); - debug3("cipher_get_keyiv: Copying 3DES IV"); + fatal("%s: no 3des context", __FUNCTION__); + debug3("%s: Copying 3DES IV", __FUNCTION__); memcpy(iv, desc->k1.iv, 8); memcpy(iv + 8, desc->k2.iv, 8); memcpy(iv + 16, desc->k3.iv, 8); return; } default: - fatal("cipher_get_keyiv: bad cipher %d", c->number); + fatal("%s: bad cipher %d", __FUNCTION__, c->number); } memcpy(iv, civ, len); } @@ -586,12 +631,12 @@ cipher_set_keyiv(CipherContext *cc, u_char *iv) if (evplen == 0) return; - if (strncmp(c->name, "aes", 3) == 0) { + if (c->evptype == evp_rijndael) { struct ssh_rijndael_ctx *aesc; aesc = EVP_CIPHER_CTX_get_app_data(&cc->evp); if (aesc == NULL) - fatal("cipher_set_keyiv: no rijndael context"); + fatal("%s: no rijndael context", __FUNCTION__); div = aesc->r_iv; }else { div = cc->evp.iv; @@ -601,15 +646,15 @@ cipher_set_keyiv(CipherContext *cc, u_char *iv) struct ssh1_3des_ctx *desc; desc = EVP_CIPHER_CTX_get_app_data(&cc->evp); if (desc == NULL) - fatal("cipher_set_keyiv: no 3des context"); - debug3("cipher_set_keyiv: Installed 3DES IV"); + fatal("%s: no 3des context", __FUNCTION__); + debug3("%s: Installed 3DES IV", __FUNCTION__); memcpy(desc->k1.iv, iv, 8); memcpy(desc->k2.iv, iv + 8, 8); memcpy(desc->k3.iv, iv + 16, 8); return; } default: - fatal("cipher_set_keyiv: bad cipher %d", c->number); + fatal("%s: bad cipher %d", __FUNCTION__, c->number); } memcpy(div, iv, evplen); } @@ -632,7 +677,7 @@ cipher_get_keycontext(CipherContext *cc, u_char *dat) struct ssh1_3des_ctx *desc; desc = EVP_CIPHER_CTX_get_app_data(&cc->evp); if (desc == NULL) - fatal("cipher_get_keycontext: no 3des context"); + fatal("%s: no 3des context", __FUNCTION__); plen = EVP_X_STATE_LEN(desc->k1); if (dat == NULL) return (3*plen); @@ -661,7 +706,7 @@ cipher_set_keycontext(CipherContext *cc, u_char *dat) struct ssh1_3des_ctx *desc; desc = EVP_CIPHER_CTX_get_app_data(&cc->evp); if (desc == NULL) - fatal("cipher_set_keycontext: no 3des context"); + fatal("%s: no 3des context", __FUNCTION__); plen = EVP_X_STATE_LEN(desc->k1); memcpy(EVP_X_STATE(desc->k1), dat, plen); memcpy(EVP_X_STATE(desc->k2), dat + plen, plen); diff --git a/openssh/cipher.h b/openssh/cipher.h index b3b0303..fc7f6dd 100644 --- a/openssh/cipher.h +++ b/openssh/cipher.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cipher.h,v 1.32 2002/03/04 17:27:39 stevesk Exp $ */ +/* $OpenBSD: cipher.h,v 1.33 2002/03/18 17:13:15 markus Exp $ */ /* * Author: Tatu Ylonen @@ -81,4 +81,11 @@ void cipher_cleanup(CipherContext *); void cipher_set_key_string(CipherContext *, Cipher *, const char *, int); u_int cipher_blocksize(Cipher *); u_int cipher_keylen(Cipher *); + +u_int cipher_get_number(Cipher *); +void cipher_get_keyiv(CipherContext *, u_char *, u_int); +void cipher_set_keyiv(CipherContext *, u_char *); +int cipher_get_keyiv_len(CipherContext *); +int cipher_get_keycontext(CipherContext *, u_char *); +void cipher_set_keycontext(CipherContext *, u_char *); #endif /* CIPHER_H */ diff --git a/openssh/clientloop.c b/openssh/clientloop.c index 65a6682..15945a8 100644 --- a/openssh/clientloop.c +++ b/openssh/clientloop.c @@ -59,7 +59,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: clientloop.c,v 1.96 2002/02/06 14:55:15 markus Exp $"); +RCSID("$OpenBSD: clientloop.c,v 1.100 2002/04/22 21:04:52 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -81,6 +81,7 @@ RCSID("$OpenBSD: clientloop.c,v 1.96 2002/02/06 14:55:15 markus Exp $"); #include "atomicio.h" #include "sshtty.h" #include "misc.h" +#include "readpass.h" /* import options */ extern Options options; @@ -470,6 +471,67 @@ client_process_net_input(fd_set * readset) } } +static void +process_cmdline(void) +{ + void (*handler)(int); + char *s, *cmd; + u_short fwd_port, fwd_host_port; + char buf[1024], sfwd_port[6], sfwd_host_port[6]; + int local = 0; + + leave_raw_mode(); + handler = signal(SIGINT, SIG_IGN); + cmd = s = read_passphrase("\r\nssh> ", RP_ECHO); + if (s == NULL) + goto out; + while (*s && isspace(*s)) + s++; + if (*s == 0) + goto out; + if (strlen(s) < 2 || s[0] != '-' || !(s[1] == 'L' || s[1] == 'R')) { + log("Invalid command."); + goto out; + } + if (s[1] == 'L') + local = 1; + if (!local && !compat20) { + log("Not supported for SSH protocol version 1."); + goto out; + } + s += 2; + while (*s && isspace(*s)) + s++; + + if (sscanf(s, "%5[0-9]:%255[^:]:%5[0-9]", + sfwd_port, buf, sfwd_host_port) != 3 && + sscanf(s, "%5[0-9]/%255[^/]/%5[0-9]", + sfwd_port, buf, sfwd_host_port) != 3) { + log("Bad forwarding specification."); + goto out; + } + if ((fwd_port = a2port(sfwd_port)) == 0 || + (fwd_host_port = a2port(sfwd_host_port)) == 0) { + log("Bad forwarding port(s)."); + goto out; + } + if (local) { + if (channel_setup_local_fwd_listener(fwd_port, buf, + fwd_host_port, options.gateway_ports) < 0) { + log("Port forwarding failed."); + goto out; + } + } else + channel_request_remote_forwarding(fwd_port, buf, + fwd_host_port); + log("Forwarding port."); +out: + signal(SIGINT, handler); + enter_raw_mode(); + if (cmd) + xfree(cmd); +} + /* process the characters one by one */ static int process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len) @@ -574,6 +636,7 @@ process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len) "%c?\r\n\ Supported escape sequences:\r\n\ ~. - terminate connection\r\n\ +~C - open a command line\r\n\ ~R - Request rekey (SSH protocol 2 only)\r\n\ ~^Z - suspend ssh\r\n\ ~# - list forwarded connections\r\n\ @@ -593,6 +656,10 @@ Supported escape sequences:\r\n\ xfree(s); continue; + case 'C': + process_cmdline(); + continue; + default: if (ch != escape_char) { buffer_put_char(bin, escape_char); @@ -1247,6 +1314,7 @@ static void client_init_dispatch_20(void) { dispatch_init(&dispatch_protocol_error); + dispatch_set(SSH2_MSG_CHANNEL_CLOSE, &channel_input_oclose); dispatch_set(SSH2_MSG_CHANNEL_DATA, &channel_input_data); dispatch_set(SSH2_MSG_CHANNEL_EOF, &channel_input_ieof); @@ -1260,6 +1328,10 @@ client_init_dispatch_20(void) /* rekeying */ dispatch_set(SSH2_MSG_KEXINIT, &kex_input_kexinit); + + /* global request reply messages */ + dispatch_set(SSH2_MSG_REQUEST_FAILURE, &client_global_request_reply); + dispatch_set(SSH2_MSG_REQUEST_SUCCESS, &client_global_request_reply); } static void client_init_dispatch_13(void) diff --git a/openssh/clientloop.h b/openssh/clientloop.h index 1bc9a95..8056a40 100644 --- a/openssh/clientloop.h +++ b/openssh/clientloop.h @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.h,v 1.6 2001/06/26 17:27:23 markus Exp $ */ +/* $OpenBSD: clientloop.h,v 1.7 2002/04/22 21:04:52 markus Exp $ */ /* * Author: Tatu Ylonen @@ -37,3 +37,4 @@ /* Client side main loop for the interactive session. */ int client_loop(int, int, int); +void client_global_request_reply(int type, u_int32_t seq, void *ctxt); diff --git a/openssh/compat.c b/openssh/compat.c index 8387278..638f082 100644 --- a/openssh/compat.c +++ b/openssh/compat.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: compat.c,v 1.61 2002/03/06 00:24:39 markus Exp $"); +RCSID("$OpenBSD: compat.c,v 1.63 2002/04/10 08:21:47 markus Exp $"); #include "buffer.h" #include "packet.h" @@ -61,21 +61,28 @@ compat_datafellows(const char *version) "OpenSSH-2.1*," "OpenSSH_2.1*," "OpenSSH_2.2*", SSH_OLD_SESSIONID|SSH_BUG_BANNER| - SSH_OLD_DHGEX|SSH_BUG_NOREKEY }, + SSH_OLD_DHGEX|SSH_BUG_NOREKEY| + SSH_BUG_EXTEOF}, { "OpenSSH_2.3.0*", SSH_BUG_BANNER|SSH_BUG_BIGENDIANAES| - SSH_OLD_DHGEX|SSH_BUG_NOREKEY}, + SSH_OLD_DHGEX|SSH_BUG_NOREKEY| + SSH_BUG_EXTEOF}, { "OpenSSH_2.3.*", SSH_BUG_BIGENDIANAES|SSH_OLD_DHGEX| - SSH_BUG_NOREKEY}, + SSH_BUG_NOREKEY|SSH_BUG_EXTEOF}, { "OpenSSH_2.5.0p1*," "OpenSSH_2.5.1p1*", SSH_BUG_BIGENDIANAES|SSH_OLD_DHGEX| - SSH_BUG_NOREKEY|SSH_OLD_GSSAPI }, + SSH_BUG_NOREKEY|SSH_BUG_EXTEOF| + SSH_OLD_GSSAPI}, { "OpenSSH_2.5.0*," "OpenSSH_2.5.1*," - "OpenSSH_2.5.2*", SSH_OLD_DHGEX|SSH_BUG_NOREKEY }, - { "OpenSSH_2.5.3*", SSH_BUG_NOREKEY }, + "OpenSSH_2.5.2*", SSH_OLD_DHGEX|SSH_BUG_NOREKEY| + SSH_BUG_EXTEOF}, + { "OpenSSH_2.5.3*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF}, { "OpenSSH_2.9p*", SSH_OLD_GSSAPI }, - { "Sun_SSH_1.0*", SSH_BUG_NOREKEY }, + { "OpenSSH_2.*," + "OpenSSH_3.0*," + "OpenSSH_3.1*", SSH_BUG_EXTEOF}, + { "Sun_SSH_1.0*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF}, { "OpenSSH*", 0 }, { "*MindTerm*", 0 }, { "2.1.0*", SSH_BUG_SIGBLOB|SSH_BUG_HMAC| @@ -122,8 +129,12 @@ compat_datafellows(const char *version) "1.2.19*," "1.2.20*," "1.2.21*," - "1.2.22*", SSH_BUG_IGNOREMSG }, - { "1.3.2*", SSH_BUG_IGNOREMSG }, /* f-secure */ + "1.2.22*", SSH_BUG_IGNOREMSG|SSH_BUG_K5USER }, + { "1.3.2*", /* F-Secure */ + SSH_BUG_IGNOREMSG|SSH_BUG_K5USER }, + { "1.2.1*," + "1.2.2*," + "1.2.3*", SSH_BUG_K5USER }, { "*SSH Compatible Server*", /* Netscreen */ SSH_BUG_PASSWORDPAD }, { "*OSU_0*," diff --git a/openssh/compat.h b/openssh/compat.h index 9dae030..cebf306 100644 --- a/openssh/compat.h +++ b/openssh/compat.h @@ -1,4 +1,4 @@ -/* $OpenBSD: compat.h,v 1.30 2002/03/04 17:27:39 stevesk Exp $ */ +/* $OpenBSD: compat.h,v 1.32 2002/04/10 08:21:47 markus Exp $ */ /* * Copyright (c) 1999, 2000, 2001 Markus Friedl. All rights reserved. @@ -52,7 +52,9 @@ #define SSH_BUG_OPENFAILURE 0x00020000 #define SSH_BUG_DERIVEKEY 0x00040000 #define SSH_BUG_DUMMYCHAN 0x00100000 -#define SSH_OLD_GSSAPI 0x00200000 +#define SSH_BUG_EXTEOF 0x00200000 +#define SSH_BUG_K5USER 0x00400000 +#define SSH_OLD_GSSAPI 0x00800000 void enable_compat13(void); void enable_compat20(void); diff --git a/openssh/compress.c b/openssh/compress.c index 3badbf4..85a361d 100644 --- a/openssh/compress.c +++ b/openssh/compress.c @@ -12,17 +12,19 @@ */ #include "includes.h" -RCSID("$OpenBSD: compress.c,v 1.17 2001/12/29 21:56:01 stevesk Exp $"); +RCSID("$OpenBSD: compress.c,v 1.19 2002/03/18 17:31:54 provos Exp $"); #include "log.h" #include "buffer.h" #include "zlib.h" #include "compress.h" -static z_stream incoming_stream; -static z_stream outgoing_stream; +z_stream incoming_stream; +z_stream outgoing_stream; static int compress_init_send_called = 0; static int compress_init_recv_called = 0; +static int inflate_failed = 0; +static int deflate_failed = 0; /* * Initializes compression; level is compression level from 1 to 9 @@ -62,9 +64,9 @@ buffer_compress_uninit(void) incoming_stream.total_out, incoming_stream.total_in, incoming_stream.total_out == 0 ? 0.0 : (double) incoming_stream.total_in / incoming_stream.total_out); - if (compress_init_recv_called == 1) + if (compress_init_recv_called == 1 && inflate_failed == 0) inflateEnd(&incoming_stream); - if (compress_init_send_called == 1) + if (compress_init_send_called == 1 && deflate_failed == 0) deflateEnd(&outgoing_stream); } @@ -106,6 +108,7 @@ buffer_compress(Buffer * input_buffer, Buffer * output_buffer) sizeof(buf) - outgoing_stream.avail_out); break; default: + deflate_failed = 1; fatal("buffer_compress: deflate returned %d", status); /* NOTREACHED */ } @@ -149,6 +152,7 @@ buffer_uncompress(Buffer * input_buffer, Buffer * output_buffer) */ return; default: + inflate_failed = 1; fatal("buffer_uncompress: inflate returned %d", status); /* NOTREACHED */ } diff --git a/openssh/configure.ac b/openssh/configure.ac index 124f9d1..fbccd86 100644 --- a/openssh/configure.ac +++ b/openssh/configure.ac @@ -21,6 +21,7 @@ AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin) AC_PATH_PROG(TEST_MINUS_S_SH, bash) AC_PATH_PROG(TEST_MINUS_S_SH, ksh) AC_PATH_PROG(TEST_MINUS_S_SH, sh) +AC_PATH_PROG(SH, sh) # System features AC_SYS_LARGEFILE @@ -57,13 +58,24 @@ case "$host" in CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" if (test "$LD" != "gcc" && test -z "$blibpath"); then - blibpath="/usr/lib:/lib:/usr/local/lib" + AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath]) + saved_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib" + AC_TRY_LINK([], + [], + [ + AC_MSG_RESULT(yes) + blibpath="/usr/lib:/lib:/usr/local/lib" + ], + [ AC_MSG_RESULT(no) ] + ) + LDFLAGS="$saved_LDFLAGS" fi AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)]) AC_DEFINE(BROKEN_GETADDRINFO) + AC_DEFINE(BROKEN_REALPATH) dnl AIX handles lastlog as part of its login message AC_DEFINE(DISABLE_LASTLOG) - AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) ;; *-*-cygwin*) LIBS="$LIBS /usr/lib/textmode.o" @@ -80,6 +92,22 @@ case "$host" in *-*-darwin*) AC_DEFINE(BROKEN_GETADDRINFO) ;; +*-*-hpux10.26) + if test -z "$GCC"; then + CFLAGS="$CFLAGS -Ae" + fi + CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" + IPADDR_IN_DISPLAY=yes + AC_DEFINE(HAVE_SECUREWARE) + AC_DEFINE(USE_PIPES) + AC_DEFINE(LOGIN_NO_ENDOPT) + AC_DEFINE(LOGIN_NEEDS_UTMPX) + AC_DEFINE(DISABLE_SHADOW) + AC_DEFINE(DISABLE_UTMP) + AC_DEFINE(SPT_TYPE,SPT_PSTAT) + LIBS="$LIBS -lxnet -lsec -lsecpw" + disable_ptmx_check=yes + ;; *-*-hpux10*) if test -z "$GCC"; then CFLAGS="$CFLAGS -Ae" @@ -87,6 +115,8 @@ case "$host" in CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" IPADDR_IN_DISPLAY=yes AC_DEFINE(USE_PIPES) + AC_DEFINE(LOGIN_NO_ENDOPT) + AC_DEFINE(LOGIN_NEEDS_UTMPX) AC_DEFINE(DISABLE_SHADOW) AC_DEFINE(DISABLE_UTMP) AC_DEFINE(SPT_TYPE,SPT_PSTAT) @@ -97,6 +127,8 @@ case "$host" in IPADDR_IN_DISPLAY=yes AC_DEFINE(PAM_SUN_CODEBASE) AC_DEFINE(USE_PIPES) + AC_DEFINE(LOGIN_NO_ENDOPT) + AC_DEFINE(LOGIN_NEEDS_UTMPX) AC_DEFINE(DISABLE_SHADOW) AC_DEFINE(DISABLE_UTMP) AC_DEFINE(SPT_TYPE,SPT_PSTAT) @@ -107,6 +139,7 @@ case "$host" in LDFLAGS="$LDFLAGS" PATH="$PATH:/usr/etc" AC_DEFINE(BROKEN_INET_NTOA) + AC_DEFINE(WITH_ABBREV_NO_TTY) ;; *-*-irix6*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" @@ -117,21 +150,18 @@ case "$host" in AC_DEFINE(WITH_IRIX_AUDIT) AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)]) AC_DEFINE(BROKEN_INET_NTOA) + AC_DEFINE(WITH_ABBREV_NO_TTY) ;; *-*-linux*) no_dev_ptmx=1 check_for_libcrypt_later=1 AC_DEFINE(DONT_TRY_OTHER_AF) AC_DEFINE(PAM_TTY_KLUDGE) - AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) inet6_default_4in6=yes ;; mips-sony-bsd|mips-sony-newsos4) AC_DEFINE(HAVE_NEWS4) SONY=1 - AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT), - AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***]) - ) ;; *-*-netbsd*) need_dash_r=1 @@ -175,7 +205,6 @@ mips-sony-bsd|mips-sony-newsos4) CPPFLAGS="$CPPFLAGS -DSUNOS4" AC_CHECK_FUNCS(getpwanam) AC_DEFINE(PAM_SUN_CODEBASE) - AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) conf_utmp_location=/etc/utmp conf_wtmp_location=/var/adm/wtmp conf_lastlog_location=/var/adm/lastlog @@ -185,7 +214,6 @@ mips-sony-bsd|mips-sony-newsos4) CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" LIBS="$LIBS -lc89" - AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) AC_DEFINE(USE_PIPES) ;; *-sni-sysv*) @@ -195,7 +223,6 @@ mips-sony-bsd|mips-sony-newsos4) IPADDR_IN_DISPLAY=yes AC_DEFINE(USE_PIPES) AC_DEFINE(IP_TOS_IS_BROKEN) - AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) # /usr/ucblib/libucb.a no longer needed on ReliantUNIX # Attention: always take care to bind libsocket and libnsl before libc, # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog @@ -225,9 +252,8 @@ mips-sony-bsd|mips-sony-newsos4) no_dev_ptmx=1 AC_DEFINE(BROKEN_SYS_TERMIO_H) AC_DEFINE(USE_PIPES) - AC_DEFINE(HAVE_SCO_PROTECTED_PW) + AC_DEFINE(HAVE_SECUREWARE) AC_DEFINE(DISABLE_SHADOW) - AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) AC_DEFINE(BROKEN_SAVED_UIDS) AC_CHECK_FUNCS(getluid setluid) MANTYPE=man @@ -240,9 +266,8 @@ mips-sony-bsd|mips-sony-newsos4) no_dev_ptmx=1 rsh_path="/usr/bin/rcmd" AC_DEFINE(USE_PIPES) - AC_DEFINE(HAVE_SCO_PROTECTED_PW) + AC_DEFINE(HAVE_SECUREWARE) AC_DEFINE(DISABLE_SHADOW) - AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) AC_CHECK_FUNCS(getluid setluid) MANTYPE=man ;; @@ -324,12 +349,12 @@ AC_ARG_WITH(libs, AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \ getopt.h glob.h lastlog.h limits.h login.h \ login_cap.h maillock.h netdb.h netgroup.h \ - netinet/in_systm.h paths.h poll.h pty.h \ - security/pam_appl.h shadow.h stddef.h stdint.h \ + netinet/in_systm.h paths.h pty.h readpassphrase.h \ + rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \ strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \ - sys/poll.h sys/queue.h sys/select.h sys/stat.h \ + sys/mman.h sys/select.h sys/stat.h \ sys/stropts.h sys/sysmacros.h sys/time.h \ - sys/ttcompat.h sys/un.h time.h ttyent.h usersec.h \ + sys/un.h time.h ttyent.h usersec.h \ util.h utime.h utmp.h utmpx.h) # Checks for libraries. @@ -651,16 +676,16 @@ AC_ARG_WITH(tcp-wrappers, ) dnl Checks for library functions. -AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa \ +AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \ clock fchmod fchown freeaddrinfo futimes gai_strerror \ getaddrinfo getcwd getgrouplist getnameinfo getopt \ getrlimit getrusage getttyent glob inet_aton inet_ntoa \ inet_ntop innetgr login_getcapbool md5_crypt memmove \ - mkdtemp on_exit openpty readpassphrase realpath \ - rresvport_af setdtablesize setegid setenv seteuid \ - setlogin setproctitle setresgid setreuid setrlimit \ - setsid setvbuf sigaction sigvec snprintf strerror \ - strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \ + mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \ + realpath recvmsg rresvport_af sendmsg setdtablesize setegid \ + setenv seteuid setlogin setproctitle setresgid setreuid setrlimit \ + setsid setvbuf sigaction sigvec snprintf socketpair strerror \ + strlcat strlcpy strmode strsep sysconf tcgetpgrp truncate utimes \ vhangup vsnprintf waitpid __b64_ntop _getpty) dnl IRIX and Solaris 2.5.1 have dirname() in libgen @@ -792,179 +817,65 @@ if test "x$PAM_MSG" = "xyes" ; then ) fi -# The big search for OpenSSL +# Search for OpenSSL +saved_CPPFLAGS="$CPPFLAGS" +saved_LDFLAGS="$LDFLAGS" AC_ARG_WITH(ssl-dir, [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], [ if test "x$withval" != "xno" ; then - tryssldir=$withval - fi - ] -) - -saved_LIBS="$LIBS" -saved_LDFLAGS="$LDFLAGS" -saved_CPPFLAGS="$CPPFLAGS" -if test "x$globus_flavor_type" != "xno" ; then -LIBS="$saved_LIBS -lglobus_ssl_utils_${globus_flavor_type} -lssl_${globus_flavor_type} -lcrypto_${globus_flavor_type}" -LDFLAGS="$saved_LDFLAGS" -CPPFLAGS="$saved_CPPFLAGS" -else -if test "x$prefix" != "xNONE" ; then - tryssldir="$tryssldir $prefix" -fi -AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [ - for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do - CPPFLAGS="$saved_CPPFLAGS" - LDFLAGS="$saved_LDFLAGS" - LIBS="$saved_LIBS -lcrypto" - - # Skip directories if they don't exist - if test ! -z "$ssldir" -a ! -d "$ssldir" ; then - continue; - fi - if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then - # Try to use $ssldir/lib if it exists, otherwise - # $ssldir - if test -d "$ssldir/lib" ; then - LDFLAGS="-L$ssldir/lib $saved_LDFLAGS" - if test ! -z "$need_dash_r" ; then - LDFLAGS="-R$ssldir/lib $LDFLAGS" + if test -d "$withval/lib"; then + if test -n "${need_dash_r}"; then + LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" + else + LDFLAGS="-L${withval}/lib ${LDFLAGS}" fi else - LDFLAGS="-L$ssldir $saved_LDFLAGS" - if test ! -z "$need_dash_r" ; then - LDFLAGS="-R$ssldir $LDFLAGS" + if test -n "${need_dash_r}"; then + LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" + else + LDFLAGS="-L${withval} ${LDFLAGS}" fi fi - # Try to use $ssldir/include if it exists, otherwise - # $ssldir - if test -d "$ssldir/include" ; then - CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS" + if test -d "$withval/include"; then + CPPFLAGS="-I${withval}/include ${CPPFLAGS}" else - CPPFLAGS="-I$ssldir $saved_CPPFLAGS" + CPPFLAGS="-I${withval} ${CPPFLAGS}" fi fi + ] +) - # Basic test to check for compatible version and correct linking - # *does not* test for RSA - that comes later. - AC_TRY_RUN( - [ -#include -#include -int main(void) -{ - char a[2048]; - memset(a, 0, sizeof(a)); - RAND_add(a, sizeof(a), sizeof(a)); - return(RAND_status() <= 0); -} - ], - [ - found_crypto=1 - break; - ], [] - ) - - if test ! -z "$found_crypto" ; then - break; - fi - done - - if test -z "$found_crypto" ; then - AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log]) - fi - if test -z "$ssldir" ; then - ssldir="(system)" - fi - - ac_cv_openssldir=$ssldir -]) - -if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then - AC_DEFINE(HAVE_OPENSSL) - dnl Need to recover ssldir - test above runs in subshell - ssldir=$ac_cv_openssldir - if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then - # Try to use $ssldir/lib if it exists, otherwise - # $ssldir - if test -d "$ssldir/lib" ; then - LDFLAGS="-L$ssldir/lib $saved_LDFLAGS" - if test ! -z "$need_dash_r" ; then - LDFLAGS="-R$ssldir/lib $LDFLAGS" - fi - else - LDFLAGS="-L$ssldir $saved_LDFLAGS" - if test ! -z "$need_dash_r" ; then - LDFLAGS="-R$ssldir $LDFLAGS" - fi - fi - # Try to use $ssldir/include if it exists, otherwise - # $ssldir - if test -d "$ssldir/include" ; then - CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS" - else - CPPFLAGS="-I$ssldir $saved_CPPFLAGS" - fi - fi -fi -if test "x$gsi_path" == "xno" ; then -LIBS="$saved_LIBS -lcrypto" +# Patch up SSL libraries for GSI authentication as needed +if test "x$globus_flavor_type" != "xno" ; then + # For Globus 2, always link with the static libraries + LIBS="$LIBS ${gsi_path}/lib/libglobus_ssl_utils_${globus_flavor_type}.a ${gsi_path}/lib/libssl_${globus_flavor_type}.a ${gsi_path}/lib/libcrypto_${globus_flavor_type}.a" else -LIBS="$saved_LIBS -lssl -lcrypto" -fi + if test "x$gsi_path" != "xno" ; then + # Older GSI needs -lssl too + LIBS="$LIBS -lssl -lcrypto" + else # if no GSI authentication (i.e., OpenSSL default) + LIBS="$LIBS -lcrypto" + fi fi # globus_flavor_type -# Now test RSA support -saved_LIBS="$LIBS" -AC_MSG_CHECKING([for RSA support]) -for WANTS_RSAREF in "" 1 ; do - if test -z "$WANTS_RSAREF" ; then - LIBS="$saved_LIBS" - else - LIBS="$saved_LIBS -lRSAglue -lrsaref" - fi - AC_TRY_RUN([ -#include -#include -#include -#include -#include -int main(void) -{ - int num; RSA *key; static unsigned char p_in[] = "blahblah"; - unsigned char c[256], p[256]; - memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c)); - if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1); - num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING); - return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING)); -} - ], +AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL), [ - rsa_works=1 - break; - ], []) -done -LIBS="$saved_LIBS" - -if test ! -z "$no_rsa" ; then - AC_MSG_RESULT(disabled) - RSA_MSG="disabled" -else - if test -z "$rsa_works" ; then - AC_MSG_WARN([*** No RSA support found *** ]) - RSA_MSG="no" - else - if test -z "$WANTS_RSAREF" ; then - AC_MSG_RESULT(yes) - RSA_MSG="yes" + dnl Check default openssl install dir + if test -n "${need_dash_r}"; then + LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}" else - RSA_MSG="yes (using RSAref)" - AC_MSG_RESULT(using RSAref) - LIBS="$LIBS -lcrypto -lRSAglue -lrsaref" + LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}" fi - fi -fi + CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}" + AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL), + [ + AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***]) + ] + ) + ] +) + # Sanity check OpenSSL headers AC_MSG_CHECKING([whether OpenSSL's headers match the library]) @@ -1127,9 +1038,33 @@ AC_ARG_WITH(entropy-timeout, fi ] ) - AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout) +ssh_privsep_user=sshd +AC_ARG_WITH(privsep-user, + [ --with-privsep-user=user Specify non-privileged user for privilege separation], + [ + if test -n "$withval"; then + ssh_privsep_user=$withval + fi + ] +) +AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$ssh_privsep_user") + +# We do this little dance with the search path to insure +# that programs that we select for use by installed programs +# (which may be run by the super-user) come from trusted +# locations before they come from the user's private area. +# This should help avoid accidentally configuring some +# random version of a program in someone's personal bin. + +OPATH=$PATH +PATH=/bin:/usr/bin +test -h /bin 2> /dev/null && PATH=/usr/bin +test -d /sbin && PATH=$PATH:/sbin +test -d /usr/sbin && PATH=$PATH:/usr/sbin +PATH=$PATH:/etc:$OPATH + # These programs are used by the command hashing source to gather entropy OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat) @@ -1147,6 +1082,8 @@ OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat) OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime) OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs) OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail) +# restore PATH +PATH=$OPATH # Where does ssh-rand-helper get its randomness from? INSTALL_SSH_PRNG_CMDS="" @@ -1176,6 +1113,11 @@ AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long int, 4) AC_CHECK_SIZEOF(long long int, 8) +# Sanity check long long for some platforms (AIX) +if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then + ac_cv_sizeof_long_long_int=0 +fi + # More checks for data types AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ AC_TRY_COMPILE( @@ -1684,6 +1626,40 @@ if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD) fi +AC_CACHE_CHECK([for msg_accrights field in struct msghdr], + ac_cv_have_accrights_in_msghdr, [ + AC_TRY_COMPILE( + [ +#include +#include +#include + ], + [ struct msghdr m; m.msg_accrights = 0; ], + [ ac_cv_have_accrights_in_msghdr="yes" ], + [ ac_cv_have_accrights_in_msghdr="no" ] + ) +]) +if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then + AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR) +fi + +AC_CACHE_CHECK([for msg_control field in struct msghdr], + ac_cv_have_control_in_msghdr, [ + AC_TRY_COMPILE( + [ +#include +#include +#include + ], + [ struct msghdr m; m.msg_control = 0; ], + [ ac_cv_have_control_in_msghdr="yes" ], + [ ac_cv_have_control_in_msghdr="no" ] + ) +]) +if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then + AC_DEFINE(HAVE_CONTROL_IN_MSGHDR) +fi + AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ AC_TRY_LINK([], [ extern char *__progname; printf("%s", __progname); ], @@ -1695,6 +1671,32 @@ if test "x$ac_cv_libc_defines___progname" = "xyes" ; then AC_DEFINE(HAVE___PROGNAME) fi +AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ + AC_TRY_LINK([ +#include +], + [ printf("%s", __FUNCTION__); ], + [ ac_cv_cc_implements___FUNCTION__="yes" ], + [ ac_cv_cc_implements___FUNCTION__="no" ] + ) +]) +if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then + AC_DEFINE(HAVE___FUNCTION__) +fi + +AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ + AC_TRY_LINK([ +#include +], + [ printf("%s", __func__); ], + [ ac_cv_cc_implements___func__="yes" ], + [ ac_cv_cc_implements___func__="no" ] + ) +]) +if test "x$ac_cv_cc_implements___func__" = "xyes" ; then + AC_DEFINE(HAVE___func__) +fi + AC_CACHE_CHECK([whether getopt has optreset support], ac_cv_have_getopt_optreset, [ AC_TRY_LINK( @@ -1733,11 +1735,11 @@ if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then AC_DEFINE(HAVE_SYS_NERR) fi - -# Check whether user wants Kerberos support SCARD_MSG="no" -AC_ARG_WITH(smartcard, - [ --with-smartcard Enable smartcard support], + +# Check whether user wants sectok support +AC_ARG_WITH(sectok, + [ --with-sectok Enable smartcard support using libsectok], [ if test "x$withval" != "xno" ; then if test "x$withval" != "xyes" ; then @@ -1759,12 +1761,33 @@ AC_ARG_WITH(smartcard, AC_MSG_ERROR(Can't find libsectok) fi AC_DEFINE(SMARTCARD) - SCARD_MSG="yes" + AC_DEFINE(USE_SECTOK) + SCARD_MSG="yes, using sectok" fi ] ) +# Check whether user wants OpenSC support +AC_ARG_WITH(opensc, + AC_HELP_STRING([--with-opensc=PFX], + [Enable smartcard support using OpenSC]), + opensc_config_prefix="$withval", opensc_config_prefix="") +if test x$opensc_config_prefix != x ; then + OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config + AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no) + if test "$OPENSC_CONFIG" != "no"; then + LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags` + LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs` + CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS" + LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS" + AC_DEFINE(SMARTCARD) + AC_DEFINE(USE_OPENSC) + SCARD_MSG="yes, using OpenSC" + fi +fi + # Check whether user wants Kerberos 5 support +KRB5_MSG="no" AC_ARG_WITH(kerberos5, [ --with-kerberos5=PATH Enable Kerberos 5 support], [ @@ -1777,6 +1800,7 @@ AC_ARG_WITH(kerberos5, CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" AC_DEFINE(KRB5) + KRB5_MSG="yes" AC_MSG_CHECKING(whether we are using Heimdal) AC_TRY_COMPILE([ #include ], [ char *tmp = heimdal_version; ], @@ -1920,6 +1944,17 @@ AC_ARG_WITH(rsh, ] ) +PRIVSEP_PATH=/var/empty +AC_ARG_WITH(privsep-path, + [ --with-privsep-path=xxx Path for privilege separation chroot ], + [ + if test "x$withval" != "$no" ; then + PRIVSEP_PATH=$withval + fi + ] +) +AC_SUBST(PRIVSEP_PATH) + AC_ARG_WITH(xauth, [ --with-xauth=PATH Specify path to xauth program ], [ @@ -1954,12 +1989,14 @@ if test ! -z "$MAIL" ; then fi if test -z "$no_dev_ptmx" ; then - AC_CHECK_FILE("/dev/ptmx", - [ - AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) - have_dev_ptmx=1 - ] - ) + if test "x$disable_ptmx_check" != "xyes" ; then + AC_CHECK_FILE("/dev/ptmx", + [ + AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) + have_dev_ptmx=1 + ] + ) + fi fi AC_CHECK_FILE("/dev/ptc", [ @@ -2059,17 +2096,28 @@ else ) fi +dnl BSD systems use /etc/login.conf so --with-default-path= has no effect +if test $ac_cv_func_login_getcapbool = "yes" -a \ + $ac_cv_header_login_cap_h = "yes" ; then + USES_LOGIN_CONF=yes +fi # Whether to mess with the default path SERVER_PATH_MSG="(default)" AC_ARG_WITH(default-path, - [ --with-default-path=PATH Specify default \$PATH environment for server], + [ --with-default-path= Specify default \$PATH environment for server], [ - if test "x$withval" != "xno" ; then + if test "$USES_LOGIN_CONF" = "yes" ; then + AC_MSG_WARN([ +--with-default-path=PATH has no effect on this system. +Edit /etc/login.conf instead.]) + elif test "x$withval" != "xno" ; then user_path="$withval" SERVER_PATH_MSG="$withval" fi ], - [ + [ if test "$USES_LOGIN_CONF" = "yes" ; then + AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf]) + else AC_TRY_RUN( [ /* find out what STDPATH is */ @@ -2119,10 +2167,24 @@ main() AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work) fi fi + fi ] +) +if test "$USES_LOGIN_CONF" != "yes" ; then + AC_DEFINE_UNQUOTED(USER_PATH, "$user_path") + AC_SUBST(user_path) +fi + +# Set superuser path separately to user path +AC_ARG_WITH(superuser-path, + [ --with-superuser-path= Specify different path for super-user], + [ + if test "x$withval" != "xno" ; then + AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval") + superuser_path=$withval + fi ] ) -AC_DEFINE_UNQUOTED(USER_PATH, "$user_path") -AC_SUBST(user_path) + # Whether to force IPv4 by default (needed on broken glibc Linux) IPV4_HACK_MSG="no" @@ -2192,23 +2254,26 @@ AC_SUBST(SSHMODE) # Where to place sshd.pid piddir=/var/run +# make sure the directory exists +if test ! -d $piddir ; then + piddir=`eval echo ${sysconfdir}` + case $piddir in + NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; + esac +fi + AC_ARG_WITH(pid-dir, [ --with-pid-dir=PATH Specify location of ssh.pid file], [ if test "x$withval" != "xno" ; then piddir=$withval + if test ! -d $piddir ; then + AC_MSG_WARN([** no $piddir directory on this system **]) + fi fi ] ) -# make sure the directory exists -if test ! -d $piddir ; then - piddir=`eval echo ${sysconfdir}` - case $piddir in - NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; - esac -fi - AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir") AC_SUBST(piddir) @@ -2460,32 +2525,43 @@ D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` G=`eval echo ${piddir}` ; G=`eval echo ${G}` -H=`eval echo ${user_path}` ; H=`eval echo ${H}` +H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}` +I=`eval echo ${user_path}` ; I=`eval echo ${I}` +J=`eval echo ${superuser_path}` ; J=`eval echo ${J}` echo "" echo "OpenSSH has been configured with the following options:" -echo " User binaries: $B" -echo " System binaries: $C" -echo " Configuration files: $D" -echo " Askpass program: $E" -echo " Manual pages: $F" -echo " PID file: $G" -echo " sshd default user PATH: $H" -echo " Manpage format: $MANTYPE" -echo " PAM support: ${PAM_MSG}" -echo " KerberosIV support: $KRB4_MSG" -echo " Smartcard support: $SCARD_MSG" -echo " AFS support: $AFS_MSG" -echo " S/KEY support: $SKEY_MSG" -echo " TCP Wrappers support: $TCPW_MSG" -echo " MD5 password support: $MD5_MSG" -echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" -echo " Use IPv4 by default hack: $IPV4_HACK_MSG" -echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" -echo " BSD Auth support: $BSD_AUTH_MSG" -echo " Random number source: $RAND_MSG" +echo " User binaries: $B" +echo " System binaries: $C" +echo " Configuration files: $D" +echo " Askpass program: $E" +echo " Manual pages: $F" +echo " PID file: $G" +echo " Privilege separation chroot path: $H" +if test "$USES_LOGIN_CONF" = "yes" ; then +echo " At runtime, sshd will use the path defined in /etc/login.conf" +else +echo " sshd default user PATH: $I" +fi +if test ! -z "$superuser_path" ; then +echo " sshd superuser user PATH: $J" +fi +echo " Manpage format: $MANTYPE" +echo " PAM support: ${PAM_MSG}" +echo " KerberosIV support: $KRB4_MSG" +echo " KerberosV support: $KRB5_MSG" +echo " Smartcard support: $SCARD_MSG" +echo " AFS support: $AFS_MSG" +echo " S/KEY support: $SKEY_MSG" +echo " TCP Wrappers support: $TCPW_MSG" +echo " MD5 password support: $MD5_MSG" +echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" +echo " Use IPv4 by default hack: $IPV4_HACK_MSG" +echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" +echo " BSD Auth support: $BSD_AUTH_MSG" +echo " Random number source: $RAND_MSG" if test ! -z "$USE_RAND_HELPER" ; then - echo " ssh-rand-helper collects from: $RAND_HELPER_MSG" +echo " ssh-rand-helper collects from: $RAND_HELPER_MSG" fi echo "" diff --git a/openssh/contrib/aix/buildbff.sh b/openssh/contrib/aix/buildbff.sh index 6c7aaf4..4095884 100755 --- a/openssh/contrib/aix/buildbff.sh +++ b/openssh/contrib/aix/buildbff.sh @@ -11,21 +11,14 @@ umask 022 PKGNAME=openssh +PKGDIR=package -PATH=$PATH:`pwd` # set path for external tools +PATH=`pwd`:$PATH # set path for external tools export PATH -## Extract common info requires for the 'info' part of the package. -VERSION=`tail -1 ../../version.h | sed -e 's/.*_\([0-9]\)/\1/g' | sed 's/\"$//'` -BFFVERSION=`echo $VERSION | sed 's/p/./g'` - -echo "Building BFF for $PKGNAME $VERSION (package version $BFFVERSION)" -PKGDIR=package - -# Clean build directory and package file +# Clean build directory rm -rf $PKGDIR mkdir $PKGDIR -rm -f $PKGNAME-$VERSION.bff if [ ! -f ../../Makefile ] then @@ -40,6 +33,29 @@ FAKE_ROOT=$START/$PKGDIR cd ../.. make install-nokeys DESTDIR=$FAKE_ROOT +if [ $? -gt 0 ] +then + echo "Fake root install failed, stopping." + exit 1 +fi + +# +# Extract common info requires for the 'info' part of the package. +# AIX requires 4-part version numbers +# +VERSION=`./ssh -V 2>&1 | sed -e 's/,.*//' | cut -f 2 -d _` +MAJOR=`echo $VERSION | cut -f 1 -d p | cut -f 1 -d .` +MINOR=`echo $VERSION | cut -f 1 -d p | cut -f 2 -d .` +PATCH=`echo $VERSION | cut -f 1 -d p | cut -f 3 -d .` +PORTABLE=`echo $VERSION | cut -f 2 -d p` +if [ "$PATCH" = "" ] +then + PATCH=0 +fi +BFFVERSION=`printf "%d.%d.%d.%d" $MAJOR $MINOR $PATCH $PORTABLE` + +echo "Building BFF for $PKGNAME $VERSION (package version $BFFVERSION)" + # # Fill in some details, like prefix and sysconfdir # the eval also expands variables like sysconfdir=${prefix}/etc @@ -175,6 +191,7 @@ mv ../lpp_name . # file list on the fly and feed it to backup using -i # echo Creating $PKGNAME-$VERSION.bff with backup... +rm -f $PKGNAME-$VERSION.bff ( echo "./lpp_name" find . ! -name lpp_name -a ! -name . -print diff --git a/openssh/contrib/aix/inventory.sh b/openssh/contrib/aix/inventory.sh index aa44ab9..78df0d1 100755 --- a/openssh/contrib/aix/inventory.sh +++ b/openssh/contrib/aix/inventory.sh @@ -52,7 +52,7 @@ find . ! -name . -print | perl -ne '{ } elsif ( -f $_ ) { # Entry is File print "\ttype=FILE\n"; - print "\tsize=VOLATILE\n"; + print "\tsize=$sz\n"; print "\tchecksum=VOLATILE\n"; } elsif ( -d $_ ) { # Entry is Directory diff --git a/openssh/contrib/caldera/openssh.spec b/openssh/contrib/caldera/openssh.spec index e2077bf..5ac18b6 100644 --- a/openssh/contrib/caldera/openssh.spec +++ b/openssh/contrib/caldera/openssh.spec @@ -1,11 +1,11 @@ %define use-stable 1 %if %{use-stable} - %define version 3.1p1 + %define version 3.2.3p1 %define cvs %{nil} %define release 1 %else - %define version 3.0p1 - %define cvs cvs20011102 + %define version 3.2.3 + %define cvs cvs20020515 %define release 0r1 %endif %define xsa x11-ssh-askpass @@ -93,7 +93,7 @@ mkdir -p $DESTDIR/{etc/pam.d,%{SVIcdir},%{SVIdir}} # enabling X11 forwarding on the server is convenient and okay, # on the client side we consider it a potential security risk! %{fixUP} -vT $DESTDIR/etc/ssh/sshd_config -e ' - s/X11Forwarding no/X11Forwarding yes/i' + s/#X11Forwarding no/X11Forwarding yes/i' install -m644 contrib/caldera/sshd.pam $DESTDIR/etc/pam.d/sshd # FIXME: disabled, find out why this doesn't work with NIS @@ -171,7 +171,7 @@ EOF if [ -x %{LSBinit}-install ]; then %{LSBinit}-install sshd else - lisa --SysV-init install sshd S55 3:4:5 K45 0:1:2:6 + lisa --SysV-init install sshd S55 2:3:4:5 K45 0:1:6 fi ! %{SVIdir}/sshd status || %{SVIdir}/sshd restart diff --git a/openssh/contrib/cygwin/README b/openssh/contrib/cygwin/README index 60d3916..9021ba2 100644 --- a/openssh/contrib/cygwin/README +++ b/openssh/contrib/cygwin/README @@ -172,8 +172,8 @@ configure are used for the Cygwin binary distribution: --sysconfdir=/etc \ --libexecdir='${exec_prefix}/sbin' -You must have installed the zlib, openssl and regex packages to -be able to build OpenSSH! +You must have installed the zlib and openssl packages to be able to +build OpenSSH! Please send requests, error reports etc. to cygwin@cygwin.com. diff --git a/openssh/contrib/cygwin/ssh-host-config b/openssh/contrib/cygwin/ssh-host-config index bfeee7f..da60112 100644 --- a/openssh/contrib/cygwin/ssh-host-config +++ b/openssh/contrib/cygwin/ssh-host-config @@ -434,9 +434,9 @@ then then if [ "${with_comment}" -eq 0 ] then - echo 'ssh stream tcp nowait root /usr/sbin/sshd -i' >> "${_inetcnf}" + echo 'ssh stream tcp nowait root /usr/sbin/sshd sshd -i' >> "${_inetcnf}" else - echo '# ssh stream tcp nowait root /usr/sbin/sshd -i' >> "${_inetcnf}" + echo '# ssh stream tcp nowait root /usr/sbin/sshd sshd -i' >> "${_inetcnf}" fi echo "Added ssh to ${_inetcnf}" fi diff --git a/openssh/contrib/redhat/gnome-ssh-askpass.csh b/openssh/contrib/redhat/gnome-ssh-askpass.csh new file mode 100644 index 0000000..dd77712 --- /dev/null +++ b/openssh/contrib/redhat/gnome-ssh-askpass.csh @@ -0,0 +1 @@ +setenv SSH_ASKPASS /usr/libexec/openssh/gnome-ssh-askpass diff --git a/openssh/contrib/redhat/gnome-ssh-askpass.sh b/openssh/contrib/redhat/gnome-ssh-askpass.sh new file mode 100644 index 0000000..355189f --- /dev/null +++ b/openssh/contrib/redhat/gnome-ssh-askpass.sh @@ -0,0 +1,2 @@ +SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass +export SSH_ASKPASS diff --git a/openssh/contrib/redhat/openssh.spec b/openssh/contrib/redhat/openssh.spec index c36b651..b3dccfb 100644 --- a/openssh/contrib/redhat/openssh.spec +++ b/openssh/contrib/redhat/openssh.spec @@ -1,5 +1,9 @@ -# Version of OpenSSH -%define oversion 3.1p1 +%define ver 3.2.3p1 +%define rel 1 + +# OpenSSH privilege separation requires a user & group ID +%define sshd_uid 74 +%define sshd_gid 74 # Version of ssh-askpass %define aversion 1.2.4.1 @@ -16,8 +20,8 @@ # Do we want smartcard support (1=yes 0=no) %define scard 0 -# Use Redhat 7.0 pam control file -%define redhat7 0 +# Is this build for RHL 6.x? +%define build6x 0 # Disable IPv6 (avoids DNS hangs on some glibc versions) %define noip6 0 @@ -27,9 +31,14 @@ %{?skip_x11_askpass:%define no_x11_askpass 1} %{?skip_gnome_askpass:%define no_gnome_askpass 1} -# Options for Redhat version: -# rpm -ba|--rebuild --define "rh7 1" -%{?rh7:%define redhat7 1} +# Is this a build for RHL 6.x or earlier? +%{?build_6x:%define build6x 1} + +# If this is RHL 6.x, the default configuration has sysconfdir in /usr/etc. +%if %{build6x} +%define _sysconfdir /etc +%define noip6 1 +%endif # Options for static OpenSSL link: # rpm -ba|--rebuild --define "static_openssl 1" @@ -43,37 +52,43 @@ # rpm -ba|--rebuild --define "noipv6 1" %{?noipv6:%define noip6 1} -%define exact_openssl_version %(rpm -q openssl | cut -d - -f 2) +# Is this a build for the rescue CD (without PAM, with MD5)? (1=yes 0=no) +%define rescue 0 +%{?build_rescue:%define rescue 1} -Summary: The OpenSSH implementation of SSH protocol versions 1 and 2 +Summary: The OpenSSH implementation of SSH protocol versions 1 and 2. Name: openssh -Version: %{oversion} -Release: 1 -Packager: Damien Miller +Version: %{ver} +%if %{rescue} +Release: %{rel}rescue +%else +Release: %{rel} +%endif URL: http://www.openssh.com/portable.html -Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{oversion}.tar.gz -%if ! %{no_x11_askpass} +Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz Source1: http://www.pobox.com/~jmknoble/software/x11-ssh-askpass/x11-ssh-askpass-%{aversion}.tar.gz -%endif License: BSD Group: Applications/Internet BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot Obsoletes: ssh -BuildPreReq: perl, openssl-devel, tcp_wrappers -BuildPreReq: /bin/login, /usr/include/security/pam_appl.h -BuildPreReq: rpm >= 3.0.5 +%if %{build6x} +PreReq: initscripts >= 5.00 +%else +PreReq: initscripts >= 5.20 +%endif +BuildPreReq: perl, openssl-devel, sharutils, tcp_wrappers +BuildPreReq: /bin/login +%if %{build6x} +BuildPreReq: glibc-devel, pam +%else +BuildPreReq: db1-devel, /usr/include/security/pam_appl.h +%endif %if ! %{no_x11_askpass} BuildPreReq: XFree86-devel %endif %if ! %{no_gnome_askpass} BuildPreReq: gnome-libs-devel %endif -%if ! %{static_libcrypto} -PreReq: openssl >= 0.9.5a -PreReq: openssl = %{exact_openssl_version} -Requires: openssl >= 0.9.5a -%endif -Requires: rpm >= 3.0.5 %package clients Summary: OpenSSH clients. @@ -86,7 +101,7 @@ Summary: The OpenSSH server daemon. Group: System Environment/Daemons Obsoletes: ssh-server PreReq: openssh = %{version}-%{release}, chkconfig >= 0.9 -%if %{redhat7} +%if ! %{build6x} Requires: /etc/pam.d/system-auth %endif @@ -103,41 +118,43 @@ Requires: openssh = %{version}-%{release} Obsoletes: ssh-extras %description -OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation. SSH -replaces rlogin and rsh, to provide secure encrypted communications -between two untrusted hosts over an insecure network. X11 connections -and arbitrary TCP/IP ports can also be forwarded over the secure -channel. Public key authentication may be used for "passwordless" -access to servers. +SSH (Secure SHell) is a program for logging into and executing +commands on a remote machine. SSH is intended to replace rlogin and +rsh, and to provide secure encrypted communications between two +untrusted hosts over an insecure network. X11 connections and +arbitrary TCP/IP ports can also be forwarded over the secure channel. + +OpenSSH is OpenBSD's version of the last free version of SSH, bringing +it up to date in terms of security and features, as well as removing +all patented algorithms to separate libraries. This package includes the core files necessary for both the OpenSSH client and server. To make this package useful, you should also install openssh-clients, openssh-server, or both. %description clients -OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation. - -This package includes the clients necessary to make encrypted -connections to SSH protocol servers. You'll also need to install the -openssh package on OpenSSH clients. +OpenSSH is a free version of SSH (Secure SHell), a program for logging +into and executing commands on a remote machine. This package includes +the clients necessary to make encrypted connections to SSH servers. +You'll also need to install the openssh package on OpenSSH clients. %description server -OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation. - -This package contains the secure shell daemon (sshd). The sshd daemon -allows SSH clients to securely connect to your SSH server. You also -need to have the openssh package installed. +OpenSSH is a free version of SSH (Secure SHell), a program for logging +into and executing commands on a remote machine. This package contains +the secure shell daemon (sshd). The sshd daemon allows SSH clients to +securely connect to your SSH server. You also need to have the openssh +package installed. %description askpass -OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation. - -This package contains an X11 passphrase dialog for OpenSSH. +OpenSSH is a free version of SSH (Secure SHell), a program for logging +into and executing commands on a remote machine. This package contains +an X11 passphrase dialog for OpenSSH. %description askpass-gnome -OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation. - -This package contains an X11 passphrase dialog for OpenSSH and the -GNOME GUI desktop environment. +OpenSSH is a free version of SSH (Secure SHell), a program for logging +into and executing commands on a remote machine. This package contains +an X11 passphrase dialog for OpenSSH and the GNOME GUI desktop +environment. %prep @@ -148,38 +165,41 @@ GNOME GUI desktop environment. %endif %build - -%define _sysconfdir /etc/ssh - -EXTRA_OPTS="" - -%if %{scard} - EXTRA_OPTS="$EXTRA_OPTS --with-smartcard" -%endif - -%if %{noip6} - EXTRA_OPTS="$EXTRA_OPTS --with-ipv4-default " +%if %{rescue} +CFLAGS="$RPM_OPT_FLAGS -Os"; export CFLAGS %endif %configure \ + --sysconfdir=%{_sysconfdir}/ssh \ --libexecdir=%{_libexecdir}/openssh \ --datadir=%{_datadir}/openssh \ - --with-pam \ --with-tcp-wrappers \ - --with-rsh=/usr/bin/rsh \ - --with-default-path=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin \ - $EXTRA_OPTS + --with-rsh=%{_bindir}/rsh \ + --with-default-path=/usr/local/bin:/bin:/usr/bin \ + --with-superuser-path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin \ + --with-privsep-path=%{_var}/empty/sshd \ +%if %{scard} + --with-smartcard \ +%endif +%if %{noip6} + --with-ipv4-default \ +%endif +%if %{rescue} + --without-pam --with-md5-passwords +%else + --with-pam --with-kerberos5=/usr/kerberos +%endif + %if %{static_libcrypto} -perl -pi -e "s|-lcrypto|/usr/lib/libcrypto.a|g" Makefile +perl -pi -e "s|-lcrypto|%{_libdir}/libcrypto.a|g" Makefile %endif make %if ! %{no_x11_askpass} pushd x11-ssh-askpass-%{aversion} -%configure \ - --libexecdir=%{_libexecdir}/openssh +%configure --libexecdir=%{_libexecdir}/openssh xmkmf -a make popd @@ -187,7 +207,7 @@ popd %if ! %{no_gnome_askpass} pushd contrib -gcc -O -g `gnome-config --cflags gnome gnomeui` \ +gcc $RPM_OPT_FLAGS `gnome-config --cflags gnome gnomeui` \ gnome-ssh-askpass.c -o gnome-ssh-askpass \ `gnome-config --libs gnome gnomeui` popd @@ -195,58 +215,98 @@ popd %install rm -rf $RPM_BUILD_ROOT -%{makeinstall} \ - libexecdir=$RPM_BUILD_ROOT%{_libexecdir}/openssh \ - datadir=$RPM_BUILD_ROOT%{_datadir}/openssh \ - DESTDIR=/ # Hack to disable key generation +mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/ssh +mkdir -p -m755 $RPM_BUILD_ROOT%{_libexecdir}/openssh +mkdir -p -m755 $RPM_BUILD_ROOT%{_var}/empty/sshd +make install DESTDIR=$RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT/etc/pam.d/ install -d $RPM_BUILD_ROOT/etc/rc.d/init.d install -d $RPM_BUILD_ROOT%{_libexecdir}/openssh -%if %{redhat7} -install -m644 contrib/redhat/sshd.pam-7.x $RPM_BUILD_ROOT/etc/pam.d/sshd +%if %{build6x} +install -m644 contrib/redhat/sshd.pam.old $RPM_BUILD_ROOT/etc/pam.d/sshd %else -install -m644 contrib/redhat/sshd.pam $RPM_BUILD_ROOT/etc/pam.d/sshd +install -m644 contrib/redhat/sshd.pam $RPM_BUILD_ROOT/etc/pam.d/sshd %endif install -m755 contrib/redhat/sshd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/sshd %if ! %{no_x11_askpass} install -s x11-ssh-askpass-%{aversion}/x11-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/x11-ssh-askpass -ln -s /usr/libexec/openssh/x11-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/ssh-askpass +ln -s x11-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/ssh-askpass %endif %if ! %{no_gnome_askpass} install -s contrib/gnome-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/gnome-ssh-askpass %endif +install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/ +install -m 755 contrib/redhat/gnome-ssh-askpass.csh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/ +install -m 755 contrib/redhat/gnome-ssh-askpass.sh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/ + perl -pi -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_mandir}/man*/* %clean rm -rf $RPM_BUILD_ROOT +%triggerun server -- ssh-server +if [ "$1" != 0 -a -r /var/run/sshd.pid ] ; then + touch /var/run/sshd.restart +fi + +%triggerun server -- openssh-server < 2.5.0p1 +# Count the number of HostKey and HostDsaKey statements we have. +gawk 'BEGIN {IGNORECASE=1} + /^hostkey/ || /^hostdsakey/ {sawhostkey = sawhostkey + 1} + END {exit sawhostkey}' /etc/ssh/sshd_config +# And if we only found one, we know the client was relying on the old default +# behavior, which loaded the the SSH2 DSA host key when HostDsaKey wasn't +# specified. Now that HostKey is used for both SSH1 and SSH2 keys, specifying +# one nullifies the default, which would have loaded both. +if [ $? -eq 1 ] ; then + echo HostKey /etc/ssh/ssh_host_rsa_key >> /etc/ssh/sshd_config + echo HostKey /etc/ssh/ssh_host_dsa_key >> /etc/ssh/sshd_config +fi + +%triggerpostun server -- ssh-server +if [ "$1" != 0 ] ; then + /sbin/chkconfig --add sshd + if test -f /var/run/sshd.restart ; then + rm -f /var/run/sshd.restart + /sbin/service sshd start > /dev/null 2>&1 || : + fi +fi + +%pre server +%{_sbindir}/groupadd -r -g %{sshd_gid} sshd 2>/dev/null || : +%{_sbindir}/useradd -d /var/empty/sshd -s /bin/false -u %{sshd_uid} \ + -g sshd -M -r sshd 2>/dev/null || : + %post server /sbin/chkconfig --add sshd -if test -r /var/run/sshd.pid ; then - /etc/rc.d/init.d/sshd restart >&2 -fi + +%postun server +/sbin/service sshd condrestart > /dev/null 2>&1 || : %preun server -if [ "$1" = 0 ] ; then - /etc/rc.d/init.d/sshd stop >&2 +if [ "$1" = 0 ] +then + /sbin/service sshd stop > /dev/null 2>&1 || : /sbin/chkconfig --del sshd fi %files %defattr(-,root,root) %doc CREDITS ChangeLog INSTALL LICENCE OVERVIEW README* RFC* TODO WARNING* -%attr(0755,root,root) %{_bindir}/ssh-keygen %attr(0755,root,root) %{_bindir}/scp -%attr(0644,root,root) %{_mandir}/man1/ssh-keygen.1* %attr(0644,root,root) %{_mandir}/man1/scp.1* -%attr(0755,root,root) %dir %{_sysconfdir} -%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/moduli +%attr(0755,root,root) %dir %{_sysconfdir}/ssh +%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/ssh/moduli +%if ! %{rescue} +%attr(0755,root,root) %{_bindir}/ssh-keygen +%attr(0644,root,root) %{_mandir}/man1/ssh-keygen.1* %attr(0755,root,root) %dir %{_libexecdir}/openssh +%endif %if %{scard} %attr(0755,root,root) %dir %{_datadir}/openssh %attr(0644,root,root) %{_datadir}/openssh/Ssh.bin @@ -255,29 +315,34 @@ fi %files clients %defattr(-,root,root) %attr(4755,root,root) %{_bindir}/ssh +%attr(0644,root,root) %{_mandir}/man1/ssh.1* +%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh/ssh_config +%attr(-,root,root) %{_bindir}/slogin +%attr(-,root,root) %{_mandir}/man1/slogin.1* +%if ! %{rescue} %attr(0755,root,root) %{_bindir}/ssh-agent %attr(0755,root,root) %{_bindir}/ssh-add %attr(0755,root,root) %{_bindir}/ssh-keyscan %attr(0755,root,root) %{_bindir}/sftp -%attr(0644,root,root) %{_mandir}/man1/ssh.1* %attr(0644,root,root) %{_mandir}/man1/ssh-agent.1* %attr(0644,root,root) %{_mandir}/man1/ssh-add.1* %attr(0644,root,root) %{_mandir}/man1/ssh-keyscan.1* %attr(0644,root,root) %{_mandir}/man1/sftp.1* -%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh_config -%attr(-,root,root) %{_bindir}/slogin -%attr(-,root,root) %{_mandir}/man1/slogin.1* +%endif +%if ! %{rescue} %files server %defattr(-,root,root) +%dir %attr(0111,root,root) %{_var}/empty/sshd %attr(0755,root,root) %{_sbindir}/sshd %attr(0755,root,root) %{_libexecdir}/openssh/sftp-server %attr(0644,root,root) %{_mandir}/man8/sshd.8* %attr(0644,root,root) %{_mandir}/man8/sftp-server.8* -#%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sshd_config -%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sshd_config +%attr(0755,root,root) %dir %{_sysconfdir}/ssh +%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/ssh/sshd_config %attr(0600,root,root) %config(noreplace) /etc/pam.d/sshd %attr(0755,root,root) %config /etc/rc.d/init.d/sshd +%endif %if ! %{no_x11_askpass} %files askpass @@ -292,44 +357,389 @@ fi %if ! %{no_gnome_askpass} %files askpass-gnome %defattr(-,root,root) +%attr(0755,root,root) %config %{_sysconfdir}/profile.d/gnome-ssh-askpass.* %attr(0755,root,root) %{_libexecdir}/openssh/gnome-ssh-askpass %endif %changelog -* Mon Oct 18 2000 Damien Miller -- Merge some of Nalin Dahyabhai changes from the - Redhat 7.0 spec file -* Tue Sep 05 2000 Damien Miller -- Use RPM configure macro -* Tue Aug 08 2000 Damien Miller -- Some surgery to sshd.init (generate keys at runtime) -- Cleanup of groups and removal of keygen calls -* Wed Jul 12 2000 Damien Miller -- Make building of X11-askpass and gnome-askpass optional -* Mon Jun 12 2000 Damien Miller -- Glob manpages to catch compressed files +* Fri May 10 2002 Damien Miller +- Merge in spec changes from RedHat, reorgansie a little +- Add Privsep user, group and directory + +* Thu Mar 7 2002 Nalin Dahyabhai 3.1p1-2 +- bump and grind (through the build system) + +* Thu Mar 7 2002 Nalin Dahyabhai 3.1p1-1 +- require sharutils for building (mindrot #137) +- require db1-devel only when building for 6.x (#55105), which probably won't + work anyway (3.1 requires OpenSSL 0.9.6 to build), but what the heck +- require pam-devel by file (not by package name) again +- add Markus's patch to compile with OpenSSL 0.9.5a (from + http://bugzilla.mindrot.org/show_bug.cgi?id=141) and apply it if we're + building for 6.x + +* Thu Mar 7 2002 Nalin Dahyabhai 3.1p1-0 +- update to 3.1p1 + +* Tue Mar 5 2002 Nalin Dahyabhai SNAP-20020305 +- update to SNAP-20020305 +- drop debug patch, fixed upstream + +* Wed Feb 20 2002 Nalin Dahyabhai SNAP-20020220 +- update to SNAP-20020220 for testing purposes (you've been warned, if there's + anything to be warned about, gss patches won't apply, I don't mind) + +* Wed Feb 13 2002 Nalin Dahyabhai 3.0.2p1-3 +- add patches from Simon Wilkinson and Nicolas Williams for GSSAPI key + exchange, authentication, and named key support + +* Wed Jan 23 2002 Nalin Dahyabhai 3.0.2p1-2 +- remove dependency on db1-devel, which has just been swallowed up whole + by gnome-libs-devel + +* Sun Dec 29 2001 Nalin Dahyabhai +- adjust build dependencies so that build6x actually works right (fix + from Hugo van der Kooij) + +* Tue Dec 4 2001 Nalin Dahyabhai 3.0.2p1-1 +- update to 3.0.2p1 + +* Fri Nov 16 2001 Nalin Dahyabhai 3.0.1p1-1 +- update to 3.0.1p1 + +* Tue Nov 13 2001 Nalin Dahyabhai +- update to current CVS (not for use in distribution) + +* Thu Nov 8 2001 Nalin Dahyabhai 3.0p1-1 +- merge some of Damien Miller changes from the upstream + 3.0p1 spec file and init script + +* Wed Nov 7 2001 Nalin Dahyabhai +- update to 3.0p1 +- update to x11-ssh-askpass 1.2.4.1 +- change build dependency on a file from pam-devel to the pam-devel package +- replace primes with moduli + +* Thu Sep 27 2001 Nalin Dahyabhai 2.9p2-9 +- incorporate fix from Markus Friedl's advisory for IP-based authorization bugs + +* Thu Sep 13 2001 Bernhard Rosenkraenzer 2.9p2-8 +- Merge changes to rescue build from current sysadmin survival cd + +* Thu Sep 6 2001 Nalin Dahyabhai 2.9p2-7 +- fix scp's server's reporting of file sizes, and build with the proper + preprocessor define to get large-file capable open(), stat(), etc. + (sftp has been doing this correctly all along) (#51827) +- configure without --with-ipv4-default on RHL 7.x and newer (#45987,#52247) +- pull cvs patch to fix support for /etc/nologin for non-PAM logins (#47298) +- mark profile.d scriptlets as config files (#42337) +- refer to Jason Stone's mail for zsh workaround for exit-hanging quasi-bug +- change a couple of log() statements to debug() statements (#50751) +- pull cvs patch to add -t flag to sshd (#28611) +- clear fd_sets correctly (one bit per FD, not one byte per FD) (#43221) + +* Mon Aug 20 2001 Nalin Dahyabhai 2.9p2-6 +- add db1-devel as a BuildPrerequisite (noted by Hans Ecke) + +* Thu Aug 16 2001 Nalin Dahyabhai +- pull cvs patch to fix remote port forwarding with protocol 2 + +* Thu Aug 9 2001 Nalin Dahyabhai +- pull cvs patch to add session initialization to no-pty sessions +- pull cvs patch to not cut off challengeresponse auth needlessly +- refuse to do X11 forwarding if xauth isn't there, handy if you enable + it by default on a system that doesn't have X installed (#49263) + +* Wed Aug 8 2001 Nalin Dahyabhai +- don't apply patches to code we don't intend to build (spotted by Matt Galgoci) + +* Mon Aug 6 2001 Nalin Dahyabhai +- pass OPTIONS correctly to initlog (#50151) + +* Wed Jul 25 2001 Nalin Dahyabhai +- switch to x11-ssh-askpass 1.2.2 + +* Wed Jul 11 2001 Nalin Dahyabhai +- rebuild in new environment + +* Mon Jun 25 2001 Nalin Dahyabhai +- disable the gssapi patch + +* Mon Jun 18 2001 Nalin Dahyabhai +- update to 2.9p2 +- refresh to a new version of the gssapi patch + +* Thu Jun 7 2001 Nalin Dahyabhai +- change Copyright: BSD to License: BSD +- add Markus Friedl's unverified patch for the cookie file deletion problem + so that we can verify it +- drop patch to check if xauth is present (was folded into cookie patch) +- don't apply gssapi patches for the errata candidate +- clear supplemental groups list at startup + +* Fri May 25 2001 Nalin Dahyabhai +- fix an error parsing the new default sshd_config +- add a fix from Markus Friedl (via openssh-unix-dev) for ssh-keygen not + dealing with comments right + +* Thu May 24 2001 Nalin Dahyabhai +- add in Simon Wilkinson's GSSAPI patch to give it some testing in-house, + to be removed before the next beta cycle because it's a big departure + from the upstream version + +* Thu May 3 2001 Nalin Dahyabhai +- finish marking strings in the init script for translation +- modify init script to source /etc/sysconfig/sshd and pass $OPTIONS to sshd + at startup (change merged from openssh.com init script, originally by + Pekka Savola) +- refuse to do X11 forwarding if xauth isn't there, handy if you enable + it by default on a system that doesn't have X installed + +* Wed May 2 2001 Nalin Dahyabhai +- update to 2.9 +- drop various patches that came from or went upstream or to or from CVS + +* Wed Apr 18 2001 Nalin Dahyabhai +- only require initscripts 5.00 on 6.2 (reported by Peter Bieringer) + +* Sun Apr 8 2001 Preston Brown +- remove explicit openssl requirement, fixes builddistro issue +- make initscript stop() function wait until sshd really dead to avoid + races in condrestart + +* Mon Apr 2 2001 Nalin Dahyabhai +- mention that challengereponse supports PAM, so disabling password doesn't + limit users to pubkey and rsa auth (#34378) +- bypass the daemon() function in the init script and call initlog directly, + because daemon() won't start a daemon it detects is already running (like + open connections) +- require the version of openssl we had when we were built + +* Fri Mar 23 2001 Nalin Dahyabhai +- make do_pam_setcred() smart enough to know when to establish creds and + when to reinitialize them +- add in a couple of other fixes from Damien for inclusion in the errata + +* Thu Mar 22 2001 Nalin Dahyabhai +- update to 2.5.2p2 +- call setcred() again after initgroups, because the "creds" could actually + be group memberships + +* Tue Mar 20 2001 Nalin Dahyabhai +- update to 2.5.2p1 (includes endianness fixes in the rijndael implementation) +- don't enable challenge-response by default until we find a way to not + have too many userauth requests (we may make up to six pubkey and up to + three password attempts as it is) +- remove build dependency on rsh to match openssh.com's packages more closely + +* Sat Mar 3 2001 Nalin Dahyabhai +- remove dependency on openssl -- would need to be too precise + +* Fri Mar 2 2001 Nalin Dahyabhai +- rebuild in new environment + +* Mon Feb 26 2001 Nalin Dahyabhai +- Revert the patch to move pam_open_session. +- Init script and spec file changes from Pekka Savola. (#28750) +- Patch sftp to recognize '-o protocol' arguments. (#29540) + +* Thu Feb 22 2001 Nalin Dahyabhai +- Chuck the closing patch. +- Add a trigger to add host keys for protocol 2 to the config file, now that + configuration file syntax requires us to specify it with HostKey if we + specify any other HostKey values, which we do. + +* Tue Feb 20 2001 Nalin Dahyabhai +- Redo patch to move pam_open_session after the server setuid()s to the user. +- Rework the nopam patch to use be picked up by autoconf. + +* Mon Feb 19 2001 Nalin Dahyabhai +- Update for 2.5.1p1. +- Add init script mods from Pekka Savola. +- Tweak the init script to match the CVS contrib script more closely. +- Redo patch to ssh-add to try to adding both identity and id_dsa to also try + adding id_rsa. + +* Fri Feb 16 2001 Nalin Dahyabhai +- Update for 2.5.0p1. +- Use $RPM_OPT_FLAGS instead of -O when building gnome-ssh-askpass +- Resync with parts of Damien Miller's openssh.spec from CVS, including + update of x11 askpass to 1.2.0. +- Only require openssl (don't prereq) because we generate keys in the init + script now. + +* Tue Feb 13 2001 Nalin Dahyabhai +- Don't open a PAM session until we've forked and become the user (#25690). +- Apply Andrew Bartlett's patch for letting pam_authenticate() know which + host the user is attempting a login from. +- Resync with parts of Damien Miller's openssh.spec from CVS. +- Don't expose KbdInt responses in debug messages (from CVS). +- Detect and handle errors in rsa_{public,private}_decrypt (from CVS). + +* Wed Feb 7 2001 Trond Eivind Glomsrxd +- i18n-tweak to initscript. + +* Tue Jan 23 2001 Nalin Dahyabhai +- More gettextizing. +- Close all files after going into daemon mode (needs more testing). +- Extract patch from CVS to handle auth banners (in the client). +- Extract patch from CVS to handle compat weirdness. + +* Fri Jan 19 2001 Nalin Dahyabhai +- Finish with the gettextizing. + +* Thu Jan 18 2001 Nalin Dahyabhai +- Fix a bug in auth2-pam.c (#23877) +- Gettextize the init script. + +* Wed Dec 20 2000 Nalin Dahyabhai +- Incorporate a switch for using PAM configs for 6.x, just in case. + +* Tue Dec 5 2000 Nalin Dahyabhai +- Incorporate Bero's changes for a build specifically for rescue CDs. + +* Wed Nov 29 2000 Nalin Dahyabhai +- Don't treat pam_setcred() failure as fatal unless pam_authenticate() has + succeeded, to allow public-key authentication after a failure with "none" + authentication. (#21268) + +* Tue Nov 28 2000 Nalin Dahyabhai +- Update to x11-askpass 1.1.1. (#21301) +- Don't second-guess fixpaths, which causes paths to get fixed twice. (#21290) + +* Mon Nov 27 2000 Nalin Dahyabhai +- Merge multiple PAM text messages into subsequent prompts when possible when + doing keyboard-interactive authentication. + +* Sun Nov 26 2000 Nalin Dahyabhai +- Disable the built-in MD5 password support. We're using PAM. +- Take a crack at doing keyboard-interactive authentication with PAM, and + enable use of it in the default client configuration so that the client + will try it when the server disallows password authentication. +- Build with debugging flags. Build root policies strip all binaries anyway. + +* Tue Nov 21 2000 Nalin Dahyabhai +- Use DESTDIR instead of %%makeinstall. +- Remove /usr/X11R6/bin from the path-fixing patch. + +* Mon Nov 20 2000 Nalin Dahyabhai +- Add the primes file from the latest snapshot to the main package (#20884). +- Add the dev package to the prereq list (#19984). +- Remove the default path and mimic login's behavior in the server itself. + +* Fri Nov 17 2000 Nalin Dahyabhai +- Resync with conditional options in Damien Miller's .spec file for an errata. +- Change libexecdir from %%{_libexecdir}/ssh to %%{_libexecdir}/openssh. + +* Tue Nov 7 2000 Nalin Dahyabhai +- Update to OpenSSH 2.3.0p1. +- Update to x11-askpass 1.1.0. +- Enable keyboard-interactive authentication. + +* Mon Oct 30 2000 Nalin Dahyabhai +- Update to ssh-askpass-x11 1.0.3. +- Change authentication related messages to be private (#19966). + +* Tue Oct 10 2000 Nalin Dahyabhai +- Patch ssh-keygen to be able to list signatures for DSA public key files + it generates. + +* Thu Oct 5 2000 Nalin Dahyabhai +- Add BuildPreReq on /usr/include/security/pam_appl.h to be sure we always + build PAM authentication in. +- Try setting SSH_ASKPASS if gnome-ssh-askpass is installed. +- Clean out no-longer-used patches. +- Patch ssh-add to try to add both identity and id_dsa, and to error only + when neither exists. + +* Mon Oct 2 2000 Nalin Dahyabhai +- Update x11-askpass to 1.0.2. (#17835) +- Add BuildPreReqs for /bin/login and /usr/bin/rsh so that configure will + always find them in the right place. (#17909) +- Set the default path to be the same as the one supplied by /bin/login, but + add /usr/X11R6/bin. (#17909) +- Try to handle obsoletion of ssh-server more cleanly. Package names + are different, but init script name isn't. (#17865) + +* Wed Sep 6 2000 Nalin Dahyabhai +- Update to 2.2.0p1. (#17835) +- Tweak the init script to allow proper restarting. (#18023) + +* Wed Aug 23 2000 Nalin Dahyabhai +- Update to 20000823 snapshot. +- Change subpackage requirements from %%{version} to %%{version}-%%{release} +- Back out the pipe patch. + +* Mon Jul 17 2000 Nalin Dahyabhai +- Update to 2.1.1p4, which includes fixes for config file parsing problems. +- Move the init script back. +- Add Damien's quick fix for wackiness. + +* Wed Jul 12 2000 Nalin Dahyabhai +- Update to 2.1.1p3, which includes fixes for X11 forwarding and strtok(). + +* Thu Jul 6 2000 Nalin Dahyabhai +- Move condrestart to server postun. +- Move key generation to init script. +- Actually use the right patch for moving the key generation to the init script. +- Clean up the init script a bit. + +* Wed Jul 5 2000 Nalin Dahyabhai +- Fix X11 forwarding, from mail post by Chan Shih-Ping Richard. + +* Sun Jul 2 2000 Nalin Dahyabhai +- Update to 2.1.1p2. +- Use of strtok() considered harmful. + +* Sat Jul 1 2000 Nalin Dahyabhai +- Get the build root out of the man pages. + +* Thu Jun 29 2000 Nalin Dahyabhai +- Add and use condrestart support in the init script. +- Add newer initscripts as a prereq. + +* Tue Jun 27 2000 Nalin Dahyabhai +- Build in new environment (release 2) +- Move -clients subpackage to Applications/Internet group + +* Fri Jun 9 2000 Nalin Dahyabhai +- Update to 2.2.1p1 + +* Sat Jun 3 2000 Nalin Dahyabhai +- Patch to build with neither RSA nor RSAref. +- Miscellaneous FHS-compliance tweaks. +- Fix for possibly-compressed man pages. + * Wed Mar 15 2000 Damien Miller - Updated for new location - Updated for new gnome-ssh-askpass build + * Sun Dec 26 1999 Damien Miller - Added Jim Knoble's askpass + * Mon Nov 15 1999 Damien Miller - Split subpackages further based on patch from jim knoble + * Sat Nov 13 1999 Damien Miller - Added 'Obsoletes' directives + * Tue Nov 09 1999 Damien Miller - Use make install - Subpackages + * Mon Nov 08 1999 Damien Miller - Added links for slogin - Fixed perms on manpages + * Sat Oct 30 1999 Damien Miller - Renamed init script + * Fri Oct 29 1999 Damien Miller - Back to old binary names + * Thu Oct 28 1999 Damien Miller - Use autoconf - New binary names + * Wed Oct 27 1999 Damien Miller - Initial RPMification, based on Jan "Yenya" Kasprzak's spec. - diff --git a/openssh/contrib/redhat/sshd.init b/openssh/contrib/redhat/sshd.init index 86b040c..4ee8630 100755 --- a/openssh/contrib/redhat/sshd.init +++ b/openssh/contrib/redhat/sshd.init @@ -1,5 +1,5 @@ #!/bin/bash - +# # Init file for OpenSSH server daemon # # chkconfig: 2345 55 25 @@ -15,149 +15,140 @@ # source function library . /etc/rc.d/init.d/functions +# pull in sysconfig settings [ -f /etc/sysconfig/sshd ] && . /etc/sysconfig/sshd RETVAL=0 +prog="sshd" # Some functions to make the below more readable KEYGEN=/usr/bin/ssh-keygen +SSHD=/usr/sbin/sshd RSA1_KEY=/etc/ssh/ssh_host_key RSA_KEY=/etc/ssh/ssh_host_rsa_key DSA_KEY=/etc/ssh/ssh_host_dsa_key PID_FILE=/var/run/sshd.pid -my_success() { - local msg - if [ $# -gt 1 ]; then - msg="$2" - else - msg="done" - fi - case "`type -type success`" in - function) - success "$1" - ;; - *) - echo -n "${msg}" - ;; - esac -} -my_failure() { - local msg - if [ $# -gt 1 ]; then - msg="$2" - else - msg="FAILED" - fi - case "`type -type failure`" in - function) - failure "$1" - ;; - *) - echo -n "${msg}" - ;; - esac -} + do_rsa1_keygen() { - if ! test -f $RSA1_KEY ; then - echo -n "Generating SSH1 RSA host key: " + if [ ! -s $RSA1_KEY ]; then + echo -n $"Generating SSH1 RSA host key: " if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then - my_success "RSA1 key generation" + chmod 600 $RSA1_KEY + chmod 644 $RSA1_KEY.pub + success $"RSA1 key generation" echo else - my_failure "RSA1 key generation" + failure $"RSA1 key generation" echo exit 1 fi fi } + do_rsa_keygen() { - if ! test -f $RSA_KEY ; then - echo -n "Generating SSH2 RSA host key: " + if [ ! -s $RSA_KEY ]; then + echo -n $"Generating SSH2 RSA host key: " if $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then - my_success "RSA key generation" + chmod 600 $RSA_KEY + chmod 644 $RSA_KEY.pub + success $"RSA key generation" echo else - my_failure "RSA key generation" + failure $"RSA key generation" echo exit 1 fi fi } + do_dsa_keygen() { - if ! test -f $DSA_KEY ; then - echo -n "Generating SSH2 DSA host key: " + if [ ! -s $DSA_KEY ]; then + echo -n $"Generating SSH2 DSA host key: " if $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then - my_success "DSA key generation" + chmod 600 $DSA_KEY + chmod 644 $DSA_KEY.pub + success $"DSA key generation" echo else - my_failure "DSA key generation" + failure $"DSA key generation" echo exit 1 fi fi } -do_restart_sanity_check() { - sshd -t + +do_restart_sanity_check() +{ + $SSHD -t RETVAL=$? if [ ! "$RETVAL" = 0 ]; then - my_failure "Configuration file or keys" + failure $"Configuration file or keys are invalid" echo - exit $RETVAL fi } +start() +{ + # Create keys if necessary + do_rsa1_keygen + do_rsa_keygen + do_dsa_keygen + + echo -n $"Starting $prog:" + initlog -c "$SSHD $OPTIONS" && success || failure + RETVAL=$? + [ "$RETVAL" = 0 ] && touch /var/lock/subsys/sshd + echo +} + +stop() +{ + echo -n $"Stopping $prog:" + killproc $SSHD -TERM + RETVAL=$? + [ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/sshd + echo +} + +reload() +{ + echo -n $"Reloading $prog:" + killproc $SSHD -HUP + RETVAL=$? + echo +} case "$1" in start) - # Create keys if necessary - do_rsa1_keygen; - do_rsa_keygen; - do_dsa_keygen; - - echo -n "Starting sshd: " - if [ ! -f $PID_FILE ] ; then - sshd $OPTIONS - RETVAL=$? - if [ "$RETVAL" = "0" ] ; then - my_success "sshd startup" "sshd" - touch /var/lock/subsys/sshd - else - my_failure "sshd startup" "" - fi - fi - echo + start ;; stop) - echo -n "Shutting down sshd: " - if [ -f $PID_FILE ] ; then - killproc sshd - RETVAL=$? - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sshd - fi - echo + stop ;; restart) - do_restart_sanity_check - $0 stop - $0 start - RETVAL=$? + stop + start + ;; + reload) + reload ;; condrestart) if [ -f /var/lock/subsys/sshd ] ; then do_restart_sanity_check - $0 stop - $0 start - RETVAL=$? + if [ "$RETVAL" = 0 ] ; then + stop + # avoid race + sleep 3 + start + fi fi ;; status) - status sshd + status $SSHD RETVAL=$? ;; *) - echo "Usage: sshd {start|stop|restart|status|condrestart}" - exit 1 - ;; + echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" + RETVAL=1 esac - exit $RETVAL diff --git a/openssh/contrib/redhat/sshd.pam b/openssh/contrib/redhat/sshd.pam index 26dcb34..d2ab073 100644 --- a/openssh/contrib/redhat/sshd.pam +++ b/openssh/contrib/redhat/sshd.pam @@ -1,8 +1,8 @@ #%PAM-1.0 -auth required /lib/security/pam_pwdb.so shadow nodelay +auth required /lib/security/pam_stack.so service=system-auth auth required /lib/security/pam_nologin.so -account required /lib/security/pam_pwdb.so -password required /lib/security/pam_cracklib.so -password required /lib/security/pam_pwdb.so shadow nullok use_authtok -session required /lib/security/pam_pwdb.so +account required /lib/security/pam_stack.so service=system-auth +password required /lib/security/pam_stack.so service=system-auth +session required /lib/security/pam_stack.so service=system-auth session required /lib/security/pam_limits.so +session optional /lib/security/pam_console.so diff --git a/openssh/contrib/solaris/README b/openssh/contrib/solaris/README index 5585249..9b0a46e 100644 --- a/openssh/contrib/solaris/README +++ b/openssh/contrib/solaris/README @@ -1,6 +1,7 @@ The following is a new package build script for Solaris. This is being introduced into OpenSSH 3.0 and above in hopes of simplifying the build -process. +process. As of 3.1p2 the script should work on all platforms that have +SVR4 style package tools. The build process is called a 'dummy install'.. Which means the software does a "make install-nokeys DESTDIR=[fakeroot]". This way all manpages should @@ -11,7 +12,8 @@ Directions: 1. make -F Makefile.in distprep (Only if you are getting from the CVS tree) 2. ./configure --with-pam [..any other options you want..] -3. cd contrib/solaris; ./buildpkg.sh +3. look at the top of contrib/solaris/buildpkg.sh for the configurable options. +4. ./contrib/solaris/buildpkg.sh If all goes well you should have a solaris package ready to be installed. @@ -20,9 +22,3 @@ openssh-unix-dev@mindrot.org and I will try to assist you as best as I can. - Ben Lindstrom -TODO: -- Expand to cover all sysvr4 family of OSes -- Clean things up a bit more. -- Detect if sshd is running and refuse to start. -- SHOULD check for existing sshd_config nor ssh_config (does not currently). - [Post install script? Ugh.. Nasty] diff --git a/openssh/contrib/solaris/buildpkg.sh b/openssh/contrib/solaris/buildpkg.sh index 05abb22..1be6ed8 100755 --- a/openssh/contrib/solaris/buildpkg.sh +++ b/openssh/contrib/solaris/buildpkg.sh @@ -1,52 +1,141 @@ #!/bin/sh # -# Fake Root Solaris Build System - Prototype +# Fake Root Solaris/SVR4/SVR5 Build System - Prototype # # The following code has been provide under Public Domain License. I really # don't care what you use it for. Just as long as you don't complain to me # nor my employer if you break it. - Ben Lindstrom (mouring@eviladmin.org) # umask 022 +# +# Options for building the package +# You can create a config.local with your customized options +# +# uncommenting TEST_DIR and using configure--prefix=/var/tmp and +# PKGNAME=tOpenSSH should allow testing a package without interfering +# with a real OpenSSH package on a system. +#TEST_DIR=/var/tmp # leave commented out for production build PKGNAME=OpenSSH +SYSVINIT_NAME=opensshd +MAKE=${MAKE:="make"} +# uncomment these next two as needed +#PERMIT_ROOT_LOGIN=no +#X11_FORWARDING=yes +# list of system directories we do NOT want to change owner/group/perms +# when installing our package +SYSTEM_DIR="/etc \ +/etc/init.d \ +/etc/rcS.d \ +/etc/rc0.d \ +/etc/rc1.d \ +/etc/rc2.d \ +/etc/opt \ +/opt \ +/opt/bin \ +/usr \ +/usr/bin \ +/usr/lib \ +/usr/sbin \ +/usr/share \ +/usr/share/man \ +/usr/share/man/man1 \ +/usr/share/man/man8 \ +/usr/local \ +/usr/local/bin \ +/usr/local/etc \ +/usr/local/libexec \ +/usr/local/man \ +/usr/local/man/man1 \ +/usr/local/man/man8 \ +/usr/local/sbin \ +/usr/local/share \ +/var \ +/var/opt \ +/var/run \ +/var/tmp \ +/tmp" -## Extract common info requires for the 'info' part of the package. -VERSION=`tail -1 ../../version.h | sed -e 's/.*_\([0-9]\)/\1/g' | sed 's/\"$//'` -ARCH=`uname -p` +# We may need to buiild as root so we make sure PATH is set up +# only set the path if it's not set already +[ -d /usr/local/bin ] && { + echo $PATH | grep ":/usr/local/bin" > /dev/null 2>&1 + [ $? -ne 0 ] && PATH=$PATH:/usr/local/bin +} +[ -d /usr/ccs/bin ] && { + echo $PATH | grep ":/usr/ccs/bin" > /dev/null 2>&1 + [ $? -ne 0 ] && PATH=$PATH:/usr/ccs/bin +} +export PATH +# + +[ -f Makefile ] || { + echo "Please run this script from your build directory" + exit 1 +} + +# we will look for config.local to override the above options +[ -s ./config.local ] && . ./config.local ## Start by faking root install echo "Faking root install..." START=`pwd` +OPENSSHD_IN=`dirname $0`/opensshd.in FAKE_ROOT=$START/package +[ -d $FAKE_ROOT ] && rm -fr $FAKE_ROOT mkdir $FAKE_ROOT -cd ../.. -make install-nokeys DESTDIR=$FAKE_ROOT +${MAKE} install-nokeys DESTDIR=$FAKE_ROOT +if [ $? -gt 0 ] +then + echo "Fake root install failed, stopping." + exit 1 +fi ## Fill in some details, like prefix and sysconfdir -ETCDIR=`grep "^sysconfdir=" Makefile | sed 's/sysconfdir=//'` -PREFIX=`grep "^prefix=" Makefile | cut -d = -f 2` -PIDDIR=`grep "^piddir=" Makefile | cut -d = -f 2` -cd $FAKE_ROOT +for confvar in prefix exec_prefix bindir sbindir libexecdir datadir mandir sysconfdir piddir +do + eval $confvar=`grep "^$confvar=" Makefile | cut -d = -f 2` +done -## Setup our run level stuff while we are at it. -mkdir -p $FAKE_ROOT/etc/init.d -mkdir -p $FAKE_ROOT/etc/rcS.d -mkdir -p $FAKE_ROOT/etc/rc0.d -mkdir -p $FAKE_ROOT/etc/rc1.d -mkdir -p $FAKE_ROOT/etc/rc2.d +## Extract common info requires for the 'info' part of the package. +VERSION=`./ssh -V 2>&1 | sed -e 's/,.*//'` +UNAME_S=`uname -s` +case ${UNAME_S} in + SunOS) UNAME_S=Solaris + ARCH=`uname -p` + RCS_D=yes + DEF_MSG="(default: n)" + ;; + *) ARCH=`uname -m` ;; +esac + +## Setup our run level stuff while we are at it. +mkdir -p $FAKE_ROOT${TEST_DIR}/etc/init.d ## setup our initscript correctly -sed -e "s#%%configDir%%#$ETCDIR#g" \ - -e "s#%%openSSHDir%%#$PREFIX#g" \ - -e "s#%%pidDir%%#$PIDDIR#g" \ - ../opensshd.in > $FAKE_ROOT/etc/init.d/opensshd -chmod 711 $FAKE_ROOT/etc/init.d/opensshd +sed -e "s#%%configDir%%#${sysconfdir}#g" \ + -e "s#%%openSSHDir%%#$prefix#g" \ + -e "s#%%pidDir%%#${piddir}#g" \ + ${OPENSSHD_IN} > $FAKE_ROOT${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} +chmod 744 $FAKE_ROOT${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} -ln -s ../init.d/opensshd $FAKE_ROOT/etc/rcS.d/K30opensshd -ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc0.d/K30opensshd -ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc1.d/K30opensshd -ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc2.d/S98opensshd +[ "${PERMIT_ROOT_LOGIN}" = no ] && \ + perl -p -i -e "s/#PermitRootLogin yes/PermitRootLogin no/" \ + $FAKE_ROOT/${sysconfdir}/sshd_config +[ "${X11_FORWARDING}" = yes ] && \ + perl -p -i -e "s/#X11Forwarding no/X11Forwarding yes/" \ + $FAKE_ROOT/${sysconfdir}/sshd_config +# fix PrintMotd +perl -p -i -e "s/#PrintMotd yes/PrintMotd no/" \ + $FAKE_ROOT/${sysconfdir}/sshd_config +# We don't want to overwrite config files on multiple installs +mv $FAKE_ROOT/${sysconfdir}/ssh_config $FAKE_ROOT/${sysconfdir}/ssh_config.default +mv $FAKE_ROOT/${sysconfdir}/sshd_config $FAKE_ROOT/${sysconfdir}/sshd_config.default +[ -f $FAKE_ROOT/${sysconfdir}/ssh_prng_cmds ] && \ +mv $FAKE_ROOT/${sysconfdir}/ssh_prng_cmds $FAKE_ROOT/${sysconfdir}/ssh_prng_cmds.default + +cd $FAKE_ROOT ## Ok, this is outright wrong, but it will work. I'm tired of pkgmk ## whining. @@ -58,28 +147,159 @@ done echo "Building pkginfo file..." cat > pkginfo << _EOF PKG=$PKGNAME -NAME=OpenSSH Portable for Solaris +NAME="OpenSSH Portable for ${UNAME_S}" DESC="Secure Shell remote access utility; replaces telnet and rlogin/rsh." VENDOR="OpenSSH Portable Team - http://www.openssh.com/portable.html" -BASEDIR=$FAKE_ROOT ARCH=$ARCH VERSION=$VERSION -CATEGORY=Security +CATEGORY="Security,application" BASEDIR=/ +CLASSES="none" +_EOF + +## Build preinstall file +echo "Building preinstall file..." +cat > preinstall << _EOF +#! /sbin/sh +# +[ "\${PRE_INS_STOP}" = "yes" ] && ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} stop +exit 0 _EOF +## Build postinstall file +echo "Building postinstall file..." +cat > postinstall << _EOF +#! /sbin/sh +# +[ -f ${sysconfdir}/ssh_config ] || \\ + cp -p ${sysconfdir}/ssh_config.default ${sysconfdir}/ssh_config +[ -f ${sysconfdir}/sshd_config ] || \\ + cp -p ${sysconfdir}/sshd_config.default ${sysconfdir}/sshd_config +[ -f ${sysconfdir}/ssh_prng_cmds.default ] && { + [ -f ${sysconfdir}/ssh_prng_cmds ] || \\ + cp -p ${sysconfdir}/ssh_prng_cmds.default ${sysconfdir}/ssh_prng_cmds +} + +# make rc?.d dirs only if we are doing a test install +[ -n "${TEST_DIR}" ] && { + [ "$RCS_D" = yes ] && mkdir -p ${TEST_DIR}/etc/rcS.d + mkdir -p ${TEST_DIR}/etc/rc0.d + mkdir -p ${TEST_DIR}/etc/rc1.d + mkdir -p ${TEST_DIR}/etc/rc2.d +} + +if [ "\${USE_SYM_LINKS}" = yes ] +then + [ "$RCS_D" = yes ] && \ +installf ${PKGNAME} $TEST_DIR/etc/rcS.d/K30${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s + installf ${PKGNAME} $TEST_DIR/etc/rc0.d/K30${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s + installf ${PKGNAME} $TEST_DIR/etc/rc1.d/K30${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s + installf ${PKGNAME} $TEST_DIR/etc/rc2.d/S98${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s +else + [ "$RCS_D" = yes ] && \ +installf ${PKGNAME} $TEST_DIR/etc/rcS.d/K30${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l + installf ${PKGNAME} $TEST_DIR/etc/rc0.d/K30${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l + installf ${PKGNAME} $TEST_DIR/etc/rc1.d/K30${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l + installf ${PKGNAME} $TEST_DIR/etc/rc2.d/S98${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l +fi + +# If piddir doesn't exist we add it. (Ie. --with-pid-dir=/var/opt/ssh) +[ -d $piddir ] || installf ${PKGNAME} $TEST_DIR$piddir d 755 root sys + +installf -f ${PKGNAME} + +[ "\${POST_INS_START}" = "yes" ] && ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} start +exit 0 +_EOF + +## Build preremove file +echo "Building preremove file..." +cat > preremove << _EOF +#! /sbin/sh +# +${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} stop +exit 0 +_EOF + +## Build request file +echo "Building request file..." +cat > request << _EOF +trap 'exit 3' 15 +USE_SYM_LINKS=no +PRE_INS_STOP=no +POST_INS_START=no +# Use symbolic links? +ans=\`ckyorn -d n \ +-p "Do you want symbolic links for the start/stop scripts? ${DEF_MSG}"\` || exit \$? +case \$ans in + [y,Y]*) USE_SYM_LINKS=yes ;; +esac + +# determine if should restart the daemon +if [ -s ${piddir}/sshd.pid -a -f ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} ] +then + ans=\`ckyorn -d n \ +-p "Should the running sshd daemon be restarted? ${DEF_MSG}"\` || exit \$? + case \$ans in + [y,Y]*) PRE_INS_STOP=yes + POST_INS_START=yes + ;; + esac + +else + +# determine if we should start sshd + ans=\`ckyorn -d n \ +-p "Start the sshd daemon after installing this package? ${DEF_MSG}"\` || exit \$? + case \$ans in + [y,Y]*) POST_INS_START=yes ;; + esac +fi + +# make parameters available to installation service, +# and so to any other packaging scripts +cat >\$1 < space << _EOF +# extra space required by start/stop links added by installf in postinstall +$TEST_DIR/etc/rc0.d/K30${SYSVINIT_NAME} 0 1 +$TEST_DIR/etc/rc1.d/K30${SYSVINIT_NAME} 0 1 +$TEST_DIR/etc/rc2.d/S98${SYSVINIT_NAME} 0 1 +_EOF +[ "$RCS_D" = yes ] && \ +echo "$TEST_DIR/etc/rcS.d/K30${SYSVINIT_NAME} 0 1" >> space + ## Next Build our prototype echo "Building prototype file..." -find . | egrep -v "prototype|pkginfo" | sort | pkgproto $PROTO_ARGS | \ - awk ' - BEGIN { print "i pkginfo" } - { $5="root"; $6="sys"; } - { print; }' > prototype +cat >mk-proto.awk << _EOF + BEGIN { print "i pkginfo"; print "i preinstall"; \\ + print "i postinstall"; print "i preremove"; \\ + print "i request"; print "i space"; \\ + split("$SYSTEM_DIR",sys_files); } + { + for (dir in sys_files) { if ( \$3 != sys_files[dir] ) + { \$5="root"; \$6="sys"; } + else + { \$4="?"; \$5="?"; \$6="?"; break;} + } } + { print; } +_EOF +find . | egrep -v "prototype|pkginfo|mk-proto.awk" | sort | \ + pkgproto $PROTO_ARGS | nawk -f mk-proto.awk > prototype ## Step back a directory and now build the package. echo "Building package.." cd .. -pkgmk -d . -f $FAKE_ROOT/prototype -o +pkgmk -d ${FAKE_ROOT} -f $FAKE_ROOT/prototype -o +echo | pkgtrans -os ${FAKE_ROOT} ${START}/$PKGNAME-$UNAME_S-$ARCH-$VERSION.pkg rm -rf $FAKE_ROOT -echo | pkgtrans -os . $PKGNAME-$ARCH-$VERSION.pkg -rm -rf $PKGNAME + diff --git a/openssh/contrib/suse/openssh.spec b/openssh/contrib/suse/openssh.spec index 88b0e81..bf97fed 100644 --- a/openssh/contrib/suse/openssh.spec +++ b/openssh/contrib/suse/openssh.spec @@ -1,6 +1,6 @@ Summary: OpenSSH, a free Secure Shell (SSH) protocol implementation Name: openssh -Version: 3.1p1 +Version: 3.2.3p1 URL: http://www.openssh.com/ Release: 1 Source0: openssh-%{version}.tar.gz @@ -168,7 +168,7 @@ fi %files %defattr(-,root,root) %doc ChangeLog OVERVIEW README* -%doc RFC.nroff TODO CREDITS LICENSE +%doc RFC.nroff TODO CREDITS LICENCE %attr(0755,root,root) %dir /etc/ssh %attr(0644,root,root) %config /etc/ssh/ssh_config %attr(0600,root,root) %config /etc/ssh/sshd_config diff --git a/openssh/defines.h b/openssh/defines.h index 4caea9b..dfb89b2 100644 --- a/openssh/defines.h +++ b/openssh/defines.h @@ -3,58 +3,6 @@ /* $Id$ */ -/* Necessary headers */ - -#include /* For [u]intxx_t */ -#include /* For SHUT_XXXX */ -#include /* For MAXPATHLEN and roundup() */ -#include /* For typedefs */ -#include /* For IPv6 macros */ -#include /* For IPTOS macros */ -#ifdef HAVE_SYS_UN_H -# include /* For sockaddr_un */ -#endif -#ifdef HAVE_SYS_BITYPES_H -# include /* For u_intXX_t */ -#endif -#ifdef HAVE_PATHS_H -# include /* For _PATH_XXX */ -#endif -#ifdef HAVE_LIMITS_H -# include /* For PATH_MAX */ -#endif -#ifdef HAVE_SYS_TIME_H -# include /* For timersub */ -#endif -#ifdef HAVE_MAILLOCK_H -# include /* For _PATH_MAILDIR */ -#endif -#ifdef HAVE_SYS_CDEFS_H -# include /* For __P() */ -#endif -#ifdef HAVE_SYS_SYSMACROS_H -# include /* For MIN, MAX, etc */ -#endif -#ifdef HAVE_SYS_STAT_H -# include /* For S_* constants and macros */ -#endif -#ifdef HAVE_NEXT -# include -#endif - -#include /* For STDIN_FILENO, etc */ -#include /* Struct winsize */ -#include /* For O_NONBLOCK */ -#include /* For OPENSSL_VERSION_NUMBER */ - -/* *-*-nto-qnx needs these headers for strcasecmp and LASTLOG_FILE respectively */ -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_LOGIN_H -# include -#endif - /* Constants */ @@ -136,6 +84,14 @@ enum # define S_IRWXO 0000007 /* read, write, execute */ #endif /* S_IXUSR */ +#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS) +#define MAP_ANON MAP_ANONYMOUS +#endif + +#ifndef MAP_FAILED +# define MAP_FAILED ((void *)-1) +#endif + /* *-*-nto-qnx doesn't define this constant in the system headers */ #ifdef MISSING_NFDBITS # define NFDBITS (8 * sizeof(unsigned long)) @@ -437,8 +393,38 @@ struct winsize { # define howmany(x,y) (((x)+((y)-1))/(y)) #endif +#ifndef OSSH_ALIGNBYTES +#define OSSH_ALIGNBYTES (sizeof(int) - 1) +#endif +#ifndef __CMSG_ALIGN +#define __CMSG_ALIGN(p) (((u_int)(p) + OSSH_ALIGNBYTES) &~ OSSH_ALIGNBYTES) +#endif + +/* Length of the contents of a control message of length len */ +#ifndef CMSG_LEN +#define CMSG_LEN(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) +#endif + +/* Length of the space taken up by a padded control message of length len */ +#ifndef CMSG_SPACE +#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len)) +#endif + /* Function replacement / compatibility hacks */ +#if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO)) +# define HAVE_GETADDRINFO +#endif + +#ifndef HAVE_GETOPT_OPTRESET +#define getopt(ac, av, o) BSDgetopt(ac, av, o) +#define opterr BSDopterr +#define optind BSDoptind +#define optopt BSDoptopt +#define optreset BSDoptreset +#define optarg BSDoptarg +#endif + /* In older versions of libpam, pam_strerror takes a single argument */ #ifdef HAVE_OLD_PAM # define PAM_STRERROR(a,b) pam_strerror((b)) @@ -466,14 +452,6 @@ struct winsize { # define memmove(s1, s2, n) bcopy((s2), (s1), (n)) #endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */ -#if !defined(HAVE_ATEXIT) && defined(HAVE_ON_EXIT) -# define atexit(a) on_exit(a, NULL) -#else -# if defined(HAVE_XATEXIT) -# define atexit(a) xatexit(a) -# endif /* defined(HAVE_XATEXIT) */ -#endif /* !defined(HAVE_ATEXIT) && defined(HAVE_ON_EXIT) */ - #if defined(HAVE_VHANGUP) && !defined(HAVE_DEV_PTMX) # define USE_VHANGUP #endif /* defined(HAVE_VHANGUP) && !defined(HAVE_DEV_PTMX) */ @@ -487,6 +465,12 @@ struct winsize { # define OPENSSL_free(x) Free(x) #endif +#if defined(HAVE___func__) +# define __FUNCTION__ __func__ +#elif !defined(HAVE___FUNCTION__) +# define __FUNCTION__ "" +#endif + /* * Define this to use pipes instead of socketpairs for communicating with the * client program. Socketpairs do not seem to work on all systems. @@ -500,27 +484,6 @@ struct winsize { ** login recorder definitions **/ -/* preprocess */ - -#ifdef HAVE_UTMP_H -# ifdef HAVE_TIME_IN_UTMP -# include -# endif -# include -#endif -#ifdef HAVE_UTMPX_H -# ifdef HAVE_TV_IN_UTMPX -# include -# endif -# include -#endif -#ifdef HAVE_LASTLOG_H -# include -#endif -#ifdef HAVE_PATHS_H -# include -#endif - /* FIXME: put default paths back in */ #ifndef UTMP_FILE # ifdef _PATH_UTMP @@ -579,11 +542,6 @@ struct winsize { # define USE_LASTLOG #endif -/* which type of time to use? (api.c) */ -#ifdef HAVE_SYS_TIME_H -# define USE_TIMEVAL -#endif - /** end of login recorder definitions */ #endif /* _DEFINES_H */ diff --git a/openssh/entropy.c b/openssh/entropy.c index 9de2921..578ffbe 100644 --- a/openssh/entropy.c +++ b/openssh/entropy.c @@ -61,19 +61,21 @@ seed_rng(void) pid_t pid; int ret; unsigned char buf[RANDOM_SEED_SIZE]; + mysig_t old_sigchld; if (RAND_status() == 1) { debug3("RNG is ready, skipping seeding"); return; } - debug3("Seeing PRNG from %s", SSH_RAND_HELPER); + debug3("Seeding PRNG from %s", SSH_RAND_HELPER); if ((devnull = open("/dev/null", O_RDWR)) == -1) fatal("Couldn't open /dev/null: %s", strerror(errno)); if (pipe(p) == -1) fatal("pipe: %s", strerror(errno)); + old_sigchld = mysignal(SIGCHLD, SIG_DFL); if ((pid = fork()) == -1) fatal("Couldn't fork: %s", strerror(errno)); if (pid == 0) { @@ -85,9 +87,10 @@ seed_rng(void) close(devnull); if (original_uid != original_euid && - setuid(original_uid) == -1) { - fprintf(stderr, "(rand child) setuid: %s\n", - strerror(errno)); + ( seteuid(getuid()) == -1 || + setuid(original_uid) == -1) ) { + fprintf(stderr, "(rand child) setuid(%d): %s\n", + original_uid, strerror(errno)); _exit(1); } @@ -113,6 +116,7 @@ seed_rng(void) if (waitpid(pid, &ret, 0) == -1) fatal("Couldn't wait for ssh-rand-helper completion: %s", strerror(errno)); + mysignal(SIGCHLD, old_sigchld); /* We don't mind if the child exits upon a SIGPIPE */ if (!WIFEXITED(ret) && diff --git a/openssh/gss-serv.c b/openssh/gss-serv.c index 9b70ab8..fc2a9ac 100644 --- a/openssh/gss-serv.c +++ b/openssh/gss-serv.c @@ -44,6 +44,7 @@ #include "dispatch.h" #include "servconf.h" #include "compat.h" +#include "misc.h" #include "ssh-gss.h" @@ -602,7 +603,6 @@ input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt) char *user; char *gridmapped_name = NULL; struct passwd *pw = NULL; - gssapi_setup_env(); if(globus_gss_assist_gridmap(gssapi_client_name.value, &gridmapped_name) == 0) { user = gridmapped_name; diff --git a/openssh/includes.h b/openssh/includes.h index 6320c61..e20d7a5 100644 --- a/openssh/includes.h +++ b/openssh/includes.h @@ -21,21 +21,10 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #include "config.h" -#include "openbsd-compat/bsd-nextstep.h" - -#include -#include -#include -#include -#include - -#include -#include - #include #include #include -#include +#include /* For O_NONBLOCK */ #include #include #include @@ -46,19 +35,11 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #include #ifdef HAVE_LIMITS_H -# include +# include /* For PATH_MAX */ #endif #ifdef HAVE_GETOPT_H # include #endif -#ifndef HAVE_GETOPT_OPTRESET -#define getopt(ac, av, o) BSDgetopt(ac, av, o) -#define opterr BSDopterr -#define optind BSDoptind -#define optopt BSDoptopt -#define optreset BSDoptreset -#define optarg BSDoptarg -#endif #ifdef HAVE_BSTRING_H # include #endif @@ -75,37 +56,105 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #ifdef HAVE_ENDIAN_H # include #endif -#ifdef HAVE_SYS_SELECT_H -# include +#ifdef HAVE_TTYENT_H +# include +#endif +#ifdef HAVE_UTIME_H +# include +#endif +#ifdef HAVE_MAILLOCK_H +# include /* For _PATH_MAILDIR */ +#endif +#ifdef HAVE_NEXT +# include +#endif +#include /* For STDIN_FILENO, etc */ +#include /* Struct winsize */ + +/* + *-*-nto-qnx needs these headers for strcasecmp and LASTLOG_FILE respectively + */ +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_LOGIN_H +# include +#endif + +#ifdef HAVE_UTMP_H +# include +#endif +#ifdef HAVE_UTMPX_H +# ifdef HAVE_TV_IN_UTMPX +# include +# endif +# include +#endif +#ifdef HAVE_LASTLOG_H +# include #endif +#ifdef HAVE_PATHS_H +# include /* For _PATH_XXX */ +#endif + +#include +#include +#include +#include #ifdef HAVE_SYS_TIME_H -# include +# include /* For timersub */ +#endif +#include +#ifdef HAVE_SYS_SELECT_H +# include #endif #ifdef HAVE_SYS_BSDTTY_H # include #endif -#ifdef HAVE_TTYENT_H -# include +#include /* For MAXPATHLEN and roundup() */ +#ifdef HAVE_SYS_UN_H +# include /* For sockaddr_un */ #endif -#ifdef USE_PAM -# include +#ifdef HAVE_SYS_BITYPES_H +# include /* For u_intXX_t */ +#endif +#ifdef HAVE_SYS_CDEFS_H +# include /* For __P() */ #endif -#ifdef HAVE_POLL_H -# include -#else -# ifdef HAVE_SYS_POLL_H -# include -# endif +#ifdef HAVE_SYS_STAT_H +# include /* For S_* constants and macros */ #endif #ifdef HAVE_SYS_SYSMACROS_H -# include +# include /* For MIN, MAX, etc */ #endif -#ifdef HAVE_UTIME_H -# include +#ifdef HAVE_SYS_MMAN_H +#include /* for MAP_ANONYMOUS */ +#endif + +#include /* For typedefs */ +#include /* For IPv6 macros */ +#include /* For IPTOS macros */ +#include +#include +#ifdef HAVE_RPC_TYPES_H +# include /* For INADDR_LOOPBACK */ #endif +#ifdef USE_PAM +# include +#endif +#ifdef HAVE_READPASSPHRASE_H +# include +#endif + +#include /* For OPENSSL_VERSION_NUMBER */ + +#include "defines.h" + #include "version.h" #include "openbsd-compat/openbsd-compat.h" #include "openbsd-compat/bsd-cygwin_util.h" +#include "openbsd-compat/bsd-nextstep.h" + #include "entropy.h" #endif /* INCLUDES_H */ diff --git a/openssh/kex.c b/openssh/kex.c index 480d51a..b90d750 100644 --- a/openssh/kex.c +++ b/openssh/kex.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: kex.c,v 1.47 2002/02/28 15:46:33 markus Exp $"); +RCSID("$OpenBSD: kex.c,v 1.50 2002/05/15 15:47:49 mouring Exp $"); #include @@ -40,6 +40,7 @@ RCSID("$OpenBSD: kex.c,v 1.47 2002/02/28 15:46:33 markus Exp $"); #include "mac.h" #include "match.h" #include "dispatch.h" +#include "monitor.h" #ifdef GSSAPI #include "ssh-gss.h" @@ -47,6 +48,11 @@ RCSID("$OpenBSD: kex.c,v 1.47 2002/02/28 15:46:33 markus Exp $"); #define KEX_COOKIE_LEN 16 +/* Use privilege separation for sshd */ +int use_privsep; +struct monitor *pmonitor; + + /* prototype */ static void kex_kexinit_finish(Kex *); static void kex_choose_conf(Kex *); @@ -55,16 +61,15 @@ static void kex_choose_conf(Kex *); static void kex_prop2buf(Buffer *b, char *proposal[PROPOSAL_MAX]) { - u_int32_t rand = 0; int i; buffer_clear(b); - for (i = 0; i < KEX_COOKIE_LEN; i++) { - if (i % 4 == 0) - rand = arc4random(); - buffer_put_char(b, rand & 0xff); - rand >>= 8; - } + /* + * add a dummy cookie, the cookie will be overwritten by + * kex_send_kexinit(), each time a kexinit is set + */ + for (i = 0; i < KEX_COOKIE_LEN; i++) + buffer_put_char(b, 0); for (i = 0; i < PROPOSAL_MAX; i++) buffer_put_cstring(b, proposal[i]); buffer_put_char(b, 0); /* first_kex_packet_follows */ @@ -150,6 +155,10 @@ kex_finish(Kex *kex) void kex_send_kexinit(Kex *kex) { + u_int32_t rand = 0; + u_char *cookie; + int i; + if (kex == NULL) { error("kex_send_kexinit: no kex, cannot rekey"); return; @@ -159,6 +168,17 @@ kex_send_kexinit(Kex *kex) return; } kex->done = 0; + + /* generate a random cookie */ + if (buffer_len(&kex->my) < KEX_COOKIE_LEN) + fatal("kex_send_kexinit: kex proposal too short"); + cookie = buffer_ptr(&kex->my); + for (i = 0; i < KEX_COOKIE_LEN; i++) { + if (i % 4 == 0) + rand = arc4random(); + cookie[i] = rand; + rand >>= 8; + } packet_start(SSH2_MSG_KEXINIT); packet_put_raw(buffer_ptr(&kex->my), buffer_len(&kex->my)); packet_send(); diff --git a/openssh/kex.h b/openssh/kex.h index a9bc978..2bd86ad 100644 --- a/openssh/kex.h +++ b/openssh/kex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: kex.h,v 1.29 2002/02/14 23:41:01 markus Exp $ */ +/* $OpenBSD: kex.h,v 1.30 2002/03/18 17:50:31 provos Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -113,11 +113,12 @@ struct Kex { Buffer peer; int done; int flags; - char *host; + char *host; char *client_version_string; char *server_version_string; int (*verify_host_key)(Key *); Key *(*load_host_key)(int); + int (*host_key_index)(Key *); struct KexOptions options; }; diff --git a/openssh/kexdh.c b/openssh/kexdh.c index eaf497c..1e91e25 100644 --- a/openssh/kexdh.c +++ b/openssh/kexdh.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexdh.c,v 1.17 2002/02/28 15:46:33 markus Exp $"); +RCSID("$OpenBSD: kexdh.c,v 1.18 2002/03/18 17:50:31 provos Exp $"); #include #include @@ -37,6 +37,7 @@ RCSID("$OpenBSD: kexdh.c,v 1.17 2002/02/28 15:46:33 markus Exp $"); #include "packet.h" #include "dh.h" #include "ssh2.h" +#include "monitor_wrap.h" static u_char * kex_dh_hash( @@ -275,7 +276,7 @@ kexdh_server(Kex *kex) /* sign H */ /* XXX hashlen depends on KEX */ - key_sign(server_host_key, &signature, &slen, hash, 20); + PRIVSEP(key_sign(server_host_key, &signature, &slen, hash, 20)); /* destroy_sensitive_data(); */ diff --git a/openssh/kexgex.c b/openssh/kexgex.c index 61896e6..2d4a581 100644 --- a/openssh/kexgex.c +++ b/openssh/kexgex.c @@ -24,7 +24,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexgex.c,v 1.20 2002/02/28 15:46:33 markus Exp $"); +RCSID("$OpenBSD: kexgex.c,v 1.22 2002/03/24 17:27:03 stevesk Exp $"); #include @@ -38,6 +38,7 @@ RCSID("$OpenBSD: kexgex.c,v 1.20 2002/02/28 15:46:33 markus Exp $"); #include "dh.h" #include "ssh2.h" #include "compat.h" +#include "monitor_wrap.h" static u_char * kexgex_hash( @@ -259,7 +260,7 @@ kexgex_server(Kex *kex) { BIGNUM *shared_secret = NULL, *dh_client_pub = NULL; Key *server_host_key; - DH *dh = dh; + DH *dh; u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL; u_int sbloblen, klen, kout, slen; int min = -1, max = -1, nbits = -1, type; @@ -296,7 +297,8 @@ kexgex_server(Kex *kex) fatal("DH_GEX_REQUEST, bad parameters: %d !< %d !< %d", min, nbits, max); - dh = choose_dh(min, nbits, max); + /* Contact privileged parent */ + dh = PRIVSEP(choose_dh(min, nbits, max)); if (dh == NULL) packet_disconnect("Protocol error: no matching DH grp found"); @@ -379,7 +381,7 @@ kexgex_server(Kex *kex) /* sign H */ /* XXX hashlen depends on KEX */ - key_sign(server_host_key, &signature, &slen, hash, 20); + PRIVSEP(key_sign(server_host_key, &signature, &slen, hash, 20)); /* destroy_sensitive_data(); */ @@ -390,6 +392,7 @@ kexgex_server(Kex *kex) packet_put_bignum2(dh->pub_key); /* f */ packet_put_string(signature, slen); packet_send(); + xfree(signature); xfree(server_host_key_blob); /* have keys, free DH */ diff --git a/openssh/key.c b/openssh/key.c index c3f6452..077c517 100644 --- a/openssh/key.c +++ b/openssh/key.c @@ -32,7 +32,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: key.c,v 1.41 2002/02/28 15:46:33 markus Exp $"); +RCSID("$OpenBSD: key.c,v 1.43 2002/03/19 10:49:35 markus Exp $"); #include @@ -803,3 +803,46 @@ key_verify( break; } } + +/* Converts a private to a public key */ + +Key * +key_demote(Key *k) +{ + Key *pk; + + pk = xmalloc(sizeof(*pk)); + pk->type = k->type; + pk->flags = k->flags; + pk->dsa = NULL; + pk->rsa = NULL; + + switch (k->type) { + case KEY_RSA1: + case KEY_RSA: + if ((pk->rsa = RSA_new()) == NULL) + fatal("key_demote: RSA_new failed"); + if ((pk->rsa->e = BN_dup(k->rsa->e)) == NULL) + fatal("key_demote: BN_dup failed"); + if ((pk->rsa->n = BN_dup(k->rsa->n)) == NULL) + fatal("key_demote: BN_dup failed"); + break; + case KEY_DSA: + if ((pk->dsa = DSA_new()) == NULL) + fatal("key_demote: DSA_new failed"); + if ((pk->dsa->p = BN_dup(k->dsa->p)) == NULL) + fatal("key_demote: BN_dup failed"); + if ((pk->dsa->q = BN_dup(k->dsa->q)) == NULL) + fatal("key_demote: BN_dup failed"); + if ((pk->dsa->g = BN_dup(k->dsa->g)) == NULL) + fatal("key_demote: BN_dup failed"); + if ((pk->dsa->pub_key = BN_dup(k->dsa->pub_key)) == NULL) + fatal("key_demote: BN_dup failed"); + break; + default: + fatal("key_free: bad key type %d", k->type); + break; + } + + return (pk); +} diff --git a/openssh/key.h b/openssh/key.h index 7b4d1c2..957dab2 100644 --- a/openssh/key.h +++ b/openssh/key.h @@ -1,4 +1,4 @@ -/* $OpenBSD: key.h,v 1.18 2002/02/24 19:14:59 markus Exp $ */ +/* $OpenBSD: key.h,v 1.19 2002/03/18 17:23:31 markus Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -59,6 +59,7 @@ struct Key { Key *key_new(int); Key *key_new_private(int); void key_free(Key *); +Key *key_demote(Key *); int key_equal(Key *, Key *); char *key_fingerprint(Key *, enum fp_type, enum fp_rep); char *key_type(Key *); diff --git a/openssh/loginrec.c b/openssh/loginrec.c index 1805f3e..7aa1025 100644 --- a/openssh/loginrec.c +++ b/openssh/loginrec.c @@ -564,6 +564,11 @@ line_abbrevname(char *dst, const char *src, int dstsize) if (strncmp(src, "/dev/", 5) == 0) src += 5; +#ifdef WITH_ABBREV_NO_TTY + if (strncmp(src, "tty", 3) == 0) + src += 3; +#endif + len = strlen(src); if (len > 0) { diff --git a/openssh/mdoc2man.pl b/openssh/mdoc2man.pl index fddb2e0..928fc5d 100644 --- a/openssh/mdoc2man.pl +++ b/openssh/mdoc2man.pl @@ -318,11 +318,13 @@ sub ParseMacro # ($line) if (/^Nm$/) { - $name = shift @words + my $n = $name; + $n = shift @words if (@words > 0); + $name = $n unless $name; $retval .= ".br\n" if ($synopsis); - $retval .= "\\fB$name\\fP"; + $retval .= "\\fB$n\\fP"; $nospace = 1 if (! $nospace && $words[0] =~ m/^[\.,]/); next; diff --git a/openssh/misc.h b/openssh/misc.h index 668fd60..3b4b879 100644 --- a/openssh/misc.h +++ b/openssh/misc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.h,v 1.11 2002/01/24 21:09:25 stevesk Exp $ */ +/* $OpenBSD: misc.h,v 1.12 2002/03/19 10:49:35 markus Exp $ */ /* * Author: Tatu Ylonen @@ -26,9 +26,9 @@ struct passwd *pwcopy(struct passwd *); typedef struct arglist arglist; struct arglist { - char **list; - int num; - int nalloc; + char **list; + int num; + int nalloc; }; void addargs(arglist *, char *, ...) __attribute__((format(printf, 2, 3))); diff --git a/openssh/monitor.c b/openssh/monitor.c new file mode 100644 index 0000000..1e23d91 --- /dev/null +++ b/openssh/monitor.c @@ -0,0 +1,1503 @@ +/* + * Copyright 2002 Niels Provos + * Copyright 2002 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: monitor.c,v 1.11 2002/05/15 15:47:49 mouring Exp $"); + +#include + +#ifdef SKEY +#include +#endif + +#include "ssh.h" +#include "auth.h" +#include "kex.h" +#include "dh.h" +#include "zlib.h" +#include "packet.h" +#include "auth-options.h" +#include "sshpty.h" +#include "channels.h" +#include "session.h" +#include "sshlogin.h" +#include "canohost.h" +#include "log.h" +#include "servconf.h" +#include "monitor.h" +#include "monitor_mm.h" +#include "monitor_wrap.h" +#include "monitor_fdpass.h" +#include "xmalloc.h" +#include "misc.h" +#include "buffer.h" +#include "bufaux.h" +#include "compat.h" +#include "ssh2.h" +#include "mpaux.h" + +/* Imports */ +extern ServerOptions options; +extern u_int utmp_len; +extern Newkeys *current_keys[]; +extern z_stream incoming_stream; +extern z_stream outgoing_stream; +extern u_char session_id[]; +extern Buffer input, output; +extern Buffer auth_debug; +extern int auth_debug_init; + +/* State exported from the child */ + +struct { + z_stream incoming; + z_stream outgoing; + u_char *keyin; + u_int keyinlen; + u_char *keyout; + u_int keyoutlen; + u_char *ivin; + u_int ivinlen; + u_char *ivout; + u_int ivoutlen; + int ssh1cipher; + int ssh1protoflags; + u_char *input; + u_int ilen; + u_char *output; + u_int olen; +} child_state; + +/* Functions on the montior that answer unprivileged requests */ + +int mm_answer_moduli(int, Buffer *); +int mm_answer_sign(int, Buffer *); +int mm_answer_pwnamallow(int, Buffer *); +int mm_answer_auth2_read_banner(int, Buffer *); +int mm_answer_authserv(int, Buffer *); +int mm_answer_authpassword(int, Buffer *); +int mm_answer_bsdauthquery(int, Buffer *); +int mm_answer_bsdauthrespond(int, Buffer *); +int mm_answer_skeyquery(int, Buffer *); +int mm_answer_skeyrespond(int, Buffer *); +int mm_answer_keyallowed(int, Buffer *); +int mm_answer_keyverify(int, Buffer *); +int mm_answer_pty(int, Buffer *); +int mm_answer_pty_cleanup(int, Buffer *); +int mm_answer_term(int, Buffer *); +int mm_answer_rsa_keyallowed(int, Buffer *); +int mm_answer_rsa_challenge(int, Buffer *); +int mm_answer_rsa_response(int, Buffer *); +int mm_answer_sesskey(int, Buffer *); +int mm_answer_sessid(int, Buffer *); + +#ifdef USE_PAM +int mm_answer_pam_start(int, Buffer *); +#endif + +static Authctxt *authctxt; +static BIGNUM *ssh1_challenge = NULL; /* used for ssh1 rsa auth */ + +/* local state for key verify */ +static u_char *key_blob = NULL; +static u_int key_bloblen = 0; +static int key_blobtype = MM_NOKEY; +static u_char *hostbased_cuser = NULL; +static u_char *hostbased_chost = NULL; +static char *auth_method = "unknown"; + +struct mon_table { + enum monitor_reqtype type; + int flags; + int (*f)(int, Buffer *); +}; + +#define MON_ISAUTH 0x0004 /* Required for Authentication */ +#define MON_AUTHDECIDE 0x0008 /* Decides Authentication */ +#define MON_ONCE 0x0010 /* Disable after calling */ + +#define MON_AUTH (MON_ISAUTH|MON_AUTHDECIDE) + +#define MON_PERMIT 0x1000 /* Request is permitted */ + +struct mon_table mon_dispatch_proto20[] = { + {MONITOR_REQ_MODULI, MON_ONCE, mm_answer_moduli}, + {MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign}, + {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, + {MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv}, + {MONITOR_REQ_AUTH2_READ_BANNER, MON_ONCE, mm_answer_auth2_read_banner}, + {MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword}, +#ifdef USE_PAM + {MONITOR_REQ_PAM_START, MON_ONCE, mm_answer_pam_start}, +#endif +#ifdef BSD_AUTH + {MONITOR_REQ_BSDAUTHQUERY, MON_ISAUTH, mm_answer_bsdauthquery}, + {MONITOR_REQ_BSDAUTHRESPOND, MON_AUTH,mm_answer_bsdauthrespond}, +#endif +#ifdef SKEY + {MONITOR_REQ_SKEYQUERY, MON_ISAUTH, mm_answer_skeyquery}, + {MONITOR_REQ_SKEYRESPOND, MON_AUTH, mm_answer_skeyrespond}, +#endif + {MONITOR_REQ_KEYALLOWED, MON_ISAUTH, mm_answer_keyallowed}, + {MONITOR_REQ_KEYVERIFY, MON_AUTH, mm_answer_keyverify}, + {0, 0, NULL} +}; + +struct mon_table mon_dispatch_postauth20[] = { + {MONITOR_REQ_MODULI, 0, mm_answer_moduli}, + {MONITOR_REQ_SIGN, 0, mm_answer_sign}, + {MONITOR_REQ_PTY, 0, mm_answer_pty}, + {MONITOR_REQ_PTYCLEANUP, 0, mm_answer_pty_cleanup}, + {MONITOR_REQ_TERM, 0, mm_answer_term}, + {0, 0, NULL} +}; + +struct mon_table mon_dispatch_proto15[] = { + {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, + {MONITOR_REQ_SESSKEY, MON_ONCE, mm_answer_sesskey}, + {MONITOR_REQ_SESSID, MON_ONCE, mm_answer_sessid}, + {MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword}, + {MONITOR_REQ_RSAKEYALLOWED, MON_ISAUTH, mm_answer_rsa_keyallowed}, + {MONITOR_REQ_KEYALLOWED, MON_ISAUTH, mm_answer_keyallowed}, + {MONITOR_REQ_RSACHALLENGE, MON_ONCE, mm_answer_rsa_challenge}, + {MONITOR_REQ_RSARESPONSE, MON_ONCE|MON_AUTHDECIDE, mm_answer_rsa_response}, +#ifdef USE_PAM + {MONITOR_REQ_PAM_START, MON_ONCE, mm_answer_pam_start}, +#endif +#ifdef BSD_AUTH + {MONITOR_REQ_BSDAUTHQUERY, MON_ISAUTH, mm_answer_bsdauthquery}, + {MONITOR_REQ_BSDAUTHRESPOND, MON_AUTH,mm_answer_bsdauthrespond}, +#endif +#ifdef SKEY + {MONITOR_REQ_SKEYQUERY, MON_ISAUTH, mm_answer_skeyquery}, + {MONITOR_REQ_SKEYRESPOND, MON_AUTH, mm_answer_skeyrespond}, +#endif +#ifdef USE_PAM + {MONITOR_REQ_PAM_START, MON_ONCE, mm_answer_pam_start}, +#endif + {0, 0, NULL} +}; + +struct mon_table mon_dispatch_postauth15[] = { + {MONITOR_REQ_PTY, MON_ONCE, mm_answer_pty}, + {MONITOR_REQ_PTYCLEANUP, MON_ONCE, mm_answer_pty_cleanup}, + {MONITOR_REQ_TERM, 0, mm_answer_term}, + {0, 0, NULL} +}; + +struct mon_table *mon_dispatch; + +/* Specifies if a certain message is allowed at the moment */ + +static void +monitor_permit(struct mon_table *ent, enum monitor_reqtype type, int permit) +{ + while (ent->f != NULL) { + if (ent->type == type) { + ent->flags &= ~MON_PERMIT; + ent->flags |= permit ? MON_PERMIT : 0; + return; + } + ent++; + } +} + +static void +monitor_permit_authentications(int permit) +{ + struct mon_table *ent = mon_dispatch; + + while (ent->f != NULL) { + if (ent->flags & MON_AUTH) { + ent->flags &= ~MON_PERMIT; + ent->flags |= permit ? MON_PERMIT : 0; + } + ent++; + } +} + +Authctxt * +monitor_child_preauth(struct monitor *pmonitor) +{ + struct mon_table *ent; + int authenticated = 0; + + debug3("preauth child monitor started"); + + if (compat20) { + mon_dispatch = mon_dispatch_proto20; + + /* Permit requests for moduli and signatures */ + monitor_permit(mon_dispatch, MONITOR_REQ_MODULI, 1); + monitor_permit(mon_dispatch, MONITOR_REQ_SIGN, 1); + } else { + mon_dispatch = mon_dispatch_proto15; + + monitor_permit(mon_dispatch, MONITOR_REQ_SESSKEY, 1); + } + + authctxt = authctxt_new(); + + /* The first few requests do not require asynchronous access */ + while (!authenticated) { + authenticated = monitor_read(pmonitor, mon_dispatch, &ent); + if (authenticated) { + if (!(ent->flags & MON_AUTHDECIDE)) + fatal("%s: unexpected authentication from %d", + __FUNCTION__, ent->type); + if (authctxt->pw->pw_uid == 0 && + !auth_root_allowed(auth_method)) + authenticated = 0; +#ifdef USE_PAM + if (!do_pam_account(authctxt->pw->pw_name, NULL)) + authenticated = 0; +#endif + } + + if (ent->flags & MON_AUTHDECIDE) { + auth_log(authctxt, authenticated, auth_method, + compat20 ? " ssh2" : ""); + if (!authenticated) + authctxt->failures++; + } + } + + if (!authctxt->valid) + fatal("%s: authenticated invalid user", __FUNCTION__); + + debug("%s: %s has been authenticated by privileged process", + __FUNCTION__, authctxt->user); + + mm_get_keystate(pmonitor); + + return (authctxt); +} + +void +monitor_child_postauth(struct monitor *pmonitor) +{ + if (compat20) { + mon_dispatch = mon_dispatch_postauth20; + + /* Permit requests for moduli and signatures */ + monitor_permit(mon_dispatch, MONITOR_REQ_MODULI, 1); + monitor_permit(mon_dispatch, MONITOR_REQ_SIGN, 1); + monitor_permit(mon_dispatch, MONITOR_REQ_TERM, 1); + + } else { + mon_dispatch = mon_dispatch_postauth15; + monitor_permit(mon_dispatch, MONITOR_REQ_TERM, 1); + } + if (!no_pty_flag) { + monitor_permit(mon_dispatch, MONITOR_REQ_PTY, 1); + monitor_permit(mon_dispatch, MONITOR_REQ_PTYCLEANUP, 1); + } + + for (;;) + monitor_read(pmonitor, mon_dispatch, NULL); +} + +void +monitor_sync(struct monitor *pmonitor) +{ + /* The member allocation is not visible, so sync it */ + mm_share_sync(&pmonitor->m_zlib, &pmonitor->m_zback); +} + +int +monitor_read(struct monitor *pmonitor, struct mon_table *ent, + struct mon_table **pent) +{ + Buffer m; + int ret; + u_char type; + + buffer_init(&m); + + mm_request_receive(pmonitor->m_sendfd, &m); + type = buffer_get_char(&m); + + debug3("%s: checking request %d", __FUNCTION__, type); + + while (ent->f != NULL) { + if (ent->type == type) + break; + ent++; + } + + if (ent->f != NULL) { + if (!(ent->flags & MON_PERMIT)) + fatal("%s: unpermitted request %d", __FUNCTION__, + type); + ret = (*ent->f)(pmonitor->m_sendfd, &m); + buffer_free(&m); + + /* The child may use this request only once, disable it */ + if (ent->flags & MON_ONCE) { + debug2("%s: %d used once, disabling now", __FUNCTION__, + type); + ent->flags &= ~MON_PERMIT; + } + + if (pent != NULL) + *pent = ent; + + return ret; + } + + fatal("%s: unsupported request: %d", __FUNCTION__, type); + + /* NOTREACHED */ + return (-1); +} + +/* allowed key state */ +static int +monitor_allowed_key(u_char *blob, u_int bloblen) +{ + /* make sure key is allowed */ + if (key_blob == NULL || key_bloblen != bloblen || + memcmp(key_blob, blob, key_bloblen)) + return (0); + return (1); +} + +static void +monitor_reset_key_state(void) +{ + /* reset state */ + if (key_blob != NULL) + xfree(key_blob); + if (hostbased_cuser != NULL) + xfree(hostbased_cuser); + if (hostbased_chost != NULL) + xfree(hostbased_chost); + key_blob = NULL; + key_bloblen = 0; + key_blobtype = MM_NOKEY; + hostbased_cuser = NULL; + hostbased_chost = NULL; +} + +int +mm_answer_moduli(int socket, Buffer *m) +{ + DH *dh; + int min, want, max; + + min = buffer_get_int(m); + want = buffer_get_int(m); + max = buffer_get_int(m); + + debug3("%s: got parameters: %d %d %d", + __FUNCTION__, min, want, max); + /* We need to check here, too, in case the child got corrupted */ + if (max < min || want < min || max < want) + fatal("%s: bad parameters: %d %d %d", + __FUNCTION__, min, want, max); + + buffer_clear(m); + + dh = choose_dh(min, want, max); + if (dh == NULL) { + buffer_put_char(m, 0); + return (0); + } else { + /* Send first bignum */ + buffer_put_char(m, 1); + buffer_put_bignum2(m, dh->p); + buffer_put_bignum2(m, dh->g); + + DH_free(dh); + } + mm_request_send(socket, MONITOR_ANS_MODULI, m); + return (0); +} + +int +mm_answer_sign(int socket, Buffer *m) +{ + Key *key; + u_char *p; + u_char *signature; + u_int siglen, datlen; + int keyid; + + debug3("%s", __FUNCTION__); + + keyid = buffer_get_int(m); + p = buffer_get_string(m, &datlen); + + if (datlen != 20) + fatal("%s: data length incorrect: %d", __FUNCTION__, datlen); + + if ((key = get_hostkey_by_index(keyid)) == NULL) + fatal("%s: no hostkey from index %d", __FUNCTION__, keyid); + if (key_sign(key, &signature, &siglen, p, datlen) < 0) + fatal("%s: key_sign failed", __FUNCTION__); + + debug3("%s: signature %p(%d)", __FUNCTION__, signature, siglen); + + buffer_clear(m); + buffer_put_string(m, signature, siglen); + + xfree(p); + xfree(signature); + + mm_request_send(socket, MONITOR_ANS_SIGN, m); + + /* Turn on permissions for getpwnam */ + monitor_permit(mon_dispatch, MONITOR_REQ_PWNAM, 1); + + return (0); +} + +/* Retrieves the password entry and also checks if the user is permitted */ + +int +mm_answer_pwnamallow(int socket, Buffer *m) +{ + char *login; + struct passwd *pwent; + int allowed = 0; + + debug3("%s", __FUNCTION__); + + if (authctxt->attempt++ != 0) + fatal("%s: multiple attempts for getpwnam", __FUNCTION__); + + login = buffer_get_string(m, NULL); + + pwent = getpwnamallow(login); + + authctxt->user = xstrdup(login); + setproctitle("%s [priv]", pwent ? login : "unknown"); + xfree(login); + + buffer_clear(m); + + if (pwent == NULL) { + buffer_put_char(m, 0); + goto out; + } + + allowed = 1; + authctxt->pw = pwent; + authctxt->valid = 1; + + buffer_put_char(m, 1); + buffer_put_string(m, pwent, sizeof(struct passwd)); + buffer_put_cstring(m, pwent->pw_name); + buffer_put_cstring(m, "*"); + buffer_put_cstring(m, pwent->pw_gecos); +#ifdef HAVE_PW_CLASS_IN_PASSWD + buffer_put_cstring(m, pwent->pw_class); +#endif + buffer_put_cstring(m, pwent->pw_dir); + buffer_put_cstring(m, pwent->pw_shell); + + out: + debug3("%s: sending MONITOR_ANS_PWNAM: %d", __FUNCTION__, allowed); + mm_request_send(socket, MONITOR_ANS_PWNAM, m); + + /* For SSHv1 allow authentication now */ + if (!compat20) + monitor_permit_authentications(1); + else { + /* Allow service/style information on the auth context */ + monitor_permit(mon_dispatch, MONITOR_REQ_AUTHSERV, 1); + monitor_permit(mon_dispatch, MONITOR_REQ_AUTH2_READ_BANNER, 1); + } + +#ifdef USE_PAM + monitor_permit(mon_dispatch, MONITOR_REQ_PAM_START, 1); +#endif + + return (0); +} + +int mm_answer_auth2_read_banner(int socket, Buffer *m) +{ + char *banner; + + buffer_clear(m); + banner = auth2_read_banner(); + buffer_put_cstring(m, banner != NULL ? banner : ""); + mm_request_send(socket, MONITOR_ANS_AUTH2_READ_BANNER, m); + + if (banner != NULL) + free(banner); + + return (0); +} + +int +mm_answer_authserv(int socket, Buffer *m) +{ + monitor_permit_authentications(1); + + authctxt->service = buffer_get_string(m, NULL); + authctxt->style = buffer_get_string(m, NULL); + debug3("%s: service=%s, style=%s", + __FUNCTION__, authctxt->service, authctxt->style); + + if (strlen(authctxt->style) == 0) { + xfree(authctxt->style); + authctxt->style = NULL; + } + + return (0); +} + +int +mm_answer_authpassword(int socket, Buffer *m) +{ + static int call_count; + char *passwd; + int authenticated, plen; + + passwd = buffer_get_string(m, &plen); + /* Only authenticate if the context is valid */ + authenticated = authctxt->valid && auth_password(authctxt, passwd); + memset(passwd, 0, strlen(passwd)); + xfree(passwd); + + buffer_clear(m); + buffer_put_int(m, authenticated); + + debug3("%s: sending result %d", __FUNCTION__, authenticated); + mm_request_send(socket, MONITOR_ANS_AUTHPASSWORD, m); + + call_count++; + if (plen == 0 && call_count == 1) + auth_method = "none"; + else + auth_method = "password"; + + /* Causes monitor loop to terminate if authenticated */ + return (authenticated); +} + +#ifdef BSD_AUTH +int +mm_answer_bsdauthquery(int socket, Buffer *m) +{ + char *name, *infotxt; + u_int numprompts; + u_int *echo_on; + char **prompts; + int res; + + res = bsdauth_query(authctxt, &name, &infotxt, &numprompts, + &prompts, &echo_on); + + buffer_clear(m); + buffer_put_int(m, res); + if (res != -1) + buffer_put_cstring(m, prompts[0]); + + debug3("%s: sending challenge res: %d", __FUNCTION__, res); + mm_request_send(socket, MONITOR_ANS_BSDAUTHQUERY, m); + + if (res != -1) { + xfree(name); + xfree(infotxt); + xfree(prompts); + xfree(echo_on); + } + + return (0); +} + +int +mm_answer_bsdauthrespond(int socket, Buffer *m) +{ + char *response; + int authok; + + if (authctxt->as == 0) + fatal("%s: no bsd auth session", __FUNCTION__); + + response = buffer_get_string(m, NULL); + authok = auth_userresponse(authctxt->as, response, 0); + authctxt->as = NULL; + debug3("%s: <%s> = <%d>", __FUNCTION__, response, authok); + xfree(response); + + buffer_clear(m); + buffer_put_int(m, authok); + + debug3("%s: sending authenticated: %d", __FUNCTION__, authok); + mm_request_send(socket, MONITOR_ANS_BSDAUTHRESPOND, m); + + auth_method = "bsdauth"; + + return (authok != 0); +} +#endif + +#ifdef SKEY +int +mm_answer_skeyquery(int socket, Buffer *m) +{ + struct skey skey; + char challenge[1024]; + int res; + + res = skeychallenge(&skey, authctxt->user, challenge); + + buffer_clear(m); + buffer_put_int(m, res); + if (res != -1) + buffer_put_cstring(m, challenge); + + debug3("%s: sending challenge res: %d", __FUNCTION__, res); + mm_request_send(socket, MONITOR_ANS_SKEYQUERY, m); + + return (0); +} + +int +mm_answer_skeyrespond(int socket, Buffer *m) +{ + char *response; + int authok; + + response = buffer_get_string(m, NULL); + + authok = (authctxt->valid && + skey_haskey(authctxt->pw->pw_name) == 0 && + skey_passcheck(authctxt->pw->pw_name, response) != -1); + + xfree(response); + + buffer_clear(m); + buffer_put_int(m, authok); + + debug3("%s: sending authenticated: %d", __FUNCTION__, authok); + mm_request_send(socket, MONITOR_ANS_SKEYRESPOND, m); + + auth_method = "skey"; + + return (authok != 0); +} +#endif + +#ifdef USE_PAM +int +mm_answer_pam_start(int socket, Buffer *m) +{ + char *user; + + user = buffer_get_string(m, NULL); + + start_pam(user); + + xfree(user); + + return (0); +} +#endif + +static void +mm_append_debug(Buffer *m) +{ + if (auth_debug_init && buffer_len(&auth_debug)) { + debug3("%s: Appending debug messages for child", __FUNCTION__); + buffer_append(m, buffer_ptr(&auth_debug), + buffer_len(&auth_debug)); + buffer_clear(&auth_debug); + } +} + +int +mm_answer_keyallowed(int socket, Buffer *m) +{ + Key *key; + u_char *cuser, *chost, *blob; + u_int bloblen; + enum mm_keytype type = 0; + int allowed = 0; + + debug3("%s entering", __FUNCTION__); + + type = buffer_get_int(m); + cuser = buffer_get_string(m, NULL); + chost = buffer_get_string(m, NULL); + blob = buffer_get_string(m, &bloblen); + + key = key_from_blob(blob, bloblen); + + if ((compat20 && type == MM_RSAHOSTKEY) || + (!compat20 && type != MM_RSAHOSTKEY)) + fatal("%s: key type and protocol mismatch", __FUNCTION__); + + debug3("%s: key_from_blob: %p", __FUNCTION__, key); + + if (key != NULL && authctxt->pw != NULL) { + switch(type) { + case MM_USERKEY: + allowed = user_key_allowed(authctxt->pw, key); + break; + case MM_HOSTKEY: + allowed = hostbased_key_allowed(authctxt->pw, + cuser, chost, key); + break; + case MM_RSAHOSTKEY: + key->type = KEY_RSA1; /* XXX */ + allowed = auth_rhosts_rsa_key_allowed(authctxt->pw, + cuser, chost, key); + break; + default: + fatal("%s: unknown key type %d", __FUNCTION__, type); + break; + } + key_free(key); + } + + /* clear temporarily storage (used by verify) */ + monitor_reset_key_state(); + + if (allowed) { + /* Save temporarily for comparison in verify */ + key_blob = blob; + key_bloblen = bloblen; + key_blobtype = type; + hostbased_cuser = cuser; + hostbased_chost = chost; + } + + debug3("%s: key %p is %s", + __FUNCTION__, key, allowed ? "allowed" : "disallowed"); + + buffer_clear(m); + buffer_put_int(m, allowed); + + mm_append_debug(m); + + mm_request_send(socket, MONITOR_ANS_KEYALLOWED, m); + + if (type == MM_RSAHOSTKEY) + monitor_permit(mon_dispatch, MONITOR_REQ_RSACHALLENGE, allowed); + + return (0); +} + +static int +monitor_valid_userblob(u_char *data, u_int datalen) +{ + Buffer b; + u_char *p; + u_int len; + int fail = 0; + int session_id2_len = 20 /*XXX should get from [net] */; + + buffer_init(&b); + buffer_append(&b, data, datalen); + + if (datafellows & SSH_OLD_SESSIONID) { + buffer_consume(&b, session_id2_len); + } else { + xfree(buffer_get_string(&b, &len)); + if (len != session_id2_len) + fail++; + } + if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST) + fail++; + p = buffer_get_string(&b, NULL); + if (strcmp(authctxt->user, p) != 0) { + log("wrong user name passed to monitor: expected %s != %.100s", + authctxt->user, p); + fail++; + } + xfree(p); + buffer_skip_string(&b); + if (datafellows & SSH_BUG_PKAUTH) { + if (!buffer_get_char(&b)) + fail++; + } else { + p = buffer_get_string(&b, NULL); + if (strcmp("publickey", p) != 0) + fail++; + xfree(p); + if (!buffer_get_char(&b)) + fail++; + buffer_skip_string(&b); + } + buffer_skip_string(&b); + if (buffer_len(&b) != 0) + fail++; + buffer_free(&b); + return (fail == 0); +} + +static int +monitor_valid_hostbasedblob(u_char *data, u_int datalen, u_char *cuser, + u_char *chost) +{ + Buffer b; + u_char *p; + u_int len; + int fail = 0; + int session_id2_len = 20 /*XXX should get from [net] */; + + buffer_init(&b); + buffer_append(&b, data, datalen); + + xfree(buffer_get_string(&b, &len)); + if (len != session_id2_len) + fail++; + if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST) + fail++; + p = buffer_get_string(&b, NULL); + if (strcmp(authctxt->user, p) != 0) { + log("wrong user name passed to monitor: expected %s != %.100s", + authctxt->user, p); + fail++; + } + xfree(p); + buffer_skip_string(&b); /* service */ + p = buffer_get_string(&b, NULL); + if (strcmp(p, "hostbased") != 0) + fail++; + xfree(p); + buffer_skip_string(&b); /* pkalg */ + buffer_skip_string(&b); /* pkblob */ + + /* verify client host, strip trailing dot if necessary */ + p = buffer_get_string(&b, NULL); + if (((len = strlen(p)) > 0) && p[len - 1] == '.') + p[len - 1] = '\0'; + if (strcmp(p, chost) != 0) + fail++; + xfree(p); + + /* verify client user */ + p = buffer_get_string(&b, NULL); + if (strcmp(p, cuser) != 0) + fail++; + xfree(p); + + if (buffer_len(&b) != 0) + fail++; + buffer_free(&b); + return (fail == 0); +} + +int +mm_answer_keyverify(int socket, Buffer *m) +{ + Key *key; + u_char *signature, *data, *blob; + u_int signaturelen, datalen, bloblen; + int verified = 0; + int valid_data = 0; + + blob = buffer_get_string(m, &bloblen); + signature = buffer_get_string(m, &signaturelen); + data = buffer_get_string(m, &datalen); + + if (hostbased_cuser == NULL || hostbased_chost == NULL || + !monitor_allowed_key(blob, bloblen)) + fatal("%s: bad key, not previously allowed", __FUNCTION__); + + key = key_from_blob(blob, bloblen); + if (key == NULL) + fatal("%s: bad public key blob", __FUNCTION__); + + switch (key_blobtype) { + case MM_USERKEY: + valid_data = monitor_valid_userblob(data, datalen); + break; + case MM_HOSTKEY: + valid_data = monitor_valid_hostbasedblob(data, datalen, + hostbased_cuser, hostbased_chost); + break; + default: + valid_data = 0; + break; + } + if (!valid_data) + fatal("%s: bad signature data blob", __FUNCTION__); + + verified = key_verify(key, signature, signaturelen, data, datalen); + debug3("%s: key %p signature %s", + __FUNCTION__, key, verified ? "verified" : "unverified"); + + key_free(key); + xfree(blob); + xfree(signature); + xfree(data); + + monitor_reset_key_state(); + + buffer_clear(m); + buffer_put_int(m, verified); + mm_request_send(socket, MONITOR_ANS_KEYVERIFY, m); + + auth_method = "publickey"; + + return (verified); +} + +static void +mm_record_login(Session *s, struct passwd *pw) +{ + socklen_t fromlen; + struct sockaddr_storage from; + + /* + * Get IP address of client. If the connection is not a socket, let + * the address be 0.0.0.0. + */ + memset(&from, 0, sizeof(from)); + if (packet_connection_is_on_socket()) { + fromlen = sizeof(from); + if (getpeername(packet_get_connection_in(), + (struct sockaddr *) & from, &fromlen) < 0) { + debug("getpeername: %.100s", strerror(errno)); + fatal_cleanup(); + } + } + /* Record that there was a login on that tty from the remote host. */ + record_login(s->pid, s->tty, pw->pw_name, pw->pw_uid, + get_remote_name_or_ip(utmp_len, options.verify_reverse_mapping), + (struct sockaddr *)&from); +} + +static void +mm_session_close(Session *s) +{ + debug3("%s: session %d pid %d", __FUNCTION__, s->self, s->pid); + if (s->ttyfd != -1) { + debug3("%s: tty %s ptyfd %d", __FUNCTION__, s->tty, s->ptyfd); + fatal_remove_cleanup(session_pty_cleanup2, (void *)s); + session_pty_cleanup2(s); + } + s->used = 0; +} + +int +mm_answer_pty(int socket, Buffer *m) +{ + extern struct monitor *pmonitor; + Session *s; + int res, fd0; + + debug3("%s entering", __FUNCTION__); + + buffer_clear(m); + s = session_new(); + if (s == NULL) + goto error; + s->authctxt = authctxt; + s->pw = authctxt->pw; + s->pid = pmonitor->m_pid; + res = pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty)); + if (res == 0) + goto error; + fatal_add_cleanup(session_pty_cleanup2, (void *)s); + pty_setowner(authctxt->pw, s->tty); + + buffer_put_int(m, 1); + buffer_put_cstring(m, s->tty); + mm_request_send(socket, MONITOR_ANS_PTY, m); + + mm_send_fd(socket, s->ptyfd); + mm_send_fd(socket, s->ttyfd); + + /* We need to trick ttyslot */ + if (dup2(s->ttyfd, 0) == -1) + fatal("%s: dup2", __FUNCTION__); + + mm_record_login(s, authctxt->pw); + + /* Now we can close the file descriptor again */ + close(0); + + /* make sure nothing uses fd 0 */ + if ((fd0 = open(_PATH_DEVNULL, O_RDONLY)) < 0) + fatal("%s: open(/dev/null): %s", __FUNCTION__, strerror(errno)); + if (fd0 != 0) + error("%s: fd0 %d != 0", __FUNCTION__, fd0); + + /* slave is not needed */ + close(s->ttyfd); + s->ttyfd = s->ptyfd; + /* no need to dup() because nobody closes ptyfd */ + s->ptymaster = s->ptyfd; + + debug3("%s: tty %s ptyfd %d", __FUNCTION__, s->tty, s->ttyfd); + + return (0); + + error: + if (s != NULL) + mm_session_close(s); + buffer_put_int(m, 0); + mm_request_send(socket, MONITOR_ANS_PTY, m); + return (0); +} + +int +mm_answer_pty_cleanup(int socket, Buffer *m) +{ + Session *s; + char *tty; + + debug3("%s entering", __FUNCTION__); + + tty = buffer_get_string(m, NULL); + if ((s = session_by_tty(tty)) != NULL) + mm_session_close(s); + buffer_clear(m); + xfree(tty); + return (0); +} + +int +mm_answer_sesskey(int socket, Buffer *m) +{ + BIGNUM *p; + int rsafail; + + /* Turn off permissions */ + monitor_permit(mon_dispatch, MONITOR_REQ_SESSKEY, 1); + + if ((p = BN_new()) == NULL) + fatal("%s: BN_new", __FUNCTION__); + + buffer_get_bignum2(m, p); + + rsafail = ssh1_session_key(p); + + buffer_clear(m); + buffer_put_int(m, rsafail); + buffer_put_bignum2(m, p); + + BN_clear_free(p); + + mm_request_send(socket, MONITOR_ANS_SESSKEY, m); + + /* Turn on permissions for sessid passing */ + monitor_permit(mon_dispatch, MONITOR_REQ_SESSID, 1); + + return (0); +} + +int +mm_answer_sessid(int socket, Buffer *m) +{ + int i; + + debug3("%s entering", __FUNCTION__); + + if (buffer_len(m) != 16) + fatal("%s: bad ssh1 session id", __FUNCTION__); + for (i = 0; i < 16; i++) + session_id[i] = buffer_get_char(m); + + /* Turn on permissions for getpwnam */ + monitor_permit(mon_dispatch, MONITOR_REQ_PWNAM, 1); + + return (0); +} + +int +mm_answer_rsa_keyallowed(int socket, Buffer *m) +{ + BIGNUM *client_n; + Key *key = NULL; + u_char *blob = NULL; + u_int blen = 0; + int allowed = 0; + + debug3("%s entering", __FUNCTION__); + + if (authctxt->valid) { + if ((client_n = BN_new()) == NULL) + fatal("%s: BN_new", __FUNCTION__); + buffer_get_bignum2(m, client_n); + allowed = auth_rsa_key_allowed(authctxt->pw, client_n, &key); + BN_clear_free(client_n); + } + buffer_clear(m); + buffer_put_int(m, allowed); + + /* clear temporarily storage (used by generate challenge) */ + monitor_reset_key_state(); + + if (allowed && key != NULL) { + key->type = KEY_RSA; /* cheat for key_to_blob */ + if (key_to_blob(key, &blob, &blen) == 0) + fatal("%s: key_to_blob failed", __FUNCTION__); + buffer_put_string(m, blob, blen); + + /* Save temporarily for comparison in verify */ + key_blob = blob; + key_bloblen = blen; + key_blobtype = MM_RSAUSERKEY; + key_free(key); + } + + mm_append_debug(m); + + mm_request_send(socket, MONITOR_ANS_RSAKEYALLOWED, m); + + monitor_permit(mon_dispatch, MONITOR_REQ_RSACHALLENGE, allowed); + monitor_permit(mon_dispatch, MONITOR_REQ_RSARESPONSE, 0); + return (0); +} + +int +mm_answer_rsa_challenge(int socket, Buffer *m) +{ + Key *key = NULL; + u_char *blob; + u_int blen; + + debug3("%s entering", __FUNCTION__); + + if (!authctxt->valid) + fatal("%s: authctxt not valid", __FUNCTION__); + blob = buffer_get_string(m, &blen); + if (!monitor_allowed_key(blob, blen)) + fatal("%s: bad key, not previously allowed", __FUNCTION__); + if (key_blobtype != MM_RSAUSERKEY && key_blobtype != MM_RSAHOSTKEY) + fatal("%s: key type mismatch", __FUNCTION__); + if ((key = key_from_blob(blob, blen)) == NULL) + fatal("%s: received bad key", __FUNCTION__); + + if (ssh1_challenge) + BN_clear_free(ssh1_challenge); + ssh1_challenge = auth_rsa_generate_challenge(key); + + buffer_clear(m); + buffer_put_bignum2(m, ssh1_challenge); + + debug3("%s sending reply", __FUNCTION__); + mm_request_send(socket, MONITOR_ANS_RSACHALLENGE, m); + + monitor_permit(mon_dispatch, MONITOR_REQ_RSARESPONSE, 1); + return (0); +} + +int +mm_answer_rsa_response(int socket, Buffer *m) +{ + Key *key = NULL; + u_char *blob, *response; + u_int blen, len; + int success; + + debug3("%s entering", __FUNCTION__); + + if (!authctxt->valid) + fatal("%s: authctxt not valid", __FUNCTION__); + if (ssh1_challenge == NULL) + fatal("%s: no ssh1_challenge", __FUNCTION__); + + blob = buffer_get_string(m, &blen); + if (!monitor_allowed_key(blob, blen)) + fatal("%s: bad key, not previously allowed", __FUNCTION__); + if (key_blobtype != MM_RSAUSERKEY && key_blobtype != MM_RSAHOSTKEY) + fatal("%s: key type mismatch: %d", __FUNCTION__, key_blobtype); + if ((key = key_from_blob(blob, blen)) == NULL) + fatal("%s: received bad key", __FUNCTION__); + response = buffer_get_string(m, &len); + if (len != 16) + fatal("%s: received bad response to challenge", __FUNCTION__); + success = auth_rsa_verify_response(key, ssh1_challenge, response); + + key_free(key); + xfree(response); + + auth_method = key_blobtype == MM_RSAUSERKEY ? "rsa" : "rhosts-rsa"; + + /* reset state */ + BN_clear_free(ssh1_challenge); + ssh1_challenge = NULL; + monitor_reset_key_state(); + + buffer_clear(m); + buffer_put_int(m, success); + mm_request_send(socket, MONITOR_ANS_RSARESPONSE, m); + + return (success); +} + +int +mm_answer_term(int socket, Buffer *req) +{ + extern struct monitor *pmonitor; + int res, status; + + debug3("%s: tearing down sessions", __FUNCTION__); + + /* The child is terminating */ + session_destroy_all(&mm_session_close); + + while (waitpid(pmonitor->m_pid, &status, 0) == -1) + if (errno != EINTR) + exit(1); + + res = WIFEXITED(status) ? WEXITSTATUS(status) : 1; + + /* Terminate process */ + exit (res); +} + +void +monitor_apply_keystate(struct monitor *pmonitor) +{ + if (compat20) { + set_newkeys(MODE_IN); + set_newkeys(MODE_OUT); + } else { + u_char key[SSH_SESSION_KEY_LENGTH]; + + memset(key, 'a', sizeof(key)); + packet_set_protocol_flags(child_state.ssh1protoflags); + packet_set_encryption_key(key, SSH_SESSION_KEY_LENGTH, + child_state.ssh1cipher); + } + + packet_set_keycontext(MODE_OUT, child_state.keyout); + xfree(child_state.keyout); + packet_set_keycontext(MODE_IN, child_state.keyin); + xfree(child_state.keyin); + + if (!compat20) { + packet_set_iv(MODE_OUT, child_state.ivout); + xfree(child_state.ivout); + packet_set_iv(MODE_IN, child_state.ivin); + xfree(child_state.ivin); + } + + memcpy(&incoming_stream, &child_state.incoming, + sizeof(incoming_stream)); + memcpy(&outgoing_stream, &child_state.outgoing, + sizeof(outgoing_stream)); + + /* Update with new address */ + mm_init_compression(pmonitor->m_zlib); + + /* Network I/O buffers */ + /* XXX inefficient for large buffers, need: buffer_init_from_string */ + buffer_clear(&input); + buffer_append(&input, child_state.input, child_state.ilen); + memset(child_state.input, 0, child_state.ilen); + xfree(child_state.input); + + buffer_clear(&output); + buffer_append(&output, child_state.output, child_state.olen); + memset(child_state.output, 0, child_state.olen); + xfree(child_state.output); +} + +static Kex * +mm_get_kex(Buffer *m) +{ + Kex *kex; + void *blob; + u_int bloblen; + + kex = xmalloc(sizeof(*kex)); + memset(kex, 0, sizeof(*kex)); + kex->session_id = buffer_get_string(m, &kex->session_id_len); + kex->we_need = buffer_get_int(m); + kex->server = 1; + kex->hostkey_type = buffer_get_int(m); + kex->kex_type = buffer_get_int(m); + blob = buffer_get_string(m, &bloblen); + buffer_init(&kex->my); + buffer_append(&kex->my, blob, bloblen); + xfree(blob); + blob = buffer_get_string(m, &bloblen); + buffer_init(&kex->peer); + buffer_append(&kex->peer, blob, bloblen); + xfree(blob); + kex->done = 1; + kex->flags = buffer_get_int(m); + kex->client_version_string = buffer_get_string(m, NULL); + kex->server_version_string = buffer_get_string(m, NULL); + kex->load_host_key=&get_hostkey_by_type; + kex->host_key_index=&get_hostkey_index; + + return (kex); +} + +/* This function requries careful sanity checking */ + +void +mm_get_keystate(struct monitor *pmonitor) +{ + Buffer m; + u_char *blob, *p; + u_int bloblen, plen; + + debug3("%s: Waiting for new keys", __FUNCTION__); + + buffer_init(&m); + mm_request_receive_expect(pmonitor->m_sendfd, MONITOR_REQ_KEYEXPORT, &m); + if (!compat20) { + child_state.ssh1protoflags = buffer_get_int(&m); + child_state.ssh1cipher = buffer_get_int(&m); + child_state.ivout = buffer_get_string(&m, + &child_state.ivoutlen); + child_state.ivin = buffer_get_string(&m, &child_state.ivinlen); + goto skip; + } else { + /* Get the Kex for rekeying */ + *pmonitor->m_pkex = mm_get_kex(&m); + } + + blob = buffer_get_string(&m, &bloblen); + current_keys[MODE_OUT] = mm_newkeys_from_blob(blob, bloblen); + xfree(blob); + + debug3("%s: Waiting for second key", __FUNCTION__); + blob = buffer_get_string(&m, &bloblen); + current_keys[MODE_IN] = mm_newkeys_from_blob(blob, bloblen); + xfree(blob); + + /* Now get sequence numbers for the packets */ + packet_set_seqnr(MODE_OUT, buffer_get_int(&m)); + packet_set_seqnr(MODE_IN, buffer_get_int(&m)); + + skip: + /* Get the key context */ + child_state.keyout = buffer_get_string(&m, &child_state.keyoutlen); + child_state.keyin = buffer_get_string(&m, &child_state.keyinlen); + + debug3("%s: Getting compression state", __FUNCTION__); + /* Get compression state */ + p = buffer_get_string(&m, &plen); + if (plen != sizeof(child_state.outgoing)) + fatal("%s: bad request size", __FUNCTION__); + memcpy(&child_state.outgoing, p, sizeof(child_state.outgoing)); + xfree(p); + + p = buffer_get_string(&m, &plen); + if (plen != sizeof(child_state.incoming)) + fatal("%s: bad request size", __FUNCTION__); + memcpy(&child_state.incoming, p, sizeof(child_state.incoming)); + xfree(p); + + /* Network I/O buffers */ + debug3("%s: Getting Network I/O buffers", __FUNCTION__); + child_state.input = buffer_get_string(&m, &child_state.ilen); + child_state.output = buffer_get_string(&m, &child_state.olen); + + buffer_free(&m); +} + + +/* Allocation functions for zlib */ +void * +mm_zalloc(struct mm_master *mm, u_int ncount, u_int size) +{ + void *address; + + address = mm_malloc(mm, size * ncount); + + return (address); +} + +void +mm_zfree(struct mm_master *mm, void *address) +{ + mm_free(mm, address); +} + +void +mm_init_compression(struct mm_master *mm) +{ + outgoing_stream.zalloc = (alloc_func)mm_zalloc; + outgoing_stream.zfree = (free_func)mm_zfree; + outgoing_stream.opaque = mm; + + incoming_stream.zalloc = (alloc_func)mm_zalloc; + incoming_stream.zfree = (free_func)mm_zfree; + incoming_stream.opaque = mm; +} + +/* XXX */ + +#define FD_CLOSEONEXEC(x) do { \ + if (fcntl(x, F_SETFD, 1) == -1) \ + fatal("fcntl(%d, F_SETFD)", x); \ +} while (0) + +static void +monitor_socketpair(int *pair) +{ +#ifdef HAVE_SOCKETPAIR + if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) + fatal("%s: socketpair", __FUNCTION__); +#else + fatal("%s: UsePrivilegeSeparation=yes not supported", + __FUNCTION__); +#endif + FD_CLOSEONEXEC(pair[0]); + FD_CLOSEONEXEC(pair[1]); +} + +#define MM_MEMSIZE 65536 + +struct monitor * +monitor_init(void) +{ + struct monitor *mon; + int pair[2]; + + mon = xmalloc(sizeof(*mon)); + + monitor_socketpair(pair); + + mon->m_recvfd = pair[0]; + mon->m_sendfd = pair[1]; + + /* Used to share zlib space across processes */ + mon->m_zback = mm_create(NULL, MM_MEMSIZE); + mon->m_zlib = mm_create(mon->m_zback, 20 * MM_MEMSIZE); + + /* Compression needs to share state across borders */ + mm_init_compression(mon->m_zlib); + + return mon; +} + +void +monitor_reinit(struct monitor *mon) +{ + int pair[2]; + + monitor_socketpair(pair); + + mon->m_recvfd = pair[0]; + mon->m_sendfd = pair[1]; +} diff --git a/openssh/monitor.h b/openssh/monitor.h new file mode 100644 index 0000000..b5db999 --- /dev/null +++ b/openssh/monitor.h @@ -0,0 +1,82 @@ +/* $OpenBSD: monitor.h,v 1.4 2002/05/12 23:53:45 djm Exp $ */ + +/* + * Copyright 2002 Niels Provos + * 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. + */ + +#ifndef _MONITOR_H_ +#define _MONITOR_H_ + +enum monitor_reqtype { + MONITOR_REQ_MODULI, MONITOR_ANS_MODULI, + MONITOR_REQ_FREE, MONITOR_REQ_AUTHSERV, + MONITOR_REQ_SIGN, MONITOR_ANS_SIGN, + MONITOR_REQ_PWNAM, MONITOR_ANS_PWNAM, + MONITOR_REQ_AUTH2_READ_BANNER, MONITOR_ANS_AUTH2_READ_BANNER, + MONITOR_REQ_AUTHPASSWORD, MONITOR_ANS_AUTHPASSWORD, + MONITOR_REQ_BSDAUTHQUERY, MONITOR_ANS_BSDAUTHQUERY, + MONITOR_REQ_BSDAUTHRESPOND, MONITOR_ANS_BSDAUTHRESPOND, + MONITOR_REQ_SKEYQUERY, MONITOR_ANS_SKEYQUERY, + MONITOR_REQ_SKEYRESPOND, MONITOR_ANS_SKEYRESPOND, + MONITOR_REQ_KEYALLOWED, MONITOR_ANS_KEYALLOWED, + MONITOR_REQ_KEYVERIFY, MONITOR_ANS_KEYVERIFY, + MONITOR_REQ_KEYEXPORT, + MONITOR_REQ_PTY, MONITOR_ANS_PTY, + MONITOR_REQ_PTYCLEANUP, + MONITOR_REQ_SESSKEY, MONITOR_ANS_SESSKEY, + MONITOR_REQ_SESSID, + MONITOR_REQ_RSAKEYALLOWED, MONITOR_ANS_RSAKEYALLOWED, + MONITOR_REQ_RSACHALLENGE, MONITOR_ANS_RSACHALLENGE, + MONITOR_REQ_RSARESPONSE, MONITOR_ANS_RSARESPONSE, + MONITOR_REQ_PAM_START, + MONITOR_REQ_TERM, +}; + +struct mm_master; +struct monitor { + int m_recvfd; + int m_sendfd; + struct mm_master *m_zback; + struct mm_master *m_zlib; + struct Kex **m_pkex; + int m_pid; +}; + +struct monitor *monitor_init(void); +void monitor_reinit(struct monitor *); +void monitor_sync(struct monitor *); + +struct Authctxt; +struct Authctxt *monitor_child_preauth(struct monitor *); +void monitor_child_postauth(struct monitor *); + +struct mon_table; +int monitor_read(struct monitor*, struct mon_table *, struct mon_table **); + +/* Prototypes for request sending and receiving */ +void mm_request_send(int, enum monitor_reqtype, Buffer *); +void mm_request_receive(int, Buffer *); +void mm_request_receive_expect(int, enum monitor_reqtype, Buffer *); + +#endif /* _MONITOR_H_ */ diff --git a/openssh/monitor_fdpass.c b/openssh/monitor_fdpass.c new file mode 100644 index 0000000..fb97171 --- /dev/null +++ b/openssh/monitor_fdpass.c @@ -0,0 +1,127 @@ +/* + * Copyright 2001 Niels Provos + * 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: monitor_fdpass.c,v 1.2 2002/03/24 17:53:16 stevesk Exp $"); + +#include + +#include "log.h" +#include "monitor_fdpass.h" + +void +mm_send_fd(int socket, int fd) +{ +#if defined(HAVE_SENDMSG) && (defined(HAVE_ACCRIGHTS_IN_MSGHDR) || defined(HAVE_CONTROL_IN_MSGHDR)) + struct msghdr msg; + struct iovec vec; + char ch = '\0'; + int n; +#if !defined(HAVE_ACCRIGHTS_IN_MSGHDR) || \ + (defined(HAVE_ACCRIGHTS_IN_MSGHDR) && defined(HAVE_CONTROL_IN_MSGHDR)) + char tmp[CMSG_SPACE(sizeof(int))]; + struct cmsghdr *cmsg; +#endif + + memset(&msg, 0, sizeof(msg)); +#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR) + msg.msg_accrights = (caddr_t)&fd; + msg.msg_accrightslen = sizeof(fd); +#else + msg.msg_control = (caddr_t)tmp; + msg.msg_controllen = CMSG_LEN(sizeof(int)); + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + *(int *)CMSG_DATA(cmsg) = fd; +#endif + + vec.iov_base = &ch; + vec.iov_len = 1; + msg.msg_iov = &vec; + msg.msg_iovlen = 1; + + if ((n = sendmsg(socket, &msg, 0)) == -1) + fatal("%s: sendmsg(%d): %s", __FUNCTION__, fd, + strerror(errno)); + if (n != 1) + fatal("%s: sendmsg: expected sent 1 got %d", + __FUNCTION__, n); +#else + fatal("%s: UsePrivilegeSeparation=yes not supported", + __FUNCTION__); +#endif +} + +int +mm_receive_fd(int socket) +{ +#if defined(HAVE_RECVMSG) && (defined(HAVE_ACCRIGHTS_IN_MSGHDR) || defined(HAVE_CONTROL_IN_MSGHDR)) + struct msghdr msg; + struct iovec vec; + char ch; + int fd, n; +#if !defined(HAVE_ACCRIGHTS_IN_MSGHDR) || \ + (defined(HAVE_ACCRIGHTS_IN_MSGHDR) && defined(HAVE_CONTROL_IN_MSGHDR)) + char tmp[CMSG_SPACE(sizeof(int))]; + struct cmsghdr *cmsg; +#endif + + memset(&msg, 0, sizeof(msg)); + vec.iov_base = &ch; + vec.iov_len = 1; + msg.msg_iov = &vec; + msg.msg_iovlen = 1; +#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR) + msg.msg_accrights = (caddr_t)&fd; + msg.msg_accrightslen = sizeof(fd); +#else + msg.msg_control = tmp; + msg.msg_controllen = sizeof(tmp); +#endif + + if ((n = recvmsg(socket, &msg, 0)) == -1) + fatal("%s: recvmsg: %s", __FUNCTION__, strerror(errno)); + if (n != 1) + fatal("%s: recvmsg: expected received 1 got %d", + __FUNCTION__, n); + +#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR) + if (msg.msg_accrightslen != sizeof(fd)) + fatal("%s: no fd", __FUNCTION__); +#else + cmsg = CMSG_FIRSTHDR(&msg); + if (cmsg->cmsg_type != SCM_RIGHTS) + fatal("%s: expected type %d got %d", __FUNCTION__, + SCM_RIGHTS, cmsg->cmsg_type); + fd = (*(int *)CMSG_DATA(cmsg)); +#endif + return fd; +#else + fatal("%s: UsePrivilegeSeparation=yes not supported", + __FUNCTION__); +#endif +} diff --git a/openssh/monitor_fdpass.h b/openssh/monitor_fdpass.h new file mode 100644 index 0000000..cb12c41 --- /dev/null +++ b/openssh/monitor_fdpass.h @@ -0,0 +1,34 @@ +/* $OpenBSD: monitor_fdpass.h,v 1.2 2002/03/26 03:24:01 stevesk Exp $ */ + +/* + * Copyright 2002 Niels Provos + * 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. + */ + +#ifndef _MM_FDPASS_H_ +#define _MM_FDPASS_H_ + +void mm_send_fd(int, int); +int mm_receive_fd(int); + +#endif /* _MM_FDPASS_H_ */ diff --git a/openssh/monitor_mm.c b/openssh/monitor_mm.c new file mode 100644 index 0000000..993925e --- /dev/null +++ b/openssh/monitor_mm.c @@ -0,0 +1,341 @@ +/* + * Copyright 2002 Niels Provos + * 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: monitor_mm.c,v 1.4 2002/03/25 20:12:10 stevesk Exp $"); + +#ifdef HAVE_SYS_MMAN_H +#include +#endif + +#include "ssh.h" +#include "xmalloc.h" +#include "log.h" +#include "monitor_mm.h" + +static int +mm_compare(struct mm_share *a, struct mm_share *b) +{ + return ((char *)a->address - (char *)b->address); +} + +RB_GENERATE(mmtree, mm_share, next, mm_compare) + +static struct mm_share * +mm_make_entry(struct mm_master *mm, struct mmtree *head, + void *address, size_t size) +{ + struct mm_share *tmp, *tmp2; + + if (mm->mmalloc == NULL) + tmp = xmalloc(sizeof(struct mm_share)); + else + tmp = mm_xmalloc(mm->mmalloc, sizeof(struct mm_share)); + tmp->address = address; + tmp->size = size; + + tmp2 = RB_INSERT(mmtree, head, tmp); + if (tmp2 != NULL) + fatal("mm_make_entry(%p): double address %p->%p(%lu)", + mm, tmp2, address, (u_long)size); + + return (tmp); +} + +/* Creates a shared memory area of a certain size */ + +struct mm_master * +mm_create(struct mm_master *mmalloc, size_t size) +{ + void *address; + struct mm_master *mm; + + if (mmalloc == NULL) + mm = xmalloc(sizeof(struct mm_master)); + else + mm = mm_xmalloc(mmalloc, sizeof(struct mm_master)); + + /* + * If the memory map has a mm_master it can be completely + * shared including authentication between the child + * and the client. + */ + mm->mmalloc = mmalloc; + +#if defined(HAVE_MMAP) && defined(MAP_ANON) + address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, + -1, 0); + if (address == MAP_FAILED) + fatal("mmap(%lu)", (u_long)size); +#else + fatal("%s: UsePrivilegeSeparation=yes not supported", + __FUNCTION__); +#endif + + mm->address = address; + mm->size = size; + + RB_INIT(&mm->rb_free); + RB_INIT(&mm->rb_allocated); + + mm_make_entry(mm, &mm->rb_free, address, size); + + return (mm); +} + +/* Frees either the allocated or the free list */ + +static void +mm_freelist(struct mm_master *mmalloc, struct mmtree *head) +{ + struct mm_share *mms, *next; + + for (mms = RB_ROOT(head); mms; mms = next) { + next = RB_NEXT(mmtree, head, mms); + RB_REMOVE(mmtree, head, mms); + if (mmalloc == NULL) + xfree(mms); + else + mm_free(mmalloc, mms); + } +} + +/* Destroys a memory mapped area */ + +void +mm_destroy(struct mm_master *mm) +{ + mm_freelist(mm->mmalloc, &mm->rb_free); + mm_freelist(mm->mmalloc, &mm->rb_allocated); + +#ifdef HAVE_MMAP + if (munmap(mm->address, mm->size) == -1) + fatal("munmap(%p, %lu)", mm->address, (u_long)mm->size); +#else + fatal("%s: UsePrivilegeSeparation=yes not supported", + __FUNCTION__); +#endif + if (mm->mmalloc == NULL) + xfree(mm); + else + mm_free(mm->mmalloc, mm); +} + +void * +mm_xmalloc(struct mm_master *mm, size_t size) +{ + void *address; + + address = mm_malloc(mm, size); + if (address == NULL) + fatal("%s: mm_malloc(%lu)", __FUNCTION__, (u_long)size); + return (address); +} + + +/* Allocates data from a memory mapped area */ + +void * +mm_malloc(struct mm_master *mm, size_t size) +{ + struct mm_share *mms, *tmp; + + if (size == 0) + fatal("mm_malloc: try to allocate 0 space"); + + size = ((size + MM_MINSIZE - 1) / MM_MINSIZE) * MM_MINSIZE; + + RB_FOREACH(mms, mmtree, &mm->rb_free) { + if (mms->size >= size) + break; + } + + if (mms == NULL) + return (NULL); + + /* Debug */ + memset(mms->address, 0xd0, size); + + tmp = mm_make_entry(mm, &mm->rb_allocated, mms->address, size); + + /* Does not change order in RB tree */ + mms->size -= size; + mms->address = (u_char *)mms->address + size; + + if (mms->size == 0) { + RB_REMOVE(mmtree, &mm->rb_free, mms); + if (mm->mmalloc == NULL) + xfree(mms); + else + mm_free(mm->mmalloc, mms); + } + + return (tmp->address); +} + +/* Frees memory in a memory mapped area */ + +void +mm_free(struct mm_master *mm, void *address) +{ + struct mm_share *mms, *prev, tmp; + + tmp.address = address; + mms = RB_FIND(mmtree, &mm->rb_allocated, &tmp); + if (mms == NULL) + fatal("mm_free(%p): can not find %p", mm, address); + + /* Debug */ + memset(mms->address, 0xd0, mms->size); + + /* Remove from allocated list and insert in free list */ + RB_REMOVE(mmtree, &mm->rb_allocated, mms); + if (RB_INSERT(mmtree, &mm->rb_free, mms) != NULL) + fatal("mm_free(%p): double address %p", mm, address); + + /* Find previous entry */ + prev = mms; + if (RB_LEFT(prev, next)) { + prev = RB_LEFT(prev, next); + while (RB_RIGHT(prev, next)) + prev = RB_RIGHT(prev, next); + } else { + if (RB_PARENT(prev, next) && + (prev == RB_RIGHT(RB_PARENT(prev, next), next))) + prev = RB_PARENT(prev, next); + else { + while (RB_PARENT(prev, next) && + (prev == RB_LEFT(RB_PARENT(prev, next), next))) + prev = RB_PARENT(prev, next); + prev = RB_PARENT(prev, next); + } + } + + /* Check if range does not overlap */ + if (prev != NULL && MM_ADDRESS_END(prev) > address) + fatal("mm_free: memory corruption: %p(%lu) > %p", + prev->address, (u_long)prev->size, address); + + /* See if we can merge backwards */ + if (prev != NULL && MM_ADDRESS_END(prev) == address) { + prev->size += mms->size; + RB_REMOVE(mmtree, &mm->rb_free, mms); + if (mm->mmalloc == NULL) + xfree(mms); + else + mm_free(mm->mmalloc, mms); + } else + prev = mms; + + if (prev == NULL) + return; + + /* Check if we can merge forwards */ + mms = RB_NEXT(mmtree, &mm->rb_free, prev); + if (mms == NULL) + return; + + if (MM_ADDRESS_END(prev) > mms->address) + fatal("mm_free: memory corruption: %p < %p(%lu)", + mms->address, prev->address, (u_long)prev->size); + if (MM_ADDRESS_END(prev) != mms->address) + return; + + prev->size += mms->size; + RB_REMOVE(mmtree, &mm->rb_free, mms); + + if (mm->mmalloc == NULL) + xfree(mms); + else + mm_free(mm->mmalloc, mms); +} + +static void +mm_sync_list(struct mmtree *oldtree, struct mmtree *newtree, + struct mm_master *mm, struct mm_master *mmold) +{ + struct mm_master *mmalloc = mm->mmalloc; + struct mm_share *mms, *new; + + /* Sync free list */ + RB_FOREACH(mms, mmtree, oldtree) { + /* Check the values */ + mm_memvalid(mmold, mms, sizeof(struct mm_share)); + mm_memvalid(mm, mms->address, mms->size); + + new = mm_xmalloc(mmalloc, sizeof(struct mm_share)); + memcpy(new, mms, sizeof(struct mm_share)); + RB_INSERT(mmtree, newtree, new); + } +} + +void +mm_share_sync(struct mm_master **pmm, struct mm_master **pmmalloc) +{ + struct mm_master *mm; + struct mm_master *mmalloc; + struct mm_master *mmold; + struct mmtree rb_free, rb_allocated; + + debug3("%s: Share sync", __FUNCTION__); + + mm = *pmm; + mmold = mm->mmalloc; + mm_memvalid(mmold, mm, sizeof(*mm)); + + mmalloc = mm_create(NULL, mm->size); + mm = mm_xmalloc(mmalloc, sizeof(struct mm_master)); + memcpy(mm, *pmm, sizeof(struct mm_master)); + mm->mmalloc = mmalloc; + + rb_free = mm->rb_free; + rb_allocated = mm->rb_allocated; + + RB_INIT(&mm->rb_free); + RB_INIT(&mm->rb_allocated); + + mm_sync_list(&rb_free, &mm->rb_free, mm, mmold); + mm_sync_list(&rb_allocated, &mm->rb_allocated, mm, mmold); + + mm_destroy(mmold); + + *pmm = mm; + *pmmalloc = mmalloc; + + debug3("%s: Share sync end", __FUNCTION__); +} + +void +mm_memvalid(struct mm_master *mm, void *address, size_t size) +{ + void *end = (u_char *)address + size; + + if (address < mm->address) + fatal("mm_memvalid: address too small: %p", address); + if (end < address) + fatal("mm_memvalid: end < address: %p < %p", end, address); + if (end > (void *)((u_char *)mm->address + mm->size)) + fatal("mm_memvalid: address too large: %p", address); +} diff --git a/openssh/monitor_mm.h b/openssh/monitor_mm.h new file mode 100644 index 0000000..c0af432 --- /dev/null +++ b/openssh/monitor_mm.h @@ -0,0 +1,66 @@ +/* $OpenBSD: monitor_mm.h,v 1.2 2002/03/26 03:24:01 stevesk Exp $ */ + +/* + * Copyright 2002 Niels Provos + * 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. + */ + +#ifndef _MM_H_ +#define _MM_H_ +#include "openbsd-compat/tree.h" + +struct mm_share { + RB_ENTRY(mm_share) next; + void *address; + size_t size; +}; + +struct mm_master { + RB_HEAD(mmtree, mm_share) rb_free; + struct mmtree rb_allocated; + void *address; + size_t size; + + struct mm_master *mmalloc; /* Used to completely share */ + + int write; /* used to writing to other party */ + int read; /* used for reading from other party */ +}; + +RB_PROTOTYPE(mmtree, mm_share, next, mm_compare) + +#define MM_MINSIZE 128 + +#define MM_ADDRESS_END(x) (void *)((u_char *)(x)->address + (x)->size) + +struct mm_master *mm_create(struct mm_master *, size_t); +void mm_destroy(struct mm_master *); + +void mm_share_sync(struct mm_master **, struct mm_master **); + +void *mm_malloc(struct mm_master *, size_t); +void *mm_xmalloc(struct mm_master *, size_t); +void mm_free(struct mm_master *, void *); + +void mm_memvalid(struct mm_master *, void *, size_t); +#endif /* _MM_H_ */ diff --git a/openssh/monitor_wrap.c b/openssh/monitor_wrap.c new file mode 100644 index 0000000..c5e3fb9 --- /dev/null +++ b/openssh/monitor_wrap.c @@ -0,0 +1,931 @@ +/* + * Copyright 2002 Niels Provos + * Copyright 2002 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: monitor_wrap.c,v 1.7 2002/05/15 15:47:49 mouring Exp $"); + +#include +#include + +#include "ssh.h" +#include "dh.h" +#include "kex.h" +#include "auth.h" +#include "buffer.h" +#include "bufaux.h" +#include "packet.h" +#include "mac.h" +#include "log.h" +#include "zlib.h" +#include "monitor.h" +#include "monitor_wrap.h" +#include "xmalloc.h" +#include "atomicio.h" +#include "monitor_fdpass.h" +#include "getput.h" + +#include "auth.h" +#include "channels.h" +#include "session.h" + +/* Imports */ +extern int compat20; +extern Newkeys *newkeys[]; +extern z_stream incoming_stream; +extern z_stream outgoing_stream; +extern struct monitor *pmonitor; +extern Buffer input, output; + +void +mm_request_send(int socket, enum monitor_reqtype type, Buffer *m) +{ + u_char buf[5]; + u_int mlen = buffer_len(m); + + debug3("%s entering: type %d", __FUNCTION__, type); + + PUT_32BIT(buf, mlen + 1); + buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */ + if (atomicio(write, socket, buf, sizeof(buf)) != sizeof(buf)) + fatal("%s: write", __FUNCTION__); + if (atomicio(write, socket, buffer_ptr(m), mlen) != mlen) + fatal("%s: write", __FUNCTION__); +} + +void +mm_request_receive(int socket, Buffer *m) +{ + u_char buf[4]; + ssize_t res; + u_int msg_len; + + debug3("%s entering", __FUNCTION__); + + res = atomicio(read, socket, buf, sizeof(buf)); + if (res != sizeof(buf)) { + if (res == 0) + fatal_cleanup(); + fatal("%s: read: %ld", __FUNCTION__, (long)res); + } + msg_len = GET_32BIT(buf); + if (msg_len > 256 * 1024) + fatal("%s: read: bad msg_len %d", __FUNCTION__, msg_len); + buffer_clear(m); + buffer_append_space(m, msg_len); + res = atomicio(read, socket, buffer_ptr(m), msg_len); + if (res != msg_len) + fatal("%s: read: %ld != msg_len", __FUNCTION__, (long)res); +} + +void +mm_request_receive_expect(int socket, enum monitor_reqtype type, Buffer *m) +{ + u_char rtype; + + debug3("%s entering: type %d", __FUNCTION__, type); + + mm_request_receive(socket, m); + rtype = buffer_get_char(m); + if (rtype != type) + fatal("%s: read: rtype %d != type %d", __FUNCTION__, + rtype, type); +} + +DH * +mm_choose_dh(int min, int nbits, int max) +{ + BIGNUM *p, *g; + int success = 0; + Buffer m; + + buffer_init(&m); + buffer_put_int(&m, min); + buffer_put_int(&m, nbits); + buffer_put_int(&m, max); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_MODULI, &m); + + debug3("%s: waiting for MONITOR_ANS_MODULI", __FUNCTION__); + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_MODULI, &m); + + success = buffer_get_char(&m); + if (success == 0) + fatal("%s: MONITOR_ANS_MODULI failed", __FUNCTION__); + + if ((p = BN_new()) == NULL) + fatal("%s: BN_new failed", __FUNCTION__); + if ((g = BN_new()) == NULL) + fatal("%s: BN_new failed", __FUNCTION__); + buffer_get_bignum2(&m, p); + buffer_get_bignum2(&m, g); + + debug3("%s: remaining %d", __FUNCTION__, buffer_len(&m)); + buffer_free(&m); + + return (dh_new_group(g, p)); +} + +int +mm_key_sign(Key *key, u_char **sigp, u_int *lenp, u_char *data, u_int datalen) +{ + Kex *kex = *pmonitor->m_pkex; + Buffer m; + + debug3("%s entering", __FUNCTION__); + + buffer_init(&m); + buffer_put_int(&m, kex->host_key_index(key)); + buffer_put_string(&m, data, datalen); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SIGN, &m); + + debug3("%s: waiting for MONITOR_ANS_SIGN", __FUNCTION__); + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_SIGN, &m); + *sigp = buffer_get_string(&m, lenp); + buffer_free(&m); + + return (0); +} + +struct passwd * +mm_getpwnamallow(const char *login) +{ + Buffer m; + struct passwd *pw; + u_int pwlen; + + debug3("%s entering", __FUNCTION__); + + buffer_init(&m); + buffer_put_cstring(&m, login); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PWNAM, &m); + + debug3("%s: waiting for MONITOR_ANS_PWNAM", __FUNCTION__); + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PWNAM, &m); + + if (buffer_get_char(&m) == 0) { + buffer_free(&m); + return (NULL); + } + pw = buffer_get_string(&m, &pwlen); + if (pwlen != sizeof(struct passwd)) + fatal("%s: struct passwd size mismatch", __FUNCTION__); + pw->pw_name = buffer_get_string(&m, NULL); + pw->pw_passwd = buffer_get_string(&m, NULL); + pw->pw_gecos = buffer_get_string(&m, NULL); +#ifdef HAVE_PW_CLASS_IN_PASSWD + pw->pw_class = buffer_get_string(&m, NULL); +#endif + pw->pw_dir = buffer_get_string(&m, NULL); + pw->pw_shell = buffer_get_string(&m, NULL); + buffer_free(&m); + + return (pw); +} + +char* mm_auth2_read_banner(void) +{ + Buffer m; + char *banner; + + debug3("%s entering", __FUNCTION__); + + buffer_init(&m); + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTH2_READ_BANNER, &m); + buffer_clear(&m); + + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUTH2_READ_BANNER, &m); + banner = buffer_get_string(&m, NULL); + buffer_free(&m); + + return (banner); +} + +/* Inform the privileged process about service and style */ + +void +mm_inform_authserv(char *service, char *style) +{ + Buffer m; + + debug3("%s entering", __FUNCTION__); + + buffer_init(&m); + buffer_put_cstring(&m, service); + buffer_put_cstring(&m, style ? style : ""); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m); + + buffer_free(&m); +} + +/* Do the password authentication */ +int +mm_auth_password(Authctxt *authctxt, char *password) +{ + Buffer m; + int authenticated = 0; + + debug3("%s entering", __FUNCTION__); + + buffer_init(&m); + buffer_put_cstring(&m, password); + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHPASSWORD, &m); + + debug3("%s: waiting for MONITOR_ANS_AUTHPASSWORD", __FUNCTION__); + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUTHPASSWORD, &m); + + authenticated = buffer_get_int(&m); + + buffer_free(&m); + + debug3("%s: user %sauthenticated", + __FUNCTION__, authenticated ? "" : "not "); + return (authenticated); +} + +int +mm_user_key_allowed(struct passwd *pw, Key *key) +{ + return (mm_key_allowed(MM_USERKEY, NULL, NULL, key)); +} + +int +mm_hostbased_key_allowed(struct passwd *pw, char *user, char *host, + Key *key) +{ + return (mm_key_allowed(MM_HOSTKEY, user, host, key)); +} + +int +mm_auth_rhosts_rsa_key_allowed(struct passwd *pw, char *user, + char *host, Key *key) +{ + int ret; + + key->type = KEY_RSA; /* XXX hack for key_to_blob */ + ret = mm_key_allowed(MM_RSAHOSTKEY, user, host, key); + key->type = KEY_RSA1; + return (ret); +} + +static void +mm_send_debug(Buffer *m) +{ + char *msg; + + while (buffer_len(m)) { + msg = buffer_get_string(m, NULL); + debug3("%s: Sending debug: %s", __FUNCTION__, msg); + packet_send_debug("%s", msg); + xfree(msg); + } +} + +int +mm_key_allowed(enum mm_keytype type, char *user, char *host, Key *key) +{ + Buffer m; + u_char *blob; + u_int len; + int allowed = 0; + + debug3("%s entering", __FUNCTION__); + + /* Convert the key to a blob and the pass it over */ + if (!key_to_blob(key, &blob, &len)) + return (0); + + buffer_init(&m); + buffer_put_int(&m, type); + buffer_put_cstring(&m, user ? user : ""); + buffer_put_cstring(&m, host ? host : ""); + buffer_put_string(&m, blob, len); + xfree(blob); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYALLOWED, &m); + + debug3("%s: waiting for MONITOR_ANS_KEYALLOWED", __FUNCTION__); + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KEYALLOWED, &m); + + allowed = buffer_get_int(&m); + + /* Send potential debug messages */ + mm_send_debug(&m); + + buffer_free(&m); + + return (allowed); +} + +/* + * This key verify needs to send the key type along, because the + * privileged parent makes the decision if the key is allowed + * for authentication. + */ + +int +mm_key_verify(Key *key, u_char *sig, u_int siglen, u_char *data, u_int datalen) +{ + Buffer m; + u_char *blob; + u_int len; + int verified = 0; + + debug3("%s entering", __FUNCTION__); + + /* Convert the key to a blob and the pass it over */ + if (!key_to_blob(key, &blob, &len)) + return (0); + + buffer_init(&m); + buffer_put_string(&m, blob, len); + buffer_put_string(&m, sig, siglen); + buffer_put_string(&m, data, datalen); + xfree(blob); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYVERIFY, &m); + + debug3("%s: waiting for MONITOR_ANS_KEYVERIFY", __FUNCTION__); + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KEYVERIFY, &m); + + verified = buffer_get_int(&m); + + buffer_free(&m); + + return (verified); +} + +/* Export key state after authentication */ +Newkeys * +mm_newkeys_from_blob(u_char *blob, int blen) +{ + Buffer b; + u_int len; + Newkeys *newkey = NULL; + Enc *enc; + Mac *mac; + Comp *comp; + + debug3("%s: %p(%d)", __FUNCTION__, blob, blen); +#ifdef DEBUG_PK + dump_base64(stderr, blob, blen); +#endif + buffer_init(&b); + buffer_append(&b, blob, blen); + + newkey = xmalloc(sizeof(*newkey)); + enc = &newkey->enc; + mac = &newkey->mac; + comp = &newkey->comp; + + /* Enc structure */ + enc->name = buffer_get_string(&b, NULL); + buffer_get(&b, &enc->cipher, sizeof(enc->cipher)); + enc->enabled = buffer_get_int(&b); + enc->block_size = buffer_get_int(&b); + enc->key = buffer_get_string(&b, &enc->key_len); + enc->iv = buffer_get_string(&b, &len); + if (len != enc->block_size) + fatal("%s: bad ivlen: expected %d != %d", __FUNCTION__, + enc->block_size, len); + + if (enc->name == NULL || cipher_by_name(enc->name) != enc->cipher) + fatal("%s: bad cipher name %s or pointer %p", __FUNCTION__, + enc->name, enc->cipher); + + /* Mac structure */ + mac->name = buffer_get_string(&b, NULL); + if (mac->name == NULL || mac_init(mac, mac->name) == -1) + fatal("%s: can not init mac %s", __FUNCTION__, mac->name); + mac->enabled = buffer_get_int(&b); + mac->key = buffer_get_string(&b, &len); + if (len > mac->key_len) + fatal("%s: bad mac key lenght: %d > %d", __FUNCTION__, len, + mac->key_len); + mac->key_len = len; + + /* Comp structure */ + comp->type = buffer_get_int(&b); + comp->enabled = buffer_get_int(&b); + comp->name = buffer_get_string(&b, NULL); + + len = buffer_len(&b); + if (len != 0) + error("newkeys_from_blob: remaining bytes in blob %d", len); + buffer_free(&b); + return (newkey); +} + +int +mm_newkeys_to_blob(int mode, u_char **blobp, u_int *lenp) +{ + Buffer b; + int len; + u_char *buf; + Enc *enc; + Mac *mac; + Comp *comp; + Newkeys *newkey = newkeys[mode]; + + debug3("%s: converting %p", __FUNCTION__, newkey); + + if (newkey == NULL) { + error("%s: newkey == NULL", __FUNCTION__); + return 0; + } + enc = &newkey->enc; + mac = &newkey->mac; + comp = &newkey->comp; + + buffer_init(&b); + /* Enc structure */ + buffer_put_cstring(&b, enc->name); + /* The cipher struct is constant and shared, you export pointer */ + buffer_append(&b, &enc->cipher, sizeof(enc->cipher)); + buffer_put_int(&b, enc->enabled); + buffer_put_int(&b, enc->block_size); + buffer_put_string(&b, enc->key, enc->key_len); + packet_get_keyiv(mode, enc->iv, enc->block_size); + buffer_put_string(&b, enc->iv, enc->block_size); + + /* Mac structure */ + buffer_put_cstring(&b, mac->name); + buffer_put_int(&b, mac->enabled); + buffer_put_string(&b, mac->key, mac->key_len); + + /* Comp structure */ + buffer_put_int(&b, comp->type); + buffer_put_int(&b, comp->enabled); + buffer_put_cstring(&b, comp->name); + + len = buffer_len(&b); + buf = xmalloc(len); + memcpy(buf, buffer_ptr(&b), len); + memset(buffer_ptr(&b), 0, len); + buffer_free(&b); + if (lenp != NULL) + *lenp = len; + if (blobp != NULL) + *blobp = buf; + return len; +} + +static void +mm_send_kex(Buffer *m, Kex *kex) +{ + buffer_put_string(m, kex->session_id, kex->session_id_len); + buffer_put_int(m, kex->we_need); + buffer_put_int(m, kex->hostkey_type); + buffer_put_int(m, kex->kex_type); + buffer_put_string(m, buffer_ptr(&kex->my), buffer_len(&kex->my)); + buffer_put_string(m, buffer_ptr(&kex->peer), buffer_len(&kex->peer)); + buffer_put_int(m, kex->flags); + buffer_put_cstring(m, kex->client_version_string); + buffer_put_cstring(m, kex->server_version_string); +} + +void +mm_send_keystate(struct monitor *pmonitor) +{ + Buffer m; + u_char *blob, *p; + u_int bloblen, plen; + + buffer_init(&m); + + if (!compat20) { + u_char iv[24]; + int ivlen; + + buffer_put_int(&m, packet_get_protocol_flags()); + + buffer_put_int(&m, packet_get_ssh1_cipher()); + + debug3("%s: Sending ssh1 IV", __FUNCTION__); + ivlen = packet_get_keyiv_len(MODE_OUT); + packet_get_keyiv(MODE_OUT, iv, ivlen); + buffer_put_string(&m, iv, ivlen); + ivlen = packet_get_keyiv_len(MODE_OUT); + packet_get_keyiv(MODE_IN, iv, ivlen); + buffer_put_string(&m, iv, ivlen); + goto skip; + } else { + /* Kex for rekeying */ + mm_send_kex(&m, *pmonitor->m_pkex); + } + + debug3("%s: Sending new keys: %p %p", + __FUNCTION__, newkeys[MODE_OUT], newkeys[MODE_IN]); + + /* Keys from Kex */ + if (!mm_newkeys_to_blob(MODE_OUT, &blob, &bloblen)) + fatal("%s: conversion of newkeys failed", __FUNCTION__); + + buffer_put_string(&m, blob, bloblen); + xfree(blob); + + if (!mm_newkeys_to_blob(MODE_IN, &blob, &bloblen)) + fatal("%s: conversion of newkeys failed", __FUNCTION__); + + buffer_put_string(&m, blob, bloblen); + xfree(blob); + + buffer_put_int(&m, packet_get_seqnr(MODE_OUT)); + buffer_put_int(&m, packet_get_seqnr(MODE_IN)); + + debug3("%s: New keys have been sent", __FUNCTION__); + skip: + /* More key context */ + plen = packet_get_keycontext(MODE_OUT, NULL); + p = xmalloc(plen+1); + packet_get_keycontext(MODE_OUT, p); + buffer_put_string(&m, p, plen); + xfree(p); + + plen = packet_get_keycontext(MODE_IN, NULL); + p = xmalloc(plen+1); + packet_get_keycontext(MODE_IN, p); + buffer_put_string(&m, p, plen); + xfree(p); + + /* Compression state */ + debug3("%s: Sending compression state", __FUNCTION__); + buffer_put_string(&m, &outgoing_stream, sizeof(outgoing_stream)); + buffer_put_string(&m, &incoming_stream, sizeof(incoming_stream)); + + /* Network I/O buffers */ + buffer_put_string(&m, buffer_ptr(&input), buffer_len(&input)); + buffer_put_string(&m, buffer_ptr(&output), buffer_len(&output)); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYEXPORT, &m); + debug3("%s: Finished sending state", __FUNCTION__); + + buffer_free(&m); +} + +int +mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) +{ + Buffer m; + u_char *p; + int success = 0; + + buffer_init(&m); + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PTY, &m); + + debug3("%s: waiting for MONITOR_ANS_PTY", __FUNCTION__); + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PTY, &m); + + success = buffer_get_int(&m); + if (success == 0) { + debug3("%s: pty alloc failed", __FUNCTION__); + buffer_free(&m); + return (0); + } + p = buffer_get_string(&m, NULL); + buffer_free(&m); + + strlcpy(namebuf, p, namebuflen); /* Possible truncation */ + xfree(p); + + *ptyfd = mm_receive_fd(pmonitor->m_recvfd); + *ttyfd = mm_receive_fd(pmonitor->m_recvfd); + + /* Success */ + return (1); +} + +void +mm_session_pty_cleanup2(void *session) +{ + Session *s = session; + Buffer m; + + if (s->ttyfd == -1) + return; + buffer_init(&m); + buffer_put_cstring(&m, s->tty); + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PTYCLEANUP, &m); + buffer_free(&m); + + /* closed dup'ed master */ + if (close(s->ptymaster) < 0) + error("close(s->ptymaster): %s", strerror(errno)); + + /* unlink pty from session */ + s->ttyfd = -1; +} + +#ifdef USE_PAM +void +mm_start_pam(char *user) +{ + Buffer m; + + debug3("%s entering", __FUNCTION__); + + buffer_init(&m); + buffer_put_cstring(&m, user); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_START, &m); + + buffer_free(&m); +} +#endif /* USE_PAM */ + +/* Request process termination */ + +void +mm_terminate(void) +{ + Buffer m; + + buffer_init(&m); + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_TERM, &m); + buffer_free(&m); +} + +int +mm_ssh1_session_key(BIGNUM *num) +{ + int rsafail; + Buffer m; + + buffer_init(&m); + buffer_put_bignum2(&m, num); + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SESSKEY, &m); + + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_SESSKEY, &m); + + rsafail = buffer_get_int(&m); + buffer_get_bignum2(&m, num); + + buffer_free(&m); + + return (rsafail); +} + +static void +mm_chall_setup(char **name, char **infotxt, u_int *numprompts, + char ***prompts, u_int **echo_on) +{ + *name = xstrdup(""); + *infotxt = xstrdup(""); + *numprompts = 1; + *prompts = xmalloc(*numprompts * sizeof(char*)); + *echo_on = xmalloc(*numprompts * sizeof(u_int)); + (*echo_on)[0] = 0; +} + +int +mm_bsdauth_query(void *ctx, char **name, char **infotxt, + u_int *numprompts, char ***prompts, u_int **echo_on) +{ + Buffer m; + int res; + char *challenge; + + debug3("%s: entering", __FUNCTION__); + + buffer_init(&m); + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_BSDAUTHQUERY, &m); + + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_BSDAUTHQUERY, + &m); + res = buffer_get_int(&m); + if (res == -1) { + debug3("%s: no challenge", __FUNCTION__); + buffer_free(&m); + return (-1); + } + + /* Get the challenge, and format the response */ + challenge = buffer_get_string(&m, NULL); + buffer_free(&m); + + mm_chall_setup(name, infotxt, numprompts, prompts, echo_on); + (*prompts)[0] = challenge; + + debug3("%s: received challenge: %s", __FUNCTION__, challenge); + + return (0); +} + +int +mm_bsdauth_respond(void *ctx, u_int numresponses, char **responses) +{ + Buffer m; + int authok; + + debug3("%s: entering", __FUNCTION__); + if (numresponses != 1) + return (-1); + + buffer_init(&m); + buffer_put_cstring(&m, responses[0]); + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_BSDAUTHRESPOND, &m); + + mm_request_receive_expect(pmonitor->m_recvfd, + MONITOR_ANS_BSDAUTHRESPOND, &m); + + authok = buffer_get_int(&m); + buffer_free(&m); + + return ((authok == 0) ? -1 : 0); +} + +int +mm_skey_query(void *ctx, char **name, char **infotxt, + u_int *numprompts, char ***prompts, u_int **echo_on) +{ + Buffer m; + int len, res; + char *p, *challenge; + + debug3("%s: entering", __FUNCTION__); + + buffer_init(&m); + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SKEYQUERY, &m); + + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_SKEYQUERY, + &m); + res = buffer_get_int(&m); + if (res == -1) { + debug3("%s: no challenge", __FUNCTION__); + buffer_free(&m); + return (-1); + } + + /* Get the challenge, and format the response */ + challenge = buffer_get_string(&m, NULL); + buffer_free(&m); + + debug3("%s: received challenge: %s", __FUNCTION__, challenge); + + mm_chall_setup(name, infotxt, numprompts, prompts, echo_on); + + len = strlen(challenge) + strlen(SKEY_PROMPT) + 1; + p = xmalloc(len); + strlcpy(p, challenge, len); + strlcat(p, SKEY_PROMPT, len); + (*prompts)[0] = p; + xfree(challenge); + + return (0); +} + +int +mm_skey_respond(void *ctx, u_int numresponses, char **responses) +{ + Buffer m; + int authok; + + debug3("%s: entering", __FUNCTION__); + if (numresponses != 1) + return (-1); + + buffer_init(&m); + buffer_put_cstring(&m, responses[0]); + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SKEYRESPOND, &m); + + mm_request_receive_expect(pmonitor->m_recvfd, + MONITOR_ANS_SKEYRESPOND, &m); + + authok = buffer_get_int(&m); + buffer_free(&m); + + return ((authok == 0) ? -1 : 0); +} + +void +mm_ssh1_session_id(u_char session_id[16]) +{ + Buffer m; + int i; + + debug3("%s entering", __FUNCTION__); + + buffer_init(&m); + for (i = 0; i < 16; i++) + buffer_put_char(&m, session_id[i]); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SESSID, &m); + buffer_free(&m); +} + +int +mm_auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey) +{ + Buffer m; + Key *key; + u_char *blob; + u_int blen; + int allowed = 0; + + debug3("%s entering", __FUNCTION__); + + buffer_init(&m); + buffer_put_bignum2(&m, client_n); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_RSAKEYALLOWED, &m); + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_RSAKEYALLOWED, &m); + + allowed = buffer_get_int(&m); + + if (allowed && rkey != NULL) { + blob = buffer_get_string(&m, &blen); + if ((key = key_from_blob(blob, blen)) == NULL) + fatal("%s: key_from_blob failed", __FUNCTION__); + *rkey = key; + xfree(blob); + } + mm_send_debug(&m); + buffer_free(&m); + + return (allowed); +} + +BIGNUM * +mm_auth_rsa_generate_challenge(Key *key) +{ + Buffer m; + BIGNUM *challenge; + u_char *blob; + u_int blen; + + debug3("%s entering", __FUNCTION__); + + if ((challenge = BN_new()) == NULL) + fatal("%s: BN_new failed", __FUNCTION__); + + key->type = KEY_RSA; /* XXX cheat for key_to_blob */ + if (key_to_blob(key, &blob, &blen) == 0) + fatal("%s: key_to_blob failed", __FUNCTION__); + key->type = KEY_RSA1; + + buffer_init(&m); + buffer_put_string(&m, blob, blen); + xfree(blob); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_RSACHALLENGE, &m); + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_RSACHALLENGE, &m); + + buffer_get_bignum2(&m, challenge); + buffer_free(&m); + + return (challenge); +} + +int +mm_auth_rsa_verify_response(Key *key, BIGNUM *p, u_char response[16]) +{ + Buffer m; + u_char *blob; + u_int blen; + int success = 0; + + debug3("%s entering", __FUNCTION__); + + key->type = KEY_RSA; /* XXX cheat for key_to_blob */ + if (key_to_blob(key, &blob, &blen) == 0) + fatal("%s: key_to_blob failed", __FUNCTION__); + key->type = KEY_RSA1; + + buffer_init(&m); + buffer_put_string(&m, blob, blen); + buffer_put_string(&m, response, 16); + xfree(blob); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_RSARESPONSE, &m); + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_RSARESPONSE, &m); + + success = buffer_get_int(&m); + buffer_free(&m); + + return (success); +} diff --git a/openssh/monitor_wrap.h b/openssh/monitor_wrap.h new file mode 100644 index 0000000..ce72124 --- /dev/null +++ b/openssh/monitor_wrap.h @@ -0,0 +1,92 @@ +/* $OpenBSD: monitor_wrap.h,v 1.5 2002/05/12 23:53:45 djm Exp $ */ + +/* + * Copyright 2002 Niels Provos + * 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. + */ + +#ifndef _MM_WRAP_H_ +#define _MM_WRAP_H_ +#include "key.h" +#include "buffer.h" + +extern int use_privsep; +#define PRIVSEP(x) (use_privsep ? mm_##x : x) + +enum mm_keytype {MM_NOKEY, MM_HOSTKEY, MM_USERKEY, MM_RSAHOSTKEY, MM_RSAUSERKEY}; + +struct monitor; +struct mm_master; +struct passwd; +struct Authctxt; + +DH *mm_choose_dh(int, int, int); +int mm_key_sign(Key *, u_char **, u_int *, u_char *, u_int); +void mm_inform_authserv(char *, char *); +struct passwd *mm_getpwnamallow(const char *); +char* mm_auth2_read_banner(void); +int mm_auth_password(struct Authctxt *, char *); +int mm_key_allowed(enum mm_keytype, char *, char *, Key *); +int mm_user_key_allowed(struct passwd *, Key *); +int mm_hostbased_key_allowed(struct passwd *, char *, char *, Key *); +int mm_auth_rhosts_rsa_key_allowed(struct passwd *, char *, char *, Key *); +int mm_key_verify(Key *, u_char *, u_int, u_char *, u_int); +int mm_auth_rsa_key_allowed(struct passwd *, BIGNUM *, Key **); +int mm_auth_rsa_verify_response(Key *, BIGNUM *, u_char *); +BIGNUM *mm_auth_rsa_generate_challenge(Key *); + +#ifdef USE_PAM +void mm_start_pam(char *); +#endif + +void mm_terminate(void); +int mm_pty_allocate(int *, int *, char *, int); +void mm_session_pty_cleanup2(void *); + +/* SSHv1 interfaces */ +void mm_ssh1_session_id(u_char *); +int mm_ssh1_session_key(BIGNUM *); + +/* Key export functions */ +struct Newkeys *mm_newkeys_from_blob(u_char *, int); +int mm_newkeys_to_blob(int, u_char **, u_int *); + +void monitor_apply_keystate(struct monitor *); +void mm_get_keystate(struct monitor *); +void mm_send_keystate(struct monitor*); + +/* bsdauth */ +int mm_bsdauth_query(void *, char **, char **, u_int *, char ***, u_int **); +int mm_bsdauth_respond(void *, u_int, char **); + +/* skey */ +int mm_skey_query(void *, char **, char **, u_int *, char ***, u_int **); +int mm_skey_respond(void *, u_int, char **); + +/* zlib allocation hooks */ + +void *mm_zalloc(struct mm_master *, u_int, u_int); +void mm_zfree(struct mm_master *, void *); +void mm_init_compression(struct mm_master *); + +#endif /* _MM_H_ */ diff --git a/openssh/myproposal.h b/openssh/myproposal.h index 1caf04a..62f5cfb 100644 --- a/openssh/myproposal.h +++ b/openssh/myproposal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: myproposal.h,v 1.13 2002/01/21 22:30:12 markus Exp $ */ +/* $OpenBSD: myproposal.h,v 1.14 2002/04/03 09:26:11 markus Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -27,7 +27,7 @@ #define KEX_DEFAULT_PK_ALG "ssh-rsa,ssh-dss" #define KEX_DEFAULT_ENCRYPT \ "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour," \ - "aes192-cbc,aes256-cbc" + "aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se" #define KEX_DEFAULT_MAC \ "hmac-md5,hmac-sha1,hmac-ripemd160," \ "hmac-ripemd160@openssh.com," \ diff --git a/openssh/nchan.c b/openssh/nchan.c index fc8e7f1..db38de6 100644 --- a/openssh/nchan.c +++ b/openssh/nchan.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: nchan.c,v 1.44 2002/01/21 23:27:10 markus Exp $"); +RCSID("$OpenBSD: nchan.c,v 1.45 2002/03/25 21:13:51 markus Exp $"); #include "ssh1.h" #include "ssh2.h" @@ -302,6 +302,7 @@ static void chan_rcvd_eof2(Channel *c) { debug("channel %d: rcvd eof", c->self); + c->flags |= CHAN_EOF_RCVD; if (c->ostate == CHAN_OUTPUT_OPEN) chan_set_ostate(c, CHAN_OUTPUT_WAIT_DRAIN); } @@ -330,6 +331,7 @@ chan_send_eof2(Channel *c) packet_start(SSH2_MSG_CHANNEL_EOF); packet_put_int(c->remote_id); packet_send(); + c->flags |= CHAN_EOF_SENT; break; default: error("channel %d: cannot send eof for istate %d", @@ -365,7 +367,8 @@ chan_rcvd_ieof(Channel *c) else chan_rcvd_ieof1(c); if (c->ostate == CHAN_OUTPUT_WAIT_DRAIN && - buffer_len(&c->output) == 0) + buffer_len(&c->output) == 0 && + !CHANNEL_EFD_OUTPUT_ACTIVE(c)) chan_obuf_empty(c); } void @@ -404,39 +407,30 @@ chan_is_dead(Channel *c, int send) debug("channel %d: is dead", c->self); return 1; } - /* - * we have to delay the close message if the efd (for stderr) is - * still active - */ - if (((c->extended_usage != CHAN_EXTENDED_IGNORE) && - buffer_len(&c->extended) > 0) -#if 0 - || ((c->extended_usage == CHAN_EXTENDED_READ) && - c->efd != -1) -#endif - ) { - debug2("channel %d: active efd: %d len %d type %s", - c->self, c->efd, buffer_len(&c->extended), - c->extended_usage==CHAN_EXTENDED_READ ? - "read": "write"); - } else { - if (!(c->flags & CHAN_CLOSE_SENT)) { - if (send) { - chan_send_close2(c); - } else { - /* channel would be dead if we sent a close */ - if (c->flags & CHAN_CLOSE_RCVD) { - debug("channel %d: almost dead", - c->self); - return 1; - } + if ((datafellows & SSH_BUG_EXTEOF) && + c->extended_usage == CHAN_EXTENDED_WRITE && + c->efd != -1 && + buffer_len(&c->extended) > 0) { + debug2("channel %d: active efd: %d len %d", + c->self, c->efd, buffer_len(&c->extended)); + return 0; + } + if (!(c->flags & CHAN_CLOSE_SENT)) { + if (send) { + chan_send_close2(c); + } else { + /* channel would be dead if we sent a close */ + if (c->flags & CHAN_CLOSE_RCVD) { + debug("channel %d: almost dead", + c->self); + return 1; } } - if ((c->flags & CHAN_CLOSE_SENT) && - (c->flags & CHAN_CLOSE_RCVD)) { - debug("channel %d: is dead", c->self); - return 1; - } + } + if ((c->flags & CHAN_CLOSE_SENT) && + (c->flags & CHAN_CLOSE_RCVD)) { + debug("channel %d: is dead", c->self); + return 1; } return 0; } diff --git a/openssh/openbsd-compat/bsd-arc4random.c b/openssh/openbsd-compat/bsd-arc4random.c index 4fcfc6e..25a559b 100644 --- a/openssh/openbsd-compat/bsd-arc4random.c +++ b/openssh/openbsd-compat/bsd-arc4random.c @@ -48,7 +48,7 @@ unsigned int arc4random(void) static int first_time = 1; if (rc4_ready <= 0) { - if (!first_time) + if (first_time) seed_rng(); first_time = 0; arc4random_stir(); diff --git a/openssh/openbsd-compat/bsd-cray.c b/openssh/openbsd-compat/bsd-cray.c index fa76641..b673d1f 100644 --- a/openssh/openbsd-compat/bsd-cray.c +++ b/openssh/openbsd-compat/bsd-cray.c @@ -1,14 +1,41 @@ -/* - * XXX: license? - */ - -/* - * The modules contains code to support cray t3e and sv1 computers. - * It is here to minimize the modifcations to the openssh base code. +/* + * $Id$ + * + * bsd-cray.c + * + * Copyright (c) 2002, Cray Inc. (Wendy Palm ) + * Significant portions provided by + * Wayne Schroeder, SDSC + * William Jones, UTexas + * + * 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. + * + * Created: Apr 22 16.34:00 2002 wp + * + * This file contains functions required for proper execution + * on UNICOS systems. + * */ #ifdef _CRAY - #include #include #include diff --git a/openssh/openbsd-compat/bsd-cray.h b/openssh/openbsd-compat/bsd-cray.h index ef36652..8a33113 100644 --- a/openssh/openbsd-compat/bsd-cray.h +++ b/openssh/openbsd-compat/bsd-cray.h @@ -1,3 +1,39 @@ +/* + * $Id$ + * + * bsd-cray.h + * + * Copyright (c) 2002, Cray Inc. (Wendy Palm ) + * Significant portions provided by + * Wayne Schroeder, SDSC + * William Jones, UTexas + * + * 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. + * + * Created: Apr 22 16.34:00 2002 wp + * + * This file contains functions required for proper execution + * on UNICOS systems. + * + */ #ifndef _BSD_CRAY_H #define _BSD_CRAY_H diff --git a/openssh/openbsd-compat/bsd-cygwin_util.c b/openssh/openbsd-compat/bsd-cygwin_util.c index f56ad7c..6f4f316 100644 --- a/openssh/openbsd-compat/bsd-cygwin_util.c +++ b/openssh/openbsd-compat/bsd-cygwin_util.c @@ -1,11 +1,27 @@ /* - * * cygwin_util.c * - * Author: Corinna Vinschen + * Copyright (c) 2000, 2001, Corinna Vinschen + * + * 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. * - * Copyright (c) 2000 Corinna Vinschen , Duisburg, Germany - * All rights reserved + * 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. * * Created: Sat Sep 02 12:17:00 2000 cv * diff --git a/openssh/openbsd-compat/bsd-cygwin_util.h b/openssh/openbsd-compat/bsd-cygwin_util.h index a87aeee..8ff590c 100644 --- a/openssh/openbsd-compat/bsd-cygwin_util.h +++ b/openssh/openbsd-compat/bsd-cygwin_util.h @@ -1,11 +1,29 @@ +/* $Id$ */ + /* - * * cygwin_util.c * - * Author: Corinna Vinschen + * Copyright (c) 2000, 2001, Corinna Vinschen * - * Copyright (c) 2000 Corinna Vinschen , Duisburg, Germany - * 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. * * Created: Sat Sep 02 12:17:00 2000 cv * @@ -13,8 +31,6 @@ * binary mode on Windows systems. */ -/* $Id$ */ - #ifndef _BSD_CYGWIN_UTIL_H #define _BSD_CYGWIN_UTIL_H diff --git a/openssh/openbsd-compat/bsd-misc.c b/openssh/openbsd-compat/bsd-misc.c index d87d562..dae9012 100644 --- a/openssh/openbsd-compat/bsd-misc.c +++ b/openssh/openbsd-compat/bsd-misc.c @@ -99,3 +99,22 @@ int utimes(char *filename, struct timeval *tvp) return(utime(filename, &ub)); } #endif + +#ifndef HAVE_TRUNCATE +int truncate (const char *path, off_t length) +{ + int fd, ret, saverrno; + + fd = open(path, O_WRONLY); + if (fd < 0) + return -1; + + ret = ftruncate(fd, length); + saverrno = errno; + (void) close (fd); + if (ret == -1) + errno = saverrno; + return(ret); +} +#endif /* HAVE_TRUNCATE */ + diff --git a/openssh/openbsd-compat/bsd-misc.h b/openssh/openbsd-compat/bsd-misc.h index 3a85526..5872a5b 100644 --- a/openssh/openbsd-compat/bsd-misc.h +++ b/openssh/openbsd-compat/bsd-misc.h @@ -72,5 +72,8 @@ struct timeval { int utimes(char *filename, struct timeval *tvp); #endif /* HAVE_UTIMES */ +#ifndef HAVE_TRUNCATE +int truncate (const char *path, off_t length); +#endif /* HAVE_TRUNCATE */ #endif /* _BSD_MISC_H */ diff --git a/openssh/openbsd-compat/fake-queue.h b/openssh/openbsd-compat/fake-queue.h index c85bb24..176fe31 100644 --- a/openssh/openbsd-compat/fake-queue.h +++ b/openssh/openbsd-compat/fake-queue.h @@ -36,8 +36,89 @@ * @(#)queue.h 8.5 (Berkeley) 8/20/94 */ -#ifndef _SYS_QUEUE_H_ -#define _SYS_QUEUE_H_ +#ifndef _FAKE_QUEUE_H_ +#define _FAKE_QUEUE_H_ + +/* + * Ignore all since older platforms have broken/incomplete + * that are too hard to work around. + */ +#undef SLIST_HEAD +#undef SLIST_HEAD_INITIALIZER +#undef SLIST_ENTRY +#undef SLIST_FIRST +#undef SLIST_END +#undef SLIST_EMPTY +#undef SLIST_NEXT +#undef SLIST_FOREACH +#undef SLIST_INIT +#undef SLIST_INSERT_AFTER +#undef SLIST_INSERT_HEAD +#undef SLIST_REMOVE_HEAD +#undef SLIST_REMOVE +#undef LIST_HEAD +#undef LIST_HEAD_INITIALIZER +#undef LIST_ENTRY +#undef LIST_FIRST +#undef LIST_END +#undef LIST_EMPTY +#undef LIST_NEXT +#undef LIST_FOREACH +#undef LIST_INIT +#undef LIST_INSERT_AFTER +#undef LIST_INSERT_BEFORE +#undef LIST_INSERT_HEAD +#undef LIST_REMOVE +#undef LIST_REPLACE +#undef SIMPLEQ_HEAD +#undef SIMPLEQ_HEAD_INITIALIZER +#undef SIMPLEQ_ENTRY +#undef SIMPLEQ_FIRST +#undef SIMPLEQ_END +#undef SIMPLEQ_EMPTY +#undef SIMPLEQ_NEXT +#undef SIMPLEQ_FOREACH +#undef SIMPLEQ_INIT +#undef SIMPLEQ_INSERT_HEAD +#undef SIMPLEQ_INSERT_TAIL +#undef SIMPLEQ_INSERT_AFTER +#undef SIMPLEQ_REMOVE_HEAD +#undef TAILQ_HEAD +#undef TAILQ_HEAD_INITIALIZER +#undef TAILQ_ENTRY +#undef TAILQ_FIRST +#undef TAILQ_END +#undef TAILQ_NEXT +#undef TAILQ_LAST +#undef TAILQ_PREV +#undef TAILQ_EMPTY +#undef TAILQ_FOREACH +#undef TAILQ_FOREACH_REVERSE +#undef TAILQ_INIT +#undef TAILQ_INSERT_HEAD +#undef TAILQ_INSERT_TAIL +#undef TAILQ_INSERT_AFTER +#undef TAILQ_INSERT_BEFORE +#undef TAILQ_REMOVE +#undef TAILQ_REPLACE +#undef CIRCLEQ_HEAD +#undef CIRCLEQ_HEAD_INITIALIZER +#undef CIRCLEQ_ENTRY +#undef CIRCLEQ_FIRST +#undef CIRCLEQ_LAST +#undef CIRCLEQ_END +#undef CIRCLEQ_NEXT +#undef CIRCLEQ_PREV +#undef CIRCLEQ_EMPTY +#undef CIRCLEQ_FOREACH +#undef CIRCLEQ_FOREACH_REVERSE +#undef CIRCLEQ_INIT +#undef CIRCLEQ_INSERT_AFTER +#undef CIRCLEQ_INSERT_BEFORE +#undef CIRCLEQ_INSERT_HEAD +#undef CIRCLEQ_INSERT_TAIL +#undef CIRCLEQ_REMOVE +#undef CIRCLEQ_REPLACE /* * This file defines five types of data structures: singly-linked lists, @@ -500,4 +581,4 @@ struct { \ (elm2)->field.cqe_prev->field.cqe_next = (elm2); \ } while (0) -#endif /* !_SYS_QUEUE_H_ */ +#endif /* !_FAKE_QUEUE_H_ */ diff --git a/openssh/openbsd-compat/fake-socket.h b/openssh/openbsd-compat/fake-socket.h index 79f8ed4..540cfea 100644 --- a/openssh/openbsd-compat/fake-socket.h +++ b/openssh/openbsd-compat/fake-socket.h @@ -3,7 +3,7 @@ #ifndef _FAKE_SOCKET_H #define _FAKE_SOCKET_H -#include "config.h" +#include "includes.h" #include "sys/types.h" #ifndef HAVE_STRUCT_SOCKADDR_STORAGE diff --git a/openssh/openbsd-compat/inet_aton.c b/openssh/openbsd-compat/inet_aton.c index 18e31e7..1fc001d 100644 --- a/openssh/openbsd-compat/inet_aton.c +++ b/openssh/openbsd-compat/inet_aton.c @@ -55,7 +55,7 @@ * --Copyright-- */ -#include "config.h" +#include "includes.h" #if !defined(HAVE_INET_ATON) diff --git a/openssh/openbsd-compat/readpassphrase.c b/openssh/openbsd-compat/readpassphrase.c index 7687710..8c2f5f8 100644 --- a/openssh/openbsd-compat/readpassphrase.c +++ b/openssh/openbsd-compat/readpassphrase.c @@ -165,7 +165,6 @@ restart: errno = save_errno; return(nr == -1 ? NULL : buf); } -#endif /* HAVE_READPASSPHRASE */ #if 0 char * @@ -179,6 +178,6 @@ getpass(const char *prompt) static void handler(int s) { - signo = s; } +#endif /* HAVE_READPASSPHRASE */ diff --git a/openssh/openbsd-compat/tree.h b/openssh/openbsd-compat/tree.h new file mode 100644 index 0000000..30b4a85 --- /dev/null +++ b/openssh/openbsd-compat/tree.h @@ -0,0 +1,667 @@ +/* + * Copyright 2002 Niels Provos + * 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. + */ + +#ifndef _SYS_TREE_H_ +#define _SYS_TREE_H_ + +/* + * This file defines data structures for different types of trees: + * splay trees and red-black trees. + * + * A splay tree is a self-organizing data structure. Every operation + * on the tree causes a splay to happen. The splay moves the requested + * node to the root of the tree and partly rebalances it. + * + * This has the benefit that request locality causes faster lookups as + * the requested nodes move to the top of the tree. On the other hand, + * every lookup causes memory writes. + * + * The Balance Theorem bounds the total access time for m operations + * and n inserts on an initially empty tree as O((m + n)lg n). The + * amortized cost for a sequence of m accesses to a splay tree is O(lg n); + * + * A red-black tree is a binary search tree with the node color as an + * extra attribute. It fulfills a set of conditions: + * - every search path from the root to a leaf consists of the + * same number of black nodes, + * - each red node (except for the root) has a black parent, + * - each leaf node is black. + * + * Every operation on a red-black tree is bounded as O(lg n). + * The maximum height of a red-black tree is 2lg (n+1). + */ + +#define SPLAY_HEAD(name, type) \ +struct name { \ + struct type *sph_root; /* root of the tree */ \ +} + +#define SPLAY_INITIALIZER(root) \ + { NULL } + +#define SPLAY_INIT(root) do { \ + (root)->sph_root = NULL; \ +} while (0) + +#define SPLAY_ENTRY(type) \ +struct { \ + struct type *spe_left; /* left element */ \ + struct type *spe_right; /* right element */ \ +} + +#define SPLAY_LEFT(elm, field) (elm)->field.spe_left +#define SPLAY_RIGHT(elm, field) (elm)->field.spe_right +#define SPLAY_ROOT(head) (head)->sph_root +#define SPLAY_EMPTY(head) (SPLAY_ROOT(head) == NULL) + +/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */ +#define SPLAY_ROTATE_RIGHT(head, tmp, field) do { \ + SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \ + SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ + (head)->sph_root = tmp; \ +} while (0) + +#define SPLAY_ROTATE_LEFT(head, tmp, field) do { \ + SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \ + SPLAY_LEFT(tmp, field) = (head)->sph_root; \ + (head)->sph_root = tmp; \ +} while (0) + +#define SPLAY_LINKLEFT(head, tmp, field) do { \ + SPLAY_LEFT(tmp, field) = (head)->sph_root; \ + tmp = (head)->sph_root; \ + (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \ +} while (0) + +#define SPLAY_LINKRIGHT(head, tmp, field) do { \ + SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ + tmp = (head)->sph_root; \ + (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \ +} while (0) + +#define SPLAY_ASSEMBLE(head, node, left, right, field) do { \ + SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \ + SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\ + SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \ + SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \ +} while (0) + +/* Generates prototypes and inline functions */ + +#define SPLAY_PROTOTYPE(name, type, field, cmp) \ +void name##_SPLAY(struct name *, struct type *); \ +void name##_SPLAY_MINMAX(struct name *, int); \ + \ +static __inline void \ +name##_SPLAY_INSERT(struct name *head, struct type *elm) \ +{ \ + if (SPLAY_EMPTY(head)) { \ + SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \ + } else { \ + int __comp; \ + name##_SPLAY(head, elm); \ + __comp = (cmp)(elm, (head)->sph_root); \ + if(__comp < 0) { \ + SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);\ + SPLAY_RIGHT(elm, field) = (head)->sph_root; \ + SPLAY_LEFT((head)->sph_root, field) = NULL; \ + } else if (__comp > 0) { \ + SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);\ + SPLAY_LEFT(elm, field) = (head)->sph_root; \ + SPLAY_RIGHT((head)->sph_root, field) = NULL; \ + } else \ + return; \ + } \ + (head)->sph_root = (elm); \ +} \ + \ +static __inline void \ +name##_SPLAY_REMOVE(struct name *head, struct type *elm) \ +{ \ + struct type *__tmp; \ + if (SPLAY_EMPTY(head)) \ + return; \ + name##_SPLAY(head, elm); \ + if ((cmp)(elm, (head)->sph_root) == 0) { \ + if (SPLAY_LEFT((head)->sph_root, field) == NULL) { \ + (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);\ + } else { \ + __tmp = SPLAY_RIGHT((head)->sph_root, field); \ + (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);\ + name##_SPLAY(head, elm); \ + SPLAY_RIGHT((head)->sph_root, field) = __tmp; \ + } \ + } \ +} \ + \ +/* Finds the node with the same key as elm */ \ +static __inline struct type * \ +name##_SPLAY_FIND(struct name *head, struct type *elm) \ +{ \ + if (SPLAY_EMPTY(head)) \ + return(NULL); \ + name##_SPLAY(head, elm); \ + if ((cmp)(elm, (head)->sph_root) == 0) \ + return (head->sph_root); \ + return (NULL); \ +} \ + \ +static __inline struct type * \ +name##_SPLAY_NEXT(struct name *head, struct type *elm) \ +{ \ + name##_SPLAY(head, elm); \ + if (SPLAY_RIGHT(elm, field) != NULL) { \ + elm = SPLAY_RIGHT(elm, field); \ + while (SPLAY_LEFT(elm, field) != NULL) { \ + elm = SPLAY_LEFT(elm, field); \ + } \ + } else \ + elm = NULL; \ + return (elm); \ +} \ + \ +static __inline struct type * \ +name##_SPLAY_MIN_MAX(struct name *head, int val) \ +{ \ + name##_SPLAY_MINMAX(head, val); \ + return (SPLAY_ROOT(head)); \ +} + +/* Main splay operation. + * Moves node close to the key of elm to top + */ +#define SPLAY_GENERATE(name, type, field, cmp) \ +void name##_SPLAY(struct name *head, struct type *elm) \ +{ \ + struct type __node, *__left, *__right, *__tmp; \ + int __comp; \ +\ + SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\ + __left = __right = &__node; \ +\ + while ((__comp = (cmp)(elm, (head)->sph_root))) { \ + if (__comp < 0) { \ + __tmp = SPLAY_LEFT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if ((cmp)(elm, __tmp) < 0){ \ + SPLAY_ROTATE_RIGHT(head, __tmp, field); \ + if (SPLAY_LEFT((head)->sph_root, field) == NULL)\ + break; \ + } \ + SPLAY_LINKLEFT(head, __right, field); \ + } else if (__comp > 0) { \ + __tmp = SPLAY_RIGHT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if ((cmp)(elm, __tmp) > 0){ \ + SPLAY_ROTATE_LEFT(head, __tmp, field); \ + if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\ + break; \ + } \ + SPLAY_LINKRIGHT(head, __left, field); \ + } \ + } \ + SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ +} \ + \ +/* Splay with either the minimum or the maximum element \ + * Used to find minimum or maximum element in tree. \ + */ \ +void name##_SPLAY_MINMAX(struct name *head, int __comp) \ +{ \ + struct type __node, *__left, *__right, *__tmp; \ +\ + SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\ + __left = __right = &__node; \ +\ + while (1) { \ + if (__comp < 0) { \ + __tmp = SPLAY_LEFT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if (__comp < 0){ \ + SPLAY_ROTATE_RIGHT(head, __tmp, field); \ + if (SPLAY_LEFT((head)->sph_root, field) == NULL)\ + break; \ + } \ + SPLAY_LINKLEFT(head, __right, field); \ + } else if (__comp > 0) { \ + __tmp = SPLAY_RIGHT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if (__comp > 0) { \ + SPLAY_ROTATE_LEFT(head, __tmp, field); \ + if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\ + break; \ + } \ + SPLAY_LINKRIGHT(head, __left, field); \ + } \ + } \ + SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ +} + +#define SPLAY_NEGINF -1 +#define SPLAY_INF 1 + +#define SPLAY_INSERT(name, x, y) name##_SPLAY_INSERT(x, y) +#define SPLAY_REMOVE(name, x, y) name##_SPLAY_REMOVE(x, y) +#define SPLAY_FIND(name, x, y) name##_SPLAY_FIND(x, y) +#define SPLAY_NEXT(name, x, y) name##_SPLAY_NEXT(x, y) +#define SPLAY_MIN(name, x) (SPLAY_EMPTY(x) ? NULL \ + : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF)) +#define SPLAY_MAX(name, x) (SPLAY_EMPTY(x) ? NULL \ + : name##_SPLAY_MIN_MAX(x, SPLAY_INF)) + +#define SPLAY_FOREACH(x, name, head) \ + for ((x) = SPLAY_MIN(name, head); \ + (x) != NULL; \ + (x) = SPLAY_NEXT(name, head, x)) + +/* Macros that define a red-back tree */ +#define RB_HEAD(name, type) \ +struct name { \ + struct type *rbh_root; /* root of the tree */ \ +} + +#define RB_INITIALIZER(root) \ + { NULL } + +#define RB_INIT(root) do { \ + (root)->rbh_root = NULL; \ +} while (0) + +#define RB_BLACK 0 +#define RB_RED 1 +#define RB_ENTRY(type) \ +struct { \ + struct type *rbe_left; /* left element */ \ + struct type *rbe_right; /* right element */ \ + struct type *rbe_parent; /* parent element */ \ + int rbe_color; /* node color */ \ +} + +#define RB_LEFT(elm, field) (elm)->field.rbe_left +#define RB_RIGHT(elm, field) (elm)->field.rbe_right +#define RB_PARENT(elm, field) (elm)->field.rbe_parent +#define RB_COLOR(elm, field) (elm)->field.rbe_color +#define RB_ROOT(head) (head)->rbh_root +#define RB_EMPTY(head) (RB_ROOT(head) == NULL) + +#define RB_SET(elm, parent, field) do { \ + RB_PARENT(elm, field) = parent; \ + RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \ + RB_COLOR(elm, field) = RB_RED; \ +} while (0) + +#define RB_SET_BLACKRED(black, red, field) do { \ + RB_COLOR(black, field) = RB_BLACK; \ + RB_COLOR(red, field) = RB_RED; \ +} while (0) + +#ifndef RB_AUGMENT +#define RB_AUGMENT(x) +#endif + +#define RB_ROTATE_LEFT(head, elm, tmp, field) do { \ + (tmp) = RB_RIGHT(elm, field); \ + if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field))) { \ + RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \ + } \ + RB_AUGMENT(elm); \ + if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \ + if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ + RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ + else \ + RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ + RB_AUGMENT(RB_PARENT(elm, field)); \ + } else \ + (head)->rbh_root = (tmp); \ + RB_LEFT(tmp, field) = (elm); \ + RB_PARENT(elm, field) = (tmp); \ + RB_AUGMENT(tmp); \ +} while (0) + +#define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \ + (tmp) = RB_LEFT(elm, field); \ + if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field))) { \ + RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \ + } \ + RB_AUGMENT(elm); \ + if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \ + if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ + RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ + else \ + RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ + RB_AUGMENT(RB_PARENT(elm, field)); \ + } else \ + (head)->rbh_root = (tmp); \ + RB_RIGHT(tmp, field) = (elm); \ + RB_PARENT(elm, field) = (tmp); \ + RB_AUGMENT(tmp); \ +} while (0) + +/* Generates prototypes and inline functions */ +#define RB_PROTOTYPE(name, type, field, cmp) \ +void name##_RB_INSERT_COLOR(struct name *, struct type *); \ +void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\ +void name##_RB_REMOVE(struct name *, struct type *); \ +struct type *name##_RB_INSERT(struct name *, struct type *); \ +struct type *name##_RB_FIND(struct name *, struct type *); \ +struct type *name##_RB_NEXT(struct name *, struct type *); \ +struct type *name##_RB_MINMAX(struct name *, int); \ + \ + +/* Main rb operation. + * Moves node close to the key of elm to top + */ +#define RB_GENERATE(name, type, field, cmp) \ +void \ +name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \ +{ \ + struct type *parent, *gparent, *tmp; \ + while ((parent = RB_PARENT(elm, field)) && \ + RB_COLOR(parent, field) == RB_RED) { \ + gparent = RB_PARENT(parent, field); \ + if (parent == RB_LEFT(gparent, field)) { \ + tmp = RB_RIGHT(gparent, field); \ + if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ + RB_COLOR(tmp, field) = RB_BLACK; \ + RB_SET_BLACKRED(parent, gparent, field);\ + elm = gparent; \ + continue; \ + } \ + if (RB_RIGHT(parent, field) == elm) { \ + RB_ROTATE_LEFT(head, parent, tmp, field);\ + tmp = parent; \ + parent = elm; \ + elm = tmp; \ + } \ + RB_SET_BLACKRED(parent, gparent, field); \ + RB_ROTATE_RIGHT(head, gparent, tmp, field); \ + } else { \ + tmp = RB_LEFT(gparent, field); \ + if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ + RB_COLOR(tmp, field) = RB_BLACK; \ + RB_SET_BLACKRED(parent, gparent, field);\ + elm = gparent; \ + continue; \ + } \ + if (RB_LEFT(parent, field) == elm) { \ + RB_ROTATE_RIGHT(head, parent, tmp, field);\ + tmp = parent; \ + parent = elm; \ + elm = tmp; \ + } \ + RB_SET_BLACKRED(parent, gparent, field); \ + RB_ROTATE_LEFT(head, gparent, tmp, field); \ + } \ + } \ + RB_COLOR(head->rbh_root, field) = RB_BLACK; \ +} \ + \ +void \ +name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \ +{ \ + struct type *tmp; \ + while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \ + elm != RB_ROOT(head)) { \ + if (RB_LEFT(parent, field) == elm) { \ + tmp = RB_RIGHT(parent, field); \ + if (RB_COLOR(tmp, field) == RB_RED) { \ + RB_SET_BLACKRED(tmp, parent, field); \ + RB_ROTATE_LEFT(head, parent, tmp, field);\ + tmp = RB_RIGHT(parent, field); \ + } \ + if ((RB_LEFT(tmp, field) == NULL || \ + RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\ + (RB_RIGHT(tmp, field) == NULL || \ + RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\ + RB_COLOR(tmp, field) = RB_RED; \ + elm = parent; \ + parent = RB_PARENT(elm, field); \ + } else { \ + if (RB_RIGHT(tmp, field) == NULL || \ + RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\ + struct type *oleft; \ + if ((oleft = RB_LEFT(tmp, field)))\ + RB_COLOR(oleft, field) = RB_BLACK;\ + RB_COLOR(tmp, field) = RB_RED; \ + RB_ROTATE_RIGHT(head, tmp, oleft, field);\ + tmp = RB_RIGHT(parent, field); \ + } \ + RB_COLOR(tmp, field) = RB_COLOR(parent, field);\ + RB_COLOR(parent, field) = RB_BLACK; \ + if (RB_RIGHT(tmp, field)) \ + RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;\ + RB_ROTATE_LEFT(head, parent, tmp, field);\ + elm = RB_ROOT(head); \ + break; \ + } \ + } else { \ + tmp = RB_LEFT(parent, field); \ + if (RB_COLOR(tmp, field) == RB_RED) { \ + RB_SET_BLACKRED(tmp, parent, field); \ + RB_ROTATE_RIGHT(head, parent, tmp, field);\ + tmp = RB_LEFT(parent, field); \ + } \ + if ((RB_LEFT(tmp, field) == NULL || \ + RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\ + (RB_RIGHT(tmp, field) == NULL || \ + RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\ + RB_COLOR(tmp, field) = RB_RED; \ + elm = parent; \ + parent = RB_PARENT(elm, field); \ + } else { \ + if (RB_LEFT(tmp, field) == NULL || \ + RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\ + struct type *oright; \ + if ((oright = RB_RIGHT(tmp, field)))\ + RB_COLOR(oright, field) = RB_BLACK;\ + RB_COLOR(tmp, field) = RB_RED; \ + RB_ROTATE_LEFT(head, tmp, oright, field);\ + tmp = RB_LEFT(parent, field); \ + } \ + RB_COLOR(tmp, field) = RB_COLOR(parent, field);\ + RB_COLOR(parent, field) = RB_BLACK; \ + if (RB_LEFT(tmp, field)) \ + RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;\ + RB_ROTATE_RIGHT(head, parent, tmp, field);\ + elm = RB_ROOT(head); \ + break; \ + } \ + } \ + } \ + if (elm) \ + RB_COLOR(elm, field) = RB_BLACK; \ +} \ + \ +void \ +name##_RB_REMOVE(struct name *head, struct type *elm) \ +{ \ + struct type *child, *parent; \ + int color; \ + if (RB_LEFT(elm, field) == NULL) \ + child = RB_RIGHT(elm, field); \ + else if (RB_RIGHT(elm, field) == NULL) \ + child = RB_LEFT(elm, field); \ + else { \ + struct type *old = elm, *left; \ + elm = RB_RIGHT(elm, field); \ + while ((left = RB_LEFT(elm, field))) \ + elm = left; \ + child = RB_RIGHT(elm, field); \ + parent = RB_PARENT(elm, field); \ + color = RB_COLOR(elm, field); \ + if (child) \ + RB_PARENT(child, field) = parent; \ + if (parent) { \ + if (RB_LEFT(parent, field) == elm) \ + RB_LEFT(parent, field) = child; \ + else \ + RB_RIGHT(parent, field) = child; \ + RB_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = child; \ + if (RB_PARENT(elm, field) == old) \ + parent = elm; \ + (elm)->field = (old)->field; \ + if (RB_PARENT(old, field)) { \ + if (RB_LEFT(RB_PARENT(old, field), field) == old)\ + RB_LEFT(RB_PARENT(old, field), field) = elm;\ + else \ + RB_RIGHT(RB_PARENT(old, field), field) = elm;\ + RB_AUGMENT(RB_PARENT(old, field)); \ + } else \ + RB_ROOT(head) = elm; \ + RB_PARENT(RB_LEFT(old, field), field) = elm; \ + if (RB_RIGHT(old, field)) \ + RB_PARENT(RB_RIGHT(old, field), field) = elm; \ + if (parent) { \ + left = parent; \ + do { \ + RB_AUGMENT(left); \ + } while ((left = RB_PARENT(left, field))); \ + } \ + goto color; \ + } \ + parent = RB_PARENT(elm, field); \ + color = RB_COLOR(elm, field); \ + if (child) \ + RB_PARENT(child, field) = parent; \ + if (parent) { \ + if (RB_LEFT(parent, field) == elm) \ + RB_LEFT(parent, field) = child; \ + else \ + RB_RIGHT(parent, field) = child; \ + RB_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = child; \ +color: \ + if (color == RB_BLACK) \ + name##_RB_REMOVE_COLOR(head, parent, child); \ +} \ + \ +/* Inserts a node into the RB tree */ \ +struct type * \ +name##_RB_INSERT(struct name *head, struct type *elm) \ +{ \ + struct type *tmp; \ + struct type *parent = NULL; \ + int comp = 0; \ + tmp = RB_ROOT(head); \ + while (tmp) { \ + parent = tmp; \ + comp = (cmp)(elm, parent); \ + if (comp < 0) \ + tmp = RB_LEFT(tmp, field); \ + else if (comp > 0) \ + tmp = RB_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + RB_SET(elm, parent, field); \ + if (parent != NULL) { \ + if (comp < 0) \ + RB_LEFT(parent, field) = elm; \ + else \ + RB_RIGHT(parent, field) = elm; \ + RB_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = elm; \ + name##_RB_INSERT_COLOR(head, elm); \ + return (NULL); \ +} \ + \ +/* Finds the node with the same key as elm */ \ +struct type * \ +name##_RB_FIND(struct name *head, struct type *elm) \ +{ \ + struct type *tmp = RB_ROOT(head); \ + int comp; \ + while (tmp) { \ + comp = cmp(elm, tmp); \ + if (comp < 0) \ + tmp = RB_LEFT(tmp, field); \ + else if (comp > 0) \ + tmp = RB_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + return (NULL); \ +} \ + \ +struct type * \ +name##_RB_NEXT(struct name *head, struct type *elm) \ +{ \ + if (RB_RIGHT(elm, field)) { \ + elm = RB_RIGHT(elm, field); \ + while (RB_LEFT(elm, field)) \ + elm = RB_LEFT(elm, field); \ + } else { \ + if (RB_PARENT(elm, field) && \ + (elm == RB_LEFT(RB_PARENT(elm, field), field))) \ + elm = RB_PARENT(elm, field); \ + else { \ + while (RB_PARENT(elm, field) && \ + (elm == RB_RIGHT(RB_PARENT(elm, field), field)))\ + elm = RB_PARENT(elm, field); \ + elm = RB_PARENT(elm, field); \ + } \ + } \ + return (elm); \ +} \ + \ +struct type * \ +name##_RB_MINMAX(struct name *head, int val) \ +{ \ + struct type *tmp = RB_ROOT(head); \ + struct type *parent = NULL; \ + while (tmp) { \ + parent = tmp; \ + if (val < 0) \ + tmp = RB_LEFT(tmp, field); \ + else \ + tmp = RB_RIGHT(tmp, field); \ + } \ + return (parent); \ +} + +#define RB_NEGINF -1 +#define RB_INF 1 + +#define RB_INSERT(name, x, y) name##_RB_INSERT(x, y) +#define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y) +#define RB_FIND(name, x, y) name##_RB_FIND(x, y) +#define RB_NEXT(name, x, y) name##_RB_NEXT(x, y) +#define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF) +#define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF) + +#define RB_FOREACH(x, name, head) \ + for ((x) = RB_MIN(name, head); \ + (x) != NULL; \ + (x) = name##_RB_NEXT(head, x)) + +#endif /* _SYS_TREE_H_ */ diff --git a/openssh/packet.c b/openssh/packet.c index b9e0de5..c298013 100644 --- a/openssh/packet.c +++ b/openssh/packet.c @@ -37,7 +37,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: packet.c,v 1.90 2002/02/27 21:23:13 stevesk Exp $"); +RCSID("$OpenBSD: packet.c,v 1.93 2002/03/24 16:01:13 markus Exp $"); #include "xmalloc.h" #include "buffer.h" @@ -86,10 +86,10 @@ static CipherContext receive_context; static CipherContext send_context; /* Buffer for raw input data from the socket. */ -static Buffer input; +Buffer input; /* Buffer for raw output data going to the socket. */ -static Buffer output; +Buffer output; /* Buffer for the partial outgoing packet being constructed. */ static Buffer outgoing_packet; @@ -115,6 +115,8 @@ static int interactive_mode = 0; /* Session key information for Encryption and MAC */ Newkeys *newkeys[MODE_MAX]; +static u_int32_t read_seqnr = 0; +static u_int32_t send_seqnr = 0; /* roundup current message to extra_pad bytes */ static u_char extra_pad = 0; @@ -171,6 +173,99 @@ packet_connection_is_on_socket(void) return 1; } +/* + * Exports an IV from the CipherContext required to export the key + * state back from the unprivileged child to the privileged parent + * process. + */ + +void +packet_get_keyiv(int mode, u_char *iv, u_int len) +{ + CipherContext *cc; + + if (mode == MODE_OUT) + cc = &send_context; + else + cc = &receive_context; + + cipher_get_keyiv(cc, iv, len); +} + +int +packet_get_keycontext(int mode, u_char *dat) +{ + CipherContext *cc; + + if (mode == MODE_OUT) + cc = &send_context; + else + cc = &receive_context; + + return (cipher_get_keycontext(cc, dat)); +} + +void +packet_set_keycontext(int mode, u_char *dat) +{ + CipherContext *cc; + + if (mode == MODE_OUT) + cc = &send_context; + else + cc = &receive_context; + + cipher_set_keycontext(cc, dat); +} + +int +packet_get_keyiv_len(int mode) +{ + CipherContext *cc; + + if (mode == MODE_OUT) + cc = &send_context; + else + cc = &receive_context; + + return (cipher_get_keyiv_len(cc)); +} +void +packet_set_iv(int mode, u_char *dat) +{ + CipherContext *cc; + + if (mode == MODE_OUT) + cc = &send_context; + else + cc = &receive_context; + + cipher_set_keyiv(cc, dat); +} +int +packet_get_ssh1_cipher() +{ + return (cipher_get_number(receive_context.cipher)); +} + + +u_int32_t +packet_get_seqnr(int mode) +{ + return (mode == MODE_IN ? read_seqnr : send_seqnr); +} + +void +packet_set_seqnr(int mode, u_int32_t seqnr) +{ + if (mode == MODE_IN) + read_seqnr = seqnr; + else if (mode == MODE_OUT) + send_seqnr = seqnr; + else + fatal("%s: bad mode %d", __FUNCTION__, mode); +} + /* returns 1 if connection is via ipv4 */ int @@ -182,9 +277,14 @@ packet_connection_is_ipv4(void) memset(&to, 0, sizeof(to)); if (getsockname(connection_out, (struct sockaddr *)&to, &tolen) < 0) return 0; - if (to.ss_family != AF_INET) - return 0; - return 1; + if (to.ss_family == AF_INET) + return 1; +#ifdef IPV4_IN_IPV6 + if (to.ss_family == AF_INET6 && + IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)&to)->sin6_addr)) + return 1; +#endif + return 0; } /* Sets the connection into non-blocking mode. */ @@ -433,7 +533,7 @@ packet_send1(void) */ } -static void +void set_newkeys(int mode) { Enc *enc; @@ -477,8 +577,9 @@ set_newkeys(int mode) DBG(debug("cipher_init_context: %d", mode)); cipher_init(cc, enc->cipher, enc->key, enc->key_len, enc->iv, enc->block_size, encrypt); - memset(enc->iv, 0, enc->block_size); - memset(enc->key, 0, enc->key_len); + /* Deleting the keys does not gain extra security */ + /* memset(enc->iv, 0, enc->block_size); + memset(enc->key, 0, enc->key_len); */ if (comp->type != 0 && comp->enabled == 0) { packet_init_compression(); if (mode == MODE_OUT) @@ -495,7 +596,6 @@ set_newkeys(int mode) static void packet_send2(void) { - static u_int32_t seqnr = 0; u_char type, *cp, *macbuf = NULL; u_char padlen, pad; u_int packet_length = 0; @@ -549,7 +649,7 @@ packet_send2(void) /* will wrap if extra_pad+padlen > 255 */ extra_pad = roundup(extra_pad, block_size); pad = extra_pad - ((len + padlen) % extra_pad); - debug("packet_send2: adding %d (len %d padlen %d extra_pad %d)", + debug3("packet_send2: adding %d (len %d padlen %d extra_pad %d)", pad, len, padlen, extra_pad); padlen += pad; extra_pad = 0; @@ -576,10 +676,10 @@ packet_send2(void) /* compute MAC over seqnr and packet(length fields, payload, padding) */ if (mac && mac->enabled) { - macbuf = mac_compute(mac, seqnr, + macbuf = mac_compute(mac, send_seqnr, buffer_ptr(&outgoing_packet), buffer_len(&outgoing_packet)); - DBG(debug("done calc MAC out #%d", seqnr)); + DBG(debug("done calc MAC out #%d", send_seqnr)); } /* encrypt packet and append to output buffer. */ cp = buffer_append_space(&output, buffer_len(&outgoing_packet)); @@ -593,7 +693,7 @@ packet_send2(void) buffer_dump(&output); #endif /* increment sequence number for outgoing packets */ - if (++seqnr == 0) + if (++send_seqnr == 0) log("outgoing seqnr wraps around"); buffer_clear(&outgoing_packet); @@ -783,7 +883,6 @@ packet_read_poll1(void) static int packet_read_poll2(u_int32_t *seqnr_p) { - static u_int32_t seqnr = 0; static u_int packet_length = 0; u_int padlen, need; u_char *macbuf, *cp, type; @@ -845,17 +944,17 @@ packet_read_poll2(u_int32_t *seqnr_p) * increment sequence number for incoming packet */ if (mac && mac->enabled) { - macbuf = mac_compute(mac, seqnr, + macbuf = mac_compute(mac, read_seqnr, buffer_ptr(&incoming_packet), buffer_len(&incoming_packet)); if (memcmp(macbuf, buffer_ptr(&input), mac->mac_len) != 0) packet_disconnect("Corrupted MAC on input."); - DBG(debug("MAC #%d ok", seqnr)); + DBG(debug("MAC #%d ok", read_seqnr)); buffer_consume(&input, mac->mac_len); } if (seqnr_p != NULL) - *seqnr_p = seqnr; - if (++seqnr == 0) + *seqnr_p = read_seqnr; + if (++read_seqnr == 0) log("incoming seqnr wraps around"); /* get padlen */ diff --git a/openssh/packet.h b/openssh/packet.h index b579452..08693ca 100644 --- a/openssh/packet.h +++ b/openssh/packet.h @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.h,v 1.33 2002/03/04 17:27:39 stevesk Exp $ */ +/* $OpenBSD: packet.h,v 1.34 2002/03/18 17:16:38 markus Exp $ */ /* * Author: Tatu Ylonen @@ -57,6 +57,16 @@ void packet_get_all(void); void packet_disconnect(const char *fmt,...) __attribute__((format(printf, 1, 2))); void packet_send_debug(const char *fmt,...) __attribute__((format(printf, 1, 2))); +void set_newkeys(int mode); +int packet_get_keyiv_len(int); +void packet_get_keyiv(int, u_char *, u_int); +int packet_get_keycontext(int, u_char *); +void packet_set_keycontext(int, u_char *); +u_int32_t packet_get_seqnr(int); +void packet_set_seqnr(int, u_int32_t); +int packet_get_ssh1_cipher(void); +void packet_set_iv(int, u_char *); + void packet_write_poll(void); void packet_write_wait(void); int packet_have_data_to_write(void); diff --git a/openssh/pathnames.h b/openssh/pathnames.h index 002c313..691293c 100644 --- a/openssh/pathnames.h +++ b/openssh/pathnames.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pathnames.h,v 1.11 2002/02/09 17:37:34 deraadt Exp $ */ +/* $OpenBSD: pathnames.h,v 1.12 2002/03/19 03:03:43 stevesk Exp $ */ /* * Author: Tatu Ylonen @@ -139,6 +139,12 @@ #ifndef _PATH_SFTP_SERVER #define _PATH_SFTP_SERVER "/usr/libexec/sftp-server" #endif + +/* chroot directory for unprivileged user when UsePrivilegeSeparation=yes */ +#ifndef _PATH_PRIVSEP_CHROOT_DIR +#define _PATH_PRIVSEP_CHROOT_DIR "/var/empty" +#endif + #ifndef _PATH_LS #define _PATH_LS "ls" #endif diff --git a/openssh/radix.c b/openssh/radix.c index e604357..019d7a3 100644 --- a/openssh/radix.c +++ b/openssh/radix.c @@ -1,5 +1,6 @@ /* * Copyright (c) 1999 Dug Song. All rights reserved. + * Copyright (c) 2002 Markus Friedl. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,190 +26,132 @@ #include "includes.h" #include "uuencode.h" -RCSID("$OpenBSD: radix.c,v 1.17 2001/11/19 19:02:16 mpech Exp $"); +RCSID("$OpenBSD: radix.c,v 1.20 2002/04/23 12:58:26 markus Exp $"); #ifdef AFS #include #include +#include "bufaux.h" -typedef u_char my_u_char; -typedef u_int my_u_int32_t; -typedef u_short my_u_short; - -/* Nasty macros from BIND-4.9.2 */ - -#define GETSHORT(s, cp) { \ - my_u_char *t_cp = (my_u_char *)(cp); \ - (s) = (((my_u_short)t_cp[0]) << 8) \ - | (((my_u_short)t_cp[1])) \ - ; \ - (cp) += 2; \ -} - -#define GETLONG(l, cp) { \ - my_u_char *t_cp = (my_u_char *)(cp); \ - (l) = (((my_u_int32_t)t_cp[0]) << 24) \ - | (((my_u_int32_t)t_cp[1]) << 16) \ - | (((my_u_int32_t)t_cp[2]) << 8) \ - | (((my_u_int32_t)t_cp[3])) \ - ; \ - (cp) += 4; \ -} - -#define PUTSHORT(s, cp) { \ - my_u_short t_s = (my_u_short)(s); \ - my_u_char *t_cp = (my_u_char *)(cp); \ - *t_cp++ = t_s >> 8; \ - *t_cp = t_s; \ - (cp) += 2; \ -} +int +creds_to_radix(CREDENTIALS *creds, u_char *buf, size_t buflen) +{ + Buffer b; + int ret; -#define PUTLONG(l, cp) { \ - my_u_int32_t t_l = (my_u_int32_t)(l); \ - my_u_char *t_cp = (my_u_char *)(cp); \ - *t_cp++ = t_l >> 24; \ - *t_cp++ = t_l >> 16; \ - *t_cp++ = t_l >> 8; \ - *t_cp = t_l; \ - (cp) += 4; \ -} + buffer_init(&b); -#define GETSTRING(s, p, p_l) { \ - char *p_targ = (p) + p_l; \ - char *s_c = (s); \ - char *p_c = (p); \ - while (*p_c && (p_c < p_targ)) { \ - *s_c++ = *p_c++; \ - } \ - if (p_c == p_targ) { \ - return 1; \ - } \ - *s_c = *p_c++; \ - (p_l) = (p_l) - (p_c - (p)); \ - (p) = p_c; \ -} + buffer_put_char(&b, 1); /* version */ + buffer_append(&b, creds->service, strlen(creds->service)); + buffer_put_char(&b, '\0'); + buffer_append(&b, creds->instance, strlen(creds->instance)); + buffer_put_char(&b, '\0'); + buffer_append(&b, creds->realm, strlen(creds->realm)); + buffer_put_char(&b, '\0'); + buffer_append(&b, creds->pname, strlen(creds->pname)); + buffer_put_char(&b, '\0'); + buffer_append(&b, creds->pinst, strlen(creds->pinst)); + buffer_put_char(&b, '\0'); -int -creds_to_radix(CREDENTIALS *creds, u_char *buf, size_t buflen) -{ - char *p, *s; - int len; - char temp[2048]; - - p = temp; - *p++ = 1; /* version */ - s = creds->service; - while (*s) - *p++ = *s++; - *p++ = *s; - s = creds->instance; - while (*s) - *p++ = *s++; - *p++ = *s; - s = creds->realm; - while (*s) - *p++ = *s++; - *p++ = *s; - - s = creds->pname; - while (*s) - *p++ = *s++; - *p++ = *s; - s = creds->pinst; - while (*s) - *p++ = *s++; - *p++ = *s; /* Null string to repeat the realm. */ - *p++ = '\0'; - - PUTLONG(creds->issue_date, p); - { - u_int endTime; - endTime = (u_int) krb_life_to_time(creds->issue_date, - creds->lifetime); - PUTLONG(endTime, p); - } + buffer_put_char(&b, '\0'); - memcpy(p, &creds->session, sizeof(creds->session)); - p += sizeof(creds->session); + buffer_put_int(&b, creds->issue_date); + buffer_put_int(&b, krb_life_to_time(creds->issue_date, + creds->lifetime)); + buffer_append(&b, creds->session, sizeof(creds->session)); + buffer_put_short(&b, creds->kvno); - PUTSHORT(creds->kvno, p); - PUTLONG(creds->ticket_st.length, p); + /* 32 bit size + data */ + buffer_put_string(&b, creds->ticket_st.dat, creds->ticket_st.length); - memcpy(p, creds->ticket_st.dat, creds->ticket_st.length); - p += creds->ticket_st.length; - len = p - temp; + ret = uuencode(buffer_ptr(&b), buffer_len(&b), (char *)buf, buflen); - return (uuencode((u_char *)temp, len, (char *)buf, buflen)); + buffer_free(&b); + return ret; } +#define GETSTRING(b, t, tlen) \ + do { \ + int i, found = 0; \ + for (i = 0; i < tlen; i++) { \ + if (buffer_len(b) == 0) \ + goto done; \ + t[i] = buffer_get_char(b); \ + if (t[i] == '\0') { \ + found = 1; \ + break; \ + } \ + } \ + if (!found) \ + goto done; \ + } while(0) + int radix_to_creds(const char *buf, CREDENTIALS *creds) { + Buffer b; + char c, version, *space, *p; + u_int endTime; + int len, blen, ret; - char *p; - int len, tl; - char version; - char temp[2048]; + ret = 0; + blen = strlen(buf); - len = uudecode(buf, (u_char *)temp, sizeof(temp)); - if (len < 0) + /* sanity check for size */ + if (blen > 8192) return 0; - p = temp; + buffer_init(&b); + space = buffer_append_space(&b, blen); /* check version and length! */ + len = uudecode(buf, space, blen); if (len < 1) - return 0; - version = *p; - p++; - len--; - - GETSTRING(creds->service, p, len); - GETSTRING(creds->instance, p, len); - GETSTRING(creds->realm, p, len); + goto done; - GETSTRING(creds->pname, p, len); - GETSTRING(creds->pinst, p, len); - /* Ignore possibly different realm. */ - while (*p && len) - p++, len--; - if (len == 0) - return 0; - p++, len--; - - /* Enough space for remaining fixed-length parts? */ - if (len < (4 + 4 + sizeof(creds->session) + 2 + 4)) - return 0; + version = buffer_get_char(&b); - GETLONG(creds->issue_date, p); - len -= 4; - { - u_int endTime; - GETLONG(endTime, p); - len -= 4; - creds->lifetime = krb_time_to_life(creds->issue_date, endTime); - } - - memcpy(&creds->session, p, sizeof(creds->session)); - p += sizeof(creds->session); - len -= sizeof(creds->session); - - GETSHORT(creds->kvno, p); - len -= 2; - GETLONG(creds->ticket_st.length, p); - len -= 4; - - tl = creds->ticket_st.length; - if (tl < 0 || tl > len || tl > sizeof(creds->ticket_st.dat)) - return 0; + GETSTRING(&b, creds->service, sizeof creds->service); + GETSTRING(&b, creds->instance, sizeof creds->instance); + GETSTRING(&b, creds->realm, sizeof creds->realm); + GETSTRING(&b, creds->pname, sizeof creds->pname); + GETSTRING(&b, creds->pinst, sizeof creds->pinst); - memcpy(creds->ticket_st.dat, p, tl); - p += tl; - len -= tl; + if (buffer_len(&b) == 0) + goto done; - return 1; + /* Ignore possibly different realm. */ + while (buffer_len(&b) > 0 && (c = buffer_get_char(&b)) != '\0') + ; + + if (buffer_len(&b) == 0) + goto done; + + creds->issue_date = buffer_get_int(&b); + + endTime = buffer_get_int(&b); + creds->lifetime = krb_time_to_life(creds->issue_date, endTime); + + len = buffer_len(&b); + if (len < sizeof(creds->session)) + goto done; + memcpy(&creds->session, buffer_ptr(&b), sizeof(creds->session)); + buffer_consume(&b, sizeof(creds->session)); + + creds->kvno = buffer_get_short(&b); + + p = buffer_get_string(&b, &len); + if (len < 0 || len > sizeof(creds->ticket_st.dat)) + goto done; + memcpy(&creds->ticket_st.dat, p, len); + creds->ticket_st.length = len; + + ret = 1; +done: + buffer_free(&b); + return ret; } #endif /* AFS */ diff --git a/openssh/readpass.c b/openssh/readpass.c index b4421ad..96b7e84 100644 --- a/openssh/readpass.c +++ b/openssh/readpass.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: readpass.c,v 1.26 2002/02/13 00:39:15 markus Exp $"); +RCSID("$OpenBSD: readpass.c,v 1.27 2002/03/26 15:58:46 markus Exp $"); #include "xmalloc.h" #include "readpass.h" @@ -118,8 +118,11 @@ read_passphrase(const char *prompt, int flags) return ssh_askpass(askpass, prompt); } - if (readpassphrase(prompt, buf, sizeof buf, rppflags) == NULL) + if (readpassphrase(prompt, buf, sizeof buf, rppflags) == NULL) { + if (flags & RP_ALLOW_EOF) + return NULL; return xstrdup(""); + } ret = xstrdup(buf); memset(buf, 'x', sizeof buf); diff --git a/openssh/readpass.h b/openssh/readpass.h index 229973c..a45d32f 100644 --- a/openssh/readpass.h +++ b/openssh/readpass.h @@ -1,4 +1,4 @@ -/* $OpenBSD: readpass.h,v 1.6 2001/06/26 17:27:24 markus Exp $ */ +/* $OpenBSD: readpass.h,v 1.7 2002/03/26 15:58:46 markus Exp $ */ /* * Author: Tatu Ylonen @@ -14,5 +14,6 @@ #define RP_ECHO 0x0001 #define RP_ALLOW_STDIN 0x0002 +#define RP_ALLOW_EOF 0x0004 char *read_passphrase(const char *, int); diff --git a/openssh/rijndael.c b/openssh/rijndael.c index c8ba55e..448048e 100644 --- a/openssh/rijndael.c +++ b/openssh/rijndael.c @@ -25,7 +25,7 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" +#include "includes.h" #include #include diff --git a/openssh/scard-opensc.c b/openssh/scard-opensc.c new file mode 100644 index 0000000..dd21de3 --- /dev/null +++ b/openssh/scard-opensc.c @@ -0,0 +1,462 @@ +/* + * Copyright (c) 2002 Juha Yrjölä. All rights reserved. + * Copyright (c) 2001 Markus Friedl. + * + * 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" +#if defined(SMARTCARD) && defined(USE_OPENSC) + +#include +#include + +#include +#include + +#include "key.h" +#include "log.h" +#include "xmalloc.h" +#include "readpass.h" +#include "scard.h" + +#if OPENSSL_VERSION_NUMBER < 0x00907000L && defined(CRYPTO_LOCK_ENGINE) +#define USE_ENGINE +#define RSA_get_default_method RSA_get_default_openssl_method +#else +#endif + +#ifdef USE_ENGINE +#include +#define sc_get_rsa sc_get_engine +#else +#define sc_get_rsa sc_get_rsa_method +#endif + +static int sc_reader_id; +static sc_context_t *ctx = NULL; +static sc_card_t *card = NULL; +static sc_pkcs15_card_t *p15card = NULL; + +static char *sc_pin = NULL; + +struct sc_priv_data +{ + struct sc_pkcs15_id cert_id; + int ref_count; +}; + +void +sc_close(void) +{ + if (p15card) { + sc_pkcs15_unbind(p15card); + p15card = NULL; + } + if (card) { + sc_disconnect_card(card, 0); + card = NULL; + } + if (ctx) { + sc_release_context(ctx); + ctx = NULL; + } +} + +static int +sc_init(void) +{ + int r; + + r = sc_establish_context(&ctx, "openssh"); + if (r) + goto err; + r = sc_connect_card(ctx->reader[sc_reader_id], 0, &card); + if (r) + goto err; + r = sc_pkcs15_bind(card, &p15card); + if (r) + goto err; + return 0; +err: + sc_close(); + return r; +} + +/* private key operations */ + +static int +sc_prkey_op_init(RSA *rsa, struct sc_pkcs15_object **key_obj_out) +{ + int r; + struct sc_priv_data *priv; + struct sc_pkcs15_object *key_obj; + struct sc_pkcs15_prkey_info *key; + struct sc_pkcs15_object *pin_obj; + struct sc_pkcs15_pin_info *pin; + + priv = (struct sc_priv_data *) RSA_get_app_data(rsa); + if (priv == NULL) + return -1; + if (p15card == NULL) { + sc_close(); + r = sc_init(); + if (r) { + error("SmartCard init failed: %s", sc_strerror(r)); + goto err; + } + } + r = sc_pkcs15_find_prkey_by_id(p15card, &priv->cert_id, &key_obj); + if (r) { + error("Unable to find private key from SmartCard: %s", + sc_strerror(r)); + goto err; + } + key = key_obj->data; + r = sc_pkcs15_find_pin_by_auth_id(p15card, &key_obj->auth_id, + &pin_obj); + if (r) { + error("Unable to find PIN object from SmartCard: %s", + sc_strerror(r)); + goto err; + } + pin = pin_obj->data; + r = sc_lock(card); + if (r) { + error("Unable to lock smartcard: %s", sc_strerror(r)); + goto err; + } + if (sc_pin != NULL) { + r = sc_pkcs15_verify_pin(p15card, pin, sc_pin, + strlen(sc_pin)); + if (r) { + sc_unlock(card); + error("PIN code verification failed: %s", + sc_strerror(r)); + goto err; + } + } + *key_obj_out = key_obj; + return 0; +err: + sc_close(); + return -1; +} + +static int +sc_private_decrypt(int flen, u_char *from, u_char *to, RSA *rsa, + int padding) +{ + struct sc_pkcs15_object *key_obj; + int r; + + if (padding != RSA_PKCS1_PADDING) + return -1; + r = sc_prkey_op_init(rsa, &key_obj); + if (r) + return -1; + r = sc_pkcs15_decipher(p15card, key_obj, 0, from, flen, to, flen); + sc_unlock(card); + if (r < 0) { + error("sc_pkcs15_decipher() failed: %s", sc_strerror(r)); + goto err; + } + return r; +err: + sc_close(); + return -1; +} + +static int +sc_sign(int type, u_char *m, unsigned int m_len, + unsigned char *sigret, unsigned int *siglen, RSA *rsa) +{ + struct sc_pkcs15_object *key_obj; + int r; + unsigned long flags = 0; + + r = sc_prkey_op_init(rsa, &key_obj); + if (r) + return -1; + /* FIXME: length of sigret correct? */ + /* FIXME: check 'type' and modify flags accordingly */ + flags = SC_ALGORITHM_RSA_PAD_PKCS1 | SC_ALGORITHM_RSA_HASH_SHA1; + r = sc_pkcs15_compute_signature(p15card, key_obj, flags, + m, m_len, sigret, RSA_size(rsa)); + sc_unlock(card); + if (r < 0) { + error("sc_pkcs15_compute_signature() failed: %s", + sc_strerror(r)); + goto err; + } + *siglen = r; + return 1; +err: + sc_close(); + return 0; +} + +static int +sc_private_encrypt(int flen, u_char *from, u_char *to, RSA *rsa, + int padding) +{ + error("Private key encryption not supported"); + return -1; +} + +/* called on free */ + +static int (*orig_finish)(RSA *rsa) = NULL; + +static int +sc_finish(RSA *rsa) +{ + struct sc_priv_data *priv; + + priv = RSA_get_app_data(rsa); + priv->ref_count--; + if (priv->ref_count == 0) { + free(priv); + sc_close(); + } + if (orig_finish) + orig_finish(rsa); + return 1; +} + +/* engine for overloading private key operations */ + +static RSA_METHOD * +sc_get_rsa_method(void) +{ + static RSA_METHOD smart_rsa; + const RSA_METHOD *def = RSA_get_default_method(); + + /* use the OpenSSL version */ + memcpy(&smart_rsa, def, sizeof(smart_rsa)); + + smart_rsa.name = "opensc"; + + /* overload */ + smart_rsa.rsa_priv_enc = sc_private_encrypt; + smart_rsa.rsa_priv_dec = sc_private_decrypt; + smart_rsa.rsa_sign = sc_sign; + + /* save original */ + orig_finish = def->finish; + smart_rsa.finish = sc_finish; + + return &smart_rsa; +} + +#ifdef USE_ENGINE +static ENGINE * +sc_get_engine(void) +{ + static ENGINE *smart_engine = NULL; + + if ((smart_engine = ENGINE_new()) == NULL) + fatal("ENGINE_new failed"); + + ENGINE_set_id(smart_engine, "opensc"); + ENGINE_set_name(smart_engine, "OpenSC"); + + ENGINE_set_RSA(smart_engine, sc_get_rsa_method()); + ENGINE_set_DSA(smart_engine, DSA_get_default_openssl_method()); + ENGINE_set_DH(smart_engine, DH_get_default_openssl_method()); + ENGINE_set_RAND(smart_engine, RAND_SSLeay()); + ENGINE_set_BN_mod_exp(smart_engine, BN_mod_exp); + + return smart_engine; +} +#endif + +static void +convert_rsa_to_rsa1(Key * in, Key * out) +{ + struct sc_priv_data *priv; + + out->rsa->flags = in->rsa->flags; + out->flags = in->flags; + RSA_set_method(out->rsa, RSA_get_method(in->rsa)); + BN_copy(out->rsa->n, in->rsa->n); + BN_copy(out->rsa->e, in->rsa->e); + priv = RSA_get_app_data(in->rsa); + priv->ref_count++; + RSA_set_app_data(out->rsa, priv); + return; +} + +static int +sc_read_pubkey(Key * k, const struct sc_pkcs15_object *cert_obj) +{ + int r; + sc_pkcs15_cert_t *cert = NULL; + struct sc_priv_data *priv = NULL; + sc_pkcs15_cert_info_t *cinfo = cert_obj->data; + + X509 *x509 = NULL; + EVP_PKEY *pubkey = NULL; + u8 *p; + char *tmp; + + debug("sc_read_pubkey() with cert id %02X", cinfo->id.value[0]); + r = sc_pkcs15_read_certificate(p15card, cinfo, &cert); + if (r) { + log("Certificate read failed: %s", sc_strerror(r)); + goto err; + } + x509 = X509_new(); + if (x509 == NULL) { + r = -1; + goto err; + } + p = cert->data; + if (!d2i_X509(&x509, &p, cert->data_len)) { + log("Unable to parse X.509 certificate"); + r = -1; + goto err; + } + sc_pkcs15_free_certificate(cert); + cert = NULL; + pubkey = X509_get_pubkey(x509); + X509_free(x509); + x509 = NULL; + if (pubkey->type != EVP_PKEY_RSA) { + log("Public key is of unknown type"); + r = -1; + goto err; + } + k->rsa = EVP_PKEY_get1_RSA(pubkey); + EVP_PKEY_free(pubkey); + + k->rsa->flags |= RSA_FLAG_SIGN_VER; + RSA_set_method(k->rsa, sc_get_rsa_method()); + priv = xmalloc(sizeof(struct sc_priv_data)); + priv->cert_id = cinfo->id; + priv->ref_count = 1; + RSA_set_app_data(k->rsa, priv); + + k->flags = KEY_FLAG_EXT; + tmp = key_fingerprint(k, SSH_FP_MD5, SSH_FP_HEX); + debug("fingerprint %d %s", key_size(k), tmp); + xfree(tmp); + + return 0; +err: + if (cert) + sc_pkcs15_free_certificate(cert); + if (pubkey) + EVP_PKEY_free(pubkey); + if (x509) + X509_free(x509); + return r; +} + +Key ** +sc_get_keys(const char *id, const char *pin) +{ + Key *k, **keys; + int i, r, real_count = 0, key_count; + sc_pkcs15_id_t cert_id; + sc_pkcs15_object_t *certs[32]; + char *buf = xstrdup(id), *p; + + debug("sc_get_keys called: id = %s", id); + + if (sc_pin != NULL) + xfree(sc_pin); + sc_pin = (pin == NULL) ? NULL : xstrdup(pin); + + cert_id.len = 0; + if ((p = strchr(buf, ':')) != NULL) { + *p = 0; + p++; + sc_pkcs15_hex_string_to_id(p, &cert_id); + } + r = sscanf(buf, "%d", &sc_reader_id); + xfree(buf); + if (r != 1) + goto err; + if (p15card == NULL) { + sc_close(); + r = sc_init(); + if (r) { + error("Smartcard init failed: %s", sc_strerror(r)); + goto err; + } + } + if (cert_id.len) { + r = sc_pkcs15_find_cert_by_id(p15card, &cert_id, &certs[0]); + if (r < 0) + goto err; + key_count = 1; + } else { + r = sc_pkcs15_get_objects(p15card, SC_PKCS15_TYPE_CERT_X509, + certs, 32); + if (r == 0) { + log("No certificates found on smartcard"); + r = -1; + goto err; + } else if (r < 0) { + error("Certificate enumeration failed: %s", + sc_strerror(r)); + goto err; + } + key_count = r; + } + /* FIXME: only keep entries with a corresponding private key */ + keys = xmalloc(sizeof(Key *) * (key_count*2+1)); + for (i = 0; i < key_count; i++) { + k = key_new(KEY_RSA); + if (k == NULL) + break; + r = sc_read_pubkey(k, certs[i]); + if (r) { + error("sc_read_pubkey failed: %s", sc_strerror(r)); + key_free(k); + continue; + } + keys[real_count] = k; + real_count++; + k = key_new(KEY_RSA1); + if (k == NULL) + break; + convert_rsa_to_rsa1(keys[real_count-1], k); + keys[real_count] = k; + real_count++; + } + keys[real_count] = NULL; + + return keys; +err: + sc_close(); + return NULL; +} + +int +sc_put_key(Key *prv, const char *id) +{ + error("key uploading not yet supported"); + return -1; +} + +#endif /* SMARTCARD */ diff --git a/openssh/scard.c b/openssh/scard.c index e831931..db0cc4a 100644 --- a/openssh/scard.c +++ b/openssh/scard.c @@ -23,17 +23,31 @@ */ #include "includes.h" -#ifdef SMARTCARD -RCSID("$OpenBSD: scard.c,v 1.17 2001/12/27 18:22:16 markus Exp $"); +#if defined(SMARTCARD) && defined(USE_SECTOK) +RCSID("$OpenBSD: scard.c,v 1.25 2002/03/26 18:46:59 rees Exp $"); -#include +#include #include #include "key.h" #include "log.h" #include "xmalloc.h" +#include "readpass.h" #include "scard.h" +#if OPENSSL_VERSION_NUMBER < 0x00907000L +#define USE_ENGINE +#define RSA_get_default_method RSA_get_default_openssl_method +#else +#endif + +#ifdef USE_ENGINE +#include +#define sc_get_rsa sc_get_engine +#else +#define sc_get_rsa sc_get_rsa_method +#endif + #define CLA_SSH 0x05 #define INS_DECRYPT 0x10 #define INS_GET_KEYLENGTH 0x20 @@ -42,10 +56,17 @@ RCSID("$OpenBSD: scard.c,v 1.17 2001/12/27 18:22:16 markus Exp $"); #define MAX_BUF_SIZE 256 +u_char DEFAUT0[] = {0xad, 0x9f, 0x61, 0xfe, 0xfa, 0x20, 0xce, 0x63}; + static int sc_fd = -1; static char *sc_reader_id = NULL; +static char *sc_pin = NULL; static int cla = 0x00; /* class */ +static void sc_mk_digest(const char *pin, u_char *digest); +static int get_AUT0(u_char *aut0); +static int try_AUT0(void); + /* interface to libsectok */ static int @@ -126,8 +147,7 @@ sc_read_pubkey(Key * k) n = NULL; if (sc_fd < 0) { - status = sc_init(); - if (status < 0 ) + if (sc_init() < 0) goto err; } @@ -145,6 +165,12 @@ sc_read_pubkey(Key * k) n = xmalloc(len); /* get n */ sectok_apdu(sc_fd, CLA_SSH, INS_GET_PUBKEY, 0, 0, 0, NULL, len, n, &sw); + + if (sw == 0x6982) { + if (try_AUT0() < 0) + goto err; + sectok_apdu(sc_fd, CLA_SSH, INS_GET_PUBKEY, 0, 0, 0, NULL, len, n, &sw); + } if (!sectok_swOK(sw)) { error("could not obtain public key: %s", sectok_get_sw(sw)); goto err; @@ -178,7 +204,8 @@ err: /* private key operations */ static int -sc_private_decrypt(int flen, u_char *from, u_char *to, RSA *rsa, int padding) +sc_private_decrypt(int flen, u_char *from, u_char *to, RSA *rsa, + int padding) { u_char *padded = NULL; int sw, len, olen, status = -1; @@ -197,16 +224,15 @@ sc_private_decrypt(int flen, u_char *from, u_char *to, RSA *rsa, int padding) len = BN_num_bytes(rsa->n); padded = xmalloc(len); - sectok_apdu(sc_fd, CLA_SSH, INS_DECRYPT, 0, 0, len, from, 0, NULL, &sw); - if (!sectok_swOK(sw)) { - error("sc_private_decrypt: INS_DECRYPT failed: %s", - sectok_get_sw(sw)); - goto err; + sectok_apdu(sc_fd, CLA_SSH, INS_DECRYPT, 0, 0, len, from, len, padded, &sw); + + if (sw == 0x6982) { + if (try_AUT0() < 0) + goto err; + sectok_apdu(sc_fd, CLA_SSH, INS_DECRYPT, 0, 0, len, from, len, padded, &sw); } - sectok_apdu(sc_fd, CLA_SSH, INS_GET_RESPONSE, 0, 0, 0, NULL, - len, padded, &sw); if (!sectok_swOK(sw)) { - error("sc_private_decrypt: INS_GET_RESPONSE failed: %s", + error("sc_private_decrypt: INS_DECRYPT failed: %s", sectok_get_sw(sw)); goto err; } @@ -220,7 +246,8 @@ err: } static int -sc_private_encrypt(int flen, u_char *from, u_char *to, RSA *rsa, int padding) +sc_private_encrypt(int flen, u_char *from, u_char *to, RSA *rsa, + int padding) { u_char *padded = NULL; int sw, len, status = -1; @@ -238,20 +265,18 @@ sc_private_encrypt(int flen, u_char *from, u_char *to, RSA *rsa, int padding) len = BN_num_bytes(rsa->n); padded = xmalloc(len); - if (RSA_padding_add_PKCS1_type_1(padded, len, from, flen) <= 0) { + if (RSA_padding_add_PKCS1_type_1(padded, len, (u_char *)from, flen) <= 0) { error("RSA_padding_add_PKCS1_type_1 failed"); goto err; } - sectok_apdu(sc_fd, CLA_SSH, INS_DECRYPT, 0, 0, len, padded, 0, NULL, &sw); - if (!sectok_swOK(sw)) { - error("sc_private_decrypt: INS_DECRYPT failed: %s", - sectok_get_sw(sw)); - goto err; + sectok_apdu(sc_fd, CLA_SSH, INS_DECRYPT, 0, 0, len, padded, len, to, &sw); + if (sw == 0x6982) { + if (try_AUT0() < 0) + goto err; + sectok_apdu(sc_fd, CLA_SSH, INS_DECRYPT, 0, 0, len, padded, len, to, &sw); } - sectok_apdu(sc_fd, CLA_SSH, INS_GET_RESPONSE, 0, 0, 0, NULL, - len, to, &sw); if (!sectok_swOK(sw)) { - error("sc_private_decrypt: INS_GET_RESPONSE failed: %s", + error("sc_private_encrypt: INS_DECRYPT failed: %s", sectok_get_sw(sw)); goto err; } @@ -275,31 +300,18 @@ sc_finish(RSA *rsa) return 1; } - /* engine for overloading private key operations */ -static ENGINE *smart_engine = NULL; -static RSA_METHOD smart_rsa = -{ - "sectok", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - NULL, -}; - -ENGINE * -sc_get_engine(void) +static RSA_METHOD * +sc_get_rsa_method(void) { - RSA_METHOD *def; + static RSA_METHOD smart_rsa; + const RSA_METHOD *def = RSA_get_default_method(); + + /* use the OpenSSL version */ + memcpy(&smart_rsa, def, sizeof(smart_rsa)); - def = RSA_get_default_openssl_method(); + smart_rsa.name = "sectok"; /* overload */ smart_rsa.rsa_priv_enc = sc_private_encrypt; @@ -309,23 +321,22 @@ sc_get_engine(void) orig_finish = def->finish; smart_rsa.finish = sc_finish; - /* just use the OpenSSL version */ - smart_rsa.rsa_pub_enc = def->rsa_pub_enc; - smart_rsa.rsa_pub_dec = def->rsa_pub_dec; - smart_rsa.rsa_mod_exp = def->rsa_mod_exp; - smart_rsa.bn_mod_exp = def->bn_mod_exp; - smart_rsa.init = def->init; - smart_rsa.flags = def->flags; - smart_rsa.app_data = def->app_data; - smart_rsa.rsa_sign = def->rsa_sign; - smart_rsa.rsa_verify = def->rsa_verify; + return &smart_rsa; +} + +#ifdef USE_ENGINE +static ENGINE * +sc_get_engine(void) +{ + static ENGINE *smart_engine = NULL; if ((smart_engine = ENGINE_new()) == NULL) fatal("ENGINE_new failed"); ENGINE_set_id(smart_engine, "sectok"); ENGINE_set_name(smart_engine, "libsectok"); - ENGINE_set_RSA(smart_engine, &smart_rsa); + + ENGINE_set_RSA(smart_engine, sc_get_rsa_method()); ENGINE_set_DSA(smart_engine, DSA_get_default_openssl_method()); ENGINE_set_DH(smart_engine, DH_get_default_openssl_method()); ENGINE_set_RAND(smart_engine, RAND_SSLeay()); @@ -333,6 +344,7 @@ sc_get_engine(void) return smart_engine; } +#endif void sc_close(void) @@ -343,16 +355,20 @@ sc_close(void) } } -Key * -sc_get_key(const char *id) +Key ** +sc_get_keys(const char *id, const char *pin) { - Key *k; - int status; + Key *k, *n, **keys; + int status, nkeys = 2; if (sc_reader_id != NULL) xfree(sc_reader_id); sc_reader_id = xstrdup(id); + if (sc_pin != NULL) + xfree(sc_pin); + sc_pin = (pin == NULL) ? NULL : xstrdup(pin); + k = key_new(KEY_RSA); if (k == NULL) { return NULL; @@ -367,6 +383,175 @@ sc_get_key(const char *id) key_free(k); return NULL; } - return k; + keys = xmalloc((nkeys+1) * sizeof(Key *)); + + n = key_new(KEY_RSA1); + BN_copy(n->rsa->n, k->rsa->n); + BN_copy(n->rsa->e, k->rsa->e); + RSA_set_method(n->rsa, sc_get_rsa()); + n->flags |= KEY_FLAG_EXT; + keys[0] = n; + + n = key_new(KEY_RSA); + BN_copy(n->rsa->n, k->rsa->n); + BN_copy(n->rsa->e, k->rsa->e); + RSA_set_method(n->rsa, sc_get_rsa()); + n->flags |= KEY_FLAG_EXT; + keys[1] = n; + + keys[2] = NULL; + + key_free(k); + return keys; +} + +#define NUM_RSA_KEY_ELEMENTS 5+1 +#define COPY_RSA_KEY(x, i) \ + do { \ + len = BN_num_bytes(prv->rsa->x); \ + elements[i] = xmalloc(len); \ + debug("#bytes %d", len); \ + if (BN_bn2bin(prv->rsa->x, elements[i]) < 0) \ + goto done; \ + } while (0) + +static void +sc_mk_digest(const char *pin, u_char *digest) +{ + const EVP_MD *evp_md = EVP_sha1(); + EVP_MD_CTX md; + + EVP_DigestInit(&md, evp_md); + EVP_DigestUpdate(&md, pin, strlen(pin)); + EVP_DigestFinal(&md, digest, NULL); +} + +static int +get_AUT0(u_char *aut0) +{ + char *pass; + + pass = read_passphrase("Enter passphrase for smartcard: ", RP_ALLOW_STDIN); + if (pass == NULL) + return -1; + if (!strcmp(pass, "-")) { + memcpy(aut0, DEFAUT0, sizeof DEFAUT0); + return 0; + } + sc_mk_digest(pass, aut0); + memset(pass, 0, strlen(pass)); + xfree(pass); + return 0; +} + +static int +try_AUT0(void) +{ + u_char aut0[EVP_MAX_MD_SIZE]; + + /* permission denied; try PIN if provided */ + if (sc_pin && strlen(sc_pin) > 0) { + sc_mk_digest(sc_pin, aut0); + if (cyberflex_verify_AUT0(sc_fd, cla, aut0, 8) < 0) { + error("smartcard passphrase incorrect"); + return (-1); + } + } else { + /* try default AUT0 key */ + if (cyberflex_verify_AUT0(sc_fd, cla, DEFAUT0, 8) < 0) { + /* default AUT0 key failed; prompt for passphrase */ + if (get_AUT0(aut0) < 0 || + cyberflex_verify_AUT0(sc_fd, cla, aut0, 8) < 0) { + error("smartcard passphrase incorrect"); + return (-1); + } + } + } + return (0); +} + +int +sc_put_key(Key *prv, const char *id) +{ + u_char *elements[NUM_RSA_KEY_ELEMENTS]; + u_char key_fid[2]; + u_char AUT0[EVP_MAX_MD_SIZE]; + int len, status = -1, i, fd = -1, ret; + int sw = 0, cla = 0x00; + + for (i = 0; i < NUM_RSA_KEY_ELEMENTS; i++) + elements[i] = NULL; + + COPY_RSA_KEY(q, 0); + COPY_RSA_KEY(p, 1); + COPY_RSA_KEY(iqmp, 2); + COPY_RSA_KEY(dmq1, 3); + COPY_RSA_KEY(dmp1, 4); + COPY_RSA_KEY(n, 5); + len = BN_num_bytes(prv->rsa->n); + fd = sectok_friendly_open(id, STONOWAIT, &sw); + if (fd < 0) { + error("sectok_open failed: %s", sectok_get_sw(sw)); + goto done; + } + if (! sectok_cardpresent(fd)) { + error("smartcard in reader %s not present", id); + goto done; + } + ret = sectok_reset(fd, 0, NULL, &sw); + if (ret <= 0) { + error("sectok_reset failed: %s", sectok_get_sw(sw)); + goto done; + } + if ((cla = cyberflex_inq_class(fd)) < 0) { + error("cyberflex_inq_class failed"); + goto done; + } + memcpy(AUT0, DEFAUT0, sizeof(DEFAUT0)); + if (cyberflex_verify_AUT0(fd, cla, AUT0, sizeof(DEFAUT0)) < 0) { + if (get_AUT0(AUT0) < 0 || + cyberflex_verify_AUT0(fd, cla, AUT0, sizeof(DEFAUT0)) < 0) { + memset(AUT0, 0, sizeof(DEFAUT0)); + error("smartcard passphrase incorrect"); + goto done; + } + } + memset(AUT0, 0, sizeof(DEFAUT0)); + key_fid[0] = 0x00; + key_fid[1] = 0x12; + if (cyberflex_load_rsa_priv(fd, cla, key_fid, 5, 8*len, elements, + &sw) < 0) { + error("cyberflex_load_rsa_priv failed: %s", sectok_get_sw(sw)); + goto done; + } + if (!sectok_swOK(sw)) + goto done; + log("cyberflex_load_rsa_priv done"); + key_fid[0] = 0x73; + key_fid[1] = 0x68; + if (cyberflex_load_rsa_pub(fd, cla, key_fid, len, elements[5], + &sw) < 0) { + error("cyberflex_load_rsa_pub failed: %s", sectok_get_sw(sw)); + goto done; + } + if (!sectok_swOK(sw)) + goto done; + log("cyberflex_load_rsa_pub done"); + status = 0; + +done: + memset(elements[0], '\0', BN_num_bytes(prv->rsa->q)); + memset(elements[1], '\0', BN_num_bytes(prv->rsa->p)); + memset(elements[2], '\0', BN_num_bytes(prv->rsa->iqmp)); + memset(elements[3], '\0', BN_num_bytes(prv->rsa->dmq1)); + memset(elements[4], '\0', BN_num_bytes(prv->rsa->dmp1)); + memset(elements[5], '\0', BN_num_bytes(prv->rsa->n)); + + for (i = 0; i < NUM_RSA_KEY_ELEMENTS; i++) + if (elements[i]) + xfree(elements[i]); + if (fd != -1) + sectok_close(fd); + return (status); } -#endif /* SMARTCARD */ +#endif /* SMARTCARD && USE_SECTOK */ diff --git a/openssh/scard.h b/openssh/scard.h index 6ca9916..c0aa9ed 100644 --- a/openssh/scard.h +++ b/openssh/scard.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scard.h,v 1.7 2002/03/04 17:27:39 stevesk Exp $ */ +/* $OpenBSD: scard.h,v 1.10 2002/03/25 17:34:27 markus Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -24,17 +24,17 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include - #ifndef SCARD_H #define SCARD_H +#include "key.h" + #define SCARD_ERROR_FAIL -1 #define SCARD_ERROR_NOCARD -2 #define SCARD_ERROR_APPLET -3 -Key *sc_get_key(const char*); -ENGINE *sc_get_engine(void); +Key **sc_get_keys(const char*, const char*); void sc_close(void); +int sc_put_key(Key *, const char*); #endif diff --git a/openssh/scard/Makefile.in b/openssh/scard/Makefile.in index f2d596a..07433c1 100644 --- a/openssh/scard/Makefile.in +++ b/openssh/scard/Makefile.in @@ -11,13 +11,14 @@ VPATH=@srcdir@ all: -Ssh.bin: Ssh.bin.uu - uudecode Ssh.bin.uu +#Ssh.bin: Ssh.bin.uu +# uudecode Ssh.bin.uu clean: - rm -rf Ssh.bin +# rm -rf Ssh.bin -distprep: Ssh.bin +distprep: + uudecode Ssh.bin.uu distclean: clean rm -f Makefile *~ diff --git a/openssh/scard/Ssh.bin.uu b/openssh/scard/Ssh.bin.uu index 1062e21..ea3986a 100644 --- a/openssh/scard/Ssh.bin.uu +++ b/openssh/scard/Ssh.bin.uu @@ -1,16 +1,17 @@ begin 644 Ssh.bin -M`P)!%P`501P`;``!`C@"`/Y@\`4`_J'P!0!!%T$;`?Z@\`4`01=!&@'^>/,! -M`4$701P!_G#S%P'^0],1`?Y@\!0`_G/S'0#^<]4``D$7L`4`_F'3``!!%T$9 -M`?YATP4`_G/5"P7^8=,'`OZAT`$!_J#0$@1!%T$8`0```$$7!`$&`/Y@`;@` -M`$$8\`H(`$$9\`H``$$:\@\``$$;\B$``$$<\A```/`&__(```0(`!8```9C -M""T#"<(H+00$*"T%""A;`&19``#P$/_R`P(&`0#(```38`!!70!&$UP`1@09 -M":1+``D*D`!@`"@37`!&!!E6`````*(````$____P````*$````0````*@`` -M`"````"-````,````&H37`!&`QD(2@`)"FX`8``H$UP`1@<9"@#_/2!@`$L1 -M2@`)"F<`8``H$UP`'A-<`$8($1-<`$8(7@!0"!%@`%59"C\`8`!:*PIS:&`` -M6BL37`!&`P,*`(!@`%\K`PH`@&``55D37`!&`P`"U9```````` +M`P)!&P`801X`>``!`E@"`/Y@\`4`_J'P!0!!&T$=`?Z@\`4`01M!'`'^>/,! +M`4$;01X!_G#S%P'^0],1`?Y@\!0`_G/S'0#^<]4``D$;L`4`_F'3``#^8=,% +M`/ZAT`$!_J#0)P'^H],*`?ZCTPD`_G/5"P7^8=,'`OZAT`H`_J#0$@3^:-,@ +M`T$;`P`%`/Y@`\A```/`0__(%`@8!`0H``&`` +M0205!!D)I$L`"0J0`&``*!4$&58``````.P````%____P````.D````0```` +M,P```"````#'````,````(T````R````V!4#&0A*``D*;@!@`"@5!QD*`/\] +M(6``1A)*``D*9P!@`"@*/P!@`$LK"1)@`$LK!6``4!P$#00#2@`.#01@`%5@ +M`%I@`"@37``>%0@2%0A>`%\($F``9%(`:`H_`&``2RL*7@`R10`/$UP`'@H`R`D07@`W!%>P!?_R`0$$`@`\```37P`` +M$V+^H2U?``5=``H38OZ@+5\`#UT`%!-B_G@M"@0`7P`970`>"@0`8``C10`) +/"F<`8``H$UX`+5D````` ` end diff --git a/openssh/scard/Ssh.java b/openssh/scard/Ssh.java index a26ae01..dbd07fb 100644 --- a/openssh/scard/Ssh.java +++ b/openssh/scard/Ssh.java @@ -42,6 +42,9 @@ import javacardx.crypto.*; public class Ssh extends javacard.framework.Applet { + // Change this when the applet changes; hi byte is major, low byte is minor + static final short applet_version = (short)0x0102; + /* constants declaration */ // code of CLA byte in the command APDU header static final byte Ssh_CLA =(byte)0x05; @@ -50,20 +53,19 @@ public class Ssh extends javacard.framework.Applet static final byte DECRYPT = (byte) 0x10; static final byte GET_KEYLENGTH = (byte) 0x20; static final byte GET_PUBKEY = (byte) 0x30; + static final byte GET_VERSION = (byte) 0x32; static final byte GET_RESPONSE = (byte) 0xc0; - /* instance variables declaration */ static final short keysize = 1024; + static final short root_fid = (short)0x3f00; + static final short privkey_fid = (short)0x0012; + static final short pubkey_fid = (short)(('s'<<8)|'h'); - //RSA_CRT_PrivateKey rsakey; + /* instance variables declaration */ AsymKey rsakey; CyberflexFile file; CyberflexOS os; - byte buffer[]; - - static byte[] keyHdr = {(byte)0xC2, (byte)0x01, (byte)0x05}; - private Ssh() { file = new CyberflexFile(); @@ -98,7 +100,8 @@ public class Ssh extends javacard.framework.Applet // APDU object carries a byte array (buffer) to // transfer incoming and outgoing APDU header // and data bytes between card and CAD - buffer = apdu.getBuffer(); + byte buffer[] = apdu.getBuffer(); + short size, st; // verify that if the applet can accept this // APDU message @@ -111,29 +114,47 @@ public class Ssh extends javacard.framework.Applet if (buffer[ISO.OFFSET_CLA] != Ssh_CLA) ISOException.throwIt(ISO.SW_CLA_NOT_SUPPORTED); //decrypt (apdu); - short size = (short) (buffer[ISO.OFFSET_LC] & 0x00FF); + size = (short) (buffer[ISO.OFFSET_LC] & 0x00FF); if (apdu.setIncomingAndReceive() != size) ISOException.throwIt (ISO.SW_WRONG_LENGTH); + // check access; depends on bit 2 (x/a) + file.selectFile(root_fid); + file.selectFile(privkey_fid); + st = os.checkAccess(ACL.EXECUTE); + if (st != ST.ACCESS_CLEARED) { + CyberflexAPDU.prepareSW1SW2(st); + ISOException.throwIt(CyberflexAPDU.getSW1SW2()); + } + rsakey.cryptoUpdate (buffer, (short) ISO.OFFSET_CDATA, size, buffer, (short) ISO.OFFSET_CDATA); apdu.setOutgoingAndSend ((short) ISO.OFFSET_CDATA, size); - return; + break; case GET_PUBKEY: - file.selectFile((short)(0x3f<<8)); // select root - file.selectFile((short)(('s'<<8)|'h')); // select public key file - os.readBinaryFile (buffer, (short)0, (short)0, (short)(keysize/8)); - apdu.setOutgoingAndSend((short)0, (short)(keysize/8)); - return; + file.selectFile(root_fid); // select root + file.selectFile(pubkey_fid); // select public key file + size = (short)(file.getFileSize() - 16); + st = os.readBinaryFile(buffer, (short)0, (short)0, size); + if (st == ST.SUCCESS) + apdu.setOutgoingAndSend((short)0, size); + else { + CyberflexAPDU.prepareSW1SW2(st); + ISOException.throwIt(CyberflexAPDU.getSW1SW2()); + } + break; case GET_KEYLENGTH: - buffer[0] = (byte)((keysize >> 8) & 0xff); - buffer[1] = (byte)(keysize & 0xff); + Util.setShort(buffer, (short)0, keysize); + apdu.setOutgoingAndSend ((short)0, (short)2); + break; + case GET_VERSION: + Util.setShort(buffer, (short)0, applet_version); apdu.setOutgoingAndSend ((short)0, (short)2); - return; + break; case GET_RESPONSE: - return; + break; default: ISOException.throwIt (ISO.SW_INS_NOT_SUPPORTED); } diff --git a/openssh/scp.c b/openssh/scp.c index 83e7769..1fab483 100644 --- a/openssh/scp.c +++ b/openssh/scp.c @@ -75,7 +75,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.86 2001/12/05 03:56:39 itojun Exp $"); +RCSID("$OpenBSD: scp.c,v 1.88 2002/04/06 18:24:09 mouring Exp $"); #include "xmalloc.h" #include "atomicio.h" @@ -94,14 +94,6 @@ char *__progname; /* alarm() interval for updating progress meter */ #define PROGRESSTIME 1 -/* Progress meter bar */ -#define BAR \ - "************************************************************"\ - "************************************************************"\ - "************************************************************"\ - "************************************************************" -#define MAX_BARLENGTH (sizeof(BAR) - 1) - /* Visual statistics about files as they are transferred. */ void progressmeter(int); @@ -782,7 +774,7 @@ sink(argc, argv) cursize = need; } (void) snprintf(namebuf, need, "%s%s%s", targ, - *targ ? "/" : "", cp); + strcmp(targ, "/") ? "/" : "", cp); np = namebuf; } else np = targ; @@ -1116,7 +1108,7 @@ progressmeter(int flag) off_t cursize, abbrevsize; double elapsed; int ratio, barlength, i, remaining; - char buf[256]; + char buf[512]; if (flag == -1) { (void) gettimeofday(&start, (struct timezone *) 0); @@ -1138,11 +1130,18 @@ progressmeter(int flag) snprintf(buf, sizeof(buf), "\r%-20.20s %3d%% ", curfile, ratio); barlength = getttywidth() - 51; - barlength = (barlength <= MAX_BARLENGTH)?barlength:MAX_BARLENGTH; if (barlength > 0) { i = barlength * ratio / 100; snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), - "|%.*s%*s|", i, BAR, barlength - i, ""); + "|%.*s%*s|", i, + "*******************************************************" + "*******************************************************" + "*******************************************************" + "*******************************************************" + "*******************************************************" + "*******************************************************" + "*******************************************************", + barlength - i, ""); } i = 0; abbrevsize = cursize; diff --git a/openssh/servconf.c b/openssh/servconf.c index adad372..a8f6cfe 100644 --- a/openssh/servconf.c +++ b/openssh/servconf.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: servconf.c,v 1.101 2002/02/04 12:15:25 markus Exp $"); +RCSID("$OpenBSD: servconf.c,v 1.109 2002/05/15 21:02:52 markus Exp $"); #if defined(KRB4) #include @@ -45,6 +45,8 @@ static void add_one_listen_addr(ServerOptions *, char *, u_short); /* AF_UNSPEC or AF_INET or AF_INET6 */ extern int IPv4or6; +/* Use of privilege separation or not */ +extern int use_privsep; /* Initializes the server options to their default values. */ @@ -125,6 +127,9 @@ initialize_server_options(ServerOptions *options) options->client_alive_count_max = -1; options->authorized_keys_file = NULL; options->authorized_keys_file2 = NULL; + + /* Needs to be accessable in many places */ + use_privsep = -1; } void @@ -211,7 +216,7 @@ fill_default_server_options(ServerOptions *options) #endif #if defined(KRB4) || defined(KRB5) if (options->kerberos_authentication == -1) - options->kerberos_authentication = (access(KEYFILE, R_OK) == 0); + options->kerberos_authentication = 0; if (options->kerberos_or_local_passwd == -1) options->kerberos_or_local_passwd = 1; if (options->kerberos_ticket_cleanup == -1) @@ -223,7 +228,7 @@ fill_default_server_options(ServerOptions *options) #endif #ifdef AFS if (options->afs_token_passing == -1) - options->afs_token_passing = k_hasafs(); + options->afs_token_passing = 0; #endif if (options->password_authentication == -1) options->password_authentication = 1; @@ -260,6 +265,10 @@ fill_default_server_options(ServerOptions *options) } if (options->authorized_keys_file == NULL) options->authorized_keys_file = _PATH_SSH_USER_PERMITTED_KEYS; + + /* Turn privilege separation _off_ by default */ + if (use_privsep == -1) + use_privsep = 0; } /* Keyword tokens. */ @@ -295,6 +304,7 @@ typedef enum { sBanner, sVerifyReverseMapping, sHostbasedAuthentication, sHostbasedUsesNameFromPacketOnly, sClientAliveInterval, sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2, + sUsePrivilegeSeparation, sDeprecated } ServerOpCodes; @@ -377,6 +387,7 @@ static struct { { "clientalivecountmax", sClientAliveCountMax }, { "authorizedkeysfile", sAuthorizedKeysFile }, { "authorizedkeysfile2", sAuthorizedKeysFile2 }, + { "useprivilegeseparation", sUsePrivilegeSeparation}, { NULL, sBadOption } }; @@ -767,6 +778,10 @@ parse_flag: intptr = &options->allow_tcp_forwarding; goto parse_flag; + case sUsePrivilegeSeparation: + intptr = &use_privsep; + goto parse_flag; + case sAllowUsers: while ((arg = strdelim(&cp)) && *arg != '\0') { if (options->num_allow_users >= MAX_ALLOW_USERS) diff --git a/openssh/servconf.h b/openssh/servconf.h index ecb3f18..0973882 100644 --- a/openssh/servconf.h +++ b/openssh/servconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: servconf.h,v 1.54 2002/03/04 17:27:39 stevesk Exp $ */ +/* $OpenBSD: servconf.h,v 1.57 2002/03/20 19:12:25 stevesk Exp $ */ /* * Author: Tatu Ylonen @@ -137,7 +137,6 @@ typedef struct { char *authorized_keys_file; /* File containing public keys */ char *authorized_keys_file2; int pam_authentication_via_kbd_int; - } ServerOptions; void initialize_server_options(ServerOptions *); diff --git a/openssh/serverloop.c b/openssh/serverloop.c index 46b12ee..38b1cf7 100644 --- a/openssh/serverloop.c +++ b/openssh/serverloop.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: serverloop.c,v 1.98 2002/02/06 14:55:16 markus Exp $"); +RCSID("$OpenBSD: serverloop.c,v 1.101 2002/03/30 18:51:15 markus Exp $"); #include "xmalloc.h" #include "packet.h" @@ -318,9 +318,6 @@ wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, int *maxfdp, tv.tv_usec = 1000 * (max_time_milliseconds % 1000); tvp = &tv; } - if (tvp!=NULL) - debug3("tvp!=NULL kid %d mili %d", (int) child_terminated, - max_time_milliseconds); /* Wait for something to happen, or the timeout to expire. */ ret = select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp); @@ -673,10 +670,10 @@ server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg) /* We no longer want our SIGCHLD handler to be called. */ mysignal(SIGCHLD, SIG_DFL); - wait_pid = waitpid(-1, &wait_status, 0); - if (wait_pid == -1) - packet_disconnect("wait: %.100s", strerror(errno)); - else if (wait_pid != pid) + while ((wait_pid = waitpid(-1, &wait_status, 0)) < 0) + if (errno != EINTR) + packet_disconnect("wait: %.100s", strerror(errno)); + if (wait_pid != pid) error("Strange, wait returned pid %d, expected %d", wait_pid, pid); @@ -726,8 +723,10 @@ collect_children(void) sigaddset(&nset, SIGCHLD); sigprocmask(SIG_BLOCK, &nset, &oset); if (child_terminated) { - while ((pid = waitpid(-1, &status, WNOHANG)) > 0) - session_close_by_pid(pid, status); + while ((pid = waitpid(-1, &status, WNOHANG)) > 0 || + (pid < 0 && errno == EINTR)) + if (pid > 0) + session_close_by_pid(pid, status); child_terminated = 0; } sigprocmask(SIG_SETMASK, &oset, NULL); @@ -784,7 +783,7 @@ server_loop2(Authctxt *authctxt) channel_free_all(); /* free remaining sessions, e.g. remove wtmp entries */ - session_destroy_all(); + session_destroy_all(NULL); } static void diff --git a/openssh/session.c b/openssh/session.c index efed43b..0818d94 100644 --- a/openssh/session.c +++ b/openssh/session.c @@ -33,7 +33,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.128 2002/02/16 00:51:44 markus Exp $"); +RCSID("$OpenBSD: session.c,v 1.134 2002/03/29 18:59:31 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -56,6 +56,7 @@ RCSID("$OpenBSD: session.c,v 1.128 2002/02/16 00:51:44 markus Exp $"); #include "serverloop.h" #include "canohost.h" #include "session.h" +#include "monitor_wrap.h" #ifdef GSSAPI #include "ssh-gss.h" @@ -67,39 +68,11 @@ RCSID("$OpenBSD: session.c,v 1.128 2002/02/16 00:51:44 markus Exp $"); #define is_winnt (GetVersion() < 0x80000000) #endif -/* types */ - -#define TTYSZ 64 -typedef struct Session Session; -struct Session { - int used; - int self; - struct passwd *pw; - Authctxt *authctxt; - pid_t pid; - /* tty */ - char *term; - int ptyfd, ttyfd, ptymaster; - int row, col, xpixel, ypixel; - char tty[TTYSZ]; - /* X11 */ - int display_number; - char *display; - int screen; - char *auth_display; - char *auth_proto; - char *auth_data; - int single_connection; - /* proto 2 */ - int chanid; - int is_subsystem; -}; - /* func */ Session *session_new(void); void session_set_fds(Session *, int, int, int); -static void session_pty_cleanup(void *); +void session_pty_cleanup(void *); void session_proctitle(Session *); int session_setup_x11fwd(Session *); void do_exec_pty(Session *, const char *); @@ -116,7 +89,6 @@ int check_quietlogin(Session *, const char *); static void do_authenticated1(Authctxt *); static void do_authenticated2(Authctxt *); -static void session_close(Session *); static int session_pty_req(Session *); /* import */ @@ -140,7 +112,7 @@ char *aixloginmsg; #endif /* WITH_AIXAUTHENTICATE */ #ifdef HAVE_LOGIN_CAP -static login_cap_t *lc; +login_cap_t *lc; #endif void @@ -155,18 +127,6 @@ do_authenticated(Authctxt *authctxt) close(startup_pipe); startup_pipe = -1; } -#if defined(HAVE_LOGIN_CAP) && defined(HAVE_PW_CLASS_IN_PASSWD) - if ((lc = login_getclass(authctxt->pw->pw_class)) == NULL) { - error("unable to get login class"); - return; - } -#ifdef BSD_AUTH - if (auth_approval(NULL, lc, authctxt->pw->pw_name, "ssh") <= 0) { - packet_disconnect("Approval failure for %s", - authctxt->pw->pw_name); - } -#endif -#endif #ifdef WITH_AIXAUTHENTICATE /* We don't have a pty yet, so just label the line as "ssh" */ if (loginsuccess(authctxt->user, @@ -675,10 +635,8 @@ void do_login(Session *s, const char *command) { char *time_string; - char hostname[MAXHOSTNAMELEN]; socklen_t fromlen; struct sockaddr_storage from; - time_t last_login_time; struct passwd * pw = s->pw; pid_t pid = getpid(); @@ -696,17 +654,12 @@ do_login(Session *s, const char *command) } } - /* Get the time and hostname when the user last logged in. */ - if (options.print_lastlog) { - hostname[0] = '\0'; - last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name, - hostname, sizeof(hostname)); - } - /* Record that there was a login on that tty from the remote host. */ - record_login(pid, s->tty, pw->pw_name, pw->pw_uid, - get_remote_name_or_ip(utmp_len, options.verify_reverse_mapping), - (struct sockaddr *)&from); + if (!use_privsep) + record_login(pid, s->tty, pw->pw_name, pw->pw_uid, + get_remote_name_or_ip(utmp_len, + options.verify_reverse_mapping), + (struct sockaddr *)&from); #ifdef USE_PAM /* @@ -731,14 +684,15 @@ do_login(Session *s, const char *command) printf("%s\n", aixloginmsg); #endif /* WITH_AIXAUTHENTICATE */ - if (options.print_lastlog && last_login_time != 0) { - time_string = ctime(&last_login_time); + if (options.print_lastlog && s->last_login_time != 0) { + time_string = ctime(&s->last_login_time); if (strchr(time_string, '\n')) *strchr(time_string, '\n') = 0; - if (strcmp(hostname, "") == 0) + if (strcmp(s->hostname, "") == 0) printf("Last login: %s\r\n", time_string); else - printf("Last login: %s from %s\r\n", time_string, hostname); + printf("Last login: %s from %s\r\n", time_string, + s->hostname); } do_motd(); @@ -940,7 +894,12 @@ do_setup_env(Session *s, const char *shell) * needed for loading shared libraries. So the path better * remains intact here. */ +# ifdef SUPERUSER_PATH + child_set_env(&env, &envsize, "PATH", + s->pw->pw_uid == 0 ? SUPERUSER_PATH : _PATH_STDPATH); +# else child_set_env(&env, &envsize, "PATH", _PATH_STDPATH); +# endif /* SUPERUSER_PATH */ # endif /* HAVE_CYGWIN */ #endif /* HAVE_LOGIN_CAP */ @@ -1122,7 +1081,7 @@ do_nologin(struct passwd *pw) } /* Set login name, uid, gid, and groups. */ -static void +void do_setusercontext(struct passwd *pw) { #ifdef HAVE_CYGWIN @@ -1177,6 +1136,27 @@ do_setusercontext(struct passwd *pw) fatal("Failed to set uids to %u.", (u_int) pw->pw_uid); } +static void +launch_login(struct passwd *pw, const char *hostname) +{ + /* Launch login(1). */ + + execl("/usr/bin/login", "login", "-h", hostname, +#ifdef xxxLOGIN_NEEDS_TERM + (s->term ? s->term : "unknown"), +#endif /* LOGIN_NEEDS_TERM */ +#ifdef LOGIN_NO_ENDOPT + "-p", "-f", pw->pw_name, (char *)NULL); +#else + "-p", "-f", "--", pw->pw_name, (char *)NULL); +#endif + + /* Login couldn't be executed, die. */ + + perror("login"); + exit(1); +} + /* * Performs common processing for the child, such as setting up the * environment, closing extra file descriptors, setting the user and group @@ -1302,18 +1282,8 @@ do_child(Session *s, const char *command) signal(SIGPIPE, SIG_DFL); if (options.use_login) { - /* Launch login(1). */ - - execl(LOGIN_PROGRAM, "login", "-h", hostname, -#ifdef LOGIN_NEEDS_TERM - (s->term ? s->term : "unknown"), -#endif /* LOGIN_NEEDS_TERM */ - "-p", "-f", "--", pw->pw_name, (char *)NULL); - - /* Login couldn't be executed, die. */ - - perror("login"); - exit(1); + launch_login(pw, hostname); + /* NEVERREACHED */ } /* Get the last component of the shell name. */ @@ -1423,6 +1393,22 @@ session_open(Authctxt *authctxt, int chanid) return 1; } +Session * +session_by_tty(char *tty) +{ + int i; + for (i = 0; i < MAX_SESSIONS; i++) { + Session *s = &sessions[i]; + if (s->used && s->ttyfd != -1 && strcmp(s->tty, tty) == 0) { + debug("session_by_tty: session %d tty %s", i, tty); + return s; + } + } + debug("session_by_tty: unknown tty %.100s", tty); + session_dump(); + return NULL; +} + static Session * session_by_channel(int id) { @@ -1480,6 +1466,12 @@ session_pty_req(Session *s) packet_disconnect("Protocol error: you already have a pty."); return 0; } + /* Get the time and hostname when the user last logged in. */ + if (options.print_lastlog) { + s->hostname[0] = '\0'; + s->last_login_time = get_last_login_time(s->pw->pw_uid, + s->pw->pw_name, s->hostname, sizeof(s->hostname)); + } s->term = packet_get_string(&len); @@ -1500,7 +1492,7 @@ session_pty_req(Session *s) /* Allocate a pty and open it. */ debug("Allocating pty."); - if (!pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty))) { + if (!PRIVSEP(pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty)))) { if (s->term) xfree(s->term); s->term = NULL; @@ -1521,7 +1513,8 @@ session_pty_req(Session *s) * time in case we call fatal() (e.g., the connection gets closed). */ fatal_add_cleanup(session_pty_cleanup, (void *)s); - pty_setowner(s->pw, s->tty); + if (!use_privsep) + pty_setowner(s->pw, s->tty); /* Set window size from the packet. */ pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); @@ -1684,8 +1677,8 @@ session_set_fds(Session *s, int fdin, int fdout, int fderr) * Function to perform pty cleanup. Also called if we get aborted abnormally * (e.g., due to a dropped connection). */ -static void -session_pty_cleanup(void *session) +void +session_pty_cleanup2(void *session) { Session *s = session; @@ -1703,7 +1696,8 @@ session_pty_cleanup(void *session) record_logout(s->pid, s->tty, s->pw->pw_name); /* Release the pseudo-tty. */ - pty_release(s->tty); + if (getuid() == 0) + pty_release(s->tty); /* * Close the server side of the socket pairs. We must do this after @@ -1711,12 +1705,18 @@ session_pty_cleanup(void *session) * while we're still cleaning up. */ if (close(s->ptymaster) < 0) - error("close(s->ptymaster): %s", strerror(errno)); + error("close(s->ptymaster/%d): %s", s->ptymaster, strerror(errno)); /* unlink pty from session */ s->ttyfd = -1; } +void +session_pty_cleanup(void *session) +{ + PRIVSEP(session_pty_cleanup2(session)); +} + static void session_exit_message(Session *s, int status) { @@ -1762,7 +1762,7 @@ session_exit_message(Session *s, int status) s->chanid = -1; } -static void +void session_close(Session *s) { debug("session_close: session %d pid %d", s->self, s->pid); @@ -1829,13 +1829,17 @@ session_close_by_channel(int id, void *arg) } void -session_destroy_all(void) +session_destroy_all(void (*closefunc)(Session *)) { int i; for (i = 0; i < MAX_SESSIONS; i++) { Session *s = &sessions[i]; - if (s->used) - session_close(s); + if (s->used) { + if (closefunc != NULL) + closefunc(s); + else + session_close(s); + } } } diff --git a/openssh/session.h b/openssh/session.h index b83a57a..befb7c1 100644 --- a/openssh/session.h +++ b/openssh/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.14 2002/02/03 17:53:25 markus Exp $ */ +/* $OpenBSD: session.h,v 1.17 2002/03/29 18:59:32 markus Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -26,13 +26,49 @@ #ifndef SESSION_H #define SESSION_H +#define TTYSZ 64 +typedef struct Session Session; +struct Session { + int used; + int self; + struct passwd *pw; + Authctxt *authctxt; + pid_t pid; + /* tty */ + char *term; + int ptyfd, ttyfd, ptymaster; + int row, col, xpixel, ypixel; + char tty[TTYSZ]; + /* last login */ + char hostname[MAXHOSTNAMELEN]; + time_t last_login_time; + /* X11 */ + int display_number; + char *display; + int screen; + char *auth_display; + char *auth_proto; + char *auth_data; + int single_connection; + /* proto 2 */ + int chanid; + int is_subsystem; +}; + void do_authenticated(Authctxt *); int session_open(Authctxt*, int); int session_input_channel_req(Channel *, const char *); void session_close_by_pid(pid_t, int); void session_close_by_channel(int, void *); -void session_destroy_all(void); +void session_destroy_all(void (*)(Session *)); +void session_pty_cleanup2(void *); + +Session *session_new(void); +Session *session_by_tty(char *); +void session_close(Session *); +void do_setusercontext(struct passwd *); + void child_set_env(char ***envp, u_int *envsizep, const char *name, const char *value); #endif diff --git a/openssh/sftp-client.c b/openssh/sftp-client.c index 17ac14a..0d42696 100644 --- a/openssh/sftp-client.c +++ b/openssh/sftp-client.c @@ -28,13 +28,9 @@ /* XXX: copy between two remote sites */ #include "includes.h" -RCSID("$OpenBSD: sftp-client.c,v 1.24 2002/02/24 16:57:19 markus Exp $"); +RCSID("$OpenBSD: sftp-client.c,v 1.31 2002/04/06 00:30:08 djm Exp $"); -#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) -#include -#else #include "openbsd-compat/fake-queue.h" -#endif #include "buffer.h" #include "bufaux.h" @@ -274,7 +270,7 @@ do_init(int fd_in, int fd_out, u_int transfer_buflen, u_int num_requests) /* Some filexfer v.0 servers don't support large packets */ if (version == 0) - ret->transfer_buflen = MAX(ret->transfer_buflen, 20480); + ret->transfer_buflen = MIN(ret->transfer_buflen, 20480); return(ret); } @@ -449,7 +445,7 @@ do_rm(struct sftp_conn *conn, char *path) debug2("Sending SSH2_FXP_REMOVE \"%s\"", path); id = conn->msg_id++; - send_string_request(conn->fd_out, id, SSH2_FXP_REMOVE, path, + send_string_request(conn->fd_out, id, SSH2_FXP_REMOVE, path, strlen(path)); status = get_status(conn->fd_in, id); if (status != SSH2_FX_OK) @@ -496,8 +492,8 @@ do_stat(struct sftp_conn *conn, char *path, int quiet) id = conn->msg_id++; - send_string_request(conn->fd_out, id, - conn->version == 0 ? SSH2_FXP_STAT_VERSION_0 : SSH2_FXP_STAT, + send_string_request(conn->fd_out, id, + conn->version == 0 ? SSH2_FXP_STAT_VERSION_0 : SSH2_FXP_STAT, path, strlen(path)); return(get_decode_stat(conn->fd_in, id, quiet)); @@ -512,8 +508,8 @@ do_lstat(struct sftp_conn *conn, char *path, int quiet) if (quiet) debug("Server version does not support lstat operation"); else - error("Server version does not support lstat operation"); - return(NULL); + log("Server version does not support lstat operation"); + return(do_stat(conn, path, quiet)); } id = conn->msg_id++; @@ -727,7 +723,7 @@ send_read_request(int fd_out, u_int id, u_int64_t offset, u_int len, char *handle, u_int handle_len) { Buffer msg; - + buffer_init(&msg); buffer_clear(&msg); buffer_put_char(&msg, SSH2_FXP_READ); @@ -737,7 +733,7 @@ send_read_request(int fd_out, u_int id, u_int64_t offset, u_int len, buffer_put_int(&msg, len); send_msg(fd_out, &msg); buffer_free(&msg); -} +} int do_download(struct sftp_conn *conn, char *remote_path, char *local_path, @@ -754,7 +750,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, u_int id; u_int len; u_int64_t offset; - TAILQ_ENTRY(request) tq; + TAILQ_ENTRY(request) tq; }; TAILQ_HEAD(reqhead, request) requests; struct request *req; @@ -820,8 +816,10 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, /* Send some more requests */ while (num_req < max_req) { - debug3("Request range %llu -> %llu (%d/%d)", - offset, offset + buflen - 1, num_req, max_req); + debug3("Request range %llu -> %llu (%d/%d)", + (unsigned long long)offset, + (unsigned long long)offset + buflen - 1, + num_req, max_req); req = xmalloc(sizeof(*req)); req->id = conn->msg_id++; req->len = buflen; @@ -829,7 +827,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, offset += buflen; num_req++; TAILQ_INSERT_TAIL(&requests, req, tq); - send_read_request(conn->fd_out, req->id, req->offset, + send_read_request(conn->fd_out, req->id, req->offset, req->len, handle, handle_len); } @@ -859,8 +857,9 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, break; case SSH2_FXP_DATA: data = buffer_get_string(&msg, &len); - debug3("Received data %llu -> %llu", req->offset, - req->offset + len - 1); + debug3("Received data %llu -> %llu", + (unsigned long long)req->offset, + (unsigned long long)req->offset + len - 1); if (len > req->len) fatal("Received more data than asked for " "%d > %d", len, req->len); @@ -880,12 +879,14 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, } else { /* Resend the request for the missing data */ debug3("Short data block, re-requesting " - "%llu -> %llu (%2d)", req->offset + len, - req->offset + req->len - 1, num_req); + "%llu -> %llu (%2d)", + (unsigned long long)req->offset + len, + (unsigned long long)req->offset + + req->len - 1, num_req); req->id = conn->msg_id++; req->len -= len; req->offset += len; - send_read_request(conn->fd_out, req->id, + send_read_request(conn->fd_out, req->id, req->offset, req->len, handle, handle_len); /* Reduce the request size */ if (len < buflen) @@ -896,7 +897,8 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, /* Only one request at a time * after the expected EOF */ debug3("Finish at %llu (%2d)", - offset, num_req); + (unsigned long long)offset, + num_req); max_req = 1; } else if (max_req < conn->num_requests + 1) { @@ -915,7 +917,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, fatal("Transfer complete, but requests still in queue"); if (read_error) { - error("Couldn't read from remote file \"%s\" : %s", + error("Couldn't read from remote file \"%s\" : %s", remote_path, fx2txt(status)); do_close(conn, handle, handle_len); } else if (write_error) { @@ -968,7 +970,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, u_int id; u_int len; u_int64_t offset; - TAILQ_ENTRY(outstanding_ack) tq; + TAILQ_ENTRY(outstanding_ack) tq; }; TAILQ_HEAD(ackhead, outstanding_ack) acks; struct outstanding_ack *ack; @@ -1050,19 +1052,21 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, buffer_put_string(&msg, data, len); send_msg(conn->fd_out, &msg); debug3("Sent message SSH2_FXP_WRITE I:%d O:%llu S:%u", - id, (u_int64_t)offset, len); + id, (unsigned long long)offset, len); } else if (TAILQ_FIRST(&acks) == NULL) break; if (ack == NULL) fatal("Unexpected ACK %u", id); - if (id == startid || len == 0 || + if (id == startid || len == 0 || id - ackid >= conn->num_requests) { + u_int r_id; + buffer_clear(&msg); get_msg(conn->fd_in, &msg); type = buffer_get_char(&msg); - id = buffer_get_int(&msg); + r_id = buffer_get_int(&msg); if (type != SSH2_FXP_STATUS) fatal("Expected SSH2_FXP_STATUS(%d) packet, " @@ -1073,11 +1077,11 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, /* Find the request in our queue */ for(ack = TAILQ_FIRST(&acks); - ack != NULL && ack->id != id; + ack != NULL && ack->id != r_id; ack = TAILQ_NEXT(ack, tq)) ; if (ack == NULL) - fatal("Can't find request for ID %d", id); + fatal("Can't find request for ID %d", r_id); TAILQ_REMOVE(&acks, ack, tq); if (status != SSH2_FX_OK) { @@ -1087,8 +1091,8 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, close(local_fd); goto done; } - debug3("In write loop, ack for %u %d bytes at %llu", - ack->id, ack->len, ack->offset); + debug3("In write loop, ack for %u %d bytes at %llu", + ack->id, ack->len, (unsigned long long)ack->offset); ++ackid; free(ack); } diff --git a/openssh/sftp-glob.h b/openssh/sftp-glob.h index 488b0a8..9c75491 100644 --- a/openssh/sftp-glob.h +++ b/openssh/sftp-glob.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-glob.h,v 1.6 2002/02/13 00:59:23 djm Exp $ */ +/* $OpenBSD: sftp-glob.h,v 1.7 2002/03/19 10:49:35 markus Exp $ */ /* * Copyright (c) 2001,2002 Damien Miller. All rights reserved. @@ -32,7 +32,7 @@ #include "sftp-client.h" int -remote_glob(struct sftp_conn *, const char *, int, +remote_glob(struct sftp_conn *, const char *, int, int (*)(const char *, int), glob_t *); #endif diff --git a/openssh/sftp-int.c b/openssh/sftp-int.c index 5de9389..5b1d384 100644 --- a/openssh/sftp-int.c +++ b/openssh/sftp-int.c @@ -26,7 +26,7 @@ /* XXX: recursive operations */ #include "includes.h" -RCSID("$OpenBSD: sftp-int.c,v 1.44 2002/02/13 00:59:23 djm Exp $"); +RCSID("$OpenBSD: sftp-int.c,v 1.46 2002/03/30 18:51:15 markus Exp $"); #include "buffer.h" #include "xmalloc.h" @@ -176,8 +176,9 @@ local_do_shell(const char *args) strerror(errno)); _exit(1); } - if (waitpid(pid, &status, 0) == -1) - fatal("Couldn't wait for child: %s", strerror(errno)); + while (waitpid(pid, &status, 0) == -1) + if (errno != EINTR) + fatal("Couldn't wait for child: %s", strerror(errno)); if (!WIFEXITED(status)) error("Shell exited abormally"); else if (WEXITSTATUS(status)) @@ -886,8 +887,10 @@ interactive_loop(int fd_in, int fd_out, char *file1, char *file2) file2); parse_dispatch_command(conn, cmd, &pwd); + xfree(dir); return; } + xfree(dir); } #if HAVE_SETVBUF setvbuf(stdout, NULL, _IOLBF, 0); diff --git a/openssh/sftp.c b/openssh/sftp.c index 045e076..9a6488f 100644 --- a/openssh/sftp.c +++ b/openssh/sftp.c @@ -24,7 +24,7 @@ #include "includes.h" -RCSID("$OpenBSD: sftp.c,v 1.26 2002/02/12 12:32:27 djm Exp $"); +RCSID("$OpenBSD: sftp.c,v 1.29 2002/04/02 17:37:48 markus Exp $"); /* XXX: short-form remote directory listings (like 'ls -C') */ @@ -94,7 +94,7 @@ static void usage(void) { extern char *__progname; - + fprintf(stderr, "usage: %s [-vC1] [-b batchfile] [-o option] [-s subsystem|path] [-B buffer_size]\n" " [-F config] [-P direct server path] [-S program]\n" @@ -172,7 +172,7 @@ main(int argc, char **argv) case 'R': num_requests = strtol(optarg, &cp, 10); if (num_requests == 0 || *cp != '\0') - fatal("Invalid number of requests \"%s\"", + fatal("Invalid number of requests \"%s\"", optarg); break; case 'h': @@ -181,6 +181,8 @@ main(int argc, char **argv) } } + log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1); + if (sftp_direct == NULL) { if (optind == argc || argc > (optind + 2)) usage(); @@ -210,7 +212,6 @@ main(int argc, char **argv) usage(); } - log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1); addargs(&args, "-oProtocol %d", sshver); /* no subsystem if the server-spec contains a '/' */ @@ -218,19 +219,19 @@ main(int argc, char **argv) addargs(&args, "-s"); addargs(&args, "%s", host); - addargs(&args, "%s", (sftp_server != NULL ? + addargs(&args, "%s", (sftp_server != NULL ? sftp_server : "sftp")); args.list[0] = ssh_program; fprintf(stderr, "Connecting to %s...\n", host); - connect_to_server(ssh_program, args.list, &in, &out, + connect_to_server(ssh_program, args.list, &in, &out, &sshpid); } else { args.list = NULL; addargs(&args, "sftp-server"); fprintf(stderr, "Attaching to %s...\n", sftp_direct); - connect_to_server(sftp_direct, args.list, &in, &out, + connect_to_server(sftp_direct, args.list, &in, &out, &sshpid); } @@ -246,8 +247,10 @@ main(int argc, char **argv) if (infile != stdin) fclose(infile); - if (waitpid(sshpid, NULL, 0) == -1) - fatal("Couldn't wait for ssh process: %s", strerror(errno)); + while (waitpid(sshpid, NULL, 0) == -1) + if (errno != EINTR) + fatal("Couldn't wait for ssh process: %s", + strerror(errno)); exit(0); } diff --git a/openssh/ssh-add.c b/openssh/ssh-add.c index b057a08..d24d761 100644 --- a/openssh/ssh-add.c +++ b/openssh/ssh-add.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-add.c,v 1.50 2002/01/29 14:27:57 markus Exp $"); +RCSID("$OpenBSD: ssh-add.c,v 1.53 2002/03/21 22:44:05 rees Exp $"); #include @@ -62,7 +62,7 @@ extern char *__progname; static char *default_files[] = { _PATH_SSH_CLIENT_ID_RSA, _PATH_SSH_CLIENT_ID_DSA, - _PATH_SSH_CLIENT_IDENTITY, + _PATH_SSH_CLIENT_IDENTITY, NULL }; @@ -176,7 +176,13 @@ add_file(AuthenticationConnection *ac, const char *filename) static int update_card(AuthenticationConnection *ac, int add, const char *id) { - if (ssh_update_card(ac, add, id)) { + char *pin; + + pin = read_passphrase("Enter passphrase for smartcard: ", RP_ALLOW_STDIN); + if (pin == NULL) + return -1; + + if (ssh_update_card(ac, add, id, pin)) { fprintf(stderr, "Card %s: %s\n", add ? "added" : "removed", id); return 0; @@ -310,6 +316,8 @@ main(int argc, char **argv) if (argc == 0) { char buf[MAXPATHLEN]; struct passwd *pw; + struct stat st; + int count = 0; if ((pw = getpwuid(getuid())) == NULL) { fprintf(stderr, "No user found with uid %u\n", @@ -319,11 +327,17 @@ main(int argc, char **argv) } for(i = 0; default_files[i]; i++) { - snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir, + snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir, default_files[i]); + if (stat(buf, &st) < 0) + continue; if (do_file(ac, deleting, buf) == -1) ret = 1; + else + count++; } + if (count == 0) + ret = 1; } else { for(i = 0; i < argc; i++) { if (do_file(ac, deleting, argv[i]) == -1) diff --git a/openssh/ssh-agent.c b/openssh/ssh-agent.c index 555396f..33596c4 100644 --- a/openssh/ssh-agent.c +++ b/openssh/ssh-agent.c @@ -34,13 +34,8 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-agent.c,v 1.82 2002/03/04 17:27:39 stevesk Exp $"); - -#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) -#include -#else #include "openbsd-compat/fake-queue.h" -#endif +RCSID("$OpenBSD: ssh-agent.c,v 1.85 2002/04/02 11:49:39 markus Exp $"); #include #include @@ -57,7 +52,6 @@ RCSID("$OpenBSD: ssh-agent.c,v 1.82 2002/03/04 17:27:39 stevesk Exp $"); #include "log.h" #ifdef SMARTCARD -#include #include "scard.h" #endif @@ -452,48 +446,39 @@ send: static void process_add_smartcard_key (SocketEntry *e) { + Identity *id; Idtab *tab; - Key *n = NULL, *k = NULL; - char *sc_reader_id = NULL; - int success = 0; + Key **keys, *k; + char *sc_reader_id = NULL, *pin; + int i, version, success = 0; sc_reader_id = buffer_get_string(&e->input, NULL); - k = sc_get_key(sc_reader_id); + pin = buffer_get_string(&e->input, NULL); + keys = sc_get_keys(sc_reader_id, pin); xfree(sc_reader_id); + xfree(pin); - if (k == NULL) { - error("sc_get_pubkey failed"); + if (keys == NULL || keys[0] == NULL) { + error("sc_get_keys failed"); goto send; } - success = 1; - - tab = idtab_lookup(1); - k->type = KEY_RSA1; - if (lookup_identity(k, 1) == NULL) { - Identity *id = xmalloc(sizeof(Identity)); - n = key_new(KEY_RSA1); - BN_copy(n->rsa->n, k->rsa->n); - BN_copy(n->rsa->e, k->rsa->e); - RSA_set_method(n->rsa, sc_get_engine()); - id->key = n; - id->comment = xstrdup("rsa1 smartcard"); - TAILQ_INSERT_TAIL(&tab->idlist, id, next); - tab->nentries++; - } - k->type = KEY_RSA; - tab = idtab_lookup(2); - if (lookup_identity(k, 2) == NULL) { - Identity *id = xmalloc(sizeof(Identity)); - n = key_new(KEY_RSA); - BN_copy(n->rsa->n, k->rsa->n); - BN_copy(n->rsa->e, k->rsa->e); - RSA_set_method(n->rsa, sc_get_engine()); - id->key = n; - id->comment = xstrdup("rsa smartcard"); - TAILQ_INSERT_TAIL(&tab->idlist, id, next); - tab->nentries++; + for (i = 0; keys[i] != NULL; i++) { + k = keys[i]; + version = k->type == KEY_RSA1 ? 1 : 2; + tab = idtab_lookup(version); + if (lookup_identity(k, version) == NULL) { + id = xmalloc(sizeof(Identity)); + id->key = k; + id->comment = xstrdup("smartcard key"); + TAILQ_INSERT_TAIL(&tab->idlist, id, next); + tab->nentries++; + success = 1; + } else { + key_free(k); + } + keys[i] = NULL; } - key_free(k); + xfree(keys); send: buffer_put_int(&e->output, 1); buffer_put_char(&e->output, @@ -503,39 +488,37 @@ send: static void process_remove_smartcard_key(SocketEntry *e) { - Key *k = NULL; - int success = 0; - char *sc_reader_id = NULL; + Identity *id; + Idtab *tab; + Key **keys, *k = NULL; + char *sc_reader_id = NULL, *pin; + int i, version, success = 0; sc_reader_id = buffer_get_string(&e->input, NULL); - k = sc_get_key(sc_reader_id); + pin = buffer_get_string(&e->input, NULL); + keys = sc_get_keys(sc_reader_id, pin); xfree(sc_reader_id); + xfree(pin); - if (k == NULL) { - error("sc_get_pubkey failed"); - } else { - Identity *id; - k->type = KEY_RSA1; - id = lookup_identity(k, 1); - if (id != NULL) { - Idtab *tab = idtab_lookup(1); - TAILQ_REMOVE(&tab->idlist, id, next); - free_identity(id); + if (keys == NULL || keys[0] == NULL) { + error("sc_get_keys failed"); + goto send; + } + for (i = 0; keys[i] != NULL; i++) { + k = keys[i]; + version = k->type == KEY_RSA1 ? 1 : 2; + if ((id = lookup_identity(k, version)) != NULL) { + tab = idtab_lookup(version); + TAILQ_REMOVE(&tab->idlist, id, next); tab->nentries--; - success = 1; - } - k->type = KEY_RSA; - id = lookup_identity(k, 2); - if (id != NULL) { - Idtab *tab = idtab_lookup(2); - TAILQ_REMOVE(&tab->idlist, id, next); free_identity(id); - tab->nentries--; success = 1; } key_free(k); + keys[i] = NULL; } - + xfree(keys); +send: buffer_put_int(&e->output, 1); buffer_put_char(&e->output, success ? SSH_AGENT_SUCCESS : SSH_AGENT_FAILURE); @@ -879,7 +862,7 @@ main(int ac, char **av) if (ac > 0 && (c_flag || k_flag || s_flag || d_flag)) usage(); - if (ac == 0 && !c_flag && !k_flag && !s_flag && !d_flag) { + if (ac == 0 && !c_flag && !s_flag) { shell = getenv("SHELL"); if (shell != NULL && strncmp(shell + strlen(shell) - 3, "csh", 3) == 0) c_flag = 1; diff --git a/openssh/ssh-keygen.c b/openssh/ssh-keygen.c index 6aff4a4..250e53e 100644 --- a/openssh/ssh-keygen.c +++ b/openssh/ssh-keygen.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keygen.c,v 1.94 2002/02/25 16:33:27 markus Exp $"); +RCSID("$OpenBSD: ssh-keygen.c,v 1.98 2002/03/27 22:21:45 markus Exp $"); #include #include @@ -29,8 +29,6 @@ RCSID("$OpenBSD: ssh-keygen.c,v 1.94 2002/02/25 16:33:27 markus Exp $"); #include "readpass.h" #ifdef SMARTCARD -#include -#include #include "scard.h" #endif @@ -292,6 +290,7 @@ do_convert_from_ssh2(struct passwd *pw) { Key *k; int blen; + u_int len; char line[1024], *p; u_char blob[8096]; char encoded[8096]; @@ -336,6 +335,12 @@ do_convert_from_ssh2(struct passwd *pw) *p = '\0'; strlcat(encoded, line, sizeof(encoded)); } + len = strlen(encoded); + if (((len % 4) == 3) && + (encoded[len-1] == '=') && + (encoded[len-2] == '=') && + (encoded[len-3] == '=')) + encoded[len-3] = '\0'; blen = uudecode(encoded, blob, sizeof(blob)); if (blen < 0) { fprintf(stderr, "uudecode failed.\n"); @@ -389,145 +394,47 @@ do_print_public(struct passwd *pw) } #ifdef SMARTCARD -#define NUM_RSA_KEY_ELEMENTS 5+1 -#define COPY_RSA_KEY(x, i) \ - do { \ - len = BN_num_bytes(prv->rsa->x); \ - elements[i] = xmalloc(len); \ - debug("#bytes %d", len); \ - if (BN_bn2bin(prv->rsa->x, elements[i]) < 0) \ - goto done; \ - } while (0) - -static int -get_AUT0(char *aut0) -{ - EVP_MD *evp_md = EVP_sha1(); - EVP_MD_CTX md; - char *pass; - - pass = read_passphrase("Enter passphrase for smartcard: ", RP_ALLOW_STDIN); - if (pass == NULL) - return -1; - EVP_DigestInit(&md, evp_md); - EVP_DigestUpdate(&md, pass, strlen(pass)); - EVP_DigestFinal(&md, aut0, NULL); - memset(pass, 0, strlen(pass)); - xfree(pass); - return 0; -} - static void do_upload(struct passwd *pw, const char *sc_reader_id) { Key *prv = NULL; struct stat st; - u_char *elements[NUM_RSA_KEY_ELEMENTS]; - u_char key_fid[2]; - u_char DEFAUT0[] = {0xad, 0x9f, 0x61, 0xfe, 0xfa, 0x20, 0xce, 0x63}; - u_char AUT0[EVP_MAX_MD_SIZE]; - int len, status = 1, i, fd = -1, ret; - int sw = 0, cla = 0x00; - - for (i = 0; i < NUM_RSA_KEY_ELEMENTS; i++) - elements[i] = NULL; + int ret; + if (!have_identity) ask_filename(pw, "Enter file in which the key is"); if (stat(identity_file, &st) < 0) { perror(identity_file); - goto done; + exit(1); } prv = load_identity(identity_file); if (prv == NULL) { error("load failed"); - goto done; - } - COPY_RSA_KEY(q, 0); - COPY_RSA_KEY(p, 1); - COPY_RSA_KEY(iqmp, 2); - COPY_RSA_KEY(dmq1, 3); - COPY_RSA_KEY(dmp1, 4); - COPY_RSA_KEY(n, 5); - len = BN_num_bytes(prv->rsa->n); - fd = sectok_friendly_open(sc_reader_id, STONOWAIT, &sw); - if (fd < 0) { - error("sectok_open failed: %s", sectok_get_sw(sw)); - goto done; - } - if (! sectok_cardpresent(fd)) { - error("smartcard in reader %s not present", - sc_reader_id); - goto done; - } - ret = sectok_reset(fd, 0, NULL, &sw); - if (ret <= 0) { - error("sectok_reset failed: %s", sectok_get_sw(sw)); - goto done; - } - if ((cla = cyberflex_inq_class(fd)) < 0) { - error("cyberflex_inq_class failed"); - goto done; - } - memcpy(AUT0, DEFAUT0, sizeof(DEFAUT0)); - if (cyberflex_verify_AUT0(fd, cla, AUT0, sizeof(DEFAUT0)) < 0) { - if (get_AUT0(AUT0) < 0 || - cyberflex_verify_AUT0(fd, cla, AUT0, sizeof(DEFAUT0)) < 0) { - error("cyberflex_verify_AUT0 failed"); - goto done; - } - } - key_fid[0] = 0x00; - key_fid[1] = 0x12; - if (cyberflex_load_rsa_priv(fd, cla, key_fid, 5, 8*len, elements, - &sw) < 0) { - error("cyberflex_load_rsa_priv failed: %s", sectok_get_sw(sw)); - goto done; - } - if (!sectok_swOK(sw)) - goto done; - log("cyberflex_load_rsa_priv done"); - key_fid[0] = 0x73; - key_fid[1] = 0x68; - if (cyberflex_load_rsa_pub(fd, cla, key_fid, len, elements[5], - &sw) < 0) { - error("cyberflex_load_rsa_pub failed: %s", sectok_get_sw(sw)); - goto done; + exit(1); } - if (!sectok_swOK(sw)) - goto done; - log("cyberflex_load_rsa_pub done"); - status = 0; - log("loading key done"); -done: - - memset(elements[0], '\0', BN_num_bytes(prv->rsa->q)); - memset(elements[1], '\0', BN_num_bytes(prv->rsa->p)); - memset(elements[2], '\0', BN_num_bytes(prv->rsa->iqmp)); - memset(elements[3], '\0', BN_num_bytes(prv->rsa->dmq1)); - memset(elements[4], '\0', BN_num_bytes(prv->rsa->dmp1)); - memset(elements[5], '\0', BN_num_bytes(prv->rsa->n)); - - if (prv) - key_free(prv); - for (i = 0; i < NUM_RSA_KEY_ELEMENTS; i++) - if (elements[i]) - xfree(elements[i]); - if (fd != -1) - sectok_close(fd); - exit(status); + ret = sc_put_key(prv, sc_reader_id); + key_free(prv); + if (ret < 0) + exit(1); + log("loading key done"); + exit(0); } static void do_download(struct passwd *pw, const char *sc_reader_id) { - Key *pub = NULL; + Key **keys = NULL; + int i; - pub = sc_get_key(sc_reader_id); - if (pub == NULL) + keys = sc_get_keys(sc_reader_id, NULL); + if (keys == NULL) fatal("cannot read public key from smartcard"); - key_write(pub, stdout); - key_free(pub); - fprintf(stdout, "\n"); + for (i = 0; keys[i]; i++) { + key_write(keys[i], stdout); + key_free(keys[i]); + fprintf(stdout, "\n"); + } + xfree(keys); exit(0); } #endif /* SMARTCARD */ @@ -947,12 +854,10 @@ main(int ac, char **av) do_fingerprint(pw); if (change_passphrase) do_change_passphrase(pw); - if (change_comment) - do_change_comment(pw); if (convert_to_ssh2) do_convert_to_ssh2(pw); - if (convert_from_ssh2) - do_convert_from_ssh2(pw); + if (change_comment) + do_change_comment(pw); if (print_public) do_print_public(pw); if (reader_id != NULL) { @@ -970,6 +875,9 @@ main(int ac, char **av) seed_rng(); arc4random_stir(); + if (convert_from_ssh2) + do_convert_from_ssh2(pw); + if (key_type_name == NULL) { printf("You must specify a key type (-t).\n"); usage(); diff --git a/openssh/ssh-keyscan.c b/openssh/ssh-keyscan.c index 824264c..744f802 100644 --- a/openssh/ssh-keyscan.c +++ b/openssh/ssh-keyscan.c @@ -9,12 +9,7 @@ #include "includes.h" RCSID("$OpenBSD: ssh-keyscan.c,v 1.35 2002/03/04 18:30:23 stevesk Exp $"); -#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) -#include -#else #include "openbsd-compat/fake-queue.h" -#endif -#include #include diff --git a/openssh/ssh-rand-helper.8 b/openssh/ssh-rand-helper.8 new file mode 100644 index 0000000..bcf542e --- /dev/null +++ b/openssh/ssh-rand-helper.8 @@ -0,0 +1,94 @@ +.\" $Id$ +.\" +.\" Copyright (c) 2002 Damien Miller. 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. +.\" +.Dd April 14, 2002 +.Dt SSH-RAND-HELPER 8 +.Os +.Sh NAME +.Nm ssh-rand-helper +.Nd Random number gatherer for OpenSSH +.Sh SYNOPSIS +.Nm ssh-rand-hlper +.Op Fl vxXh +.Op Fl b Ar bytes +.Sh DESCRIPTION +.Nm +is a small helper program used by +.Xr ssh 1 , +.Xr ssh-add 1 , +.Xr ssh-agent 1 , +.Xr ssh-keygen 1 , +.Xr ssh-keyscan 1 +and +.Xr sshd 8 +to gather random numbers of cryptographic quality if the +.Xr openssl 4 +library has not been configured to provide them itself. +.Pp +Normally +.Nm +will generate a strong random seed and provide it to the calling +program via standard output. If standard output is a tty, +.Nm +will instead print the seed in hexidecimal format unless told otherwise. +.Pp +.Nm +will by default gather random numbers from the system commands listed +in +.Pa /etc/ssh/ssh_prng_cmds . +The output of each of the commands listed will be hashed and used to +generate a random seed for the calling program. +.Nm +will also store seed files in +.Pa ~/.ssh/prng_seed +between executions. +.Pp +Alternately, +.Nm +may be configured at build time to collect random numbers from a +EGD/PRNGd server via a unix domain or localhost tcp socket. +.Pp +This program is not intended to be run by the end-user, so the few +commandline options are for debugging purposes only. +.Bl -tag -width Ds +.It Fl b Ar bytes +Specify the number of random bytes to include in the output. +.It Fl x +Output a hexidecimal instead of a binary seed. +.It Fl X +Force output of a binary seed, even if standard output is a tty +.It Fl v +Turn on debugging message. Multiple +.Fl v +options will increase the debugging level. +.Fl h +Display a summary of options. +.El +.Sh AUTHORS +Damien Miller +.Sh SEE ALSO +.Xr ssh 1 , +.Xr ssh-add 1 , +.Xr ssh-keygen 1 , +.Xr sshd 8 diff --git a/openssh/ssh-rand-helper.c b/openssh/ssh-rand-helper.c index 28ea659..72a818f 100644 --- a/openssh/ssh-rand-helper.c +++ b/openssh/ssh-rand-helper.c @@ -747,38 +747,88 @@ prng_read_commands(char *cmdfilename) return cur_cmd < MIN_ENTROPY_SOURCES ? -1 : 0; } +void +usage(void) +{ + fprintf(stderr, "Usage: %s [options]\n", __progname); + fprintf(stderr, " -v Verbose; display verbose debugging messages.\n"); + fprintf(stderr, " Multiple -v increases verbosity.\n"); + fprintf(stderr, " -x Force output in hexidecimal (for debugging)\n"); + fprintf(stderr, " -X Force output in binary\n"); + fprintf(stderr, " -b bytes Number of bytes to output (default %d)\n", + OUTPUT_SEED_SIZE); +} + int main(int argc, char **argv) { - unsigned char buf[OUTPUT_SEED_SIZE]; - int ret; + unsigned char *buf; + int ret, ch, debug_level, output_hex, bytes; + extern char *optarg; + LogLevel ll; __progname = get_progname(argv[0]); - /* XXX: need some debugging mode */ log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1); + ll = SYSLOG_LEVEL_INFO; + debug_level = output_hex = 0; + bytes = OUTPUT_SEED_SIZE; + + /* Don't write binary data to a tty, unless we are forced to */ + if (isatty(STDOUT_FILENO)) + output_hex = 1; + + while ((ch = getopt(argc, argv, "vxXhb:")) != -1) { + switch (ch) { + case 'v': + if (debug_level < 3) + ll = SYSLOG_LEVEL_DEBUG1 + debug_level++; + break; + case 'x': + output_hex = 1; + break; + case 'X': + output_hex = 0; + break; + case 'b': + if ((bytes = atoi(optarg)) <= 0) + fatal("Invalid number of output bytes"); + break; + case 'h': + usage(); + exit(0); + default: + error("Invalid commandline option"); + usage(); + } + } + + log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1); + #ifdef USE_SEED_FILES prng_read_seedfile(); #endif + buf = xmalloc(bytes); + /* * Seed the RNG from wherever we can */ /* Take whatever is on the stack, but don't credit it */ - RAND_add(buf, sizeof(buf), 0); + RAND_add(buf, bytes, 0); debug("Seeded RNG with %i bytes from system calls", (int)stir_from_system()); #ifdef PRNGD_PORT - if (get_random_bytes_prngd(buf, sizeof(buf), PRNGD_PORT, NULL) == -1) + if (get_random_bytes_prngd(buf, bytes, PRNGD_PORT, NULL) == -1) fatal("Entropy collection failed"); - RAND_add(buf, sizeof(buf), sizeof(buf)); + RAND_add(buf, bytes, bytes); #elif defined(PRNGD_SOCKET) - if (get_random_bytes_prngd(buf, sizeof(buf), 0, PRNGD_SOCKET) == -1) + if (get_random_bytes_prngd(buf, bytes, 0, PRNGD_SOCKET) == -1) fatal("Entropy collection failed"); - RAND_add(buf, sizeof(buf), sizeof(buf)); + RAND_add(buf, bytes, bytes); #else /* Read in collection commands */ if (prng_read_commands(SSH_PRNG_COMMAND_FILE) == -1) @@ -798,12 +848,18 @@ main(int argc, char **argv) if (!RAND_status()) fatal("Not enough entropy in RNG"); - RAND_bytes(buf, sizeof(buf)); + RAND_bytes(buf, bytes); - ret = atomicio(write, STDOUT_FILENO, buf, sizeof(buf)); + if (output_hex) { + for(ret = 0; ret < bytes; ret++) + printf("%02x", (unsigned char)(buf[ret])); + printf("\n"); + } else + ret = atomicio(write, STDOUT_FILENO, buf, bytes); - memset(buf, '\0', sizeof(buf)); + memset(buf, '\0', bytes); + xfree(buf); - return ret == sizeof(buf) ? 0 : 1; + return ret == bytes ? 0 : 1; } diff --git a/openssh/ssh-rsa.c b/openssh/ssh-rsa.c index 8e79d4e..fe4dc1f 100644 --- a/openssh/ssh-rsa.c +++ b/openssh/ssh-rsa.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-rsa.c,v 1.16 2002/02/24 19:14:59 markus Exp $"); +RCSID("$OpenBSD: ssh-rsa.c,v 1.18 2002/04/02 20:11:38 markus Exp $"); #include #include @@ -35,6 +35,7 @@ RCSID("$OpenBSD: ssh-rsa.c,v 1.16 2002/02/24 19:14:59 markus Exp $"); #include "key.h" #include "ssh-rsa.h" #include "compat.h" +#include "ssh.h" /* RSASSA-PKCS1-v1_5 (PKCS #1 v2.0 signature) with SHA1 */ int @@ -54,10 +55,6 @@ ssh_rsa_sign( error("ssh_rsa_sign: no RSA key"); return -1; } - if (datafellows & SSH_BUG_SIGBLOB) { - error("ssh_rsa_sign: SSH_BUG_SIGBLOB not supported"); - return -1; - } nid = (datafellows & SSH_BUG_RSASIGMD5) ? NID_md5 : NID_sha1; if ((evp_md = EVP_get_digestbynid(nid)) == NULL) { error("ssh_rsa_sign: EVP_get_digestbynid %d failed", nid); @@ -125,11 +122,7 @@ ssh_rsa_verify( error("ssh_rsa_verify: no RSA key"); return -1; } - if (datafellows & SSH_BUG_SIGBLOB) { - error("ssh_rsa_verify: SSH_BUG_SIGBLOB not supported"); - return -1; - } - if (BN_num_bits(key->rsa->n) < 768) { + if (BN_num_bits(key->rsa->n) < SSH_RSA_MINIMUM_MODULUS_SIZE) { error("ssh_rsa_verify: n too small: %d bits", BN_num_bits(key->rsa->n)); return -1; diff --git a/openssh/ssh.1 b/openssh/ssh.1 index 43b75dc..46c3140 100644 --- a/openssh/ssh.1 +++ b/openssh/ssh.1 @@ -34,7 +34,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $OpenBSD: ssh.1,v 1.148 2002/02/18 17:55:20 markus Exp $ +.\" $OpenBSD: ssh.1,v 1.151 2002/05/06 23:34:33 millert Exp $ .Dd September 25, 1999 .Dt SSH 1 .Os @@ -297,6 +297,12 @@ Background ssh at logout when waiting for forwarded connection / X11 sessions to terminate .It Cm ~? Display a list of escape characters +.It Cm ~C +Open command line (only useful for adding port forwardings using the +.Fl L +and +.Fl R +options) .It Cm ~R Request rekeying of the connection (only useful for SSH protocol version 2 and if the peer supports it) @@ -1445,7 +1451,7 @@ The purpose for having this file is to be able to use rhosts authentication with .Nm without permitting login with -.Xr rlogin 1 +.Nm rlogin or .Xr rsh 1 . .It Pa /etc/hosts.equiv @@ -1502,7 +1508,6 @@ created OpenSSH. Markus Friedl contributed the support for SSH protocol versions 1.5 and 2.0. .Sh SEE ALSO -.Xr rlogin 1 , .Xr rsh 1 , .Xr scp 1 , .Xr sftp 1 , @@ -1518,7 +1523,7 @@ protocol versions 1.5 and 2.0. .%A T. Rinne .%A S. Lehtinen .%T "SSH Protocol Architecture" -.%N draft-ietf-secsh-architecture-09.txt -.%D July 2001 +.%N draft-ietf-secsh-architecture-12.txt +.%D January 2002 .%O work in progress material .Re diff --git a/openssh/ssh.c b/openssh/ssh.c index d288d78..8e4739a 100644 --- a/openssh/ssh.c +++ b/openssh/ssh.c @@ -13,6 +13,7 @@ * called by a name other than "ssh" or "Secure Shell". * * Copyright (c) 1999 Niels Provos. All rights reserved. + * Copyright (c) 2000, 2001, 2002 Markus Friedl. All rights reserved. * * Modified to work with SSL by Niels Provos * in Canada (German citizen). @@ -39,7 +40,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.164 2002/02/14 23:28:00 markus Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.170 2002/04/22 21:04:52 markus Exp $"); #include #include @@ -70,7 +71,6 @@ RCSID("$OpenBSD: ssh.c,v 1.164 2002/02/14 23:28:00 markus Exp $"); #include "sshtty.h" #ifdef SMARTCARD -#include #include "scard.h" #endif @@ -146,6 +146,9 @@ Buffer command; /* Should we execute a command or invoke a subsystem? */ int subsystem_flag = 0; +/* # of replies received for global requests */ +static int client_global_request_id = 0; + /* Prints a help message to the user. This function never returns. */ static void @@ -475,7 +478,7 @@ again: /* NOTREACHED */ } if ((fwd_port = a2port(sfwd_port)) == 0 || - (fwd_host_port = a2port(sfwd_host_port)) == 0) { + (fwd_host_port = a2port(sfwd_host_port)) == 0) { fprintf(stderr, "Bad forwarding port(s) '%s'\n", optarg); exit(1); @@ -1044,6 +1047,27 @@ client_subsystem_reply(int type, u_int32_t seq, void *ctxt) len, (u_char *)buffer_ptr(&command), id); } +void +client_global_request_reply(int type, u_int32_t seq, void *ctxt) +{ + int i; + + i = client_global_request_id++; + if (i >= options.num_remote_forwards) { + debug("client_global_request_reply: too many replies %d > %d", + i, options.num_remote_forwards); + return; + } + debug("remote forward %s for: listen %d, connect %s:%d", + type == SSH2_MSG_REQUEST_SUCCESS ? "success" : "failure", + options.remote_forwards[i].port, + options.remote_forwards[i].host, + options.remote_forwards[i].host_port); + if (type == SSH2_MSG_REQUEST_FAILURE) + log("Warning: remote port forwarding failed for listen port %d", + options.remote_forwards[i].port); +} + /* request pty/x11/agent/tcpfwd/shell for channel */ static void ssh_session2_setup(int id, void *arg) @@ -1190,40 +1214,29 @@ static void load_public_identity_files(void) { char *filename; - Key *public; int i = 0; - + Key *public; #ifdef SMARTCARD + Key **keys; + if (options.smartcard_device != NULL && - options.num_identity_files + 1 < SSH_MAX_IDENTITY_FILES && - (public = sc_get_key(options.smartcard_device)) != NULL ) { - Key *new; - - if (options.num_identity_files + 2 > SSH_MAX_IDENTITY_FILES) - options.num_identity_files = SSH_MAX_IDENTITY_FILES - 2; - memmove(&options.identity_files[2], &options.identity_files[0], - sizeof(char *) * options.num_identity_files); - options.num_identity_files += 2; - i = 2; - - /* XXX ssh1 vs ssh2 */ - new = key_new(KEY_RSA); - new->flags = KEY_FLAG_EXT; - BN_copy(new->rsa->n, public->rsa->n); - BN_copy(new->rsa->e, public->rsa->e); - RSA_set_method(new->rsa, sc_get_engine()); - options.identity_keys[0] = new; - options.identity_files[0] = xstrdup("smartcard rsa key");; - - new = key_new(KEY_RSA1); - new->flags = KEY_FLAG_EXT; - BN_copy(new->rsa->n, public->rsa->n); - BN_copy(new->rsa->e, public->rsa->e); - RSA_set_method(new->rsa, sc_get_engine()); - options.identity_keys[1] = new; - options.identity_files[1] = xstrdup("smartcard rsa1 key"); - - key_free(public); + options.num_identity_files < SSH_MAX_IDENTITY_FILES && + (keys = sc_get_keys(options.smartcard_device, NULL)) != NULL ) { + int count = 0; + for (i = 0; keys[i] != NULL; i++) { + count++; + memmove(&options.identity_files[1], &options.identity_files[0], + sizeof(char *) * (SSH_MAX_IDENTITY_FILES - 1)); + memmove(&options.identity_keys[1], &options.identity_keys[0], + sizeof(Key *) * (SSH_MAX_IDENTITY_FILES - 1)); + options.num_identity_files++; + options.identity_keys[0] = keys[i]; + options.identity_files[0] = xstrdup("smartcard key");; + } + if (options.num_identity_files > SSH_MAX_IDENTITY_FILES) + options.num_identity_files = SSH_MAX_IDENTITY_FILES; + i = count; + xfree(keys); } #endif /* SMARTCARD */ for (; i < options.num_identity_files; i++) { diff --git a/openssh/ssh.h b/openssh/ssh.h index fdf554d..aac6216 100644 --- a/openssh/ssh.h +++ b/openssh/ssh.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.h,v 1.64 2002/03/04 17:27:39 stevesk Exp $ */ +/* $OpenBSD: ssh.h,v 1.69 2002/05/11 20:24:48 stevesk Exp $ */ /* * Author: Tatu Ylonen @@ -99,4 +99,16 @@ /* Used to identify ``EscapeChar none'' */ #define SSH_ESCAPECHAR_NONE -2 +/* + * unprivileged user when UsePrivilegeSeparation=yes; + * sshd will change its privileges to this user and its + * primary group. + */ +#ifndef SSH_PRIVSEP_USER +#define SSH_PRIVSEP_USER "sshd" +#endif + +/* Minimum modulus size (n) for RSA keys. */ +#define SSH_RSA_MINIMUM_MODULUS_SIZE 768 + #endif /* SSH_H */ diff --git a/openssh/sshconnect1.c b/openssh/sshconnect1.c index 255271f..3a13506 100644 --- a/openssh/sshconnect1.c +++ b/openssh/sshconnect1.c @@ -13,7 +13,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect1.c,v 1.48 2002/02/11 16:15:46 markus Exp $"); +RCSID("$OpenBSD: sshconnect1.c,v 1.50 2002/04/21 16:25:06 stevesk Exp $"); #include #include @@ -473,6 +473,8 @@ try_krb4_authentication(void) /* Get server's response. */ reply = packet_get_string((u_int *) &auth.length); + if (auth.length >= MAX_KTXT_LEN) + fatal("Kerberos v4: Malformed response from server"); memcpy(auth.dat, reply, auth.length); xfree(reply); @@ -900,7 +902,7 @@ try_challenge_response_authentication(void) error("Permission denied, please try again."); if (options.cipher == SSH_CIPHER_NONE) log("WARNING: Encryption is disabled! " - "Reponse will be transmitted in clear text."); + "Response will be transmitted in clear text."); response = read_passphrase(prompt, 0); if (strcmp(response, "") == 0) { xfree(response); diff --git a/openssh/sshconnect2.c b/openssh/sshconnect2.c index 860fa3c..9bba4da 100644 --- a/openssh/sshconnect2.c +++ b/openssh/sshconnect2.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect2.c,v 1.97 2002/02/25 16:33:27 markus Exp $"); +RCSID("$OpenBSD: sshconnect2.c,v 1.99 2002/03/26 15:58:46 markus Exp $"); #include "ssh.h" #include "ssh2.h" @@ -210,6 +210,7 @@ void input_userauth_banner(int, u_int32_t, void *); void input_userauth_error(int, u_int32_t, void *); void input_userauth_info_req(int, u_int32_t, void *); void input_userauth_pk_ok(int, u_int32_t, void *); +void input_userauth_passwd_changereq(int, u_int32_t, void *); int userauth_none(Authctxt *); int userauth_pubkey(Authctxt *); @@ -455,7 +456,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, void *ctxt) debug("no key from blob. pkalg %s", pkalg); break; } - if (key->type != pktype) { + if (key->type != pktype) { error("input_userauth_pk_ok: type mismatch " "for decoded key (received %d, expected %d)", key->type, pktype); @@ -653,7 +654,7 @@ int userauth_passwd(Authctxt *authctxt) { static int attempt = 0; - char prompt[80]; + char prompt[150]; char *password; if (attempt++ >= options.number_of_password_prompts) @@ -675,13 +676,85 @@ userauth_passwd(Authctxt *authctxt) xfree(password); packet_add_padding(64); packet_send(); + + dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ, + &input_userauth_passwd_changereq); + return 1; } +/* + * parse PASSWD_CHANGEREQ, prompt user and send SSH2_MSG_USERAUTH_REQUEST + */ +void +input_userauth_passwd_changereq(int type, u_int32_t seqnr, void *ctxt) +{ + Authctxt *authctxt = ctxt; + char *info, *lang, *password = NULL, *retype = NULL; + char prompt[150]; + + debug2("input_userauth_passwd_changereq"); + + if (authctxt == NULL) + fatal("input_userauth_passwd_changereq: " + "no authentication context"); + + info = packet_get_string(NULL); + lang = packet_get_string(NULL); + if (strlen(info) > 0) + log("%s", info); + xfree(info); + xfree(lang); + packet_start(SSH2_MSG_USERAUTH_REQUEST); + packet_put_cstring(authctxt->server_user); + packet_put_cstring(authctxt->service); + packet_put_cstring(authctxt->method->name); + packet_put_char(1); /* additional info */ + snprintf(prompt, sizeof(prompt), + "Enter %.30s@%.128s's old password: ", + authctxt->server_user, authctxt->host); + password = read_passphrase(prompt, 0); + packet_put_cstring(password); + memset(password, 0, strlen(password)); + xfree(password); + password = NULL; + while (password == NULL) { + snprintf(prompt, sizeof(prompt), + "Enter %.30s@%.128s's new password: ", + authctxt->server_user, authctxt->host); + password = read_passphrase(prompt, RP_ALLOW_EOF); + if (password == NULL) { + /* bail out */ + return; + } + snprintf(prompt, sizeof(prompt), + "Retype %.30s@%.128s's new password: ", + authctxt->server_user, authctxt->host); + retype = read_passphrase(prompt, 0); + if (strcmp(password, retype) != 0) { + memset(password, 0, strlen(password)); + xfree(password); + log("Mismatch; try again, EOF to quit."); + password = NULL; + } + memset(retype, 0, strlen(retype)); + xfree(retype); + } + packet_put_cstring(password); + memset(password, 0, strlen(password)); + xfree(password); + packet_add_padding(64); + packet_send(); + + dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ, + &input_userauth_passwd_changereq); +} static void clear_auth_state(Authctxt *authctxt) { /* XXX clear authentication state */ + dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ, NULL); + if (authctxt->last_key != NULL && authctxt->last_key_hint == -1) { debug3("clear_auth_state: key_free %p", authctxt->last_key); key_free(authctxt->last_key); diff --git a/openssh/sshd.8 b/openssh/sshd.8 index b17a07b..25398eb 100644 --- a/openssh/sshd.8 +++ b/openssh/sshd.8 @@ -34,7 +34,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $OpenBSD: sshd.8,v 1.170 2002/02/28 20:46:10 stevesk Exp $ +.\" $OpenBSD: sshd.8,v 1.181 2002/05/15 21:02:53 markus Exp $ .Dd September 25, 1999 .Dt SSHD 8 .Os @@ -116,14 +116,14 @@ Rhosts authentication is normally disabled because it is fundamentally insecure, but can be enabled in the server configuration file if desired. System security is not improved unless -.Xr rshd 8 , -.Xr rlogind 8 , +.Nm rshd , +.Nm rlogind , and -.Xr rexecd 8 +.Xr rexecd are disabled (thus completely disabling -.Xr rlogin 1 +.Xr rlogin and -.Xr rsh 1 +.Xr rsh into the machine). .Pp .Ss SSH protocol version 2 @@ -332,7 +332,7 @@ keywords are case-insensitive and arguments are case-sensitive): .It Cm AFSTokenPassing Specifies whether an AFS token may be forwarded to the server. Default is -.Dq yes . +.Dq no . .It Cm AllowGroups This keyword can be followed by a list of group name patterns, separated by spaces. @@ -390,6 +390,7 @@ may be relevant for getting legal protection. The contents of the specified file are sent to the remote user before authentication is allowed. This option is only available for protocol version 2. +By default, no banner is displayed. .Pp .It Cm ChallengeResponseAuthentication Specifies whether challenge response authentication is allowed. @@ -589,7 +590,7 @@ the Kerberos KDC. To use this option, the server needs a Kerberos servtab which allows the verification of the KDC's identity. Default is -.Dq yes . +.Dq no . .It Cm KerberosOrLocalPasswd If set then if password authentication through Kerberos fails then the password will be validated via any additional local mechanism @@ -858,7 +859,19 @@ will be disabled because .Xr login 1 does not know how to handle .Xr xauth 1 -cookies. +cookies. If +.Cm UsePrivilegeSeparation +is specified, it will be disabled after authentication. +.It Cm UsePrivilegeSeparation +Specifies whether +.Nm +separated privileges by creating an unprivileged child process +to deal with incoming network traffic. After successful authentication, +another process will be created that has the privilege of the authenticated +user. The goal of privilege separation is to prevent privilege +escalation by containing any corruption within the unprivileged processes. +The default is +.Dq no . .It Cm VerifyReverseMapping Specifies whether .Nm @@ -1042,6 +1055,10 @@ or the .Pa id_rsa.pub file and edit it. .Pp +.Nm +enforces a minimum RSA key modulus size for protocol 1 +and protocol 2 keys of 768 bits. +.Pp The options (if present) consist of comma-separated option specifications. No spaces are permitted, except within double quotes. @@ -1326,13 +1343,17 @@ only by the user; it need not be readable by anyone else. .It Pa $HOME/.ssh/rc If this file exists, it is run with /bin/sh after reading the environment files but before starting the user's shell or command. -If X11 spoofing is in use, this will receive the "proto cookie" pair in -standard input (and +It must not produce any output on stdout; stderr must be used +instead. +If X11 forwarding is in use, it will receive the "proto cookie" pair in +its standard input (and .Ev DISPLAY -in environment). -This must call +in its environment). +The script must call .Xr xauth 1 -in that case. +because +.Nm +will not run xauth automatically to add X11 cookies. .Pp The primary purpose of this file is to run any initialization routines which may be needed before the user's home directory becomes @@ -1341,15 +1362,22 @@ accessible; AFS is a particular example of such an environment. This file will probably contain some initialization code followed by something similar to: .Bd -literal - if read proto cookie; then - echo add $DISPLAY $proto $cookie | xauth -q - +if read proto cookie && [ -n "$DISPLAY" ]; then + if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then + # X11UseLocalhost=yes + xauth add unix:`echo $DISPLAY | + cut -c11-` $proto $cookie + else + # X11UseLocalhost=no + xauth add $DISPLAY $proto $cookie fi +fi .Ed .Pp If this file does not exist, .Pa /etc/ssh/sshrc is run, and if that -does not exist either, xauth is used to store the cookie. +does not exist either, xauth is used to add the cookie. .Pp This file should be writable only by the user, and need not be readable by anyone else. @@ -1369,6 +1397,8 @@ removed many bugs, re-added newer features and created OpenSSH. Markus Friedl contributed the support for SSH protocol versions 1.5 and 2.0. +Niels Provos and Markus Friedl contributed support +for privilege separation. .Sh SEE ALSO .Xr scp 1 , .Xr sftp 1 , @@ -1386,8 +1416,8 @@ protocol versions 1.5 and 2.0. .%A T. Rinne .%A S. Lehtinen .%T "SSH Protocol Architecture" -.%N draft-ietf-secsh-architecture-09.txt -.%D July 2001 +.%N draft-ietf-secsh-architecture-12.txt +.%D January 2002 .%O work in progress material .Re .Rs @@ -1395,7 +1425,7 @@ protocol versions 1.5 and 2.0. .%A N. Provos .%A W. A. Simpson .%T "Diffie-Hellman Group Exchange for the SSH Transport Layer Protocol" -.%N draft-ietf-secsh-dh-group-exchange-01.txt -.%D April 2001 +.%N draft-ietf-secsh-dh-group-exchange-02.txt +.%D January 2002 .%O work in progress material .Re diff --git a/openssh/sshd.c b/openssh/sshd.c index c35a17f..a29dde6 100644 --- a/openssh/sshd.c +++ b/openssh/sshd.c @@ -15,8 +15,10 @@ * called by a name other than "ssh" or "Secure Shell". * * SSH2 implementation: + * Privilege Separation: * - * Copyright (c) 2000 Markus Friedl. All rights reserved. + * Copyright (c) 2000, 2001, 2002 Markus Friedl. All rights reserved. + * Copyright (c) 2002 Niels Provos. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,11 +42,16 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.228 2002/02/27 21:23:13 stevesk Exp $"); +RCSID("$OpenBSD: sshd.c,v 1.242 2002/05/15 15:47:49 mouring Exp $"); #include #include #include +#include +#ifdef HAVE_SECUREWARE +#include +#include +#endif #include "ssh.h" #include "ssh1.h" @@ -72,6 +79,11 @@ RCSID("$OpenBSD: sshd.c,v 1.228 2002/02/27 21:23:13 stevesk Exp $"); #include "misc.h" #include "dispatch.h" #include "channels.h" +#include "session.h" +#include "monitor_mm.h" +#include "monitor.h" +#include "monitor_wrap.h" +#include "monitor_fdpass.h" #ifdef GSSAPI #include "ssh-gss.h" @@ -198,8 +210,13 @@ u_int utmp_len = MAXHOSTNAMELEN; int *startup_pipes = NULL; int startup_pipe; /* in child */ +/* variables used for privilege separation */ +extern struct monitor *pmonitor; +extern int use_privsep; + /* Prototypes for various functions defined later in this file. */ void destroy_sensitive_data(void); +void demote_sensitive_data(void); static void do_ssh1_kex(void); static void do_ssh2_kex(void); @@ -272,10 +289,12 @@ sigterm_handler(int sig) static void main_sigchld_handler(int sig) { + pid_t pid; int save_errno = errno; int status; - while (waitpid(-1, &status, WNOHANG) > 0) + while ((pid = waitpid(-1, &status, WNOHANG)) > 0 || + (pid < 0 && errno == EINTR)) ; signal(SIGCHLD, main_sigchld_handler); @@ -486,6 +505,160 @@ destroy_sensitive_data(void) memset(sensitive_data.ssh1_cookie, 0, SSH_SESSION_KEY_LENGTH); } +/* Demote private to public keys for network child */ +void +demote_sensitive_data(void) +{ + Key *tmp; + int i; + + if (sensitive_data.server_key) { + tmp = key_demote(sensitive_data.server_key); + key_free(sensitive_data.server_key); + sensitive_data.server_key = tmp; + } + + for (i = 0; i < options.num_host_key_files; i++) { + if (sensitive_data.host_keys[i]) { + tmp = key_demote(sensitive_data.host_keys[i]); + key_free(sensitive_data.host_keys[i]); + sensitive_data.host_keys[i] = tmp; + if (tmp->type == KEY_RSA1) + sensitive_data.ssh1_host_key = tmp; + } + } + + /* We do not clear ssh1_host key and cookie. XXX - Okay Niels? */ +} + +static void +privsep_preauth_child(void) +{ + u_int32_t rand[256]; + int i; + struct passwd *pw; + + /* Enable challenge-response authentication for privilege separation */ + privsep_challenge_enable(); + + for (i = 0; i < 256; i++) + rand[i] = arc4random(); + RAND_seed(rand, sizeof(rand)); + + /* Demote the private keys to public keys. */ + demote_sensitive_data(); + + if ((pw = getpwnam(SSH_PRIVSEP_USER)) == NULL) + fatal("Privilege separation user %s does not exist", + SSH_PRIVSEP_USER); + memset(pw->pw_passwd, 0, strlen(pw->pw_passwd)); + endpwent(); + + /* Change our root directory*/ + if (chroot(_PATH_PRIVSEP_CHROOT_DIR) == -1) + fatal("chroot(\"%s\"): %s", _PATH_PRIVSEP_CHROOT_DIR, + strerror(errno)); + if (chdir("/") == -1) + fatal("chdir(\"/\"): %s", strerror(errno)); + + /* Drop our privileges */ + debug3("privsep user:group %u:%u", (u_int)pw->pw_uid, + (u_int)pw->pw_gid); + do_setusercontext(pw); +} + +static Authctxt* +privsep_preauth(void) +{ + Authctxt *authctxt = NULL; + int status; + pid_t pid; + + /* Set up unprivileged child process to deal with network data */ + pmonitor = monitor_init(); + /* Store a pointer to the kex for later rekeying */ + pmonitor->m_pkex = &xxx_kex; + + pid = fork(); + if (pid == -1) { + fatal("fork of unprivileged child failed"); + } else if (pid != 0) { + debug2("Network child is on pid %d", pid); + + close(pmonitor->m_recvfd); + authctxt = monitor_child_preauth(pmonitor); + close(pmonitor->m_sendfd); + + /* Sync memory */ + monitor_sync(pmonitor); + + /* Wait for the child's exit status */ + while (waitpid(pid, &status, 0) < 0) + if (errno != EINTR) + break; + return (authctxt); + } else { + /* child */ + + close(pmonitor->m_sendfd); + + /* Demote the child */ + if (getuid() == 0 || geteuid() == 0) + privsep_preauth_child(); + setproctitle("%s", "[net]"); + } + return (NULL); +} + +static void +privsep_postauth(Authctxt *authctxt) +{ + extern Authctxt *x_authctxt; + + /* XXX - Remote port forwarding */ + x_authctxt = authctxt; + + if (authctxt->pw->pw_uid == 0 || options.use_login) { + /* File descriptor passing is broken or root login */ + monitor_apply_keystate(pmonitor); + use_privsep = 0; + return; + } + + /* Authentication complete */ + alarm(0); + if (startup_pipe != -1) { + close(startup_pipe); + startup_pipe = -1; + } + + /* New socket pair */ + monitor_reinit(pmonitor); + + pmonitor->m_pid = fork(); + if (pmonitor->m_pid == -1) + fatal("fork of unprivileged child failed"); + else if (pmonitor->m_pid != 0) { + debug2("User child is on pid %d", pmonitor->m_pid); + close(pmonitor->m_recvfd); + monitor_child_postauth(pmonitor); + + /* NEVERREACHED */ + exit(0); + } + + close(pmonitor->m_sendfd); + + /* Demote the private keys to public keys. */ + demote_sensitive_data(); + + /* Drop privileges */ + do_setusercontext(authctxt->pw); + + /* It is safe now to apply the key state */ + monitor_apply_keystate(pmonitor); +} + static char * list_hostkey_types(void) { @@ -515,7 +688,7 @@ list_hostkey_types(void) return p; } -static Key * +Key * get_hostkey_by_type(int type) { int i; @@ -527,6 +700,25 @@ get_hostkey_by_type(int type) return NULL; } +Key * +get_hostkey_by_index(int ind) +{ + if (ind < 0 || ind >= options.num_host_key_files) + return (NULL); + return (sensitive_data.host_keys[ind]); +} + +int +get_hostkey_index(Key *key) +{ + int i; + for (i = 0; i < options.num_host_key_files; i++) { + if (key == sensitive_data.host_keys[i]) + return (i); + } + return (-1); +} + /* * returns 1 if connection should be dropped, 0 otherwise. * dropping starts at connection #max_startups_begin with a probability @@ -603,9 +795,13 @@ 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; +#ifdef HAVE_SECUREWARE + (void)set_auth_parameters(ac, av); +#endif __progname = get_progname(av[0]); init_rng(); @@ -825,9 +1021,17 @@ main(int ac, char **av) ssh_gssapi_clean_env(); #endif /* GSSAPI */ -#ifdef HAVE_SCO_PROTECTED_PW - (void) set_auth_parameters(ac, av); -#endif +#ifndef HAVE_CYGWIN + /* + * Clear out any supplemental groups we may have inherited. This + * prevents inadvertent creation of files with bad modes (in the + * portable version at least, it's certainly possible for PAM + * to create a file, and we can't control the code in every + * module which might be used). + */ + if (setgroups(0, NULL) < 0) + debug("setgroups() failed: %.200s", strerror(errno)); +#endif /* !HAVE_CYGWIN */ /* Initialize the log (it is reinitialized below in case we forked). */ if (debug_flag && !inetd_flag) @@ -1145,6 +1349,17 @@ main(int ac, char **av) /* This is the child processing a new connection. */ + /* + * Create a new session and process group since the 4.4BSD + * setlogin() affects the entire process group. We don't + * want the child to be able to affect the parent. + */ +#if 0 + /* XXX: this breaks Solaris */ + if (setsid() < 0) + error("setsid: %.100s", strerror(errno)); +#endif + /* * Disable the key regeneration alarm. We will not regenerate the * key since we are no longer in a position to give it to anyone. We @@ -1247,15 +1462,43 @@ main(int ac, char **av) packet_set_nonblocking(); + if (use_privsep) + if ((authctxt = privsep_preauth()) != NULL) + goto authenticated; + /* perform the key exchange */ /* authenticate user and start session */ if (compat20) { do_ssh2_kex(); - do_authentication2(); + authctxt = do_authentication2(); } else { do_ssh1_kex(); - do_authentication(); + authctxt = do_authentication(); + } + /* + * If we use privilege separation, the unprivileged child transfers + * the current keystate and exits + */ + if (use_privsep) { + mm_send_keystate(pmonitor); + exit(0); } + + authenticated: + /* + * In privilege separation, we fork another child and prepare + * file descriptor passing. + */ + if (use_privsep) { + privsep_postauth(authctxt); + /* the monitor process [priv] will not return */ + if (!compat20) + destroy_sensitive_data(); + } + + /* Perform session preparation. */ + do_authenticated(authctxt); + /* The connection has been terminated. */ verbose("Closing connection to %.100s", remote_ip); @@ -1264,9 +1507,57 @@ main(int ac, char **av) #endif /* USE_PAM */ packet_close(); + + if (use_privsep) + mm_terminate(); + exit(0); } +/* + * Decrypt session_key_int using our private server key and private host key + * (key with larger modulus first). + */ +int +ssh1_session_key(BIGNUM *session_key_int) +{ + int rsafail = 0; + + if (BN_cmp(sensitive_data.server_key->rsa->n, sensitive_data.ssh1_host_key->rsa->n) > 0) { + /* Server key has bigger modulus. */ + if (BN_num_bits(sensitive_data.server_key->rsa->n) < + BN_num_bits(sensitive_data.ssh1_host_key->rsa->n) + SSH_KEY_BITS_RESERVED) { + fatal("do_connection: %s: server_key %d < host_key %d + SSH_KEY_BITS_RESERVED %d", + get_remote_ipaddr(), + BN_num_bits(sensitive_data.server_key->rsa->n), + BN_num_bits(sensitive_data.ssh1_host_key->rsa->n), + SSH_KEY_BITS_RESERVED); + } + if (rsa_private_decrypt(session_key_int, session_key_int, + sensitive_data.server_key->rsa) <= 0) + rsafail++; + if (rsa_private_decrypt(session_key_int, session_key_int, + sensitive_data.ssh1_host_key->rsa) <= 0) + rsafail++; + } else { + /* Host key has bigger modulus (or they are equal). */ + if (BN_num_bits(sensitive_data.ssh1_host_key->rsa->n) < + BN_num_bits(sensitive_data.server_key->rsa->n) + SSH_KEY_BITS_RESERVED) { + fatal("do_connection: %s: host_key %d < server_key %d + SSH_KEY_BITS_RESERVED %d", + get_remote_ipaddr(), + BN_num_bits(sensitive_data.ssh1_host_key->rsa->n), + BN_num_bits(sensitive_data.server_key->rsa->n), + SSH_KEY_BITS_RESERVED); + } + if (rsa_private_decrypt(session_key_int, session_key_int, + sensitive_data.ssh1_host_key->rsa) < 0) + rsafail++; + if (rsa_private_decrypt(session_key_int, session_key_int, + sensitive_data.server_key->rsa) < 0) + rsafail++; + } + return (rsafail); +} /* * SSH1 key exchange */ @@ -1388,43 +1679,9 @@ do_ssh1_kex(void) packet_set_protocol_flags(protocol_flags); packet_check_eom(); - /* - * Decrypt it using our private server key and private host key (key - * with larger modulus first). - */ - if (BN_cmp(sensitive_data.server_key->rsa->n, sensitive_data.ssh1_host_key->rsa->n) > 0) { - /* Server key has bigger modulus. */ - if (BN_num_bits(sensitive_data.server_key->rsa->n) < - BN_num_bits(sensitive_data.ssh1_host_key->rsa->n) + SSH_KEY_BITS_RESERVED) { - fatal("do_connection: %s: server_key %d < host_key %d + SSH_KEY_BITS_RESERVED %d", - get_remote_ipaddr(), - BN_num_bits(sensitive_data.server_key->rsa->n), - BN_num_bits(sensitive_data.ssh1_host_key->rsa->n), - SSH_KEY_BITS_RESERVED); - } - if (rsa_private_decrypt(session_key_int, session_key_int, - sensitive_data.server_key->rsa) <= 0) - rsafail++; - if (rsa_private_decrypt(session_key_int, session_key_int, - sensitive_data.ssh1_host_key->rsa) <= 0) - rsafail++; - } else { - /* Host key has bigger modulus (or they are equal). */ - if (BN_num_bits(sensitive_data.ssh1_host_key->rsa->n) < - BN_num_bits(sensitive_data.server_key->rsa->n) + SSH_KEY_BITS_RESERVED) { - fatal("do_connection: %s: host_key %d < server_key %d + SSH_KEY_BITS_RESERVED %d", - get_remote_ipaddr(), - BN_num_bits(sensitive_data.ssh1_host_key->rsa->n), - BN_num_bits(sensitive_data.server_key->rsa->n), - SSH_KEY_BITS_RESERVED); - } - if (rsa_private_decrypt(session_key_int, session_key_int, - sensitive_data.ssh1_host_key->rsa) < 0) - rsafail++; - if (rsa_private_decrypt(session_key_int, session_key_int, - sensitive_data.server_key->rsa) < 0) - rsafail++; - } + /* Decrypt session_key_int using host/server keys */ + rsafail = PRIVSEP(ssh1_session_key(session_key_int)); + /* * Extract session key from the decrypted integer. The key is in the * least significant 256 bits of the integer; the first byte of the @@ -1518,9 +1775,12 @@ do_ssh1_kex(void) } #endif /* GSSAPI */ - /* Destroy the private and public keys. They will no longer be needed. */ + /* Destroy the private and public keys. No longer. */ destroy_sensitive_data(); + if (use_privsep) + mm_ssh1_session_id(session_id); + /* Destroy the decrypted integer. It is no longer needed. */ BN_clear_free(session_key_int); @@ -1606,6 +1866,7 @@ do_ssh2_kex(void) kex->client_version_string=client_version_string; kex->server_version_string=server_version_string; kex->load_host_key=&get_hostkey_by_type; + kex->host_key_index=&get_hostkey_index; xxx_kex = kex; diff --git a/openssh/sshd_config b/openssh/sshd_config index 3eb1987..e96f7a1 100644 --- a/openssh/sshd_config +++ b/openssh/sshd_config @@ -1,4 +1,4 @@ -# $OpenBSD: sshd_config,v 1.48 2002/02/19 02:50:59 deraadt Exp $ +# $OpenBSD: sshd_config,v 1.53 2002/05/15 21:02:53 markus Exp $ # This is the sshd server system-wide configuration file. See sshd(8) # for more information. @@ -60,13 +60,11 @@ #ChallengeResponseAuthentication yes # Kerberos options -# KerberosAuthentication automatically enabled if keyfile exists -#KerberosAuthentication yes +#KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes -# AFSTokenPassing automatically enabled if k_hasafs() is true -#AFSTokenPassing yes +#AFSTokenPassing no # Kerberos TGT Passing only works with the AFS kaserver #KerberosTgtPassing no @@ -82,6 +80,7 @@ #PrintLastLog yes #KeepAlive yes #UseLogin no +#UsePrivilegeSeparation no #MaxStartups 10 # no default banner path diff --git a/openssh/sshpty.c b/openssh/sshpty.c index 71c48b5..91de759 100644 --- a/openssh/sshpty.c +++ b/openssh/sshpty.c @@ -199,6 +199,7 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) const char *ptyminors = "0123456789abcdef"; int num_minors = strlen(ptyminors); int num_ptys = strlen(ptymajors) * num_minors; + struct termios tio; for (i = 0; i < num_ptys; i++) { snprintf(buf, sizeof buf, "/dev/pty%c%c", ptymajors[i / num_minors], @@ -223,6 +224,19 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) close(*ptyfd); return 0; } + /* set tty modes to a sane state for broken clients */ + if (tcgetattr(*ptyfd, &tio) < 0) + log("Getting tty modes for pty failed: %.100s", strerror(errno)); + else { + tio.c_lflag |= (ECHO | ISIG | ICANON); + tio.c_oflag |= (OPOST | ONLCR); + tio.c_iflag |= ICRNL; + + /* Set the new modes for the terminal. */ + if (tcsetattr(*ptyfd, TCSANOW, &tio) < 0) + log("Setting tty modes for pty failed: %.100s", strerror(errno)); + } + return 1; } return 0; diff --git a/openssh/ttymodes.c b/openssh/ttymodes.c index ccc001f..8afdff1 100644 --- a/openssh/ttymodes.c +++ b/openssh/ttymodes.c @@ -43,7 +43,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ttymodes.c,v 1.16 2001/12/27 20:39:58 markus Exp $"); +RCSID("$OpenBSD: ttymodes.c,v 1.17 2002/03/19 10:49:35 markus Exp $"); #include "packet.h" #include "log.h" @@ -402,17 +402,17 @@ tty_parse_modes(int fd, int *n_bytes_ptr) * SSH1: * Opcodes 1 to 127 are defined to have * a one-byte argument. - * Opcodes 128 to 159 are defined to have - * an integer argument. - */ + * Opcodes 128 to 159 are defined to have + * an integer argument. + */ if (opcode > 0 && opcode < 128) { n_bytes += 1; (void) packet_get_char(); break; } else if (opcode >= 128 && opcode < 160) { - n_bytes += 4; - (void) packet_get_int(); - break; + n_bytes += 4; + (void) packet_get_int(); + break; } else { /* * It is a truly undefined opcode (160 to 255). @@ -423,7 +423,7 @@ tty_parse_modes(int fd, int *n_bytes_ptr) */ log("parse_tty_modes: unknown opcode %d", opcode); goto set; - } + } } else { /* * SSH2: @@ -440,7 +440,7 @@ tty_parse_modes(int fd, int *n_bytes_ptr) log("parse_tty_modes: unknown opcode %d", opcode); goto set; } - } + } } } diff --git a/openssh/uidswap.c b/openssh/uidswap.c index bc67d74..9b16a6b 100644 --- a/openssh/uidswap.c +++ b/openssh/uidswap.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: uidswap.c,v 1.19 2001/12/19 07:18:56 deraadt Exp $"); +RCSID("$OpenBSD: uidswap.c,v 1.20 2002/04/01 21:50:51 stevesk Exp $"); #include "log.h" #include "uidswap.h" @@ -84,7 +84,7 @@ temporarily_use_uid(struct passwd *pw) /* Set the effective uid to the given (unprivileged) uid. */ if (setgroups(user_groupslen, user_groups) < 0) fatal("setgroups: %.100s", strerror(errno)); -#endif /* !HAVE_CYWIN */ +#endif /* !HAVE_CYGWIN */ #ifndef SAVED_IDS_WORK_WITH_SETEUID /* Propagate the privileged gid to all of our gids. */ if (setgid(getegid()) < 0) diff --git a/openssh/version.h b/openssh/version.h index 529bd67..bd70b2c 100644 --- a/openssh/version.h +++ b/openssh/version.h @@ -1,4 +1,3 @@ -/* $OpenBSD: version.h,v 1.28 2002/03/06 00:25:55 markus Exp $ */ - -#define SSH_VERSION "OpenSSH_3.1p1" +/* $OpenBSD: version.h,v 1.32 2002/05/17 14:57:40 markus Exp $ */ +#define SSH_VERSION "OpenSSH_3.2.3p1" -- 2.45.1