]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
6 years agoupstream: Call comma-separated lists as such to clarify semantics
kn@openbsd.org [Fri, 16 Aug 2019 11:16:32 +0000 (11:16 +0000)] 
upstream: Call comma-separated lists as such to clarify semantics

Options such as Ciphers take values that may be a list of ciphers;  the
complete list, not indiviual elements, may be prefixed with a dash or plus
character to remove from or append to the default list respectively.

Users might read the current text as if each elment took an optional prefix,
so tweak the wording from "values" to "list" to prevent such ambiguity for
all options supporting this semantics (those that provide a list of
available elements via "ssh -Q ...").

Input and OK jmc

OpenBSD-Commit-ID: 4fdd175b0e5f5cb10ab3f26ccc38a93bb6515d57

6 years agoupstream: include sshbuf-misc.c in SRCS_BASE
djm@openbsd.org [Fri, 16 Aug 2019 06:35:27 +0000 (06:35 +0000)] 
upstream: include sshbuf-misc.c in SRCS_BASE

OpenBSD-Commit-ID: 99dd10e72c04e93849981d43d64c946619efa474

6 years agoFix pasto in fallback code.
Darren Tucker [Sat, 24 Aug 2019 05:12:11 +0000 (15:12 +1000)] 
Fix pasto in fallback code.

There is no parameter called "pathname", it should simply be "path".
bz#3059, patch from samuel at cendio.se.

6 years agouse SC_ALLOW_ARG_MASK to limit mmap protections
Damien Miller [Fri, 23 Aug 2019 00:19:30 +0000 (10:19 +1000)] 
use SC_ALLOW_ARG_MASK to limit mmap protections

Restrict to PROT_(READ|WRITE|NONE), i.e. exclude PROT_EXEC

6 years agoallow mprotect(2) with PROT_(READ|WRITE|NONE) only
Damien Miller [Fri, 23 Aug 2019 00:08:48 +0000 (10:08 +1000)] 
allow mprotect(2) with PROT_(READ|WRITE|NONE) only

Used by some hardened heap allocators. Requested by Yegor
Timoshenko in https://github.com/openssh/openssh-portable/pull/142

6 years agoupstream: switch percent_expand() to use sshbuf instead of a limited
djm@openbsd.org [Fri, 16 Aug 2019 06:13:15 +0000 (06:13 +0000)] 
upstream: switch percent_expand() to use sshbuf instead of a limited

fixed buffer; ok markus@

OpenBSD-Commit-ID: 3f9ef20bca5ef5058b48c1cac67c53b9a1d15711

6 years agoupstream: produce a useful error message if the user's shell is set
djm@openbsd.org [Fri, 9 Aug 2019 05:05:54 +0000 (05:05 +0000)] 
upstream: produce a useful error message if the user's shell is set

incorrectly during "match exec" processing. bz#2791 reported by Dario
Bertini; ok dtucker

OpenBSD-Commit-ID: cf9eddd6a6be726cb73bd9c3936f3888cd85c03d

6 years agoupstream: Change description of TCPKeepAlive from "inactive" to
dtucker@openbsd.org [Fri, 9 Aug 2019 04:24:03 +0000 (04:24 +0000)] 
upstream: Change description of TCPKeepAlive from "inactive" to

"unresponsive" to clarify what it checks for.  Patch from jblaine at
kickflop.net via github pr#129, ok djm@.

OpenBSD-Commit-ID: 3682f8ec7227f5697945daa25d11ce2d933899e9

6 years agoupstream: Allow the maximimum uint32 value for the argument passed to
dtucker@openbsd.org [Thu, 8 Aug 2019 08:02:57 +0000 (08:02 +0000)] 
upstream: Allow the maximimum uint32 value for the argument passed to

-b which allows better error messages from later validation.  bz#3050, ok
djm@

OpenBSD-Commit-ID: 10adf6876b2401b3dc02da580ebf67af05861673

6 years agoupstream: Many key types are supported now, so take care to check
naddy@openbsd.org [Mon, 5 Aug 2019 21:45:27 +0000 (21:45 +0000)] 
upstream: Many key types are supported now, so take care to check

the size restrictions and apply the default size only to the matching key
type. tweak and ok dtucker@

OpenBSD-Commit-ID: b825de92d79cc4cba19b298c61e99909488ff57e

6 years agoupstream: Remove now-redundant perm_ok arg since
dtucker@openbsd.org [Mon, 5 Aug 2019 11:50:33 +0000 (11:50 +0000)] 
upstream: Remove now-redundant perm_ok arg since

