]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
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

2 years agoupstream: tweak channel ctype names
djm@openbsd.org [Fri, 6 Jan 2023 02:41:49 +0000 (02:41 +0000)] 
upstream: tweak channel ctype names

These are now used by sshd_config:ChannelTimeouts to specify timeouts by
channel type, so force them all to use a similar format without whitespace.

ok dtucker markus

OpenBSD-Commit-ID: 66834765bb4ae14f96d2bb981ac98a7dae361b65

2 years agoupstream: Add channel_force_close()
djm@openbsd.org [Fri, 6 Jan 2023 02:39:59 +0000 (02:39 +0000)] 
upstream: Add channel_force_close()

This will forcibly close an open channel by simulating read/write errors,
draining the IO buffers and calling the detach function.

Previously the detach function was only ever called during channel garbage
collection, but there was no way to signal the user of a channel (e.g.
session.c) that its channel was being closed deliberately (vs. by the
usual state-machine logic). So this adds an extra "force" argument to the
channel cleanup callback to indicate this condition.

ok markus dtucker

OpenBSD-Commit-ID: 23052707a42bdc62fda2508636e624afd466324b

2 years agoupstream: replace manual poll/ppoll timeout math with ptimeout API
djm@openbsd.org [Fri, 6 Jan 2023 02:38:23 +0000 (02:38 +0000)] 
upstream: replace manual poll/ppoll timeout math with ptimeout API

feedback markus / ok markus dtucker

OpenBSD-Commit-ID: c5ec4f2d52684cdb788cd9cbc1bcf89464014be2

2 years agoupstream: add ptimeout API for keeping track of poll/ppoll
djm@openbsd.org [Fri, 6 Jan 2023 02:37:04 +0000 (02:37 +0000)] 
upstream: add ptimeout API for keeping track of poll/ppoll

timeouts; ok dtucker markus

OpenBSD-Commit-ID: 3335268ca135b3ec15a947547d7cfbb8ff929ead

2 years agoupstream: suppress "Connection closed" message when in quiet mode
djm@openbsd.org [Thu, 5 Jan 2023 05:49:13 +0000 (05:49 +0000)] 
upstream: suppress "Connection closed" message when in quiet mode

OpenBSD-Commit-ID: 8a3ab7176764da55f60bfacfeae9b82d84e3908f

2 years agoupstream: regression test for PermitRemoteOpen
djm@openbsd.org [Mon, 2 Jan 2023 07:03:57 +0000 (07:03 +0000)] 
upstream: regression test for PermitRemoteOpen

OpenBSD-Regress-ID: 8271aafbf5c21950cd5bf966f08e585cebfe630c

2 years agoupstream: fix bug in PermitRemoteOpen which caused it to ignore its
djm@openbsd.org [Mon, 2 Jan 2023 07:03:30 +0000 (07:03 +0000)] 
upstream: fix bug in PermitRemoteOpen which caused it to ignore its

first argument unless it was one of the special keywords "any" or "none".

Reported by Georges Chaudy in bz3515; ok dtucker@

OpenBSD-Commit-ID: c5678a39f1ff79993d5ae3cfac5746a4ae148ea5

2 years agoupstream: spelling fixes; from paul tagliamonte amendments to his
jmc@openbsd.org [Mon, 26 Dec 2022 19:16:03 +0000 (19:16 +0000)] 
upstream: spelling fixes; from paul tagliamonte amendments to his

diff are noted on tech

OpenBSD-Commit-ID: d776dd03d0b882ca9c83b84f6b384f6f9bd7de4a

2 years agoupstream: Mention that scp uses the SFTP protocol and remove
djm@openbsd.org [Fri, 16 Dec 2022 07:13:22 +0000 (07:13 +0000)] 
upstream: Mention that scp uses the SFTP protocol and remove

reference to legacy flag. Spotted by, feedback and ok jmc@

OpenBSD-Commit-ID: 9dfe04966f52e941966b46c7a2972147f95281b3

