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

2 years agoMove obsdsnap test VMs to ephemeral runners.
Darren Tucker [Tue, 13 Dec 2022 09:48:56 +0000 (20:48 +1100)] 
Move obsdsnap test VMs to ephemeral runners.

2 years agouse calloc for allocating arc4random structs
Damien Miller [Fri, 9 Dec 2022 07:00:21 +0000 (18:00 +1100)] 
use calloc for allocating arc4random structs

ok dtucker

2 years agoupstream: Warn if no host keys for hostbased auth can be loaded.
dtucker@openbsd.org [Fri, 9 Dec 2022 00:22:29 +0000 (00:22 +0000)] 
upstream: Warn if no host keys for hostbased auth can be loaded.

OpenBSD-Commit-ID: 2a0a13132000cf8d3593133c1b49768aa3c95977

2 years agoupstream: Add server debugging for hostbased auth.
dtucker@openbsd.org [Fri, 9 Dec 2022 00:17:40 +0000 (00:17 +0000)] 
upstream: Add server debugging for hostbased auth.

auth_debug_add queues messages about the auth process which is sent to
the client after successful authentication.  This also sends those to
the server debug log to aid in debugging.  From bz#3507, ok djm@

OpenBSD-Commit-ID: 46ff67518cccf9caf47e06393e2a121ee5aa258a

2 years agoupstream: remove '?' from getopt(3) loops
cheloha@openbsd.org [Sun, 4 Dec 2022 23:50:49 +0000 (23:50 +0000)] 
upstream: remove '?' from getopt(3) loops

userspace: remove vestigial '?' cases from top-level getopt(3) loops

getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument.  We can
handle this case with the "default" failure case with no loss of
legibility.  Hence, remove all the redundant "case '?':" lines.

Prompted by dlg@.  With help from dlg@ and millert@.

Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2
ok naddy@ millert@ dlg@

OpenBSD-Commit-ID: b2f89346538ce4f5b33ab8011a23e0626a67e66e

2 years agoupstream: Fix comment typo.
dtucker@openbsd.org [Wed, 7 Dec 2022 11:45:43 +0000 (11:45 +0000)] 
upstream: Fix comment typo.

OpenBSD-Regress-ID: 3b04faced6511bb5e74648c6a4ef4bf2c4decf03

2 years agoAdd SANDBOX_DEBUG to the kitchensink test build.
Darren Tucker [Wed, 7 Dec 2022 07:58:25 +0000 (18:58 +1100)] 
Add SANDBOX_DEBUG to the kitchensink test build.

2 years agodisable SANDBOX_SECCOMP_FILTER_DEBUG
Damien Miller [Wed, 7 Dec 2022 07:38:25 +0000 (18:38 +1100)] 
disable SANDBOX_SECCOMP_FILTER_DEBUG

It was mistakenly enabled in 2580916e4872

Reported by Peter sec-openssh-com.22.fichtner AT 0sg.net

2 years agoUpdate autotools
Rose [Tue, 29 Nov 2022 20:12:54 +0000 (15:12 -0500)] 
Update autotools

Regenerate config files using latest autotools

2 years agoFix typo in comment. Spotted by tim@
Darren Tucker [Tue, 6 Dec 2022 01:22:36 +0000 (12:22 +1100)] 
Fix typo in comment.  Spotted by tim@

2 years agoupstream: Remove duplicate includes.
dtucker@openbsd.org [Sun, 4 Dec 2022 11:03:11 +0000 (11:03 +0000)] 
upstream: Remove duplicate includes.

 Patch from AtariDreams via github PR#364.

OpenBSD-Commit-ID: b9186638a05cb8b56ef7c0de521922b6723644ea

2 years agoupstream: make struct sshbuf private
djm@openbsd.org [Fri, 2 Dec 2022 04:40:27 +0000 (04:40 +0000)] 
upstream: make struct sshbuf private

and remove an unused field; ok dtucker

OpenBSD-Commit-ID: c7a3d77c0b8c153d463398606a8d57569186a0c3

2 years agoRestore ssh-agent permissions on exit.
Darren Tucker [Fri, 2 Dec 2022 00:43:36 +0000 (11:43 +1100)] 
Restore ssh-agent permissions on exit.

...enough that subsequent builds can overwrite ssh-agent if necessary.

2 years agoupstream: Clean up ssh-add and ssh-agent logs.
dtucker@openbsd.org [Thu, 1 Dec 2022 02:22:13 +0000 (02:22 +0000)] 
upstream: Clean up ssh-add and ssh-agent logs.

OpenBSD-Regress-ID: 9eda8e4c3714d7f943ab2e73ed58a233bd29cd2c

2 years agoupstream: Log output of ssh-agent and ssh-add
dtucker@openbsd.org [Thu, 1 Dec 2022 02:19:29 +0000 (02:19 +0000)] 
upstream: Log output of ssh-agent and ssh-add

This should  make debugging easier.

OpenBSD-Regress-ID: 5974b02651f428d7e1079b41304c498ca7e306c8