sshkey_load_private_type will now return SSH_ERR_KEY_BAD_PERMISSIONS in that
case.  Patch from jitendra.sharma at intel.com, ok djm@

OpenBSD-Commit-ID: 07916a17ed0a252591b71e7fb4be2599cb5b0c77

6 years agoFix mem leak in unit test.
Darren Tucker [Mon, 5 Aug 2019 11:36:48 +0000 (21:36 +1000)] 
Fix mem leak in unit test.

Patch from jitendra.sharma at intel.com.

6 years agoupstream: fix some memleaks in test_helper code
djm@openbsd.org [Fri, 2 Aug 2019 01:41:24 +0000 (01:41 +0000)] 
upstream: fix some memleaks in test_helper code

bz#3037 from Jitendra Sharma

OpenBSD-Regress-ID: 71440fa9186f5842a65ce9a27159385c6cb6f751

6 years agoupstream: typo; from Christian Hesse
djm@openbsd.org [Fri, 2 Aug 2019 01:23:19 +0000 (01:23 +0000)] 
upstream: typo; from Christian Hesse

OpenBSD-Commit-ID: 82f6de7438ea7ee5a14f44fdf5058ed57688fdc3

6 years agoupstream: let sshbuf_find/cmp take a void* for the
djm@openbsd.org [Tue, 30 Jul 2019 05:04:49 +0000 (05:04 +0000)] 
upstream: let sshbuf_find/cmp take a void* for the

search/comparison argument, instead of a u_char*. Saves callers needing to
cast.

OpenBSD-Commit-ID: d63b69b7c5dd570963e682f758f5a47b825605ed

6 years agoupstream: When using a combination of a Yubikey+GnuPG+remote
mestre@openbsd.org [Wed, 24 Jul 2019 08:57:00 +0000 (08:57 +0000)] 
upstream: When using a combination of a Yubikey+GnuPG+remote

forwarding the gpg-agent (and options ControlMaster+RemoteForward in
ssh_config(5)) then the codepath taken will call mux_client_request_session
-> mm_send_fd -> sendmsg(2). Since sendmsg(2) is not allowed in that codepath
then pledge(2) kills the process.

The solution is to add "sendfd" to pledge(2), which is not too bad considering
a little bit later we reduce pledge(2) to only "stdio proc tty" in that
codepath.

Problem reported and diff provided by Timothy Brown <tbrown at freeshell.org>

OK deraadt@

OpenBSD-Commit-ID: 7ce38b6542bbec00e441595d0a178e970a9472ac

6 years agoupstream: Fix typo in CASignatureAlgorithms wherein what should be
dtucker@openbsd.org [Tue, 23 Jul 2019 23:06:57 +0000 (23:06 +0000)] 
upstream: Fix typo in CASignatureAlgorithms wherein what should be

a comma is a dot. Patch from hnj2 via github pr#141.

OpenBSD-Commit-ID: 01f5a460438ff1af09aab483c0a70065309445f0

6 years agoReport success of individual tests as well as all.
Darren Tucker [Mon, 29 Jul 2019 06:04:01 +0000 (16:04 +1000)] 
Report success of individual tests as well as all.

This puts the "all tests passed" message back at the end where the
test harnesses can find it.

6 years agoconvert to UTF-8; from Mike Frysinger
Damien Miller [Sun, 28 Jul 2019 23:49:23 +0000 (09:49 +1000)] 
convert to UTF-8; from Mike Frysinger

6 years agoupstream: Restrict limit-keytype to types supported by build. This
dtucker@openbsd.org [Fri, 26 Jul 2019 04:22:21 +0000 (04:22 +0000)] 
upstream: Restrict limit-keytype to types supported by build. This

means we have to skip a couple tests when only one key type is supported.

OpenBSD-Regress-ID: 22d05befb9c7ce21ce8dc22acf1ffe9e2ef2e95e

6 years agoRemove override disabling DH-GEX.
Darren Tucker [Thu, 25 Jul 2019 08:36:28 +0000 (18:36 +1000)] 
Remove override disabling DH-GEX.

The DH-GEX override doesn't work when build without OpenSSL, and
we'll prefer curve25519 these days, removing the need for it.

6 years agoupstream: Only use supported key types during KRL test, preferring
dtucker@openbsd.org [Thu, 25 Jul 2019 09:17:35 +0000 (09:17 +0000)] 
upstream: Only use supported key types during KRL test, preferring

ed25519 since it's supported by both OpenSSL and non-OpenSSL builds.

OpenBSD-Regress-ID: 9f2bb3eadd50fcc8245b1bd8fd6f0e53602f71aa