2 years agoupstream: Clear signal mask early in main(); sshd may have been
djm@openbsd.org [Fri, 16 Dec 2022 06:56:47 +0000 (06:56 +0000)] 
upstream: Clear signal mask early in main(); sshd may have been

started with one or more signals masked (sigprocmask(2) is not cleared
on fork/exec) and this could interfere with various things, e.g. the
login grace timer.

Execution environments that fail to clear the signal mask before running
sshd are clearly broken, but apparently they do exist.

Reported by Sreedhar Balasubramanian; ok dtucker@

OpenBSD-Commit-ID: 77078c0b1c53c780269fc0c416f121d05e3010ae

2 years agoupstream: add -X to usage();
jmc@openbsd.org [Fri, 16 Dec 2022 06:52:48 +0000 (06:52 +0000)] 
upstream: add -X to usage();

OpenBSD-Commit-ID: 1bdc3df7de11d766587b0428318336dbffe4a9d0

2 years agoupstream: add a -X option to both scp(1) and sftp(1) to allow
djm@openbsd.org [Fri, 16 Dec 2022 03:40:03 +0000 (03:40 +0000)] 
upstream: add a -X option to both scp(1) and sftp(1) to allow

control over some SFTP protocol knobs: the copy buffer length and
the number of inflight requests, both of which are used during
upload/download.

Previously these could be controlled in sftp(1) using the -b/-R options.
This makes them available in both SFTP protocol clients using the same
option character sequence.

ok dtucker@

OpenBSD-Commit-ID: 27502bffc589776f5da1f31df8cb51abe9a15f1c

2 years agoupstream: The idiomatic way of coping with signed char vs unsigned
deraadt@openbsd.org [Thu, 15 Dec 2022 18:20:39 +0000 (18:20 +0000)] 
upstream: The idiomatic way of coping with signed char vs unsigned

char (which did not come from stdio read functions) in the presence of
ctype macros, is to always cast to (unsigned char).  casting to (int)
for a "macro" which is documented to take int, is weird.  And sadly wrong,
because of the sing extension risk.. same diff from florian

OpenBSD-Commit-ID: 65b9a49a68e22ff3a0ebd593f363e9f22dd73fea

2 years agoSimply handling of SSH_CONNECTION PAM env var.
Darren Tucker [Mon, 19 Dec 2022 07:49:51 +0000 (18:49 +1100)] 
Simply handling of SSH_CONNECTION PAM env var.

Prompted by bz#3508: there's no need to cache the value of
sshpam_conninfo so remove the global.  While there, add check of
return value from pam_putenv.  ok djm@

2 years agoAdd tests for LibreSSL 3.7.0 and OpenSSL 1.1.1s.
Darren Tucker [Mon, 19 Dec 2022 07:42:34 +0000 (18:42 +1100)] 
Add tests for LibreSSL 3.7.0 and OpenSSL 1.1.1s.

2 years agoUse sudo when resetting perms on directories.
Darren Tucker [Sun, 18 Dec 2022 10:36:25 +0000 (21:36 +1100)] 
Use sudo when resetting perms on directories.

2 years agoSet group perms on regress dir.
Darren Tucker [Sun, 18 Dec 2022 10:19:33 +0000 (21:19 +1100)] 
Set group perms on regress dir.

This ensures that the tests don't fail due to StrictMode checks.

2 years agoFetch regress logs from obj dir.
Darren Tucker [Sun, 18 Dec 2022 10:13:42 +0000 (21:13 +1100)] 
Fetch regress logs from obj dir.

2 years agoobsdsnap test VMs runs-on libvirt too.
Darren Tucker [Tue, 13 Dec 2022 09:59:54 +0000 (20:59 +1100)] 
obsdsnap test VMs runs-on libvirt too.

2 years agoRun upstream obsdsnap tests on ephemeral runners.
Darren Tucker [Tue, 13 Dec 2022 09:55:37 +0000 (20:55 +1100)] 
Run upstream obsdsnap tests on ephemeral runners.