]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
2 years agoupstream: Remove SUDO in proxy command wrapper. Anything that needs 380/head
dtucker@openbsd.org [Thu, 2 Mar 2023 11:10:27 +0000 (11:10 +0000)] 
upstream: Remove SUDO in proxy command wrapper. Anything that needs

sudo is already run by it, and it breaks if root isn't in sudoers.

OpenBSD-Regress-ID: 6cf22fda32a89c16915f31a6ed9bbdbef2a3bac9

2 years agoupstream: Fix breakage on dhgex test.
dtucker@openbsd.org [Thu, 2 Mar 2023 08:24:41 +0000 (08:24 +0000)] 
upstream: Fix breakage on dhgex test.

This was due to the sshd logs being written to the wrong log file.
While there, make save_debug_logs less verbose, write the name of the
tarball to regress.log and use $SUDO to remove the old symlinks (which
shouldn't be needed, but won't hurt).  Initial problem spotted by anton@.

OpenBSD-Regress-ID: 9c44fb9cd418e6ff31165e7a6c1f9f11a6d19f5b

2 years agoupstream: Quote grep and log message better.
dtucker@openbsd.org [Thu, 2 Mar 2023 08:14:52 +0000 (08:14 +0000)] 
upstream: Quote grep and log message better.

OpenBSD-Regress-ID: 3823d9063127169736aa274b1784cb28e15b64d4

2 years agoupstream: Always call fclose on checkpoints.
dtucker@openbsd.org [Thu, 2 Mar 2023 06:41:56 +0000 (06:41 +0000)] 
upstream: Always call fclose on checkpoints.

In the case of an fprintf failure we would not call fclose which would
leak the FILE pointer.  While we're there, try to clean up the temp file
on failure.  Spotted by Coverity, ok djm@

OpenBSD-Commit-ID: 73c7ccc5d4fcc235f54c6b20767a2815408525ef

2 years agoupstream: Remove old log symlinks
dtucker@openbsd.org [Wed, 1 Mar 2023 21:54:50 +0000 (21:54 +0000)] 
upstream: Remove old log symlinks

before creating new ones. In -portable some platforms don't like
overwriting existing symlinks.

OpenBSD-Regress-ID: 7e7ddc0beb73e945e1c4c58d51c8a125b518120f

2 years agoAdjust test jobs for new log directory.
Darren Tucker [Wed, 1 Mar 2023 12:23:02 +0000 (23:23 +1100)] 
Adjust test jobs for new log directory.

2 years agoupstream: Rework logging for the regression tests.
dtucker@openbsd.org [Wed, 1 Mar 2023 09:29:32 +0000 (09:29 +0000)] 
upstream: Rework logging for the regression tests.

Previously we would log to ssh.log and sshd.log, but that is insufficient
for tests that have more than one concurent ssh/sshd.

Instead, we'll log to separate datestamped files in a $OBJ/log/ and
leave a symlink at the previous location pointing at the most recent
instance with an entry in regress.log showing which files were created
at each point.  This should be sufficient to reconstruct what happened
even for tests that use multiple instances of each program.  If the test
fails, tar up all of the logs for later analysis.

This will let us also capture the output from some of the other tools
which was previously sent to /dev/null although most of those will be
in future commits.

OpenBSD-Regress-ID: f802aa9e7fa51d1a01225c05fb0412d015c33e24

2 years agoupstream: fatal out if allocating banner string fails to avoid
dtucker@openbsd.org [Tue, 28 Feb 2023 21:31:50 +0000 (21:31 +0000)] 
upstream: fatal out if allocating banner string fails to avoid

potential null deref later in sscanf.  Spotted by Coverity, ok deraadt@

OpenBSD-Commit-ID: 74e8d228ac00552e96e9e968dfcccf8dd1f46ad5

2 years agoupstream: Explicitly ignore return from fchmod
dtucker@openbsd.org [Tue, 28 Feb 2023 08:45:24 +0000 (08:45 +0000)] 
upstream: Explicitly ignore return from fchmod

similar to other calls to prevent warning.

OpenBSD-Commit-ID: fdc5287dcee0860b5a493186414226c655b0eb0a

2 years agoupstream: Plug mem leak on globbed ls error path.
dtucker@openbsd.org [Mon, 27 Feb 2023 22:12:40 +0000 (22:12 +0000)] 
upstream: Plug mem leak on globbed ls error path.

 Spotted by Coverity, ok deraadt@

OpenBSD-Commit-ID: de28476025db29820a9a2e56e98b964d8a02861c

2 years agoCast time_t's in debug output to long long.
Darren Tucker [Mon, 27 Feb 2023 10:04:22 +0000 (21:04 +1100)] 
Cast time_t's in debug output to long long.

Should fix Coverity warning about truncation of 64bit time_t.

