]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
3 years agoRemove DEF_WEAK, it's already in defines.h.
Darren Tucker [Fri, 2 Sep 2022 06:43:27 +0000 (16:43 +1000)] 
Remove DEF_WEAK, it's already in defines.h.

3 years agoResync arc4random with OpenBSD.
Darren Tucker [Fri, 2 Sep 2022 04:28:14 +0000 (14:28 +1000)] 
Resync arc4random with OpenBSD.

This brings us up to current, including djm's random-reseeding change,
as prompted by logan at cyberstorm.mu in bz#3467.  It brings the
platform-specific hooks from LibreSSL Portable, simplified to match our
use case.  ok djm@.

3 years agoMove OPENBSD ORIGINAL marker.
Darren Tucker [Fri, 2 Sep 2022 04:20:04 +0000 (14:20 +1000)] 
Move OPENBSD ORIGINAL marker.

Putting this after the copyright statement (which doesn't change)
instead of before the version identifier (which does) prevents merge
conflicts when resyncing changes.

3 years agoRemove arc4random_uniform from arc4random.c
Darren Tucker [Fri, 2 Sep 2022 04:17:28 +0000 (14:17 +1000)] 
Remove arc4random_uniform from arc4random.c

This was previously moved into its own file (matching OpenBSD) which
prematurely committed in commit 73541f2.

3 years agoupstream: sk-usbhid: fix key_lookup() on tokens with built-in UV
djm@openbsd.org [Fri, 2 Sep 2022 04:20:02 +0000 (04:20 +0000)] 
upstream: sk-usbhid: fix key_lookup() on tokens with built-in UV

explicitly test whether the token performs built-in UV (e.g. biometric
tokens) and enable UV in that case. From Pedro Martelletto via GHPR#388

OpenBSD-Commit-ID: 007eb7e387d27cf3029ab06b88224e03eca62ccd

3 years agoMove sftp from valgrind-2 to 3 to rebalance.
Darren Tucker [Wed, 31 Aug 2022 10:26:30 +0000 (20:26 +1000)] 
Move sftp from valgrind-2 to 3 to rebalance.

3 years agoupstream: whitespace
djm@openbsd.org [Wed, 31 Aug 2022 02:56:40 +0000 (02:56 +0000)] 
upstream: whitespace

OpenBSD-Commit-ID: c2bcbf93610d3d62ed206cdf9bf9ff98c6aaf232

3 years agoadditional keys
Damien Miller [Mon, 29 Aug 2022 03:27:45 +0000 (13:27 +1000)] 
additional keys

3 years agocross-sign allowed_signers with PGP key
Damien Miller [Mon, 29 Aug 2022 03:23:43 +0000 (13:23 +1000)] 
cross-sign allowed_signers with PGP key

Provides continuity of trust from legacy PGP release key to
the SSHSIG signing keys that we will use henceforth for git
signing.

3 years agoAdd libcrypt-devel to cygwin-release deps.
Darren Tucker [Sat, 27 Aug 2022 11:49:27 +0000 (21:49 +1000)] 
Add libcrypt-devel to cygwin-release deps.

Based on feedback from vinschen at redhat.com.

3 years agoAdd Windows 2022 test targets.
Darren Tucker [Fri, 26 Aug 2022 23:37:40 +0000 (09:37 +1000)] 
Add Windows 2022 test targets.

3 years agoAdd cygwin-release test target.
Darren Tucker [Fri, 26 Aug 2022 06:26:06 +0000 (16:26 +1000)] 
Add cygwin-release test target.

This also moves the cygwin package install from the workflow file to
setup_ci.sh so that we can install different sets of Cygwin packages
for different test configs.

3 years agoupstream: whitespace
djm@openbsd.org [Fri, 26 Aug 2022 08:16:27 +0000 (08:16 +0000)] 
upstream: whitespace

OpenBSD-Commit-ID: a5d015efbfd228dc598ffdef612d2da3a579e5d8

3 years agoupstream: whitespace
djm@openbsd.org [Fri, 26 Aug 2022 08:12:56 +0000 (08:12 +0000)] 
upstream: whitespace

OpenBSD-Commit-ID: d297e4387935d4aef091c5e9432578c2e513f538

3 years agoinitial list of allowed signers
Damien Miller [Fri, 26 Aug 2022 04:23:55 +0000 (14:23 +1000)] 
initial list of allowed signers

3 years agoInstall Cygwin packages based on OS not config.
Darren Tucker [Fri, 19 Aug 2022 07:22:18 +0000 (17:22 +1000)] 
Install Cygwin packages based on OS not config.

3 years agoupstream: attemp FIDO key signing without PIN and use the error
djm@openbsd.org [Fri, 19 Aug 2022 06:07:47 +0000 (06:07 +0000)] 
upstream: attemp FIDO key signing without PIN and use the error

code returned to fall back only if necessary. Avoids PIN prompts for FIDO
tokens that don't require them; part of GHPR#302

OpenBSD-Commit-ID: 4f752aaf9f2e7c28bcaaf3d4f8fc290131bd038e

3 years agoupstream: remove incorrect check that can break enrolling a
djm@openbsd.org [Fri, 19 Aug 2022 05:53:28 +0000 (05:53 +0000)] 
upstream: remove incorrect check that can break enrolling a

resident key (introduced in r1.40)

OpenBSD-Commit-ID: 4cab364d518470e29e624af3d3f9ffa9c92b6f01

3 years agoupstream: Strictly enforce the maximum allowed SSH2 banner size in
dtucker@openbsd.org [Fri, 19 Aug 2022 04:02:46 +0000 (04:02 +0000)] 
upstream: Strictly enforce the maximum allowed SSH2 banner size in

ssh-keyscan and prevent a one-byte buffer overflow.  Patch from Qualys, ok
djm@

OpenBSD-Commit-ID: 6ae664f9f4db6e8a0589425f74cd0bbf3aeef4e4

3 years agoFix cygwin conditional steps.
Darren Tucker [Fri, 19 Aug 2022 05:18:09 +0000 (15:18 +1000)] 
Fix cygwin conditional steps.

3 years agoAdd a bit more debug output.
Darren Tucker [Fri, 19 Aug 2022 05:12:57 +0000 (15:12 +1000)] 
Add a bit more debug output.

3 years agoAdd Cygwin (on windows-2019) test target.
Darren Tucker [Fri, 12 Aug 2022 05:08:47 +0000 (15:08 +1000)] 
Add Cygwin (on windows-2019) test target.

In addition to installing the requisite Cygwin packages, we also need to
explicitly invoke "sh" for steps that run other scripts since the runner
environment doesn't understand #! paths.

3 years agoupstream: double free() in error path; from Eusgor via GHPR333
djm@openbsd.org [Fri, 19 Aug 2022 03:06:30 +0000 (03:06 +0000)] 
upstream: double free() in error path; from Eusgor via GHPR333

OpenBSD-Commit-ID: 39f35e16ba878c8d02b4d01d8826d9b321be26d4

3 years agoCheck for perms to run agent-getpeereid test.
Darren Tucker [Thu, 18 Aug 2022 11:36:39 +0000 (21:36 +1000)] 
Check for perms to run agent-getpeereid test.

Ubuntu 22.04 defaults to private home dirs which prevents "nobody"
running ssh-add during the agent-getpeereid test.  Check for this and
add the necessary permissions.

3 years agoon Cygwin, prefer WinHello FIDO device
Damien Miller [Wed, 17 Aug 2022 06:04:16 +0000 (16:04 +1000)] 
on Cygwin, prefer WinHello FIDO device

If no FIDO device was explictly specified, then prefer the
windows://hello FIDO device. An exception to this is when
probing resident FIDO keys, in which case hardware FIDO
devices are preferred.

3 years agoupstream: add an extra flag to sk_probe() to indicate whether we're
djm@openbsd.org [Wed, 17 Aug 2022 06:01:57 +0000 (06:01 +0000)] 
upstream: add an extra flag to sk_probe() to indicate whether we're

probing for a FIDO resident key or not. Unused here, but will make like
easier for portable

OpenBSD-Commit-ID: 432c8ff70e270378df9dbceb9bdeaa5b43b5a832

3 years agoupstream: use .Cm for "sign"; from josiah frentsos
jmc@openbsd.org [Tue, 16 Aug 2022 20:24:08 +0000 (20:24 +0000)] 
upstream: use .Cm for "sign"; from josiah frentsos

OpenBSD-Commit-ID: 7f80a53d54857ac6ae49ea6ad93c5bd12231d1e4

3 years agoRevert "check_sk_options: add temporary WinHello workaround"
Corinna Vinschen [Thu, 11 Aug 2022 18:19:35 +0000 (20:19 +0200)] 
Revert "check_sk_options: add temporary WinHello workaround"

Cygwin now comes with libfido2 1.11.0, so this workaround
isn't required anymore.

This reverts commit 242c044ab111a37aad3b0775727c36a4c5f0102c.

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
3 years agofido_dev_is_winhello: return 0, not "false"
Corinna Vinschen [Thu, 11 Aug 2022 18:18:17 +0000 (20:18 +0200)] 
fido_dev_is_winhello: return 0, not "false"

"false" is not used anywhere in OpenSSH, so return 0 like
everywhere else.

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
3 years agoupstream: sftp-server: support home-directory request
djm@openbsd.org [Fri, 12 Aug 2022 05:20:28 +0000 (05:20 +0000)] 
upstream: sftp-server: support home-directory request

Add support to the sftp-server for the home-directory extension defined
in draft-ietf-secsh-filexfer-extensions-00. This overlaps a bit with the
existing expand-path@openssh.com, but uses a more official protocol name,
and so is a bit more likely to be implemented by non-OpenSSH clients.

From Mike Frysinger, ok dtucker@

OpenBSD-Commit-ID: bfc580d05cc0c817831ae7ecbac4a481c23566ab

3 years agoReplace deprecated ubuntu-18.04 runners with 22.04
Darren Tucker [Fri, 12 Aug 2022 04:56:55 +0000 (14:56 +1000)] 
Replace deprecated ubuntu-18.04 runners with 22.04

3 years agoAdd a timegm implementation from Heimdal via Samba.
Darren Tucker [Thu, 11 Aug 2022 12:48:23 +0000 (22:48 +1000)] 
Add a timegm implementation from Heimdal via Samba.

Fixes build on (at least Solaris 10).

3 years agoRerun tests if any .github config file changes.
Darren Tucker [Thu, 11 Aug 2022 04:23:58 +0000 (14:23 +1000)] 
Rerun tests if any .github config file changes.

3 years agoSkip hostbased during Valgrind tests.
Darren Tucker [Thu, 11 Aug 2022 03:33:51 +0000 (13:33 +1000)] 
Skip hostbased during Valgrind tests.

Valgrind doesn't let ssh exec ssh-keysign (because it's setuid) so skip
it during the Valgrind based tests.

