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

3 years agofix broken case statement in previous
Damien Miller [Fri, 24 Jun 2022 04:43:54 +0000 (14:43 +1000)] 
fix broken case statement in previous

3 years agorequest 1.1x API compatibility for OpenSSL >=3.x
Damien Miller [Fri, 24 Jun 2022 04:40:42 +0000 (14:40 +1000)] 
request 1.1x API compatibility for OpenSSL >=3.x

idea/patch from Pedro Martelletto via GHPR#322; ok dtucker@

3 years agoupstream: make it clear that RekeyLimit applies to both transmitted
djm@openbsd.org [Fri, 24 Jun 2022 04:27:14 +0000 (04:27 +0000)] 
upstream: make it clear that RekeyLimit applies to both transmitted

and received data. GHPR#328 from Jan Pazdziora

OpenBSD-Commit-ID: d180a905fec9ff418a75c07bb96ea41c9308c3f9

3 years agoupstream: Make sure not to fclose() the same fd twice in case of an
tobhe@openbsd.org [Tue, 21 Jun 2022 14:52:13 +0000 (14:52 +0000)] 
upstream: Make sure not to fclose() the same fd twice in case of an

error.

ok dtucker@

OpenBSD-Commit-ID: e384c4e05d5521e7866b3d53ca59acd2a86eef99

3 years agoupstream: Don't attempt to fprintf a null identity comment. From
dtucker@openbsd.org [Sat, 18 Jun 2022 02:17:16 +0000 (02:17 +0000)] 
upstream: Don't attempt to fprintf a null identity comment. From

Martin Vahlensieck via tech@.

OpenBSD-Commit-ID: 4c54d20a8e8e4e9912c38a7b4ef5bfc5ca2e05c2

3 years agoupstream: Log an error if pipe() fails while accepting a
dtucker@openbsd.org [Fri, 17 Jun 2022 01:00:03 +0000 (01:00 +0000)] 
upstream: Log an error if pipe() fails while accepting a

connection.  bz#3447, from vincent-openssh at vinc17 net, ok djm@

OpenBSD-Commit-ID: 9d59f19872b94900a5c79da2d57850241ac5df94

3 years agoautomatically enable built-in FIDO support
Damien Miller [Fri, 24 Jun 2022 04:20:43 +0000 (14:20 +1000)] 
automatically enable built-in FIDO support

If libfido2 is found and usable, then enable the built-in
security key support unless --without-security-key-builtin
was requested.

ok dtucker@

3 years agofix possible NULL deref when built without FIDO
Damien Miller [Fri, 24 Jun 2022 03:46:39 +0000 (13:46 +1000)] 
fix possible NULL deref when built without FIDO

Analysis/fix from kircher in bz3443; ok dtucker@

3 years agoupstream: make sure that UseDNS hostname lookup happens in the monitor
djm@openbsd.org [Wed, 15 Jun 2022 16:08:25 +0000 (16:08 +0000)] 
upstream: make sure that UseDNS hostname lookup happens in the monitor

and not in the pledge(2)'d unprivileged process; fixes regression caused by
recent refactoring spotted by henning@

OpenBSD-Commit-ID: a089870b95101cd8881a2dff65b2f1627d13e88d

3 years agoupstream: move auth_openprincipals() and auth_openkeyfile() over to
djm@openbsd.org [Fri, 3 Jun 2022 04:47:21 +0000 (04:47 +0000)] 
upstream: move auth_openprincipals() and auth_openkeyfile() over to

auth2-pubkeyfile.c too; they make more sense there.

OpenBSD-Commit-ID: 9970d99f900e1117fdaab13e9e910a621b7c60ee

3 years agoupstream: test setenv in both client and server, test first-match-wins
djm@openbsd.org [Fri, 3 Jun 2022 04:31:54 +0000 (04:31 +0000)] 
upstream: test setenv in both client and server, test first-match-wins

too

OpenBSD-Regress-ID: 4c8804f9db38a02db480b9923317457b377fe34b

3 years agoupstream: Make SetEnv directives first-match-wins in both
djm@openbsd.org [Fri, 3 Jun 2022 04:30:46 +0000 (04:30 +0000)] 
upstream: Make SetEnv directives first-match-wins in both

sshd_config and sshd_config; previously if the same name was reused then the
last would win (which is the opposite to how the config is supposed to work).

While there, make the ssh_config parsing more like sshd_config.

bz3438, ok dtucker

OpenBSD-Commit-ID: 797909c1e0262c0d00e09280459d7ab00f18273b

