]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
2 years agoupstream: better debugging for connect_next()
djm@openbsd.org [Mon, 19 Sep 2022 08:49:50 +0000 (08:49 +0000)] 
upstream: better debugging for connect_next()

OpenBSD-Commit-ID: d16a307a0711499c971807f324484ed3a6036640

2 years agoupstream: Add RequiredRSASize for sshd(8); RSA keys that fall
djm@openbsd.org [Sat, 17 Sep 2022 10:34:29 +0000 (10:34 +0000)] 
upstream: Add RequiredRSASize for sshd(8); RSA keys that fall

beneath this limit will be ignored for user and host-based authentication.

Feedback deraadt@ ok markus@

OpenBSD-Commit-ID: 187931dfc19d51873df5930a04f2d972adf1f7f1

2 years agoupstream: add a RequiredRSASize for checking RSA key length in
djm@openbsd.org [Sat, 17 Sep 2022 10:33:18 +0000 (10:33 +0000)] 
upstream: add a RequiredRSASize for checking RSA key length in

ssh(1). User authentication keys that fall beneath this limit will be
ignored. If a host presents a host key beneath this limit then the connection
will be terminated (unfortunately there are no fallbacks in the protocol for
host authentication).

feedback deraadt, Dmitry Belyavskiy; ok markus@

OpenBSD-Commit-ID: 430e339b2a79fa9ecc63f2837b06fdd88a7da13a

2 years agoupstream: Add a sshkey_check_rsa_length() call for checking the
djm@openbsd.org [Sat, 17 Sep 2022 10:30:45 +0000 (10:30 +0000)] 
upstream: Add a sshkey_check_rsa_length() call for checking the

length of an RSA key; ok markus@

OpenBSD-Commit-ID: de77cd5b11594297eda82edc594b0d32b8535134

2 years agoupstream: actually hook up restrict_websafe; the command-line flag
djm@openbsd.org [Sat, 17 Sep 2022 10:11:29 +0000 (10:11 +0000)] 
upstream: actually hook up restrict_websafe; the command-line flag

was never actually used. Spotted by Matthew Garrett

OpenBSD-Commit-ID: 0b363518ac4c2819dbaa3dfad4028633ab9cdff1

2 years agoupstream: correct error value
djm@openbsd.org [Fri, 16 Sep 2022 06:55:37 +0000 (06:55 +0000)] 
upstream: correct error value

OpenBSD-Commit-ID: 780efcbad76281f11f14b2a5ff04eb6db3dfdad4

2 years agoupstream: sftp: Be a bit more clever about completions
djm@openbsd.org [Fri, 16 Sep 2022 03:33:14 +0000 (03:33 +0000)] 
upstream: sftp: Be a bit more clever about completions

There are commands (e.g. "get" or "put") that accept two
arguments, a local path and a remote path. However, the way
current completion is written doesn't take this distinction into
account and always completes remote or local paths.

By expanding CMD struct and "cmds" array this distinction can be
reflected and with small adjustment to completer code the correct
path can be completed.

By Michal Privoznik, ok dtucker@

OpenBSD-Commit-ID: 1396d921c4eb1befd531f5c4a8ab47e7a74b610b

2 years agoupstream: sftp: Don't attempt to complete arguments for
djm@openbsd.org [Fri, 16 Sep 2022 03:13:34 +0000 (03:13 +0000)] 
upstream: sftp: Don't attempt to complete arguments for

non-existent commands

If user entered a non-existent command (e.g. because they made a
typo) there is no point in trying to complete its arguments. Skip
calling complete_match() if that's the case.

From Michal Privoznik

OpenBSD-Commit-ID: cf39c811a68cde2aeb98fc85addea4000ef6b07a

2 years agoupstream: sk_enroll: never drop SSH_SK_USER_VERIFICATION_REQD flag
djm@openbsd.org [Wed, 14 Sep 2022 00:14:37 +0000 (00:14 +0000)] 
upstream: sk_enroll: never drop SSH_SK_USER_VERIFICATION_REQD flag

from response

Now that all FIDO signing calls attempt first without PIN and then
fall back to trying PIN only if that attempt fails, we can remove the
hack^wtrick that removed the UV flag from the keys returned during
enroll.

By Corinna Vinschen

OpenBSD-Commit-ID: 684517608c8491503bf80cd175425f0178d91d7f