2 years agoDo shadow expiry calcs using "long long".
Darren Tucker [Mon, 27 Feb 2023 06:28:59 +0000 (17:28 +1100)] 
Do shadow expiry calcs using "long long".

Coverity flags these as potentially not 64bit time_t safe so use
long long for the calculations and debug output.  ok djm@

2 years agoavoid clash between for getopt's struct option
Damien Miller [Mon, 27 Feb 2023 06:07:52 +0000 (17:07 +1100)] 
avoid clash between for getopt's struct option

Since we don't use getopt_long() nothing outside the getopt()
implementation itself uses this structure, so move it into the
source to remove it from visibility and clashes with libc's

ok dtucker@

2 years agoRevert explicit chmods on private keys.
Darren Tucker [Sat, 25 Feb 2023 03:45:41 +0000 (14:45 +1100)] 
Revert explicit chmods on private keys.

This should no longer be needed on Cygwin test runners due to previous
commit.

2 years agoRemove extended ACLs from working dirs.
Darren Tucker [Sat, 25 Feb 2023 03:43:28 +0000 (14:43 +1100)] 
Remove extended ACLs from working dirs.

This should allow umask to work as expected and prevent tests from
failing due to excessive permissions on private keys.

2 years agoExplicitly set permissions on user and host keys.
Darren Tucker [Fri, 24 Feb 2023 02:44:13 +0000 (13:44 +1100)] 
Explicitly set permissions on user and host keys.

On cygwin, the umask might not be sufficient.  Should fix tests on
Github runners.

2 years agoupstream: fix progressmeter corruption on wide displays; bz3534
djm@openbsd.org [Wed, 22 Feb 2023 03:56:43 +0000 (03:56 +0000)] 
upstream: fix progressmeter corruption on wide displays; bz3534

feedback/ok dtucker@

OpenBSD-Commit-ID: f4affee067cec7c182f3e0b307d758e0472762a3

2 years agoupstream: fseek to end of known_hosts before writing to it.
dtucker@openbsd.org [Tue, 21 Feb 2023 06:48:18 +0000 (06:48 +0000)] 
upstream: fseek to end of known_hosts before writing to it.

POSIX and ANSI C require that applications call fseek or similar between
read and writing to a RW file.  OpenBSD doesn't enforce this, but some
(System V derived) platforms need this to prevent it from writing a
spurious extra byte (in this case, a newline).  ok djm@ deraadt@

OpenBSD-Commit-ID: 33e680dcd8110582a93a40a8491024e961f45137

2 years agoAlso run unit tests on AIX VMs.
Darren Tucker [Tue, 21 Feb 2023 06:51:09 +0000 (17:51 +1100)] 
Also run unit tests on AIX VMs.

In the past these tests took too long, but these days it only adds
about 5 min to the run.

2 years agoWrap stdint.h inside ifdef.
Darren Tucker [Tue, 21 Feb 2023 06:38:55 +0000 (17:38 +1100)] 
Wrap stdint.h inside ifdef.

2 years agoAdd includes to ptimeout test.
Mayank Sharma [Mon, 20 Feb 2023 12:07:15 +0000 (17:37 +0530)] 
Add includes to ptimeout test.

Fixes test failures on AIX due to type mismatches.

2 years agoAlways use the openssl binary configure tells us.
Darren Tucker [Mon, 20 Feb 2023 07:24:39 +0000 (18:24 +1100)] 
Always use the openssl binary configure tells us.

This fixes tests on platforms that do not have the openssl tool
installed at all.

2 years agoupstream: Remove now-unused compat bit SSH_BUG_RSASIGMD5. The code
dtucker@openbsd.org [Fri, 17 Feb 2023 04:22:50 +0000 (04:22 +0000)] 
upstream: Remove now-unused compat bit SSH_BUG_RSASIGMD5. The code

to set this was removed in OpenSSH 7.7 when support for SSH implementations
dating back to before RFC standardization were removed.  "burn it all" djm@

OpenBSD-Commit-ID: 6330935fbe23dd00be79891505e06d1ffdac7cda

2 years agoupstream: Remove now-unused compat bit SSH_BUG_BIGENDIANAES. This
dtucker@openbsd.org [Fri, 17 Feb 2023 03:06:18 +0000 (03:06 +0000)] 
upstream: Remove now-unused compat bit SSH_BUG_BIGENDIANAES. This

was previously set for OpenSSH 2.3 (released in 2000) but this check was
removed in OpenSSH 7.7 (2018).  ok djm@ deraadt@

OpenBSD-Commit-ID: 326426ea328707fc9e83305291ab135c87f678af

2 years agowhitespace fixes
Damien Miller [Thu, 16 Feb 2023 23:12:40 +0000 (10:12 +1100)] 
whitespace fixes