3 years agoupstream: Add missing *-sk types to ssh-keyscan manpage. From
dtucker@openbsd.org [Fri, 3 Jun 2022 04:00:15 +0000 (04:00 +0000)] 
upstream: Add missing *-sk types to ssh-keyscan manpage. From

skazi0 via github PR#294.

OpenBSD-Commit-ID: fda2c869cdb871f3c90a89fb3f985370bb5d25c0

3 years agoupstream: Add period at end of "not known by any other names"
dtucker@openbsd.org [Fri, 3 Jun 2022 03:21:09 +0000 (03:21 +0000)] 
upstream: Add period at end of "not known by any other names"

message.  github PR#320 from jschauma, ok djm@

OpenBSD-Commit-ID: bd60809803c4bfd3ebb7c5c4d918b10e275266f2

3 years agoupstream: ssh-keygen -A: do not generate DSA keys by default.
dtucker@openbsd.org [Fri, 3 Jun 2022 03:17:42 +0000 (03:17 +0000)] 
upstream: ssh-keygen -A: do not generate DSA keys by default.

Based on github PR#303 from jsegitz with man page text from jmc@, ok markus@
djm@

OpenBSD-Commit-ID: 5c4c57bdd7063ff03381cfb6696659dd3f9f5b9f

3 years agoupstream: ssh-keygen: implement "verify-required" certificate option.
naddy@openbsd.org [Tue, 31 May 2022 14:05:12 +0000 (14:05 +0000)] 
upstream: ssh-keygen: implement "verify-required" certificate option.

This was already documented when support for user-verified FIDO
keys was added, but the ssh-keygen(1) code was missing.

ok djm@

OpenBSD-Commit-ID: f660f973391b593fea4b7b25913c9a15c3eb8a06

3 years agoupstream: keywords ref ssh_config.5;
jmc@openbsd.org [Sat, 28 May 2022 05:57:56 +0000 (05:57 +0000)] 
upstream: keywords ref ssh_config.5;

from caspar schutijser

OpenBSD-Commit-ID: f146a19d7d5c9374c3b9c520da43b2732d7d1a4e

3 years agofix some bugs in the fuzzer
Damien Miller [Sun, 29 May 2022 23:29:09 +0000 (09:29 +1000)] 
fix some bugs in the fuzzer

3 years agoTest against OpenSSL 1.1.1o and 3.0.3.
Darren Tucker [Fri, 27 May 2022 08:19:48 +0000 (18:19 +1000)] 
Test against OpenSSL 1.1.1o and 3.0.3.

3 years agoTest against LibreSSL 3.5.3.
Darren Tucker [Fri, 27 May 2022 08:18:31 +0000 (18:18 +1000)] 
Test against LibreSSL 3.5.3.

3 years agofuzzer for authorized_keys parsing
Damien Miller [Fri, 27 May 2022 07:00:43 +0000 (17:00 +1000)] 
fuzzer for authorized_keys parsing

mostly redundant to authopt_fuzz, but it's sensitive code so IMO it
makes sense to test this layer too

3 years agoupstream: split the low-level file handling functions out from
djm@openbsd.org [Fri, 27 May 2022 05:02:46 +0000 (05:02 +0000)] 
upstream: split the low-level file handling functions out from

auth2-pubkey.c

Put them in a new auth2-pubkeyfile.c to make it easier to refer to them
(e.g. in unit/fuzz tests) without having to refer to everything else
pubkey auth brings in.

ok dtucker@

OpenBSD-Commit-ID: 3fdca2c61ad97dc1b8d4a7346816f83dc4ce2217

3 years agoupstream: refactor authorized_keys/principals handling
djm@openbsd.org [Fri, 27 May 2022 05:01:25 +0000 (05:01 +0000)] 
upstream: refactor authorized_keys/principals handling

remove "struct ssh *" from arguments - this was only used to pass the
remote host/address. These can be passed in instead and the resulting
code is less tightly coupled to ssh_api.[ch]

ok dtucker@

OpenBSD-Commit-ID: 9d4373d013edc4cc4b5c21a599e1837ac31dda0d

3 years agoupstream: f sshpkt functions fail, then password is not cleared
dtucker@openbsd.org [Fri, 27 May 2022 04:29:40 +0000 (04:29 +0000)] 
upstream: f sshpkt functions fail, then password is not cleared

with freezero. Unconditionally call freezero to guarantee that password is
removed from RAM.

From tobias@ and c3h2_ctf via github PR#286, ok djm@

OpenBSD-Commit-ID: 6b093619c9515328e25b0f8093779c52402c89cd