2 years agoupstream: a little extra debugging
djm@openbsd.org [Wed, 14 Sep 2022 00:13:13 +0000 (00:13 +0000)] 
upstream: a little extra debugging

OpenBSD-Commit-ID: edf1601c1d0905f6da4c713f4d9cecc7d1c0295a

2 years agoupstream: ssh-agent: attempt FIDO key signing without PIN and use
djm@openbsd.org [Wed, 14 Sep 2022 00:02:03 +0000 (00:02 +0000)] 
upstream: ssh-agent: attempt FIDO key signing without PIN and use

the error to determine whether a PIN is required and prompt only if
necessary. from Corinna Vinschen

OpenBSD-Commit-ID: dd6be6a0b7148608e834ee737c3479b3270b00dd

2 years agoupstream: .Li -> .Vt where appropriate; from josiah frentsos,
jmc@openbsd.org [Sun, 11 Sep 2022 06:38:11 +0000 (06:38 +0000)] 
upstream: .Li -> .Vt where appropriate; from josiah frentsos,

tweaked by schwarze

ok schwarze

OpenBSD-Commit-ID: 565046e3ce68b46c2f440a93d67c2a92726de8ed

2 years agoupstream: fix repeated words ok miod@ jmc@
jsg@openbsd.org [Sat, 10 Sep 2022 08:50:53 +0000 (08:50 +0000)] 
upstream: fix repeated words ok miod@ jmc@

OpenBSD-Commit-ID: 6765daefe26a6b648cc15cadbbe337596af709b7

2 years agoupstream: notifier_complete(NULL, ...) is a noop, so no need to test
djm@openbsd.org [Fri, 9 Sep 2022 03:31:42 +0000 (03:31 +0000)] 
upstream: notifier_complete(NULL, ...) is a noop, so no need to test

that ctx!=NULL; from Corinna Vinschen

OpenBSD-Commit-ID: ade2f2e9cc519d01a586800c25621d910bce384a

2 years agoopenbsd-compat/bsd-asprintf: add <stdio.h> include for vsnprintf
Sam James [Thu, 8 Sep 2022 01:49:29 +0000 (02:49 +0100)] 
openbsd-compat/bsd-asprintf: add <stdio.h> include for vsnprintf

Fixes the following build failure with Clang 15 on musl:
```
bsd-asprintf.c:51:8: error: call to undeclared library function 'vsnprintf' with type 'int (char *, unsigned long, const char *, struct __va_list_tag *)'; ISO C99 and laterclang -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -pipe -Wunknown-warning-option -Qunused-arguments -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -Wmisleading-indentation -Wbitwise-instead-of-logical -fno-strict-aliasing -mretpoline  -ftrapv -fzero-call-used-regs=all -fno-builtin-memset -fstack-protector-strong -fPIE   -I. -I.  -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -DSSHDIR=\"/etc/ssh\" -D_PATH_SSH_PROGRAM=\"/usr/bin/ssh\" -D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/lib/misc/ssh-askpass\" -D_PATH_SFTP_SERVER=\"/usr/lib/misc/sftp-server\" -D_PATH_SSH_KEY_SIGN=\"/usr/lib/misc/ssh-keysign\" -D_PATH_SSH_PKCS11_HELPER=\"/usr/lib/misc/ssh-pkcs11-helper\" -D_PATH_SSH_SK_HELPER=\"/usr/lib/misc/ssh-sk-helper\" -D_PATH_SSH_PIDDIR=\"/run\" -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\" -DHAVE_CONFIG_H -c cipher-aes.c -o cipher-aes.o
 do not support
      implicit function declarations [-Wimplicit-function-declaration]
        ret = vsnprintf(string, INIT_SZ, fmt, ap2);
              ^
bsd-asprintf.c:51:8: note: include the header <stdio.h> or explicitly provide a declaration for 'vsnprintf'
1 error generated.
```

2 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.

2 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@.

2 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.

2 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.

2 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

2 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.

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

OpenBSD-Commit-ID: c2bcbf93610d3d62ed206cdf9bf9ff98c6aaf232

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

2 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.

2 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.

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

2 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.

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

OpenBSD-Commit-ID: a5d015efbfd228dc598ffdef612d2da3a579e5d8

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

OpenBSD-Commit-ID: d297e4387935d4aef091c5e9432578c2e513f538

2 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.