2 years agowhitespace at EOL
Damien Miller [Thu, 16 Feb 2023 23:02:08 +0000 (10:02 +1100)] 
whitespace at EOL

2 years agoupstream: Remove SSH_BUG_PASSWORDPAD compat bit
dtucker@openbsd.org [Thu, 16 Feb 2023 10:10:00 +0000 (10:10 +0000)] 
upstream: Remove SSH_BUG_PASSWORDPAD compat bit

since it's no longer used. ok markus@

OpenBSD-Commit-ID: b92c21f56fe4b7f9a54790d6a9650725c226820b

2 years agoupstream: Remove SSH_BUG_IGNOREMSG compat flag
dtucker@openbsd.org [Thu, 16 Feb 2023 07:55:15 +0000 (07:55 +0000)] 
upstream: Remove SSH_BUG_IGNOREMSG compat flag

since it's only applicable to SSH1 and thus no longer used.  ok markus@
"kill it with fire" djm@

OpenBSD-Commit-ID: ea13318b1937795d9db4790d3ce0a6ed01584dab

2 years agoupstream: space between macro and punctuation; sort usage();
jmc@openbsd.org [Fri, 10 Feb 2023 06:41:53 +0000 (06:41 +0000)] 
upstream: space between macro and punctuation; sort usage();

OpenBSD-Commit-ID: 6141610cfca037700730e41f868d1d9124958f8c

2 years agoupstream: space between macro and punctuation;
jmc@openbsd.org [Fri, 10 Feb 2023 06:40:48 +0000 (06:40 +0000)] 
upstream: space between macro and punctuation;

OpenBSD-Commit-ID: abc95e550be9e6d9a7ff64b65c104c7be21ab19e

2 years agoupstream: sort SYNOPSIS;
jmc@openbsd.org [Fri, 10 Feb 2023 06:39:27 +0000 (06:39 +0000)] 
upstream: sort SYNOPSIS;

OpenBSD-Commit-ID: dacd9da33277d5669a51213d880632599c890c1e

2 years agoImprove seccomp compat on older systems.
Darren Tucker [Sat, 11 Feb 2023 01:32:19 +0000 (12:32 +1100)] 
Improve seccomp compat on older systems.

Check if flags to mmap and madvise are defined before using them.
Should fix problems building on older Linux systems that don't have
these.  bz#3537, with & ok djm@.

2 years agoupstream: test -Ohashalg=... and that the default output contains both
djm@openbsd.org [Fri, 10 Feb 2023 05:06:03 +0000 (05:06 +0000)] 
upstream: test -Ohashalg=... and that the default output contains both

specified hash algorithms; prompted by dtucker@

OpenBSD-Regress-ID: 26f309208c8d8b8fa9c5f419767b85f1e9b22f51

2 years agoupstream: let ssh-keygen and ssh-keyscan accept
djm@openbsd.org [Fri, 10 Feb 2023 04:56:30 +0000 (04:56 +0000)] 
upstream: let ssh-keygen and ssh-keyscan accept

-Ohashalg=sha1|sha256 when outputting SSHFP fingerprints to allow algorithm
selection. bz3493 ok dtucker@

OpenBSD-Commit-ID: e6e07fe21318a873bd877f333e189eb963a11b3d

2 years agoupstream: add a `sshd -G` option that parses and prints the
djm@openbsd.org [Fri, 10 Feb 2023 04:47:19 +0000 (04:47 +0000)] 
upstream: add a `sshd -G` option that parses and prints the

effective configuration without attempting to load private keys and perform
other checks. This allows usage of the option before keys have been
generated.

bz3460 feedback/ok dtucker@

OpenBSD-Commit-ID: 774504f629023fc25a559ab1d95401adb3a7fb29

2 years agoupstream: make `ssh -Q CASignatureAlgorithms` work as the manpage says
djm@openbsd.org [Fri, 10 Feb 2023 04:40:28 +0000 (04:40 +0000)] 
upstream: make `ssh -Q CASignatureAlgorithms` work as the manpage says

it should bz3532

OpenBSD-Commit-ID: 0ddb17b3fcbd99bfb5baea4ac5e449620cbd3adc

2 years agoAdd CentOS 7 test targets.
Darren Tucker [Fri, 10 Feb 2023 03:26:44 +0000 (14:26 +1100)] 
Add CentOS 7 test targets.

2 years agoupstream: Test adding terminating newline to known_hosts.
dtucker@openbsd.org [Thu, 9 Feb 2023 09:55:33 +0000 (09:55 +0000)] 
upstream: Test adding terminating newline to known_hosts.

OpenBSD-Regress-ID: 5fc3010ac450195b3fbdeb68e875564968800365

2 years agoupstream: ssh-agent doesn't actually take -v,
dtucker@openbsd.org [Wed, 8 Feb 2023 08:06:03 +0000 (08:06 +0000)] 
upstream: ssh-agent doesn't actually take -v,