6 years agoupstream: Switch keys-command test from rsa to ed25519 since it's
dtucker@openbsd.org [Thu, 25 Jul 2019 08:48:11 +0000 (08:48 +0000)] 
upstream: Switch keys-command test from rsa to ed25519 since it's

supported for both OpenSSL and non-OpenSSL builds.

OpenBSD-Regress-ID: 174be4be876edd493e4a5c851e5bc579885e7a0a

6 years agoupstream: Make certificate tests work with the supported key
dtucker@openbsd.org [Thu, 25 Jul 2019 08:28:15 +0000 (08:28 +0000)] 
upstream: Make certificate tests work with the supported key

algorithms.  Allows tests to pass when built without OpenSSL.

OpenBSD-Regress-ID: 617169a6dd9d06db3697a449d9a26c284eca20fc

6 years agoupstream: Construct list of key types to test based on the types
dtucker@openbsd.org [Tue, 23 Jul 2019 13:49:14 +0000 (13:49 +0000)] 
upstream: Construct list of key types to test based on the types

supported by the binaries.

OpenBSD-Regress-ID: fcbd115efacec8ab0ecbdb3faef79ac696cb1d62

6 years agoupstream: Only use DSA key type in tests if binaries support it.
dtucker@openbsd.org [Tue, 23 Jul 2019 13:32:48 +0000 (13:32 +0000)] 
upstream: Only use DSA key type in tests if binaries support it.

OpenBSD-Regress-ID: 770e31fe61dc33ed8eea9c04ce839b33ddb4dc96

6 years agoSplit test targets further.
Darren Tucker [Wed, 24 Jul 2019 04:21:19 +0000 (14:21 +1000)] 
Split test targets further.

Splits test into file-tests, t-exec, unit and interop-tests and their
respective dependencies.  Should allow running any set individually
without having to build the other dependencies that are not needed
for that specific test.

6 years agoAdd lib dependencies for regress binary targets.
Darren Tucker [Wed, 24 Jul 2019 01:20:18 +0000 (11:20 +1000)] 
Add lib dependencies for regress binary targets.

6 years agoMake "unit" a dependency of "test".
Darren Tucker [Tue, 23 Jul 2019 14:12:51 +0000 (00:12 +1000)] 
Make "unit" a dependency of "test".

6 years agoupstream rev 1.28: fix comment typo.
Darren Tucker [Tue, 23 Jul 2019 13:24:47 +0000 (23:24 +1000)] 
upstream rev 1.28: fix comment typo.

6 years agoSplit regress-binaries into two targets.
Darren Tucker [Tue, 23 Jul 2019 13:06:22 +0000 (23:06 +1000)] 
Split regress-binaries into two targets.

Split the binaries for the unit tests out into a regress-unit-binaries
target, and add a dependency on it for only the unit tests.  This allows
us to run the integration tests only ("make t-exec") without building
the unit tests, which allows us to run a subset of the tests when
building --without-openssl without trying (and failing) to build the
unit tests.

This means there are two targets for "unit" which I *think* is valid
(it works in testing, and makedepend will generate Makefiles of this
form)a but I could be wrong.

6 years agoupstream: Skip DH group generation test if binaries don't support
dtucker@openbsd.org [Tue, 23 Jul 2019 08:19:29 +0000 (08:19 +0000)] 
upstream: Skip DH group generation test if binaries don't support

DH-GEX.

OpenBSD-Regress-ID: 7c918230d969ecf7656babd6191a74526bffbffd

6 years agoupstream: Only test conversion of key types supported by the
dtucker@openbsd.org [Tue, 23 Jul 2019 07:55:29 +0000 (07:55 +0000)] 
upstream: Only test conversion of key types supported by the

binaries.

OpenBSD-Regress-ID: e3f0938a0a7407e2dfbb90abc3ec979ab6e8eeea

6 years agoupstream: Only add ssh-dss to allowed key types if it's supported
dtucker@openbsd.org [Tue, 23 Jul 2019 07:39:43 +0000 (07:39 +0000)] 
upstream: Only add ssh-dss to allowed key types if it's supported

by the binary.

OpenBSD-Regress-ID: 395a54cab16e9e4ece9aec047ab257954eebd413

6 years agoRemove sys/cdefs.h include.
Darren Tucker [Tue, 23 Jul 2019 12:36:39 +0000 (22:36 +1000)] 
Remove sys/cdefs.h include.

It's not needed on -portable (that's handled by includes.h) and not all
platforms have it.

6 years agoAdd headers to prevent warnings w/out OpenSSL.
Darren Tucker [Tue, 23 Jul 2019 12:25:44 +0000 (22:25 +1000)] 
Add headers to prevent warnings w/out OpenSSL.