2 years agoupstream: Add void to client_repledge args to fix compiler warning. ok djm@
dtucker@openbsd.org [Tue, 29 Nov 2022 22:41:14 +0000 (22:41 +0000)] 
upstream: Add void to client_repledge args to fix compiler warning. ok djm@

OpenBSD-Commit-ID: 7e964a641ce4a0a0a11f047953b29929d7a4b866

2 years agoupstream: tighten pledge(2) after session establishment
djm@openbsd.org [Mon, 28 Nov 2022 01:38:22 +0000 (01:38 +0000)] 
upstream: tighten pledge(2) after session establishment

feedback, ok & testing in snaps deraadt@

OpenBSD-Commit-ID: aecf4d49d28586dfbcc74328d9333398fef9eb58

2 years agoupstream: New EnableEscapeCommandline ssh_config(5) option
djm@openbsd.org [Mon, 28 Nov 2022 01:37:36 +0000 (01:37 +0000)] 
upstream: New EnableEscapeCommandline ssh_config(5) option

This option (default "no") controls whether the ~C escape is available.
Turning it off by default means we will soon be able to use a stricter
default pledge(2) in the client.

feedback deraadt@ dtucker@; tested in snaps for a while

OpenBSD-Commit-ID: 7e277595d60acb8263118dcb66554472257b387a

2 years agoupstream: In channel_request_remote_forwarding the parameters for
mbuhl@openbsd.org [Fri, 18 Nov 2022 19:47:40 +0000 (19:47 +0000)] 
upstream: In channel_request_remote_forwarding the parameters for

permission_set_add are leaked as they are also duplicated in the call. Found
by CodeChecker. ok djm

OpenBSD-Commit-ID: 4aef50fa9be7c0b138188814c8fe3dccc196f61e

2 years agoUse -fzero-call-used-regs=used on clang 15.
Darren Tucker [Wed, 30 Nov 2022 00:23:11 +0000 (11:23 +1100)] 
Use -fzero-call-used-regs=used on clang 15.

clang 15 seems to have a problem with -fzero-call-used-reg=all which
causes spurious "incorrect signature" failures with ED25519.  On those
versions, use -fzero-call-used-regs=used instead.  (We may add exceptions
later if specific versions prove to be OK).  Also move the GCC version
check to match.

Initial investigation by Daniel Pouzzner (douzzer at mega nu), workaround
suggested by Bill Wendling (morbo at google com).  bz#3475, ok djm@

2 years agoSkip unit tests on slow riscv64 hardware.
Darren Tucker [Mon, 28 Nov 2022 10:09:28 +0000 (21:09 +1100)] 
Skip unit tests on slow riscv64 hardware.

2 years agoRework how selfhosted tests interact with runners.
Darren Tucker [Sun, 27 Nov 2022 04:26:22 +0000 (15:26 +1100)] 
Rework how selfhosted tests interact with runners.

Previously there was one runner per test target (mostly VMs).  This had
a few limitations:
 - multiple tests that ran on the same target (eg multiple build
   configs) were serialized on availability or that runner.
 - it needed manual balancing of VMs over host machines.

To address this, make VMs that use ephemeral disks (ie most of them)
all use a pool of runners with the "libvirt" label.  This requires that
we distinguish between "host" and "target" for those.  Native runners
and VMs with persistent disks (eg the constantly-updated snapshot ones)
specify the same host and target.

This should improve test throughput.

2 years agoRun vmstartup from temp dir.
Darren Tucker [Sun, 27 Nov 2022 01:19:37 +0000 (12:19 +1100)] 
Run vmstartup from temp dir.

This will allow us to create ephemeral disk images per-runner.

2 years agoMake "config" in matrix singular and pass in env.
Darren Tucker [Sun, 27 Nov 2022 01:14:00 +0000 (12:14 +1100)] 
Make "config" in matrix singular and pass in env.

This will allow the startup scripts to adapt their behaviour based on
the type and config.

2 years agoAdd "libvirt" label to dfly30.
Darren Tucker [Sun, 27 Nov 2022 00:42:22 +0000 (11:42 +1100)] 
Add "libvirt" label to dfly30.

2 years agoRename "os" in matrix to "target".
Darren Tucker [Sat, 26 Nov 2022 22:28:20 +0000 (09:28 +1100)] 
Rename "os" in matrix to "target".

This is in preparation to distinguish this from the host that the runner
runs on in case where they are separate (eg VMs).

2 years agoRemove unused self-hosted test targets.
Darren Tucker [Sat, 26 Nov 2022 22:23:04 +0000 (09:23 +1100)] 
Remove unused self-hosted test targets.

2 years agoRemove explicit "default" test config argument.
Darren Tucker [Sat, 26 Nov 2022 22:16:15 +0000 (09:16 +1100)] 
Remove explicit "default" test config argument.

Not specifying the test config implicitly selects default args.

2 years agoAdd fallback for old platforms w/out MAP_ANON.
Darren Tucker [Wed, 23 Nov 2022 02:18:54 +0000 (13:18 +1100)] 
Add fallback for old platforms w/out MAP_ANON.