See https://bugs.kde.org/show_bug.cgi?id=119404 for a discussion of this
(ironically there the problematic binary was ssh(1) back when it could
still be setuid).

3 years agoupstream: add some tests for parse_absolute_time(), including cases
djm@openbsd.org [Thu, 11 Aug 2022 01:57:50 +0000 (01:57 +0000)] 
upstream: add some tests for parse_absolute_time(), including cases

where it is forced to the UTC timezone. bz3468 ok dtucker

OpenBSD-Regress-ID: ea07ca31c2f3847a38df028ca632763ae44e8759

3 years agoupstream: allow certificate validity intervals, sshsig verification
djm@openbsd.org [Thu, 11 Aug 2022 01:56:51 +0000 (01:56 +0000)] 
upstream: allow certificate validity intervals, sshsig verification

times and authorized_keys expiry-time options to accept dates in the UTC time
zone in addition to the default of interpreting them in the system time zone.
YYYYMMDD and YYMMDDHHMM[SS] dates/times will be interpreted as UTC if
suffixed with a 'Z' character.

Also allow certificate validity intervals to be specified in raw
seconds-since-epoch as hex value, e.g. -V 0x1234:0x4567890. This
is intended for use by regress tests and other tools that call
ssh-keygen as part of a CA workflow.