6 years agoInclude stdlib.h for free() and calloc().
Darren Tucker [Tue, 23 Jul 2019 12:11:50 +0000 (22:11 +1000)] 
Include stdlib.h for free() and calloc().

6 years agoRe-apply portability changes to current sha2.{c,h}.
Darren Tucker [Tue, 23 Jul 2019 11:51:22 +0000 (21:51 +1000)] 
Re-apply portability changes to current sha2.{c,h}.

Rather than attempt to apply 14 years' worth of changes to OpenBSD's sha2
I imported the current versions directly then re-applied the portability
changes.  This also allowed re-syncing digest-libc.c against upstream.

6 years agoImport current sha2.c and sha2.h from OpenBSD.
Darren Tucker [Tue, 23 Jul 2019 10:27:51 +0000 (20:27 +1000)] 
Import current sha2.c and sha2.h from OpenBSD.

These are not changed from their original state, the next commit will
re-apply the portable changes.

6 years agoRename valgrind "errors" to "failures".
Darren Tucker [Mon, 22 Jul 2019 22:11:22 +0000 (08:11 +1000)] 
Rename valgrind "errors" to "failures".

When valgrind is enabled, test-exec.sh counts the number of invocations
that valgrind detects failures in, not the total number of errors detected.
This makes the name to be more accurate.

6 years agoSkip running sftp-chroot under Valgrind.
Darren Tucker [Fri, 19 Jul 2019 08:51:18 +0000 (18:51 +1000)] 
Skip running sftp-chroot under Valgrind.

6 years agoupstream: Remove the sleeps and thus races from the forwarding
dtucker@openbsd.org [Sat, 20 Jul 2019 09:50:58 +0000 (09:50 +0000)] 
upstream: Remove the sleeps and thus races from the forwarding

test.  They were originally required to work with Protocol 1, but now we can
use ssh -N and the control socket without the sleeps. While there, suppress
output fro the control exit commands.

OpenBSD-Regress-ID: 4c51a1d651242f12c90074c18c61008a74c1c790

6 years agoupstream: Allow SLEEPTIME to be overridden.
dtucker@openbsd.org [Sat, 20 Jul 2019 09:37:31 +0000 (09:37 +0000)] 
upstream: Allow SLEEPTIME to be overridden.

OpenBSD-Regress-ID: 1596ab168729954be3d219933b2d01cc93687e76

6 years agoupstream: Move sleep time into a variable so that we can increase
dtucker@openbsd.org [Sat, 20 Jul 2019 09:14:40 +0000 (09:14 +0000)] 
upstream: Move sleep time into a variable so that we can increase

it for platforms or configurations that are much slower then usual.

OpenBSD-Regress-ID: 88586cabc800062c260d0b876bdcd4ca3f58a872

6 years agoupstream: add regression tests for scp for out-of-destination path file
djm@openbsd.org [Fri, 19 Jul 2019 03:45:44 +0000 (03:45 +0000)] 
upstream: add regression tests for scp for out-of-destination path file

creation by Harry Sintonen via Jakub Jelen in bz3007

OpenBSD-Regress-ID: 01ae5fbc6ce400b2df5a84dc3152a9e31f354c07

6 years agoupstream: Accept the verbose flag when searching for host keys in known
djm@openbsd.org [Fri, 19 Jul 2019 03:38:01 +0000 (03:38 +0000)] 
upstream: Accept the verbose flag when searching for host keys in known

hosts (i.e. "ssh-keygen -vF host") to print the matching host's random- art
signature too. bz#3003 "amusing, pretty" deraadt@

OpenBSD-Commit-ID: 686221a5447d6507f40a2ffba5393984d889891f

6 years agoRevert one dependency per line change.
Darren Tucker [Fri, 19 Jul 2019 03:50:25 +0000 (13:50 +1000)] 
Revert one dependency per line change.

It turns out that having such a large number of lines in the .depend
file will cause the memory usage of awk during AC_SUBST to blow up on at
least NetBSD's awk, causing configure to fail.

6 years agofix SIGWINCH delivery of Solaris for mux sessions
Damien Miller [Fri, 19 Jul 2019 03:19:19 +0000 (13:19 +1000)] 
fix SIGWINCH delivery of Solaris for mux sessions

Remove PRIV_PROC_SESSION which was limiting ability to send SIGWINCH
signals to other sessions.  bz#3030; report and fix from Darren Moffat

6 years agoForce dependencies one per line.
Darren Tucker [Fri, 19 Jul 2019 03:20:03 +0000 (13:20 +1000)] 
Force dependencies one per line.