so the recently-added ones will result in the test not cleaning up
after itself.  Patch from cjwatson at debian.org vi bz#3536.

OpenBSD-Regress-ID: 1fc8283568f5bf2f918517c2c1e778072cf61b1a

2 years agoupstream: Ensure that there is a terminating newline when adding a new
dtucker@openbsd.org [Thu, 9 Feb 2023 09:54:11 +0000 (09:54 +0000)] 
upstream: Ensure that there is a terminating newline when adding a new

entry to known_hosts.  bz#3529, with git+openssh at limpsquid.nl, ok deraadt@
markus@

OpenBSD-Commit-ID: fa8d90698da1886570512b96f051e266eac105e0

2 years agoReplace 9.1 with 9.2 on CI status page.
Darren Tucker [Mon, 6 Feb 2023 21:43:47 +0000 (08:43 +1100)] 
Replace 9.1 with 9.2 on CI status page.

2 years agoharden Linux seccomp sandbox
Damien Miller [Fri, 3 Feb 2023 05:33:09 +0000 (16:33 +1100)] 
harden Linux seccomp sandbox

Linux mmap(2) and madvise(2) syscalls support quite a number of funky
flags that we don't expect that sshd/libc will ever need. We can
exclude this kernel attack surface by filtering the mmap(2) flags
and the madvise(2) advice arguments.

Similarly, the sandboxed process in sshd is a single-threaded program
that does not use shared memory for synchronisation or communication.
Therefore, there should be no reason for the advanced priority
inheritance futex(2) operations to be necessary. These can also be
excluded.

Motivated by Jann Horn pointing out that there have been kernel bugs
in nearby Linux kernel code, e.g. CVE-2020-29368, CVE-2020-29374 and
CVE-2022-42703.

Feedback Jann Horn, ok dtucker@

2 years agocrank versions in RPM specs V_9_2_P1
Damien Miller [Thu, 2 Feb 2023 12:21:54 +0000 (23:21 +1100)] 
crank versions in RPM specs

2 years agoupdate version in README
Damien Miller [Thu, 2 Feb 2023 12:21:45 +0000 (23:21 +1100)] 
update version in README

2 years agoadapt compat_kex_proposal() test to portable
Damien Miller [Thu, 2 Feb 2023 12:17:49 +0000 (23:17 +1100)] 
adapt compat_kex_proposal() test to portable

2 years agoupstream: test compat_kex_proposal(); by dtucker@
djm@openbsd.org [Thu, 2 Feb 2023 12:12:52 +0000 (12:12 +0000)] 
upstream: test compat_kex_proposal(); by dtucker@

OpenBSD-Regress-ID: 0e404ee264db546f9fdbf53390689ab5f8d38bf2

2 years agoupstream: Check if we can copy sshd or need to use sudo to do so
dtucker@openbsd.org [Thu, 19 Jan 2023 07:53:45 +0000 (07:53 +0000)] 
upstream: Check if we can copy sshd or need to use sudo to do so

during reexec test. Skip test if neither can work.  Patch from anton@, tweaks
from me.

OpenBSD-Regress-ID: 731b96ae74d02d5744e1f1a8e51d09877ffd9b6d

2 years agoupstream: openssh-9.2
djm@openbsd.org [Thu, 2 Feb 2023 12:10:22 +0000 (12:10 +0000)] 
upstream: openssh-9.2

OpenBSD-Commit-ID: f7389f32413c74d6e2055f05cf65e7082de03923

2 years agoupstream: fix double-free caused by compat_kex_proposal(); bz3522
djm@openbsd.org [Thu, 2 Feb 2023 12:10:05 +0000 (12:10 +0000)] 
upstream: fix double-free caused by compat_kex_proposal(); bz3522

by dtucker@, ok me

OpenBSD-Commit-ID: 2bfc37cd2d41f67dad64c17a64cf2cd3806a5c80

2 years agoSkip connection-timeout test on minix3.
Darren Tucker [Wed, 1 Feb 2023 06:17:26 +0000 (17:17 +1100)] 
Skip connection-timeout test on minix3.

Minix 3's Unix domain sockets don't seem to work the way we expect, so
skip connection-timeout test on that platform.  While there, group
together all similarly skipped tests and explicitly comment.

2 years agofix libfido2 detection without pkg-config
Damien Miller [Wed, 1 Feb 2023 01:12:05 +0000 (12:12 +1100)] 
fix libfido2 detection without pkg-config

Place libfido2 before additional libraries (that it may depend upon)
and not after. bz3530 from James Zhang; ok dtucker@

2 years agoupstream: delete useless dependency
deraadt@openbsd.org [Wed, 18 Jan 2023 20:56:36 +0000 (20:56 +0000)] 
upstream: delete useless dependency