bz3468 ok dtucker

OpenBSD-Commit-ID: 454db1cdffa9fa346aea5211223a2ce0588dfe13

3 years agoFix conditional for running hostbased tests.
Darren Tucker [Thu, 11 Aug 2022 00:23:55 +0000 (10:23 +1000)] 
Fix conditional for running hostbased tests.

3 years agofix SANDBOX_SECCOMP_FILTER_DEBUG
Damien Miller [Wed, 10 Aug 2022 22:58:28 +0000 (08:58 +1000)] 
fix SANDBOX_SECCOMP_FILTER_DEBUG

3 years agoTest hostbased auth on github runners.
Darren Tucker [Wed, 10 Aug 2022 07:35:52 +0000 (17:35 +1000)] 
Test hostbased auth on github runners.

3 years agoRename our getentropy to prevent possible loops.
Darren Tucker [Wed, 10 Aug 2022 07:25:24 +0000 (17:25 +1000)] 
Rename our getentropy to prevent possible loops.

Since arc4random seeds from getentropy, and we use OpenSSL for that
if enabled, there's the possibility that if we build on a system that
does not have getentropy then run on a system that does have it, then
OpenSSL could end up calling our getentropy and getting stuck in a loop.
Pointed out by deraadt@, ok djm@

3 years agoActually put HAVE_STDINT_H around the stdint.h.
Darren Tucker [Mon, 8 Aug 2022 02:17:04 +0000 (12:17 +1000)] 
Actually put HAVE_STDINT_H around the stdint.h.