Force makedepend to output one dependency per line, which will make
reading diffs against it much easier.  ok djm@

6 years agomake depend.
Darren Tucker [Fri, 19 Jul 2019 03:18:07 +0000 (13:18 +1000)] 
make depend.

6 years agoShow when skipping valgrind for a test.
Darren Tucker [Fri, 19 Jul 2019 03:16:11 +0000 (13:16 +1000)] 
Show when skipping valgrind for a test.

6 years agoEnable connect-privsep test with valgrind.
Darren Tucker [Fri, 19 Jul 2019 00:41:56 +0000 (10:41 +1000)] 
Enable connect-privsep test with valgrind.

connect-privsep seems to work OK with valgrind now so don't skip
valgrind on it.

6 years agoShow valgrind results and error counts.
Darren Tucker [Thu, 18 Jul 2019 21:43:07 +0000 (07:43 +1000)] 
Show valgrind results and error counts.

6 years agoFix format string integer type in error message.
Darren Tucker [Thu, 18 Jul 2019 03:40:12 +0000 (13:40 +1000)] 
Fix format string integer type in error message.

6 years agoupstream: fix off-by-one in sshbuf_dtob64() base64 wrapping that could
djm@openbsd.org [Thu, 18 Jul 2019 13:26:00 +0000 (13:26 +0000)] 
upstream: fix off-by-one in sshbuf_dtob64() base64 wrapping that could

cause extra newlines to be appended at the end of the base64 text (ugly, but
harmless). Found and fixed by Sebastian Kinne

OpenBSD-Commit-ID: 9fe290bd68f706ed8f986a7704ca5a2bd32d7b68

6 years agoFail tests if Valgrind enabled and reports errors.
Darren Tucker [Thu, 18 Jul 2019 01:09:38 +0000 (11:09 +1000)] 
Fail tests if Valgrind enabled and reports errors.

Also dump the failing valgrind report to stdout (not the cleanest
solution, but better than nothing).

6 years agoAllow low-priv tests to write to pipe dir.
Darren Tucker [Thu, 18 Jul 2019 00:17:54 +0000 (10:17 +1000)] 
Allow low-priv tests to write to pipe dir.

When running regression tests with Valgrind and SUDO, the low-priv agent
tests need to be able to create pipes in the appropriate directory.

6 years agoPut valgrind vgdb files to a specific directory.
Darren Tucker [Wed, 17 Jul 2019 11:24:55 +0000 (21:24 +1000)] 
Put valgrind vgdb files to a specific directory.

Valgrind by default puts vgdb files and pipes under /tmp, however it
is not always able to clean them up, which can cause test failures when
there's a pid/file collision.  Using a specific directory ensures that
we can clean up and start clean.

6 years agoupstream: adapt to sshbuf_dtob64() change
djm@openbsd.org [Tue, 16 Jul 2019 22:16:49 +0000 (22:16 +0000)] 
upstream: adapt to sshbuf_dtob64() change

OpenBSD-Regress-ID: 82374a83edf0955fd1477169eee3f5d6467405a6

6 years agoupstream: Remove ssh1 files from CLEANFILES since ssh1 no longer
dtucker@openbsd.org [Tue, 16 Jul 2019 03:21:54 +0000 (03:21 +0000)] 
upstream: Remove ssh1 files from CLEANFILES since ssh1 no longer

supported.

OpenBSD-Regress-ID: 5b9ae869dc669bac05939b4a2fdf44ee067acfa0

6 years agoupstream: Update names of host key files in CLEANFILES to match
dtucker@openbsd.org [Tue, 16 Jul 2019 02:09:29 +0000 (02:09 +0000)] 
upstream: Update names of host key files in CLEANFILES to match

recent changes to the tests.

OpenBSD-Regress-ID: 28743052de3acf70b06f18333561497cd47c4ecf

6 years agodepend
Damien Miller [Tue, 16 Jul 2019 13:26:53 +0000 (23:26 +1000)] 
depend

6 years agoupstream: remove mostly vestigal uuencode.[ch]; moving the only unique
djm@openbsd.org [Tue, 16 Jul 2019 13:18:39 +0000 (13:18 +0000)] 
upstream: remove mostly vestigal uuencode.[ch]; moving the only unique

functionality there (wrapping of base64-encoded data) to sshbuf functions;
feedback and ok markus@

OpenBSD-Commit-ID: 4dba6735d88c57232f6fccec8a08bdcfea44ac4c

6 years agoHook memmem compat code into build.
Darren Tucker [Mon, 15 Jul 2019 23:20:23 +0000 (09:20 +1000)] 
Hook memmem compat code into build.