OpenBSD-Commit-ID: e1dc11143f83082e3154d6094f9136d0dc2637ad

2 years agoupstream: Create and install sshd random relink kit.
deraadt@openbsd.org [Wed, 18 Jan 2023 20:43:15 +0000 (20:43 +0000)] 
upstream: Create and install sshd random relink kit.

../Makefile.inc and Makfile are concatenated for reuse, which hopefully won't
be too fragile, we'll see if we need a different approach. The resulting sshd
binary is tested with the new sshd -V option before installation.  As the
binary layout is now semi-unknown (meaning relative, fixed, and gadget
offsets are not precisely known), change the filesystem permissions to 511 to
prevent what I call "logged in BROP". I have ideas for improving this further
but this is a first step ok djm

OpenBSD-Commit-ID: 1e0a2692b7e20b126dda60bf04999d1d30d959d8

2 years agoupstream: tweak previous; ok djm
jmc@openbsd.org [Wed, 18 Jan 2023 06:55:32 +0000 (06:55 +0000)] 
upstream: tweak previous; ok djm

OpenBSD-Commit-ID: df71ce4180c58202dfdc1d92626cfe900b91b7c3

2 years agoSkip connection-timeout test under Valgrind.
Darren Tucker [Tue, 31 Jan 2023 08:35:44 +0000 (19:35 +1100)] 
Skip connection-timeout test under Valgrind.

Valgrind slows things down so much that the timeout test fails.  Skip
this test until we figure out if we can make it work.

2 years agoSkip connection-timeout when missing FD passing.
Darren Tucker [Wed, 25 Jan 2023 10:58:40 +0000 (21:58 +1100)] 
Skip connection-timeout when missing FD passing.

This tests uses multiplexing which uses file descriptor passing, so
skip it if we don't have that.  Fixes test failures on Cygwin.

2 years agoupstream: when restoring non-blocking mode to stdio fds, restore
djm@openbsd.org [Wed, 18 Jan 2023 02:00:10 +0000 (02:00 +0000)] 
upstream: when restoring non-blocking mode to stdio fds, restore

exactly the flags that ssh started with and don't just clobber them with
zero, as this could also remove the append flag from the set;

bz3523; ok dtucker@

OpenBSD-Commit-ID: 1336b03e881db7564a4b66014eb24c5230e9a0c0

2 years agoupstream: Add a -V (version) option to sshd like the ssh client
millert@openbsd.org [Wed, 18 Jan 2023 01:50:21 +0000 (01:50 +0000)] 
upstream: Add a -V (version) option to sshd like the ssh client

has. OK markus@ deraadt@

OpenBSD-Commit-ID: abe990ec3e636fb040132aab8cbbede98f0c413e

2 years agoupstream: For "ssh -V" always exit 0, there is no need to check opt
millert@openbsd.org [Tue, 17 Jan 2023 18:52:44 +0000 (18:52 +0000)] 
upstream: For "ssh -V" always exit 0, there is no need to check opt

again. This was missed when the fallthrough in the switch case above it was
removed.  OK deraadt@

OpenBSD-Commit-ID: 5583e5d8f6d62a8a4215cfa95a69932f344c8120

2 years agoupstream: also check that an active session inhibits
djm@openbsd.org [Tue, 17 Jan 2023 10:15:10 +0000 (10:15 +0000)] 
upstream: also check that an active session inhibits

UnusedConnectionTimeout idea markus@

OpenBSD-Regress-ID: 55c0fb61f3bf9e092b0a53f9041d3d2012f14003

2 years agoupstream: regression test for UnusedConnectionTimeout
djm@openbsd.org [Tue, 17 Jan 2023 10:02:34 +0000 (10:02 +0000)] 
upstream: regression test for UnusedConnectionTimeout

OpenBSD-Regress-ID: 7f29001374a68e71e5e078f69e4520cf4bcca084

2 years agoupstream: unbreak test: cannot access shell positional parameters
djm@openbsd.org [Mon, 16 Jan 2023 04:11:29 +0000 (04:11 +0000)] 
upstream: unbreak test: cannot access shell positional parameters

past $9 without wrapping the position in braces (i.e. need ${10}, etc.)

OpenBSD-Regress-ID: 3750ec98d5d409ce6a93406fedde6f220d2ea2ac

2 years agoupstream: Add a sshd_config UnusedConnectionTimeout option to terminate
djm@openbsd.org [Tue, 17 Jan 2023 09:44:48 +0000 (09:44 +0000)] 
upstream: Add a sshd_config UnusedConnectionTimeout option to terminate

client connections that have no open channels for some length of time. This
complements the recently-added ChannelTimeout option that terminates inactive
channels after a timeout.

ok markus@

OpenBSD-Commit-ID: ca983be74c0350364c11f8ba3bd692f6f24f5da9