3 years agoGive unused param a name.
Darren Tucker [Mon, 8 Aug 2022 00:30:34 +0000 (10:30 +1000)] 
Give unused param a name.

Fixes builds on platforms that do have fido2 but don't have
fido_dev_is_winhello.

3 years agoupstream: don't prompt for FIDO passphrase before attempting to enroll
djm@openbsd.org [Fri, 5 Aug 2022 05:01:40 +0000 (05:01 +0000)] 
upstream: don't prompt for FIDO passphrase before attempting to enroll

the credential, just let the enroll operating fail and we'll attempt to get a
PIN anyway. Might avoid some unneccessary PIN prompts.

Part of GHPR#302 from Corinna Vinschen; ok dtucker@

OpenBSD-Commit-ID: bd5342ffc353ee37d39617906867c305564d1ce2

3 years agosk_sign: set FIDO2 uv attribute explicitely for WinHello
Corinna Vinschen [Fri, 11 Feb 2022 13:33:41 +0000 (14:33 +0100)] 
sk_sign: set FIDO2 uv attribute explicitely for WinHello

WinHello via libfido2 performs user verification by default.
However, if we stick to that, there's no way to differentiate
between keys created with or without "-O  verify-required".
Set FIDO2 uv attribute explicitely to FIDO_OPT_FALSE, then check
if user verification has been requested.

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
3 years agocheck_sk_options: add temporary WinHello workaround
Corinna Vinschen [Tue, 15 Feb 2022 10:28:08 +0000 (11:28 +0100)] 
check_sk_options: add temporary WinHello workaround

Up to libfido 1.10.0, WinHello advertises "clientPin" rather
than "uv" capability.  This is fixed in 1.11.0.  For the time
being, workaround it here.

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
3 years agocompat code for fido_dev_is_winhello()
Corinna Vinschen [Thu, 10 Feb 2022 17:19:29 +0000 (18:19 +0100)] 
compat code for fido_dev_is_winhello()

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
3 years agoFactor out getrnd() and rename to getentropy().
Darren Tucker [Fri, 5 Aug 2022 03:12:27 +0000 (13:12 +1000)] 
Factor out getrnd() and rename to getentropy().

Factor out the arc4random seeding into its own file and change the
interface to match getentropy.  Use native getentropy if available.
This will make it easier to resync OpenBSD changes to arc4random.
Prompted by bz#3467, ok djm@.

3 years agoInclude CHANNEL and FIDO2 libs in configure output
Darren Tucker [Thu, 4 Aug 2022 08:55:48 +0000 (18:55 +1000)] 
Include CHANNEL and FIDO2 libs in configure output

3 years agoupstream: avoid double-free in error path introduced in r1.70; report
djm@openbsd.org [Mon, 1 Aug 2022 11:09:26 +0000 (11:09 +0000)] 
upstream: avoid double-free in error path introduced in r1.70; report

and fix based on GHPR#332 by v-rzh ok dtucker@

OpenBSD-Commit-ID: 3d21aa127b1f37cfc5bdc21461db369a663a951f

3 years agoRemove deprecated MacOS 10.15 runners.
Darren Tucker [Wed, 27 Jul 2022 08:40:12 +0000 (18:40 +1000)] 
Remove deprecated MacOS 10.15 runners.

3 years agoMove stale-configure check as early as possible.
Darren Tucker [Wed, 27 Jul 2022 08:31:14 +0000 (18:31 +1000)] 
Move stale-configure check as early as possible.

We added a check in Makefile to catch the case where configure needs to
be rebuilt, however this did not happen until a build was attempted in
which case all of the work done by configure was wasted.  Move this check
 to the start of configure to catch it as early as possible.  ok djm@

3 years agoMove libcrypto into CHANNELLIBS.
Darren Tucker [Fri, 22 Jul 2022 00:47:19 +0000 (10:47 +1000)] 
Move libcrypto into CHANNELLIBS.

This will result in sftp, sftp-server and scp no longer being linked
against libcrypto.  ok djm@

