]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
8 years agoCheck for NULL from malloc. V_7_4 anongit/V_7_4 github-selfhosted/V_7_4 github/V_7_4
Darren Tucker [Fri, 10 Mar 2017 02:40:18 +0000 (13:40 +1100)] 
Check for NULL from malloc.

Part of bz#2687, from jjelen at redhat.com.

8 years agoIf OSX is using launchd, remove screen no.
Darren Tucker [Fri, 10 Mar 2017 02:22:32 +0000 (13:22 +1100)] 
If OSX is using launchd, remove screen no.

Check for socket with and without screen number.  From Apple and Jakob
Schlyter via bz#2341, with contributions from Ron Frederick, ok djm@

8 years agoRemove _XOPEN_SOURCE from wide char detection.
Darren Tucker [Fri, 3 Feb 2017 03:10:34 +0000 (14:10 +1100)] 
Remove _XOPEN_SOURCE from wide char detection.

Having _XOPEN_SOURCE unconditionally causes problems on some platforms
and configurations, notably Solaris 64-bit binaries.  It was there for
the benefit of Linux put the required bits in the *-*linux* section.

Patch from yvoinov at gmail.com.

8 years agocrank version numbers for release V_7_4_P1
Damien Miller [Mon, 19 Dec 2016 04:59:26 +0000 (15:59 +1100)] 
crank version numbers for release

8 years agoupstream commit
djm@openbsd.org [Mon, 19 Dec 2016 04:55:51 +0000 (04:55 +0000)] 
upstream commit

openssh-7.4

Upstream-ID: 1ee404adba6bbe10ae9277cbae3a94abe2867b79

8 years agoupstream commit
djm@openbsd.org [Mon, 19 Dec 2016 04:55:18 +0000 (04:55 +0000)] 
upstream commit

remove testcase that depends on exact output and
behaviour of snprintf(..., "%s", NULL)

Upstream-Regress-ID: cab4288531766bd9593cb556613b91a2eeefb56f

8 years agoupstream commit
dtucker@openbsd.org [Mon, 19 Dec 2016 03:32:57 +0000 (03:32 +0000)] 
upstream commit

Use LOGNAME to get current user and fall back to whoami if
not set. Mainly to benefit -portable since some platforms don't have whoami.

Upstream-Regress-ID: e3a16b7836a3ae24dc8f8a4e43fdf8127a60bdfa

8 years agoupstream commit
dtucker@openbsd.org [Fri, 16 Dec 2016 03:51:19 +0000 (03:51 +0000)] 
upstream commit

Add regression test for AllowUsers and DenyUsers.  Patch from
Zev Weiss <zev at bewilderbeest.net>

Upstream-Regress-ID: 8f1aac24d52728398871dac14ad26ea38b533fb9

8 years agoAdd missing monitor.h include.
Darren Tucker [Fri, 16 Dec 2016 04:02:24 +0000 (15:02 +1100)] 
Add missing monitor.h include.

Fixes warning pointed out by Zev Weiss <zev at bewilderbeest.net>

8 years agoupstream commit
djm@openbsd.org [Fri, 16 Dec 2016 02:48:55 +0000 (02:48 +0000)] 
upstream commit

revert to rev1.2; the new bits in this test depend on changes
to ssh that aren't yet committed

Upstream-Regress-ID: 828ffc2c7afcf65d50ff2cf3dfc47a073ad39123

8 years agoupstream commit
dtucker@openbsd.org [Fri, 16 Dec 2016 01:06:27 +0000 (01:06 +0000)] 
upstream commit

Move the "stop sshd" code into its own helper function.
Patch from Zev Weiss <zev at bewilderbeest.net>, ok djm@

Upstream-Regress-ID: a113dea77df5bd97fb4633ea31f3d72dbe356329

8 years agoupstream commit
djm@openbsd.org [Fri, 16 Dec 2016 01:01:07 +0000 (01:01 +0000)] 
upstream commit

regression test for certificates along with private key
with no public half. bz#2617, mostly from Adam Eijdenberg

Upstream-Regress-ID: 2e74dc2c726f4dc839609b3ce045466b69f01115

8 years agoupstream commit
dtucker@openbsd.org [Thu, 15 Dec 2016 23:50:37 +0000 (23:50 +0000)] 
upstream commit

Use $SUDO to read pidfile in case root's umask is
restricted.  From portable.

Upstream-Regress-ID: f6b1c7ffbc5a0dfb7d430adb2883344899174a98

8 years agoupstream commit
dtucker@openbsd.org [Thu, 15 Dec 2016 21:29:05 +0000 (21:29 +0000)] 
upstream commit