2 years agoupstream: adapt to ed25519 changes in src/usr.bin/ssh
djm@openbsd.org [Sun, 15 Jan 2023 23:35:10 +0000 (23:35 +0000)] 
upstream: adapt to ed25519 changes in src/usr.bin/ssh

OpenBSD-Regress-ID: 4b3e7ba7ee486ae8a0b4790f8112eded2bb7dcd5

2 years agoupstream: update OpenSSH's Ed25519 code to the last version of SUPERCOP
djm@openbsd.org [Sun, 15 Jan 2023 23:05:32 +0000 (23:05 +0000)] 
upstream: update OpenSSH's Ed25519 code to the last version of SUPERCOP

(20221122) and change the import approach to the same one we use for
Streamlined NTRUPrime: use a shell script to extract the bits we need from
SUPERCOP, make some minor adjustments and squish them all into a single file.

ok tb@ tobhe@

OpenBSD-Commit-ID: 1bc0fd624cb6af440905b8ba74ac7c03311b8e3b

2 years agoAllow writev is seccomp sandbox.
Darren Tucker [Sat, 14 Jan 2023 11:02:44 +0000 (22:02 +1100)] 
Allow writev is seccomp sandbox.

This seems to be used by recent glibcs at least in some configurations.
From bz#3512, ok djm@

2 years agoupstream: Shell syntax fix. From ren mingshuai vi github PR#369.
dtucker@openbsd.org [Sat, 14 Jan 2023 10:05:54 +0000 (10:05 +0000)] 
upstream: Shell syntax fix. From ren mingshuai vi github PR#369.

OpenBSD-Regress-ID: 6696b2eeefe128099fc3d7ea9f23252cc35156f9

2 years agoupstream: Instead of skipping the all-tokens test if we don't have
dtucker@openbsd.org [Sat, 14 Jan 2023 09:57:08 +0000 (09:57 +0000)] 
upstream: Instead of skipping the all-tokens test if we don't have

OpenSSL (since we use it to compute the hash), put the hash at the end and
just omit it if we don't have it.  Prompted by bz#3521.

OpenBSD-Regress-ID: c79ecba64250ed3b6417294b6c965e6b12ca5eea

2 years agoupstream: fix double phrase in previous;
jmc@openbsd.org [Fri, 13 Jan 2023 07:13:40 +0000 (07:13 +0000)] 
upstream: fix double phrase in previous;

OpenBSD-Commit-ID: 671e6c8dc5e9230518b2bbfa143daaa88adc66c2

2 years agoupstream: Document "UserKnownHostsFile none". ok djm@
dtucker@openbsd.org [Fri, 13 Jan 2023 03:16:29 +0000 (03:16 +0000)] 
upstream: Document "UserKnownHostsFile none". ok djm@

OpenBSD-Commit-ID: f695742d39e34ecdcc3c861c3739a84648a4bce5

2 years agoRetry package installation 3 times.
Darren Tucker [Fri, 13 Jan 2023 12:02:34 +0000 (23:02 +1100)] 
Retry package installation 3 times.

When setting up the CI environment, retry package installation 3 times
before going up.  Should help prevent spurious failures during
infrastructure issues.

2 years agoupstream: Move scp path setting to a helper function. The previous
dtucker@openbsd.org [Fri, 13 Jan 2023 04:47:34 +0000 (04:47 +0000)] 
upstream: Move scp path setting to a helper function. The previous

commit to add scp to the test sshd's path causes the t-envpass test to fail
when the test scp is given using a fully qualified path.  Put this in a
helper function and only call it from the scp tests.

OpenBSD-Regress-ID: 7533dc1c4265c1de716abb062957994195b36df4

2 years agoupstream: Add scp's path to test sshd's PATH.
dtucker@openbsd.org [Fri, 13 Jan 2023 04:23:00 +0000 (04:23 +0000)] 
upstream: Add scp's path to test sshd's PATH.

If the scp we're testing is fully qualified (eg it's not in the system
PATH) then add its path to the under-test sshd's PATH so we can find
it. Prompted by bz#3518.

OpenBSD-Regress-ID: 7df4f5a0be3aa135495b7e5a6719d3cbc26cc4c0

2 years agoRemove skipping test when scp not in path.
Darren Tucker [Fri, 13 Jan 2023 04:49:48 +0000 (15:49 +1100)] 
Remove skipping test when scp not in path.

An upcoming change renders this obsolete by adding scp's path to the
test sshd's PATH, and removing this first will make the subsequent sync
easier.

2 years agoupstream: Add a "Host" line to the output of ssh -G showing the
dtucker@openbsd.org [Fri, 13 Jan 2023 02:58:20 +0000 (02:58 +0000)] 
upstream: Add a "Host" line to the output of ssh -G showing the

original host arg. Inspired by patch from vincent at bernat.ch via bz#3343,
ok djm@