3 years agoRemove seed_rng calls from scp, sftp, sftp-server.
Darren Tucker [Fri, 22 Jul 2022 00:45:47 +0000 (10:45 +1000)] 
Remove seed_rng calls from scp, sftp, sftp-server.

These binaries don't use OpenSSL's random functions.  The next step
will be to stop linking them against libcrypto.  ok djm@

3 years agoGroup libcrypto and PRNGD checks together.
Darren Tucker [Thu, 21 Jul 2022 23:51:51 +0000 (09:51 +1000)] 
Group libcrypto and PRNGD checks together.

They're related more than the libcrypt or libiaf checks which are
currently between them.  ok djm@

3 years agoDo not link scp, sftp and sftp-server w/ zlib.
Darren Tucker [Thu, 21 Jul 2022 23:24:45 +0000 (09:24 +1000)] 
Do not link scp, sftp and sftp-server w/ zlib.

Some of our binaries (eg sftp, sftp-server, scp) do not interact with
the channels code and thus do use libraries such as zlib and libcrypto
although they are linked with them.  This adds a CHANNELLIBS and starts
by moving zlib into it, which means the aformentioned binaries are no
longer linked against zlib.  ok djm@

3 years agoRemove workarounds for OpenSSL missing AES-CTR.
Darren Tucker [Mon, 25 Jul 2022 11:49:04 +0000 (21:49 +1000)] 
Remove workarounds for OpenSSL missing AES-CTR.

We have some compatibility hacks that were added to support OpenSSL
versions that do not support AES CTR mode.  Since that time, however,
the minimum OpenSSL version that we support has moved to 1.0.1 which
*does* have CTR, so this is no longer needed.  ok djm@

3 years agoRemove workarounds for OpenSSL missing AES-GCM.
Darren Tucker [Mon, 25 Jul 2022 11:43:00 +0000 (21:43 +1000)] 
Remove workarounds for OpenSSL missing AES-GCM.

We have some compatibility hacks that were added to support OpenSSL
versions that do not support AES GCM mode.  Since that time, however,
the minimum OpenSSL version that we support has moved to 1.0.1 which
*does* have GCM, so this is no longer needed.  ok djm@

3 years agoupstream: Restore missing "!" in TEST_SSH_ELAPSED_TIMES test.
dtucker@openbsd.org [Mon, 25 Jul 2022 07:12:45 +0000 (07:12 +0000)] 
upstream: Restore missing "!" in TEST_SSH_ELAPSED_TIMES test.

OpenBSD-Regress-ID: 38783f9676ec348c5a792caecee9a16e354b37b0

3 years agoupstream: Test TEST_SSH_ELAPSED_TIMES for empty string not
dtucker@openbsd.org [Sun, 24 Jul 2022 23:29:10 +0000 (23:29 +0000)] 
upstream: Test TEST_SSH_ELAPSED_TIMES for empty string not

executable.  No-op on most platforms but should prevent warnings in -portable
on systems that don't have 'date %s'.

OpenBSD-Regress-ID: e39d79867b8065e33d0c5926fa1a31f85659d2a4

3 years agoConvert "have_prog" function into "which".
Darren Tucker [Sat, 23 Jul 2022 04:38:22 +0000 (14:38 +1000)] 
Convert "have_prog" function into "which".

"which" and its behaviour is not standardized, so convert the existing
have_prog function into "which" so we can rely on it being available
and what its semantics are.  Add a have_prog wrapper that maintains the
existing behaviour.

3 years agoSkip scp3 test if there's no scp on remote path.
Darren Tucker [Sat, 23 Jul 2022 04:36:38 +0000 (14:36 +1000)] 
Skip scp3 test if there's no scp on remote path.

scp -3 ends up using the scp that's in the remote path and will fail if
one is not available.  Based on a patch from rapier at psc.edu.

3 years agocrank SSH_SK_VERSION_MAJOR in sk-dummy.so
Damien Miller [Wed, 20 Jul 2022 03:39:14 +0000 (13:39 +1000)] 
crank SSH_SK_VERSION_MAJOR in sk-dummy.so

3 years agoupstream: ssh-keygen: fix touch prompt, pin retries;
djm@openbsd.org [Wed, 20 Jul 2022 03:33:22 +0000 (03:33 +0000)] 
upstream: ssh-keygen: fix touch prompt, pin retries;

part of GHPR329 from Pedro Martelletto

OpenBSD-Commit-ID: 75d1005bd2ef8f29fa834c90d2684e73556fffe8