This fixes builds on platforms that don't have it (at least old DragonFly,
probably others).

6 years agoImport memmem.c from OpenBSD.
Darren Tucker [Mon, 15 Jul 2019 23:07:18 +0000 (09:07 +1000)] 
Import memmem.c from OpenBSD.

6 years agoupstream: unit tests for sshbuf_cmp() and sshbuf_find(); ok markus
djm@openbsd.org [Mon, 15 Jul 2019 13:12:02 +0000 (13:12 +0000)] 
upstream: unit tests for sshbuf_cmp() and sshbuf_find(); ok markus

OpenBSD-Regress-ID: b52d36bc3ab6dc158c1e59a9a4735f821cf9e1fd

6 years agoupstream: support PKCS8 as an optional format for storage of
djm@openbsd.org [Mon, 15 Jul 2019 13:16:29 +0000 (13:16 +0000)] 
upstream: support PKCS8 as an optional format for storage of

private keys, enabled via "ssh-keygen -m PKCS8" on operations that save
private keys to disk.

The OpenSSH native key format remains the default, but PKCS8 is a
superior format to PEM if interoperability with non-OpenSSH software
is required, as it may use a less terrible KDF (IIRC PEM uses a single
round of MD5 as a KDF).

adapted from patch by Jakub Jelen via bz3013; ok markus

OpenBSD-Commit-ID: 027824e3bc0b1c243dc5188504526d73a55accb1

6 years agoupstream: two more bounds-checking sshbuf counterparts to common
djm@openbsd.org [Mon, 15 Jul 2019 13:11:38 +0000 (13:11 +0000)] 
upstream: two more bounds-checking sshbuf counterparts to common

string operations: sshbuf_cmp() (bcmp-like) and sshbuf_find() (memmem like)

feedback and ok markus@

OpenBSD-Commit-ID: fd071ec2485c7198074a168ff363a0d6052a706a

6 years agoClear valgrind-out dir to prevent collisions.
Darren Tucker [Mon, 15 Jul 2019 02:52:45 +0000 (12:52 +1000)] 
Clear valgrind-out dir to prevent collisions.

6 years agoAllow agent tests to write to valgrind dir.
Darren Tucker [Mon, 15 Jul 2019 02:02:27 +0000 (12:02 +1000)] 
Allow agent tests to write to valgrind dir.

6 years agoupstream: unit tests for sshbuf_peek/poke bounds-checked random access
djm@openbsd.org [Sun, 14 Jul 2019 23:33:19 +0000 (23:33 +0000)] 
upstream: unit tests for sshbuf_peek/poke bounds-checked random access

functions. ok markus@

OpenBSD-Regress-ID: 034c4284b1da6b12e25c762a6b958efacdafbaef

6 years agoupstream: add some functions to perform random-access read/write
djm@openbsd.org [Sun, 14 Jul 2019 23:32:27 +0000 (23:32 +0000)] 
upstream: add some functions to perform random-access read/write

operations inside buffers with bounds checking. Intended to replace manual
pointer arithmetic wherever possible.

feedback and ok markus@

OpenBSD-Commit-ID: 91771fde7732738f1ffed078aa5d3bee6d198409

6 years agoupstream: include SHA2-variant RSA key algorithms in KEX proposal;
djm@openbsd.org [Fri, 12 Jul 2019 04:08:39 +0000 (04:08 +0000)] 
upstream: include SHA2-variant RSA key algorithms in KEX proposal;

allows ssh-keyscan to harvest keys from servers that disable olde SHA1
ssh-rsa. bz#3029 from Jakub Jelen

OpenBSD-Commit-ID: 9f95ebf76a150c2f727ca4780fb2599d50bbab7a

6 years agoupstream: print explicit "not modified" message if a file was
djm@openbsd.org [Fri, 12 Jul 2019 03:56:21 +0000 (03:56 +0000)] 
upstream: print explicit "not modified" message if a file was

requested for resumed download but was considered already complete.

bz#2978 ok dtucker

OpenBSD-Commit-ID: f32084b26a662f16215ee4ca4a403d67e49ab986

6 years agoupstream: Fix a typo and make <esc><right> move right to the
tb@openbsd.org [Wed, 10 Jul 2019 07:04:27 +0000 (07:04 +0000)] 
upstream: Fix a typo and make <esc><right> move right to the

closest end of a word just like <esc><left> moves left to the closest
beginning of a word.

ok djm

OpenBSD-Commit-ID: 6afe01b05ed52d8b12eb1fda6e9af5afb5e198ee