OpenBSD-Commit-ID: 59c0f60a222113a44d0650cd394376e3beecc883

2 years agoupstream: avoid printf("%s", NULL) if using ssh
djm@openbsd.org [Fri, 13 Jan 2023 02:44:02 +0000 (02:44 +0000)] 
upstream: avoid printf("%s", NULL) if using ssh

-oUserKnownHostsFile=none and a hostkey in one of the system known hosts file
changes; ok dtucker@

OpenBSD-Commit-ID: 7ca87614bfc6da491315536a7f2301434a9fe614

2 years agoupstream: clamp the minimum buffer lengths and number of inflight
djm@openbsd.org [Wed, 11 Jan 2023 05:39:38 +0000 (05:39 +0000)] 
upstream: clamp the minimum buffer lengths and number of inflight

requests too

OpenBSD-Commit-ID: c4965f62fa0ba850940fd66ae3f60cf516bbcd56

2 years agoupstream: ignore bogus upload/download buffer lengths in the limits
djm@openbsd.org [Wed, 11 Jan 2023 05:36:50 +0000 (05:36 +0000)] 
upstream: ignore bogus upload/download buffer lengths in the limits

extension

OpenBSD-Commit-ID: c5b023e0954693ba9a5376e4280c739b5db575f8

2 years agoupstream: remove whitespace at EOL from code extracted from SUPERCOP
djm@openbsd.org [Wed, 11 Jan 2023 02:13:52 +0000 (02:13 +0000)] 
upstream: remove whitespace at EOL from code extracted from SUPERCOP

OpenBSD-Commit-ID: 1ec524ff2fbb9387d731601437c82008f35a60f4

2 years agoupstream: rewrite this test to use a multiplexed ssh session so we can
djm@openbsd.org [Wed, 11 Jan 2023 00:51:27 +0000 (00:51 +0000)] 
upstream: rewrite this test to use a multiplexed ssh session so we can

control its lifecycle without risk of race conditions; fixes some of the
Github integration tests for openssh-portable

OpenBSD-Regress-ID: 5451cad59ba0d43ae9eeda48ec80f54405fee969

2 years agoremove buffer len workaround for NetBSD 4.x
Damien Miller [Wed, 11 Jan 2023 00:45:17 +0000 (11:45 +1100)] 
remove buffer len workaround for NetBSD 4.x

Switching to from pipes to a socketpair for communicating with the
ssh process avoids the (kernel bug?) problem.

2 years agoadd back use of pipes in scp.c under USE_PIPES
Damien Miller [Wed, 11 Jan 2023 00:44:19 +0000 (11:44 +1100)] 
add back use of pipes in scp.c under USE_PIPES

This matches sftp.c which prefers socketpair but uses pipes on
some older platforms.

2 years agoupstream: Switch scp from using pipes to a socketpair for
millert@openbsd.org [Tue, 10 Jan 2023 23:22:15 +0000 (23:22 +0000)] 
upstream: Switch scp from using pipes to a socketpair for

communication with it's ssh sub-processes.  We no longer need to reserve two
descriptors to ensure that we don't end up using fd 0-2 unexpectedly, that is
handled by sanitise_stdfd() in main(). Based on an original diff from djm@.
OK deraadt@ djm@

OpenBSD-Commit-ID: b80c372faac462471e955ddeab9480d668a2e48d

2 years agoupstream: tweak previous; ok djm
jmc@openbsd.org [Fri, 6 Jan 2023 08:44:11 +0000 (08:44 +0000)] 
upstream: tweak previous; ok djm

OpenBSD-Commit-ID: 229c493452766d70a78b0f02f6ff9894f9028858

2 years agotry to improve logging for dynamic-forward test
Damien Miller [Mon, 9 Jan 2023 05:33:56 +0000 (16:33 +1100)] 
try to improve logging for dynamic-forward test

previously the logs from the ssh used to exercise the forwarding
channel would clobber the logs from the ssh actually doing the
forwarding

2 years agoSkip dynamic-forward test on minix3.
Darren Tucker [Sat, 7 Jan 2023 12:24:50 +0000 (23:24 +1100)] 
Skip dynamic-forward test on minix3.

This test relies on loopback addresses which minix does not have.
Previously the test would not run at all since it also doesn't have
netcat, but now we use our own netcat it tries and fails.

2 years agodon't test IPv6 addresses if platform lacks support
Damien Miller [Sun, 8 Jan 2023 01:08:59 +0000 (12:08 +1100)] 
don't test IPv6 addresses if platform lacks support

2 years agoupstream: When OpenSSL is not available, skip parts of percent test
dtucker@openbsd.org [Fri, 6 Jan 2023 12:33:33 +0000 (12:33 +0000)] 
upstream: When OpenSSL is not available, skip parts of percent test