Add missing braces in DenyUsers code.  Patch from zev at
bewilderbeest.net, ok deraadt@

Upstream-ID: d747ace338dcf943b077925f90f85f789714b54e

8 years agoupstream commit
dtucker@openbsd.org [Thu, 15 Dec 2016 21:20:41 +0000 (21:20 +0000)] 
upstream commit

Fix text in error message.  Patch from zev at
bewilderbeest.net.

Upstream-ID: deb0486e175e7282f98f9a15035d76c55c84f7f6

8 years agoupstream commit
djm@openbsd.org [Wed, 14 Dec 2016 00:36:34 +0000 (00:36 +0000)] 
upstream commit

disable Unix-domain socket forwarding when privsep is
disabled

Upstream-ID: ab61516ae0faadad407857808517efa900a0d6d0

8 years agoupstream commit
djm@openbsd.org [Fri, 9 Dec 2016 03:04:29 +0000 (03:04 +0000)] 
upstream commit

log connections dropped in excess of MaxStartups at
verbose LogLevel; bz#2613 based on diff from Tomas Kuthan; ok dtucker@

Upstream-ID: 703ae690dbf9b56620a6018f8a3b2389ce76d92b

8 years agoGet default of TEST_SSH_UTF8 from environment.
Darren Tucker [Tue, 13 Dec 2016 02:51:32 +0000 (13:51 +1100)] 
Get default of TEST_SSH_UTF8 from environment.

8 years agoRemove commented-out includes.
Darren Tucker [Tue, 13 Dec 2016 01:56:40 +0000 (12:56 +1100)] 
Remove commented-out includes.

These commented-out includes have "Still needed?" comments.  Since
they've been commented out for ~13 years I assert that they're not.

8 years agoAdd prototype for strcasestr in compat library.
Darren Tucker [Tue, 13 Dec 2016 01:54:23 +0000 (12:54 +1100)] 
Add prototype for strcasestr in compat library.

8 years agoAdd strcasestr to compat library.
Darren Tucker [Mon, 12 Dec 2016 23:23:03 +0000 (10:23 +1100)] 
Add strcasestr to compat library.

Fixes build on (at least) Solaris 10.

8 years agoForce Turkish locales back to C/POSIX; bz#2643
Damien Miller [Mon, 12 Dec 2016 02:57:10 +0000 (13:57 +1100)] 
Force Turkish locales back to C/POSIX; bz#2643

Turkish locales are unique in their handling of the letters 'i' and
'I' (yes, they are different letters) and OpenSSH isn't remotely
prepared to deal with that. For now, the best we can do is to force
OpenSSH to use the C/POSIX locale and try to preserve the UTF-8
encoding if possible.

ok dtucker@