3 years agoupstream: sk-usbhid: preserve error code returned by key_lookup()
djm@openbsd.org [Wed, 20 Jul 2022 03:31:42 +0000 (03:31 +0000)] 
upstream: sk-usbhid: preserve error code returned by key_lookup()

it conveys useful information, such as the supplied pin being wrong.

Part of GHPR329 from Pedro Martelletto

OpenBSD-Commit-ID: c0647eb9290f793add363d81378439b273756c1b

3 years agoupstream: when enrolling a resident key on a security token, check
djm@openbsd.org [Wed, 20 Jul 2022 03:29:14 +0000 (03:29 +0000)] 
upstream: when enrolling a resident key on a security token, check

if a credential with matching application and user ID strings already exists.
if so, prompt the user for confirmation before overwriting the credential.

patch from Pedro Martelletto via GHPR329

NB. cranks SSH_SK_VERSION_MAJOR, so any third-party FIDO middleware
implementations will need to adjust

OpenBSD-Commit-ID: e45e9f1bf2b2f32d9850669e7a8dbd64acc5fca4

3 years agoupstream: pull passphrase reading and confirmation into a separate
djm@openbsd.org [Wed, 20 Jul 2022 03:13:04 +0000 (03:13 +0000)] 
upstream: pull passphrase reading and confirmation into a separate

function so it can be used for FIDO2 PINs; no functional change

OpenBSD-Commit-ID: bf34f76b8283cc1d3f54633e0d4f13613d87bb2f

3 years agoMove vmshutdown to first step.
Darren Tucker [Fri, 15 Jul 2022 11:31:48 +0000 (21:31 +1000)] 
Move vmshutdown to first step.

If a previous run on a physical runner has failed to clean up, the next
run will fail because it'll try to check out the code to a broken
directory mount.  Make cleanup the first step.

3 years agoRename bbone test target to ARM.
Darren Tucker [Fri, 15 Jul 2022 10:25:27 +0000 (20:25 +1000)] 
Rename bbone test target to ARM.

3 years agoAdd AUDIT_ARCH_PPC to supported seccomp arches.
Darren Tucker [Fri, 15 Jul 2022 03:37:29 +0000 (13:37 +1000)] 
Add AUDIT_ARCH_PPC to supported seccomp arches.

Patch from dries.deschout at dodeco.eu.

3 years agoRemove unintended changes.
Darren Tucker [Thu, 14 Jul 2022 09:20:24 +0000 (19:20 +1000)] 
Remove unintended changes.

I inadvertently included a couple of local changes with the OpenSSL
3.0.4 change.  Revert, anything that should be there will be committed
separately.

3 years agoReturn ERANGE from getcwd() if buffer size is 1.
Darren Tucker [Thu, 14 Jul 2022 01:22:08 +0000 (11:22 +1000)] 
Return ERANGE from getcwd() if buffer size is 1.

If getcwd() is supplied a buffer size of exactly 1 and a path of "/", it
could result in a nul byte being written out of array bounds.  POSIX says
it should return ERANGE if the path will not fit in the available buffer
(with terminating nul). 1 byte cannot fit any possible path with its nul,
so immediately return ERANGE in that case.

OpenSSH never uses getcwd() with this buffer size, and all current
(and even quite old) platforms that we are currently known to work
on have a native getcwd() so this code is not used on those anyway.
Reported by Qualys, ok djm@

3 years agoSplit README.platform into its own line.
Darren Tucker [Thu, 14 Jul 2022 00:02:35 +0000 (10:02 +1000)] 
Split README.platform into its own line.

README.platform has general platform-specific information, having it
following text about FIDO2 on the same line could imply that it only
has information about FIDO2.

3 years agoClarify README.md text.
Darren Tucker [Wed, 13 Jul 2022 23:56:01 +0000 (09:56 +1000)] 
Clarify README.md text.

Clarify the text about the implications of building without OpenSSL, and
prefix the "configure --help" example command with a "./" so it's likely
to work as-is in more shells.  From bz#3461.

3 years agoRemove special casing of crypt().
Darren Tucker [Tue, 12 Jul 2022 09:48:44 +0000 (19:48 +1000)] 
Remove special casing of crypt().

Configure goes to some lengths to pick crypt() from either libcrypt
or OpenSSL's libcrypto because they can more or less featureful (eg
supporting md5-style passwords).

OpenSSL removed its crypt() interface in 2002:
https://github.com/openssl/openssl/commit/69deec58 so these hijinks
should no longer be necessary.  This also only links sshd with libcrypt
which is the only thing that needs it.  ok djm@