that require it. Based on github pr#368 from ren mingshuai.

OpenBSD-Regress-ID: 49a375b2cf61ccb95b52e75e2e025cd10988ebb2

2 years agoUse our own netcat for dynamic-forward test.
Darren Tucker [Sat, 7 Jan 2023 12:01:11 +0000 (23:01 +1100)] 
Use our own netcat for dynamic-forward test.

That way we can be surer about its behaviour rather than trying to
second-guess the behaviour of various netcat implementations.

2 years agoUse autoconf to find openssl binary.
Darren Tucker [Sat, 7 Jan 2023 03:30:43 +0000 (14:30 +1100)] 
Use autoconf to find openssl binary.

It's possible to install an OpenSSL in a path not in the system's
default library search path.  OpenSSH can still use this (eg if you
specify an rpath) but the openssl binary there may not work.  If one is
available on the system path just use that.

2 years agoCheck openssl_bin path is executable before using.
Darren Tucker [Fri, 6 Jan 2023 23:34:18 +0000 (10:34 +1100)] 
Check openssl_bin path is executable before using.

2 years agoSet OPENSSL_BIN from OpenSSL directory.
Darren Tucker [Fri, 6 Jan 2023 12:19:07 +0000 (23:19 +1100)] 
Set OPENSSL_BIN from OpenSSL directory.

2 years agoupstream: Save debug logs from ssh for debugging purposes.
dtucker@openbsd.org [Fri, 6 Jan 2023 08:50:33 +0000 (08:50 +0000)] 
upstream: Save debug logs from ssh for debugging purposes.

OpenBSD-Regress-ID: 109e40b06de1c006a3b8e0d8745b790b2c5870a0

2 years agoupstream: regression test for ChannelTimeout
djm@openbsd.org [Fri, 6 Jan 2023 08:07:39 +0000 (08:07 +0000)] 
upstream: regression test for ChannelTimeout

OpenBSD-Regress-ID: 280bfbefcfa415428ad744e43f69a8dede8ad685

2 years agoupstream: fix typo in verbose logging
djm@openbsd.org [Fri, 6 Jan 2023 07:18:18 +0000 (07:18 +0000)] 
upstream: fix typo in verbose logging

OpenBSD-Regress-ID: 0497cdb66e003b2f50ed77291a9104fba2e017e9

2 years agoupstream: unit tests for misc.c:ptimeout_* API
djm@openbsd.org [Fri, 6 Jan 2023 02:59:50 +0000 (02:59 +0000)] 
upstream: unit tests for misc.c:ptimeout_* API

OpenBSD-Regress-ID: 01f8fb12d08e5aaadd4bd4e71f456b6588be9a94

2 years agoupstream: Copy bytes from the_banana[] rather than banana()
tb@openbsd.org [Wed, 4 Jan 2023 22:48:57 +0000 (22:48 +0000)] 
upstream: Copy bytes from the_banana[] rather than banana()

Fixes test failure due to segfault seen on arm64 with xonly snap.

ok djm

OpenBSD-Regress-ID: 86e2aa4bbd1dff1bc4ebb2969c0d6474485be046

2 years agounbreak scp on NetBSD 4.x
Damien Miller [Fri, 6 Jan 2023 08:13:36 +0000 (19:13 +1100)] 
unbreak scp on NetBSD 4.x

e555d5cad5 effectively increased the default copy buffer size for SFTP
transfers. This caused NetBSD 4.x to hang during the "copy local file to
remote file in place" scp.sh regression test.

This puts back the original 32KB copy buffer size until we can properly
figure out why.

lots of debugging assistance from dtucker@

2 years agoupstream: Implement channel inactivity timeouts
djm@openbsd.org [Fri, 6 Jan 2023 02:47:18 +0000 (02:47 +0000)] 
upstream: Implement channel inactivity timeouts

This adds a sshd_config ChannelTimeouts directive that allows channels that
have not seen traffic in a configurable interval to be automatically closed.
Different timeouts may be applied to session, X11, agent and TCP forwarding
channels.

Note: this only affects channels over an opened SSH connection and not
the connection itself. Most clients close the connection when their channels
go away, with a notable exception being ssh(1) in multiplexing mode.

ok markus dtucker

OpenBSD-Commit-ID: ae8bba3ed9d9f95ff2e2dc8dcadfa36b48e6c0b8

2 years agoupstream: Add channel_set_xtype()
djm@openbsd.org [Fri, 6 Jan 2023 02:42:34 +0000 (02:42 +0000)] 
upstream: Add channel_set_xtype()

This sets an "extended" channel type after channel creation (e.g.
"session:subsystem:sftp") that will be used for setting channel inactivity
timeouts.

ok markus dtucker

OpenBSD-Commit-ID: 42564aa92345045b4a74300528f960416a15d4ca