8 years agoexit is in stdlib.h not unistd.h (that's _exit).
Darren Tucker [Fri, 9 Dec 2016 01:52:02 +0000 (12:52 +1100)] 
exit is in stdlib.h not unistd.h (that's _exit).

8 years agoInclude <unistd.h> for exit in utf8 locale test.
Darren Tucker [Fri, 9 Dec 2016 01:33:25 +0000 (12:33 +1100)] 
Include <unistd.h> for exit in utf8 locale test.

8 years agoCheck for utf8 local support before testing it.
Darren Tucker [Thu, 8 Dec 2016 04:48:34 +0000 (15:48 +1100)] 
Check for utf8 local support before testing it.

Check for utf8 local support and if not found, do not attempt to run the
utf8 tests.  Suggested by djm@

8 years agoUse AC_PATH_TOOL for krb5-config.
Darren Tucker [Thu, 8 Dec 2016 01:57:24 +0000 (12:57 +1100)] 
Use AC_PATH_TOOL for krb5-config.

This will use the host-prefixed version when cross compiling; patch from
david.michael at coreos.com.

8 years agoupstream commit
djm@openbsd.org [Tue, 6 Dec 2016 07:48:01 +0000 (07:48 +0000)] 
upstream commit

make IdentityFile successfully load and use certificates that
have no corresponding bare public key. E.g. just a private id_rsa and
certificate id_rsa-cert.pub (and no id_rsa.pub).

bz#2617 ok dtucker@

Upstream-ID: c1e9699b8c0e3b63cc4189e6972e3522b6292604

8 years agoAdd a gnome-ssh-askpass3 target for GTK+3 version
Damien Miller [Fri, 25 Nov 2016 03:04:21 +0000 (14:04 +1100)] 
Add a gnome-ssh-askpass3 target for GTK+3 version

Based on patch from Colin Watson via bz#2640

8 years agoMake gnome-ssh-askpass2.c GTK+3-friendly
Damien Miller [Fri, 25 Nov 2016 03:03:53 +0000 (14:03 +1100)] 
Make gnome-ssh-askpass2.c GTK+3-friendly

Patch from Colin Watson via bz#2640

8 years agoupstream commit
djm@openbsd.org [Sun, 4 Dec 2016 23:54:02 +0000 (23:54 +0000)] 
upstream commit

Fix public key authentication when multiple
authentication is in use. Instead of deleting and re-preparing the entire
keys list, just reset the 'used' flags; the keys list is already in a good
order (with already- tried keys at the back)

Analysis and patch from Vincent Brillault on bz#2642; ok dtucker@

Upstream-ID: 7123f12dc2f3bcaae715853035a97923d7300176

8 years agoupstream commit
dtucker@openbsd.org [Sun, 4 Dec 2016 22:27:25 +0000 (22:27 +0000)] 
upstream commit

Unlink PidFile on SIGHUP and always recreate it when the
new sshd starts. Regression tests (and possibly other things) depend on the
pidfile being recreated after SIGHUP, and unlinking it means it won't contain
a stale pid if sshd fails to restart.  ok djm@ markus@

Upstream-ID: 132dd6dda0c77dd49d2f15b2573b5794f6160870

8 years agoupstream commit
djm@openbsd.org [Wed, 30 Nov 2016 03:01:33 +0000 (03:01 +0000)] 
upstream commit

test new behaviour of cert force-command restriction vs.
authorized_key/ principals

Upstream-Regress-ID: 399efa7469d40c404c0b0a295064ce75d495387c

8 years agoupstream commit
jmc@openbsd.org [Wed, 30 Nov 2016 06:54:26 +0000 (06:54 +0000)] 
upstream commit

tweak previous; while here fix up FILES and AUTHORS;

Upstream-ID: 93f6e54086145a75df8d8ec7d8689bdadbbac8fa

8 years agoupstream commit
djm@openbsd.org [Wed, 30 Nov 2016 03:07:37 +0000 (03:07 +0000)] 
upstream commit

add a whitelist of paths from which ssh-agent will load
(via ssh-pkcs11-helper) a PKCS#11 module; ok markus@

Upstream-ID: fe79769469d9cd6d26fe0dc15751b83ef2a06e8f

8 years agoupstream commit
djm@openbsd.org [Wed, 30 Nov 2016 03:00:05 +0000 (03:00 +0000)] 
upstream commit

Add a sshd_config DisableForwaring option that disables
X11, agent, TCP, tunnel and Unix domain socket forwarding, as well as
anything else we might implement in the future.

This, like the 'restrict' authorized_keys flag, is intended to be a
simple and future-proof way of restricting an account. Suggested as
a complement to 'restrict' by Jann Horn; ok markus@

Upstream-ID: 203803f66e533a474086b38a59ceb4cf2410fcf7

8 years agoupstream commit
djm@openbsd.org [Wed, 30 Nov 2016 02:57:40 +0000 (02:57 +0000)] 
upstream commit

When a forced-command appears in both a certificate and
an authorized keys/principals command= restriction, refuse to accept the
certificate unless they are identical.

The previous (documented) behaviour of having the certificate forced-
command override the other could be a bit confused and more error-prone.

Pointed out by Jann Horn of Project Zero; ok dtucker@

Upstream-ID: 79d811b6eb6bbe1221bf146dde6928f92d2cd05f

8 years agoupstream commit
dtucker@openbsd.org [Wed, 30 Nov 2016 00:28:31 +0000 (00:28 +0000)] 
upstream commit

On startup, check to see if sshd is already daemonized
and if so, skip the call to daemon() and do not rewrite the PidFile.  This
means that when sshd re-execs itself on SIGHUP the process ID will no longer
change.  Should address bz#2641.  ok djm@ markus@.

Upstream-ID: 5ea0355580056fb3b25c1fd6364307d9638a37b9

8 years agofactor out common PRNG reseed before privdrop
Damien Miller [Wed, 30 Nov 2016 02:51:49 +0000 (13:51 +1100)] 
factor out common PRNG reseed before privdrop

Add a call to RAND_poll() to ensure than more than pid+time gets
stirred into child processes states. Prompted by analysis from Jann
Horn at Project Zero. ok dtucker@

8 years agoupstream commit
dtucker@openbsd.org [Fri, 25 Nov 2016 03:02:01 +0000 (03:02 +0000)] 
upstream commit

Allow PuTTY interop tests to run unattended.  bz#2639,
patch from cjwatson at debian.org.

Upstream-Regress-ID: 4345253558ac23b2082aebabccd48377433b6fe0

8 years agoupstream commit
dtucker@openbsd.org [Fri, 25 Nov 2016 02:56:49 +0000 (02:56 +0000)] 
upstream commit

Reverse args to sshd-log-wrapper.  Matches change in
portable, where it allows sshd do be optionally run under Valgrind.

Upstream-Regress-ID: b438d1c6726dc5caa2a45153e6103a0393faa906

8 years agoupstream commit
dtucker@openbsd.org [Fri, 25 Nov 2016 02:49:18 +0000 (02:49 +0000)] 
upstream commit

Fix typo in trace message; from portable.

Upstream-Regress-ID: 4c4a2ba0d37faf5fd230a91b4c7edb5699fbd73a

8 years agoupstream commit
tb@openbsd.org [Tue, 1 Nov 2016 13:43:27 +0000 (13:43 +0000)] 
upstream commit

Clean up MALLOC_OPTIONS.  For the unittests, move
MALLOC_OPTIONS and TEST_ENV to unittets/Makefile.inc.

ok otto

Upstream-Regress-ID: 890d497e0a38eeddfebb11cc429098d76cf29f12

8 years agoupstream commit
tb@openbsd.org [Mon, 31 Oct 2016 23:45:08 +0000 (23:45 +0000)] 
upstream commit

Remove the obsolete A and P flags from MALLOC_OPTIONS.

ok dtucker

Upstream-Regress-ID: 6cc25024c8174a87e5734a0dc830194be216dd59

8 years agoupstream commit
dtucker@openbsd.org [Tue, 29 Nov 2016 03:54:50 +0000 (03:54 +0000)] 
upstream commit

Factor out code to disconnect from controlling terminal
into its own function.  ok djm@

Upstream-ID: 39fd9e8ebd7222615a837312face5cc7ae962885

8 years agoupstream commit
djm@openbsd.org [Fri, 25 Nov 2016 23:24:45 +0000 (23:24 +0000)] 
upstream commit

use sshbuf_allocate() to pre-allocate the buffer used for
loading keys. This avoids implicit realloc inside the buffer code, which
might theoretically leave fragments of the key on the heap. This doesn't
appear to happen in practice for normal sized keys, but was observed for
novelty oversize ones.

Pointed out by Jann Horn of Project Zero; ok markus@

Upstream-ID: d620e1d46a29fdea56aeadeda120879eddc60ab1

8 years agoupstream commit
djm@openbsd.org [Fri, 25 Nov 2016 23:22:04 +0000 (23:22 +0000)] 
upstream commit

split allocation out of sshbuf_reserve() into a separate
sshbuf_allocate() function; ok markus@

Upstream-ID: 11b8a2795afeeb1418d508a2c8095b3355577ec2

8 years agoupstream commit
markus@openbsd.org [Wed, 23 Nov 2016 23:14:15 +0000 (23:14 +0000)] 
upstream commit

allow ClientAlive{Interval,CountMax} in Match; ok dtucker,
djm

Upstream-ID: 8beb4c1eadd588f1080b58932281983864979f55

8 years agoupstream commit
djm@openbsd.org [Tue, 8 Nov 2016 22:04:34 +0000 (22:04 +0000)] 
upstream commit

unbreak DenyUsers; reported by henning@

Upstream-ID: 1c67d4148f5e953c35acdb62e7c08ae8e33f7cb2

8 years agoupstream commit
djm@openbsd.org [Sun, 6 Nov 2016 05:46:37 +0000 (05:46 +0000)] 
upstream commit

Validate address ranges for AllowUser/DenyUsers at
configuration load time and refuse to accept bad ones. It was previously
possible to specify invalid CIDR address ranges (e.g. djm@127.1.2.3/55) and
these would always match.

Thanks to Laurence Parry for a detailed bug report. ok markus (for
a previous diff version)

Upstream-ID: 9dfcdd9672b06e65233ea4434c38226680d40bfb

8 years agoupstream commit
djm@openbsd.org [Fri, 28 Oct 2016 03:33:52 +0000 (03:33 +0000)] 
upstream commit

Improve pkcs11_add_provider() logging: demote some
excessively verbose error()s to debug()s, include PKCS#11 provider name and
slot in log messages where possible. bz#2610, based on patch from Jakub Jelen

Upstream-ID: 3223ef693cfcbff9079edfc7e89f55bf63e1973d

8 years agoUse ptrace(PT_DENY_ATTACH, ..) on OS X.
Darren Tucker [Mon, 31 Oct 2016 21:12:33 +0000 (08:12 +1100)] 
Use ptrace(PT_DENY_ATTACH, ..) on OS X.

8 years agoUnbreak AES-CTR ciphers on old (~0.9.8) OpenSSL
Damien Miller [Fri, 28 Oct 2016 03:34:07 +0000 (14:34 +1100)] 
Unbreak AES-CTR ciphers on old (~0.9.8) OpenSSL

ok dtucker@

8 years agoMove OPENSSL_NO_RIPEMD160 to compat.
Darren Tucker [Fri, 28 Oct 2016 03:26:58 +0000 (14:26 +1100)] 
Move OPENSSL_NO_RIPEMD160 to compat.

Move OPENSSL_NO_RIPEMD160 to compat and add ifdefs to mac.c around the
ripemd160 MACs.

8 years agoCheck if RIPEMD160 is disabled in OpenSSL.
Darren Tucker [Fri, 28 Oct 2016 02:52:31 +0000 (13:52 +1100)] 
Check if RIPEMD160 is disabled in OpenSSL.

8 years agoSkip ssh1 specfic ciphers.
Darren Tucker [Fri, 28 Oct 2016 02:38:19 +0000 (13:38 +1100)] 
Skip ssh1 specfic ciphers.

cipher-3des1.c and cipher-bf1.c are specific to sshv1 so don't even try
to compile them when Protocol 1 is not enabled.

8 years agoupstream commit
jsg@openbsd.org [Tue, 25 Oct 2016 04:08:13 +0000 (04:08 +0000)] 
upstream commit

Fix logic in add_local_forward() that inverted a test
when code was refactored out into bind_permitted().  This broke ssh port
forwarding for non-priv ports as a non root user.

ok dtucker@ 'looks good' deraadt@

Upstream-ID: ddb8156ca03cc99997de284ce7777536ff9570c9

8 years agoupstream commit
dtucker@openbsd.org [Mon, 24 Oct 2016 01:09:17 +0000 (01:09 +0000)] 
upstream commit

Remove dead breaks, found via opencoverage.net.  ok
deraadt@

Upstream-ID: ad9cc655829d67fad219762810770787ba913069

8 years agoUse !=NULL instead of >0 for getdefaultproj.
Darren Tucker [Tue, 25 Oct 2016 21:43:25 +0000 (08:43 +1100)] 
Use !=NULL instead of >0 for getdefaultproj.

getdefaultproj() returns a pointer so test it for NULL inequality
instead of >0.  Fixes compiler warning and is more correct.  Patch from
David Binderman.

8 years agoupstream commit
dtucker@openbsd.org [Sun, 23 Oct 2016 22:04:05 +0000 (22:04 +0000)] 
upstream commit

Factor out "can bind to low ports" check into its own function.  This will
make it easier for Portable to support platforms with permissions models
other than uid==0 (eg bz#2625).  ok djm@, "doesn't offend me too much"
deraadt@.

Upstream-ID: 86213df4183e92b8f189a6d2dac858c994bfface

8 years agoupstream commit
dtucker@openbsd.org [Wed, 19 Oct 2016 23:21:56 +0000 (23:21 +0000)] 
upstream commit

When tearing down ControlMaster connecctions, don't
pollute stderr when LogLevel=quiet.  Patch from Tim Kuijsten via tech@.

Upstream-ID: d9b3a68b2a7c2f2fc7f74678e29a4618d55ceced

8 years agoWrap stdint.h include in ifdef.
Darren Tucker [Sun, 23 Oct 2016 22:06:18 +0000 (09:06 +1100)] 
Wrap stdint.h include in ifdef.

8 years agoFix formatting.
Darren Tucker [Thu, 20 Oct 2016 22:46:46 +0000 (09:46 +1100)] 
Fix formatting.

8 years agoUpdate links to https.
Darren Tucker [Thu, 20 Oct 2016 19:55:58 +0000 (06:55 +1100)] 
Update links to https.

www.openssh.com now supports https and ftp.openbsd.org no longer
supports ftp.  Make all links to these https.

8 years agoUpdate host key generation examples.
Darren Tucker [Thu, 20 Oct 2016 19:48:46 +0000 (06:48 +1100)] 
Update host key generation examples.

Remove ssh1 host key generation, add ssh-keygen -A

8 years agoUpdate links.
Darren Tucker [Thu, 20 Oct 2016 18:22:55 +0000 (05:22 +1100)] 
Update links.

Make links to openssh.com HTTPS now that it's supported, point release
notes link to the HTML release notes page, and update a couple of other
links and bits of text.

8 years agoRemote channels .orig and .rej files.
Darren Tucker [Wed, 19 Oct 2016 16:42:09 +0000 (03:42 +1100)] 
Remote channels .orig and .rej files.

These files were incorrectly added during an OpenBSD sync.

8 years agoupstream commit
dtucker@openbsd.org [Tue, 18 Oct 2016 17:32:54 +0000 (17:32 +0000)] 
upstream commit

Remove channel_input_port_forward_request(); the only caller
was the recently-removed SSH1 server code so it's now dead code.  ok markus@

Upstream-ID: 05453983230a1f439562535fec2818f63f297af9

8 years agoupstream commit
millert@openbsd.org [Tue, 18 Oct 2016 12:41:22 +0000 (12:41 +0000)] 
upstream commit

Install a signal handler for tty-generated signals and
wait for the ssh child to suspend before suspending sftp.  This lets ssh
restore the terminal mode as needed when it is suspended at the password
prompt.  OK dtucker@

Upstream-ID: a31c1f42aa3e2985dcc91e46e6a17bd22e372d69

8 years agoupstream commit
jmc@openbsd.org [Sat, 15 Oct 2016 19:56:25 +0000 (19:56 +0000)] 
upstream commit

various formatting fixes, specifically removing Dq;

Upstream-ID: 81e85df2b8e474f5f93d66e61d9a4419ce87347c

8 years agoImport readpassphrase.c rev 1.26.
Darren Tucker [Tue, 18 Oct 2016 16:26:09 +0000 (03:26 +1100)] 
Import readpassphrase.c rev 1.26.

Author: miller@openbsd.org:
Avoid generate SIGTTOU when restoring the terminal mode.  If we get
SIGTTOU it means the process is not in the foreground process group
which, in most cases, means that the shell has taken control of the tty.
Requiring the user the fg the process in this case doesn't make sense
and can result in both SIGTSTP and SIGTTOU being sent which can lead to
the process being suspended again immediately after being brought into
the foreground.

8 years agoImport readpassphrase.c rev 1.25.
Darren Tucker [Tue, 18 Oct 2016 16:23:16 +0000 (03:23 +1100)] 
Import readpassphrase.c rev 1.25.

Wrap <readpassphrase.h> so internal calls go direct and
readpassphrase is weak.

(DEF_WEAK is a no-op in portable.)

8 years agoMove DEF_WEAK into defines.h.
Darren Tucker [Fri, 14 Oct 2016 18:51:12 +0000 (05:51 +1100)] 
Move DEF_WEAK into defines.h.

As well pull in more recent changes from OpenBSD these will start to
arrive so put it where the definition is shared.

8 years agoRemove do_pam_set_tty which is dead code.
Darren Tucker [Fri, 14 Oct 2016 17:34:46 +0000 (04:34 +1100)] 
Remove do_pam_set_tty which is dead code.

The callers of do_pam_set_tty were removed in 2008, so this is now dead
code.  bz#2604, pointed out by jjelen at redhat.com.

8 years agounbreak principals-command test
Damien Miller [Thu, 13 Oct 2016 07:53:43 +0000 (18:53 +1100)] 
unbreak principals-command test

Undo inconsistetly updated variable name.

8 years agoupstream commit
djm@openbsd.org [Tue, 11 Oct 2016 21:49:54 +0000 (21:49 +0000)] 
upstream commit

fix the KEX fuzzer - the previous method of obtaining the
packet contents was broken. This now uses the new per-packet input hook, so
it sees exact post-decrypt packets and doesn't have to pass packet integrity
checks. ok markus@

Upstream-Regress-ID: 402fb6ffabd97de590e8e57b25788949dce8d2fd

8 years agoupstream commit
natano@openbsd.org [Thu, 6 Oct 2016 09:31:38 +0000 (09:31 +0000)] 
upstream commit

Move USER out of the way to unbreak the BUILDUSER
mechanism. ok tb

Upstream-Regress-ID: 74ab9687417dd071d62316eaadd20ddad1d5af3c

8 years agoupstream commit
bluhm@openbsd.org [Fri, 30 Sep 2016 11:55:20 +0000 (11:55 +0000)] 
upstream commit

In ssh tests set REGRESS_FAIL_EARLY with ?= so that the
environment can change it. OK djm@

Upstream-Regress-ID: 77bcb50e47b68c7209c7f0a5a020d73761e5143b

8 years agoupstream commit
djm@openbsd.org [Tue, 11 Oct 2016 21:47:45 +0000 (21:47 +0000)] 
upstream commit

Add a per-packet input hook that is called with the
decrypted packet contents. This will be used for fuzzing; ok markus@

Upstream-ID: a3221cee6b1725dd4ae1dd2c13841b4784cb75dc

8 years agoupstream commit
markus@openbsd.org [Mon, 10 Oct 2016 19:28:48 +0000 (19:28 +0000)] 
upstream commit

Unregister the KEXINIT handler after message has been
received. Otherwise an unauthenticated peer can repeat the KEXINIT and cause
allocation of up to 128MB -- until the connection is closed. Reported by
shilei-c at 360.cn

Upstream-ID: 43649ae12a27ef94290db16d1a98294588b75c05

8 years agoImport rev 1.24 from OpenBSD.
Darren Tucker [Wed, 12 Oct 2016 17:07:20 +0000 (04:07 +1100)] 
Import rev 1.24 from OpenBSD.

revision 1.24
date: 2013/11/24 23:51:29;  author: deraadt;  state: Exp;  lines: +4 -4;
most obvious unsigned char casts for ctype
ok jca krw ingo

8 years agoImport rev 1.23 from OpenBSD. Fixes bz#2619.
Darren Tucker [Wed, 12 Oct 2016 17:04:44 +0000 (04:04 +1100)] 
Import rev 1.23 from OpenBSD.  Fixes bz#2619.

revision 1.23
date: 2010/05/14 13:30:34;  author: millert;  state: Exp;  lines: +41 -39;
Defer installing signal handlers until echo is disabled so that we
get suspended normally when not the foreground process.  Fix potential
infinite loop when restoring terminal settings if process is in the
background when restore occurs.  OK miod@

8 years agoIf we don't have TCSASOFT, define it to zero.
Darren Tucker [Wed, 12 Oct 2016 16:53:51 +0000 (03:53 +1100)] 
If we don't have TCSASOFT, define it to zero.

This makes it a no-op when we use it below, which allows us to re-sync
those lines with the upstream and make future updates easier.

8 years agoupstream commit
jmc@openbsd.org [Fri, 7 Oct 2016 14:41:52 +0000 (14:41 +0000)] 
upstream commit

tidy up the formatting in this file. more specifically,
replace .Dq, which looks appalling, with .Cm, where appropriate;

Upstream-ID: ff8e90aa0343d9bb56f40a535e148607973cc738

8 years agoupstream commit
djm@openbsd.org [Tue, 4 Oct 2016 21:34:40 +0000 (21:34 +0000)] 
upstream commit

add a comment about implicitly-expected checks to
sshkey_ec_validate_public()

Upstream-ID: 74a7f71c28f7c13a50f89fc78e7863b9cd61713f

8 years agoupstream commit
djm@openbsd.org [Fri, 30 Sep 2016 20:24:46 +0000 (20:24 +0000)] 
upstream commit

fix some -Wpointer-sign warnings in the new mux proxy; ok
markus@

Upstream-ID: b1ba7b3769fbc6b7f526792a215b0197f5e55dfd

8 years agoupstream commit
bluhm@openbsd.org [Wed, 28 Sep 2016 20:09:52 +0000 (20:09 +0000)] 
upstream commit

Add a makefile rule to create the ssh library when
regress needs it.  This allows to run the ssh regression tests without doing
a "make build" before. Discussed with dtucker@ and djm@; OK djm@

Upstream-Regress-ID: ce489bd53afcd471225a125b4b94565d4717c025

8 years agoupstream commit
bluhm@openbsd.org [Mon, 26 Sep 2016 21:34:38 +0000 (21:34 +0000)] 
upstream commit

Allow to run ssh regression tests as root.  If the user
is already root, the test should not expect that SUDO is set.  If ssh needs
another user, use sudo or doas to switch from root if necessary. OK dtucker@

Upstream-Regress-ID: b464e55185ac4303529e3e6927db41683aaeace2

8 years agoupstream commit
markus@openbsd.org [Fri, 30 Sep 2016 09:19:13 +0000 (09:19 +0000)] 
upstream commit

ssh proxy mux mode (-O proxy; idea from Simon Tatham): - mux
client speaks the ssh-packet protocol directly over unix-domain socket. - mux
server acts as a proxy, translates channel IDs and relays to the server. - no
filedescriptor passing necessary. - combined with unix-domain forwarding it's
even possible to run mux client   and server on different machines. feedback
& ok djm@

Upstream-ID: 666a2fb79f58e5c50e246265fb2b9251e505c25b

8 years agoupstream commit
djm@openbsd.org [Wed, 28 Sep 2016 21:44:52 +0000 (21:44 +0000)] 
upstream commit

put back some pre-auth zlib bits that I shouldn't have
removed - they are still used by the client. Spotted by naddy@

Upstream-ID: 80919468056031037d56a1f5b261c164a6f90dc2

8 years agoupstream commit
djm@openbsd.org [Wed, 28 Sep 2016 20:32:42 +0000 (20:32 +0000)] 
upstream commit

restore pre-auth compression support in the client -- the
previous commit was intended to remove it from the server only.

remove a few server-side pre-auth compression bits that escaped

adjust wording of Compression directive in sshd_config(5)

pointed out by naddy@ ok markus@

Upstream-ID: d23696ed72a228dacd4839dd9f2dec424ba2016b

8 years agoupstream commit
jmc@openbsd.org [Wed, 28 Sep 2016 17:59:22 +0000 (17:59 +0000)] 
upstream commit

use a separate TOKENS section, as we've done for
sshd_config(5); help/ok djm

Upstream-ID: 640e32b5e4838e4363738cdec955084b3579481d

8 years agoRemove portability support for mmap
Damien Miller [Wed, 28 Sep 2016 17:19:23 +0000 (03:19 +1000)] 
Remove portability support for mmap

We no longer need to wrap/replace mmap for portability now that
pre-auth compression has been removed from OpenSSH.

8 years agoupstream commit
djm@openbsd.org [Wed, 28 Sep 2016 16:33:06 +0000 (16:33 +0000)] 
upstream commit

Remove support for pre-authentication compression. Doing
compression early in the protocol probably seemed reasonable in the 1990s,
but today it's clearly a bad idea in terms of both cryptography (cf. multiple
compression oracle attacks in TLS) and attack surface.

Moreover, to support it across privilege-separation zlib needed
the assistance of a complex shared-memory manager that made the
required attack surface considerably larger.

Prompted by Guido Vranken pointing out a compiler-elided security
check in the shared memory manager found by Stack
(http://css.csail.mit.edu/stack/); ok deraadt@ markus@

NB. pre-auth authentication has been disabled by default in sshd
for >10 years.

Upstream-ID: 32af9771788d45a0779693b41d06ec199d849caf

8 years agoupstream commit
djm@openbsd.org [Mon, 26 Sep 2016 21:16:11 +0000 (21:16 +0000)] 
upstream commit

Avoid a theoretical signed integer overflow should
BN_num_bytes() ever violate its manpage and return a negative value. Improve
order of tests to avoid confusing increasingly pedantic compilers.

Reported by Guido Vranken from stack (css.csail.mit.edu/stack)
unstable optimisation analyser output.  ok deraadt@

Upstream-ID: f8508c830c86d8f36c113985e52bf8eedae23505

8 years agofix mdoc2man.awk formatting for top-level lists
Damien Miller [Tue, 27 Sep 2016 21:40:33 +0000 (07:40 +1000)] 
fix mdoc2man.awk formatting for top-level lists

Reported by Glenn Golden
Diagnosis and fix from Ingo Schwarze

8 years agoupstream commit
djm@openbsd.org [Thu, 22 Sep 2016 21:15:41 +0000 (21:15 +0000)] 
upstream commit

missing bit from previous commit

Upstream-ID: 438d5ed6338b28b46e822eb13eee448aca31df37

8 years agoupstream commit
jmc@openbsd.org [Thu, 22 Sep 2016 19:19:01 +0000 (19:19 +0000)] 
upstream commit

organise the token stuff into a separate section; ok
markus for an earlier version of the diff ok/tweaks djm

Upstream-ID: 81a6daa506a4a5af985fce7cf9e59699156527c8

8 years agoupstream commit
djm@openbsd.org [Thu, 22 Sep 2016 17:55:13 +0000 (17:55 +0000)] 
upstream commit

mention curve25519-sha256 KEX

Upstream-ID: 33ae1f433ce4795ffa6203761fbdf86e0d7ffbaf

8 years agoupstream commit
djm@openbsd.org [Thu, 22 Sep 2016 17:52:53 +0000 (17:52 +0000)] 
upstream commit

support plain curve25519-sha256 KEX algorithm now that it
is approaching standardisation (same algorithm is currently supported as
curve25519-sha256@libssh.org)

Upstream-ID: 5e2b6db2e72667048cf426da43c0ee3fc777baa2

8 years agoupstream commit
dtucker@openbsd.org [Thu, 22 Sep 2016 02:29:57 +0000 (02:29 +0000)] 
upstream commit

If ssh receives a PACKET_DISCONNECT during userauth it
will cause ssh_dispatch_run(DISPATCH_BLOCK, ...) to return without the
session being authenticated.  Check for this and exit if necessary.  ok djm@

Upstream-ID: b3afe126c0839d2eae6cddd41ff2ba317eda0903