3 years agoOnly refuse to use OpenSSL 3.0.4 on x86_64.
Darren Tucker [Wed, 13 Jul 2022 03:17:47 +0000 (13:17 +1000)] 
Only refuse to use OpenSSL 3.0.4 on x86_64.

The potential RCE only impacts x86_64, so only refuse to use it if we're
targetting a potentially impacted architecture.  ok djm@

3 years agoCapture stderr output from configure.
Darren Tucker [Tue, 12 Jul 2022 04:37:15 +0000 (14:37 +1000)] 
Capture stderr output from configure.

3 years agoRefuse to use OpenSSL 3.0.4 due to potential RCE.
Darren Tucker [Tue, 12 Jul 2022 02:54:49 +0000 (12:54 +1000)] 
Refuse to use OpenSSL 3.0.4 due to potential RCE.

OpenSSL has a potential RCE in its RSA implementation (CVE-2022-2274)
so refuse to use that specific version.

3 years agoMove unset to before we set anything.
Darren Tucker [Tue, 12 Jul 2022 02:54:24 +0000 (12:54 +1000)] 
Move unset to before we set anything.

3 years agoTest against openssl-3.0.5.
Darren Tucker [Wed, 6 Jul 2022 01:52:54 +0000 (11:52 +1000)] 
Test against openssl-3.0.5.

3 years agoUpdate sanitizer test targets:
Darren Tucker [Tue, 5 Jul 2022 08:35:53 +0000 (18:35 +1000)] 
Update sanitizer test targets:

 - remove clang-sanitize-memory for now.  It takes so long that the test
   times out.
 - add gcc sanitize-address and sanitize-undefined test targets.

3 years agoAdd GCC address sanitizer build/test.
Darren Tucker [Tue, 5 Jul 2022 06:23:28 +0000 (16:23 +1000)] 
Add GCC address sanitizer build/test.

3 years agoMove sanitizer logs into regress for collection.
Darren Tucker [Tue, 5 Jul 2022 02:02:33 +0000 (12:02 +1000)] 
Move sanitizer logs into regress for collection.

3 years agoupstream: Add TEST_REGRESS_CACHE_DIR.
dtucker@openbsd.org [Mon, 4 Jul 2022 09:10:31 +0000 (09:10 +0000)] 
upstream: Add TEST_REGRESS_CACHE_DIR.

If set, it is used to cache regress test names that have succeeded and
skip those on a re-run.

OpenBSD-Regress-ID: a7570dd29a58df59f2cca647c3c2ec989b49f247

3 years agoAdd clang sanitizer tests.
Darren Tucker [Sun, 3 Jul 2022 11:46:44 +0000 (21:46 +1000)] 
Add clang sanitizer tests.

3 years agoSkip all rlimit tests when sandboxing disabled.
Darren Tucker [Sun, 3 Jul 2022 08:14:09 +0000 (18:14 +1000)] 
Skip all rlimit tests when sandboxing disabled.

The rlimit tests can hang when being run with some compiler sanitizers
so skip all of them if sandbox=no.

3 years agoMove checks for pollfd.fd and nfds_t.
Darren Tucker [Sun, 3 Jul 2022 07:54:49 +0000 (17:54 +1000)] 
Move checks for pollfd.fd and nfds_t.

Move the checks for struct pollfd.fd and nfds_t to before the sandboxing
checks.  This groups all the sandbox checks together so we can skip them
all when sandboxing is disabled.

3 years agoupstream: Remove leftover line.
dtucker@openbsd.org [Fri, 1 Jul 2022 05:08:23 +0000 (05:08 +0000)] 
upstream: Remove leftover line.

Remove extra line leftover from merge conflict. ok djm@

OpenBSD-Commit-ID: 460e2290875d7ae64971a7e669c244b1d1c0ae2e

3 years agoupstream: use consistent field names (s/char/byte)
djm@openbsd.org [Fri, 1 Jul 2022 04:45:50 +0000 (04:45 +0000)] 
upstream: use consistent field names (s/char/byte)

in format description

OpenBSD-Commit-ID: 3de33572733ee7fcfd7db33d37db23d2280254f0

3 years agoSkip select+rlimit check if sandboxing is disabled
Darren Tucker [Fri, 1 Jul 2022 03:55:19 +0000 (13:55 +1000)] 
Skip select+rlimit check if sandboxing is disabled

It's not needed in that case, and the test can fail when being built
with some compiler memory sanitizer flags.  bz#3441