6 years agofix typo that prevented detection of Linux VRF
Damien Miller [Tue, 9 Jul 2019 23:43:19 +0000 (09:43 +1000)] 
fix typo that prevented detection of Linux VRF

Reported by hexiaowen AT huawei.com

6 years agoupstream: cap the number of permiopen/permitlisten directives we're
djm@openbsd.org [Tue, 9 Jul 2019 04:15:00 +0000 (04:15 +0000)] 
upstream: cap the number of permiopen/permitlisten directives we're

willing to parse on a single authorized_keys line; ok deraadt@

OpenBSD-Commit-ID: a43a752c2555d26aa3fc754805a476f6e3e30f46

6 years agoMove log.h include inside ifdefs.
Darren Tucker [Mon, 8 Jul 2019 07:27:26 +0000 (17:27 +1000)] 
Move log.h include inside ifdefs.

Fixes build on some other platforms that don't have va_list immediately
available (eg NetBSD).

6 years agoInclude log.h for debug() and friends.
Darren Tucker [Sat, 6 Jul 2019 13:07:04 +0000 (23:07 +1000)] 
Include log.h for debug() and friends.

Should fix some compiler warnings on IRIX (bz#3032).

6 years agosftp-realpath.c needs includes.h
Damien Miller [Mon, 8 Jul 2019 03:44:32 +0000 (13:44 +1000)] 
sftp-realpath.c needs includes.h

6 years agoremove realpath() compat replacement
Damien Miller [Mon, 8 Jul 2019 03:38:39 +0000 (13:38 +1000)] 
remove realpath() compat replacement

We shipped a BSD implementation of realpath() because sftp-server
depended on its behaviour.

OpenBSD is now moving to a more strictly POSIX-compliant realpath(2),
so sftp-server now unconditionally requires its own BSD-style realpath
implementation. As such, there is no need to carry another independant
implementation in openbsd-compat.

ok dtucker@

6 years agoupstream: Remove some set but never used variables. ok daraadt@
dtucker@openbsd.org [Sun, 7 Jul 2019 01:05:00 +0000 (01:05 +0000)] 
upstream: Remove some set but never used variables. ok daraadt@

OpenBSD-Commit-ID: 824baf9c59afc66a4637017e397b9b74a41684e7

6 years agoupstream: still compile uuencode.c, unbreaks build
deraadt@openbsd.org [Fri, 5 Jul 2019 12:35:40 +0000 (12:35 +0000)] 
upstream: still compile uuencode.c, unbreaks build

OpenBSD-Commit-ID: 5ea3d63ab972691f43e9087ab5fd8376d48e898f

6 years agoupstream: revert header removal that snuck into previous
djm@openbsd.org [Fri, 5 Jul 2019 07:32:01 +0000 (07:32 +0000)] 
upstream: revert header removal that snuck into previous

OpenBSD-Commit-ID: 3919cdd58989786660b8269b325646ef8856428e

6 years agoupstream: add a local implementation of BSD realpath() for
djm@openbsd.org [Fri, 5 Jul 2019 04:55:40 +0000 (04:55 +0000)] 
upstream: add a local implementation of BSD realpath() for

sftp-server use ahead of OpenBSD's realpath changing to match POSIX;

ok deraadt@ (thanks for snaps testing)

OpenBSD-Commit-ID: 4f8cbf7ed8679f6237264301d104ecec64885d55

6 years agoAdd prototype for strnlen to prevent warnings.
Darren Tucker [Sat, 6 Jul 2019 03:13:57 +0000 (13:13 +1000)] 
Add prototype for strnlen to prevent warnings.

6 years agoCast *ID types to unsigned long when printing.
Darren Tucker [Sat, 6 Jul 2019 03:02:34 +0000 (13:02 +1000)] 
Cast *ID types to unsigned long when printing.

UID and GID types vary by platform so cast to u_long and use %lu when
printing them to prevent warnings.

6 years agoAdd prototype for compat strndup.(bz#3032).
Darren Tucker [Sat, 6 Jul 2019 02:54:43 +0000 (12:54 +1000)] 
Add prototype for compat strndup.(bz#3032).

6 years agoAdd missing bracket in EGD seeding code.
Darren Tucker [Sat, 6 Jul 2019 02:00:41 +0000 (12:00 +1000)] 
Add missing bracket in EGD seeding code.

When configured --with-prngd-socket the code had a missing bracket after
an API change.  Fix that and a couple of warnings.  bz#3032 , from
ole.weidner at protonmail.ch

6 years agoupstream: Add (recently added) rsa_oldfmt to CLEANFILES.
dtucker@openbsd.org [Fri, 5 Jul 2019 04:19:39 +0000 (04:19 +0000)] 
upstream: Add (recently added) rsa_oldfmt to CLEANFILES.

OpenBSD-Regress-ID: 405beda94e32aa6cc9c80969152fab91f7c54bd3

6 years agoupstream: Adapt the PuTTY/Conch tests to new key names.
dtucker@openbsd.org [Fri, 5 Jul 2019 04:12:46 +0000 (04:12 +0000)] 
upstream: Adapt the PuTTY/Conch tests to new key names.

A recent regress change (2a9b3a2ce411d16cda9c79ab713c55f65b0ec257 in
portable) broke the PuTTY and Twisted Conch interop tests, because the
key they want to use is now called ssh-rsa rather than rsa.  Adapt the
tests to the new file names.  bz#3020, patch from cjwatson at debian.org.

OpenBSD-Regress-ID: fd342a37db4d55aa4ec85316f73082c8eb96e64e

6 years agoupstream: Add a sleep to allow forwards to come up.
dtucker@openbsd.org [Fri, 5 Jul 2019 04:03:13 +0000 (04:03 +0000)] 
upstream: Add a sleep to allow forwards to come up.

Currently when the multiplex client requests a forward it returns
once the request has been sent but not necessarily when the forward
is up.  This causes intermittent text failures due to this race,
so add some sleeps to mitigate this until we can fix it properly.

OpenBSD-Regress-ID: 384c7d209d2443d25ea941d7f677e932621fb253

6 years agoRemove nc stderr redirection to resync w/OpenBSD.
Darren Tucker [Fri, 5 Jul 2019 04:58:57 +0000 (14:58 +1000)] 
Remove nc stderr redirection to resync w/OpenBSD.

6 years agoDo not fatal on failed lookup of group "tty".
Darren Tucker [Fri, 5 Jul 2019 03:21:45 +0000 (13:21 +1000)] 
Do not fatal on failed lookup of group "tty".

Some platforms (eg AIX and Cygwin) do not have a "tty" group.  In those
cases we will fall back to making the tty device the user's primary
group, so do not fatal if the group lookup fails.  ok djm@

6 years agoupstream: fatal() if getgrnam() cannot find "tty"
deraadt@openbsd.org [Thu, 4 Jul 2019 16:20:10 +0000 (16:20 +0000)] 
upstream: fatal() if getgrnam() cannot find "tty"

OpenBSD-Commit-ID: d148c1c052fa0ed7d105b5428b5c1bab91630048

6 years agoupstream: stat() returns precisely -1 to indicate error
deraadt@openbsd.org [Thu, 4 Jul 2019 16:16:51 +0000 (16:16 +0000)] 
upstream: stat() returns precisely -1 to indicate error

OpenBSD-Commit-ID: 668e8d022ed4ab847747214f64119e5865365fa1

6 years agoupstream: snprintf/vsnprintf return < 0 on error, rather than -1.
deraadt@openbsd.org [Wed, 3 Jul 2019 03:24:02 +0000 (03:24 +0000)] 
upstream: snprintf/vsnprintf return < 0 on error, rather than -1.

OpenBSD-Commit-ID: a261c421140a0639bb2b66bbceca72bf8239749d

6 years agoupstream: When system calls indicate an error they return -1, not
deraadt@openbsd.org [Fri, 28 Jun 2019 13:35:04 +0000 (13:35 +0000)] 
upstream: When system calls indicate an error they return -1, not

some arbitrary value < 0.  errno is only updated in this case.  Change all
(most?) callers of syscalls to follow this better, and let's see if this
strictness helps us in the future.

OpenBSD-Commit-ID: 48081f00db7518e3b712a49dca06efc2a5428075

6 years agoupstream: asprintf returns -1, not an arbitrary value < 0. Also
deraadt@openbsd.org [Fri, 28 Jun 2019 05:44:09 +0000 (05:44 +0000)] 
upstream: asprintf returns -1, not an arbitrary value < 0. Also

upon error the (very sloppy specification) leaves an undefined value in *ret,
so it is wrong to inspect it, the error condition is enough. discussed a
little with nicm, and then much more with millert until we were exasperated

OpenBSD-Commit-ID: 29258fa51edf8115d244b9d4b84028487bf8923e

6 years agoupstream: oops, from asou
deraadt@openbsd.org [Fri, 28 Jun 2019 01:23:50 +0000 (01:23 +0000)] 
upstream: oops, from asou

OpenBSD-Commit-ID: 702e765d1639b732370d8f003bb84a1c71c4d0c6