2 years agoIf we haven't found it yet, recheck for sys/stat.h.
Darren Tucker [Wed, 23 Nov 2022 02:09:11 +0000 (13:09 +1100)] 
If we haven't found it yet, recheck for sys/stat.h.

On some very old platforms, sys/stat.h needs sys/types.h, however
autoconf 2.71's AC_CHECK_INCLUDES_DEFAULT checks for them in the
opposite order, which in combination with modern autoconf's
"present but cannot be compiled" behaviour causes it to not be
detected.

2 years agoAdd dfly62 test target.
Darren Tucker [Fri, 11 Nov 2022 00:25:37 +0000 (11:25 +1100)] 
Add dfly62 test target.

2 years agoupstream: Handle dynamic remote port forwarding in escape commandline's
dtucker@openbsd.org [Thu, 10 Nov 2022 23:03:10 +0000 (23:03 +0000)] 
upstream: Handle dynamic remote port forwarding in escape commandline's

-R processing. bz#3499, ok djm@

OpenBSD-Commit-ID: 194ee4cfe7ed0e2b8ad0727f493c798a50454208

2 years agoRemove seed passing over reexec.
Darren Tucker [Thu, 10 Nov 2022 01:44:51 +0000 (12:44 +1100)] 
Remove seed passing over reexec.

This was added for the benefit of platforms using ssh-rand-helper to
prevent a delay on each connection as sshd reseeded itself.

ssh-random-helper is long gone, and since the re-exec happens before the
chroot the re-execed sshd can reseed itself normally. ok djm@

2 years agoSkip reexec test on OpenSSL 1.1.1 specifically.
Darren Tucker [Wed, 9 Nov 2022 09:59:20 +0000 (20:59 +1100)] 
Skip reexec test on OpenSSL 1.1.1 specifically.

OpenSSL 1.1.1 has a bug in its RNG that breaks reexec fallback, so skip
that test.  See bz#3483 for details.

2 years agoupstream: Fix typo in fatal error message.
dtucker@openbsd.org [Wed, 9 Nov 2022 09:04:12 +0000 (09:04 +0000)] 
upstream: Fix typo in fatal error message.

Patch from vapier at chromium.org.

OpenBSD-Commit-ID: 8a0c164a6a25eef0eedfc30df95bfa27644e35cf

2 years agoupstream: Remove errant colon and simplify format
dtucker@openbsd.org [Wed, 9 Nov 2022 09:01:52 +0000 (09:01 +0000)] 
upstream: Remove errant colon and simplify format

string in error messages. Patch from vapier at chromium.org.

OpenBSD-Commit-ID: fc28466ebc7b74e0072331947a89bdd239c160d3

2 years agoupstream: rename client_global_hostkeys_private_confirm() to
djm@openbsd.org [Wed, 9 Nov 2022 01:37:44 +0000 (01:37 +0000)] 
upstream: rename client_global_hostkeys_private_confirm() to

client_global_hostkeys_prove_confirm(), as it handles the
"hostkeys-prove00@openssh.com" message; no functional change

OpenBSD-Commit-ID: 31e09bd3cca6eed26855b88fb8beed18e9bd026d

2 years agoupstream: typo in comment
djm@openbsd.org [Wed, 9 Nov 2022 00:15:59 +0000 (00:15 +0000)] 
upstream: typo in comment

OpenBSD-Commit-ID: 39c58f41e0f32d1ff31731fa6f5bbbc3ad25084a

2 years agoDefer seed_rng until after closefrom call.
Darren Tucker [Tue, 8 Nov 2022 22:23:47 +0000 (09:23 +1100)] 
Defer seed_rng until after closefrom call.

seed_rng will initialize OpenSSL, and some engine providers (eg Intel's
QAT) will open descriptors for their own use.  bz#3483, patch from
joel.d.schuetze at intel.com, ok djm@

2 years agoFix comment text. From emaste at freebsd.org.
Darren Tucker [Tue, 8 Nov 2022 21:27:47 +0000 (08:27 +1100)] 
Fix comment text.  From emaste at freebsd.org.

2 years agoAvoid assuming layout of fd_set
Pierre Ossman [Wed, 6 Jul 2022 11:52:10 +0000 (13:52 +0200)] 
Avoid assuming layout of fd_set

POSIX doesn't specify the internal layout of the fd_set object, so let's
not assume it is just a bit mask. This increases compatibility with
systems that have a different layout.

The assumption is also worthless as we already refuse to use file
descriptors over FD_SETSIZE anyway. Meaning that the default size of
fd_set is quite sufficient.

2 years agoShutdown any VM before trying to check out repo.
Darren Tucker [Tue, 8 Nov 2022 01:42:52 +0000 (12:42 +1100)] 
Shutdown any VM before trying to check out repo.

In the case where the previous run did not clean up, the checkout will
fail as it'll leave a stale mount.

2 years agoRun vm startup and shutdown from runner temp dir.
Darren Tucker [Tue, 8 Nov 2022 00:33:25 +0000 (11:33 +1100)] 
Run vm startup and shutdown from runner temp dir.

Should work even if the github workspace dir is on a stale sshfs mount.