3 years agoupstream: bump up loglevel from debug to info when unable to open
djm@openbsd.org [Fri, 1 Jul 2022 03:52:57 +0000 (03:52 +0000)] 
upstream: bump up loglevel from debug to info when unable to open

authorized keys/principals file for errno != ENOENT; bz2042 ok dtucker

OpenBSD-Commit-ID: e79aa550d91ade6a80f081bda689da24c086d66b

3 years agoupstream: Don't leak the strings allocated by order_hostkeyalgs()
dtucker@openbsd.org [Fri, 1 Jul 2022 03:39:44 +0000 (03:39 +0000)] 
upstream: Don't leak the strings allocated by order_hostkeyalgs()

and list_hostkey_types() that are passed to compat_pkalg_proposal(). Part of
github PR#324 from ZoltanFridrich, ok djm@

This is a roll-forward of the previous rollback now that the required
changes in compat.c have been done.

OpenBSD-Commit-ID: c7cd93730b3b9f53cdad3ae32462922834ef73eb

3 years agoupstream: Always return allocated strings from the kex filtering so
dtucker@openbsd.org [Fri, 1 Jul 2022 03:35:45 +0000 (03:35 +0000)] 
upstream: Always return allocated strings from the kex filtering so

that we can free them later.  Fix one leak in compat_kex_proposal.  Based on
github PR#324 from ZoltanFridrich with some simplications by me. ok djm@

OpenBSD-Commit-ID: 9171616da3307612d0ede086fd511142f91246e4

3 years agoupstream: ignore SIGPIPE earlier in main(), specifically before
djm@openbsd.org [Fri, 1 Jul 2022 00:36:30 +0000 (00:36 +0000)] 
upstream: ignore SIGPIPE earlier in main(), specifically before

muxclient() which performs operations that could cause one; Reported by Noam
Lewis via bz3454, ok dtucker@

OpenBSD-Commit-ID: 63d8e13276869eebac6d7a05d5a96307f9026e47

3 years agoupstream: reflect the update to -D arg name in usage();
jmc@openbsd.org [Tue, 28 Jun 2022 06:09:14 +0000 (06:09 +0000)] 
upstream: reflect the update to -D arg name in usage();

OpenBSD-Commit-ID: abdcde4f92b1ef094ae44210ee99d3b0155aad9c

3 years agoUpdate OpenSSL tests to the most recent releases.
Darren Tucker [Wed, 29 Jun 2022 08:28:47 +0000 (18:28 +1000)] 
Update OpenSSL tests to the most recent releases.

3 years agoupstream: allow arguments to sftp -D option, e.g. sftp -D
djm@openbsd.org [Mon, 27 Jun 2022 21:41:55 +0000 (21:41 +0000)] 
upstream: allow arguments to sftp -D option, e.g. sftp -D

"/usr/libexec/sftp-server -el debug3"

ok markus@

OpenBSD-Commit-ID: 5a002b9f3a7aef2731fc0ffa9c921cf15f38ecce

3 years agoupstream: Roll back previous KEX changes as they aren't safe until
dtucker@openbsd.org [Fri, 24 Jun 2022 10:45:06 +0000 (10:45 +0000)] 
upstream: Roll back previous KEX changes as they aren't safe until

compat_pkalg_proposal and friends always allocate their returned strings.
Reported by Qualys.

OpenBSD-Commit-ID: 1c7a88a0d5033f42f88ab9bec58ef1cf72c81ad0

3 years agoupstream: Don't leak the strings allocated by order_hostkeyalgs()
dtucker@openbsd.org [Fri, 24 Jun 2022 04:37:00 +0000 (04:37 +0000)] 
upstream: Don't leak the strings allocated by order_hostkeyalgs()

and list_hostkey_types() that are passed to compat_pkalg_proposal(). Part of
github PR#324 from ZoltanFridrich, ok djm@

OpenBSD-Commit-ID: b2f6e5f60f2bba293b831654328a8a0035ef4a1b

3 years agoZero out LIBFIDO2 when SK support not usable.
Darren Tucker [Sat, 25 Jun 2022 02:16:15 +0000 (12:16 +1000)] 
Zero out LIBFIDO2 when SK support not usable.

Prevents us from trying to link them into ssh-sk-helper and failing to
build.

3 years agoDisable SK support if FIDO libs not found.
Darren Tucker [Sat, 25 Jun 2022 01:47:28 +0000 (11:47 +1000)] 
Disable SK support if FIDO libs not found.