]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
4 years agoRemove unused arg.
Darren Tucker [Thu, 18 Feb 2021 04:21:13 +0000 (15:21 +1100)] 
Remove unused arg.

4 years agoAdd DEBUG_SK to kitchensink builds.
Darren Tucker [Thu, 18 Feb 2021 03:54:07 +0000 (14:54 +1100)] 
Add DEBUG_SK to kitchensink builds.

4 years agoAdd bbone test target (arm32).
Darren Tucker [Thu, 18 Feb 2021 03:53:14 +0000 (14:53 +1100)] 
Add bbone test target (arm32).

4 years agoupstream: Fix the hostkeys rotation extension documentation
djm@openbsd.org [Thu, 18 Feb 2021 02:49:35 +0000 (02:49 +0000)] 
upstream: Fix the hostkeys rotation extension documentation

The documentation was lacking the needed want-reply field in the initial
global request.

https://github.com/openssh/openssh-portable/pull/218 by dbussink

OpenBSD-Commit-ID: 051824fd78edf6d647a0b9ac011bf88e28775054

4 years agoupstream: make names in function prototypes match those in
djm@openbsd.org [Thu, 18 Feb 2021 02:15:07 +0000 (02:15 +0000)] 
upstream: make names in function prototypes match those in

definition from https://github.com/openssh/openssh-portable/pull/225 by
ZenithalHourlyRate

OpenBSD-Commit-ID: 7c736307bf3f2c7cb24d6f82f244eee959485acd

4 years agoupstream: unbreak SK_DEBUG builds
djm@openbsd.org [Thu, 18 Feb 2021 02:13:58 +0000 (02:13 +0000)] 
upstream: unbreak SK_DEBUG builds

from https://github.com/openssh/openssh-portable/pull/225 by
ZenithalHourlyRate

OpenBSD-Commit-ID: 28d7259ce1b04d025411464decfa2f1a097b43eb

4 years agoupstream: sftp-server: implement limits@openssh.com extension
djm@openbsd.org [Thu, 18 Feb 2021 00:30:17 +0000 (00:30 +0000)] 
upstream: sftp-server: implement limits@openssh.com extension

This is a simple extension that allows the server to clearly
communicate transfer limits it is imposing so the client doesn't
have to guess, or force the user to manually tune.  This is
particularly useful when an attempt to use too large of a value
causes the server to abort the connection.

Patch from Mike Frysinger; ok dtucker@

OpenBSD-Commit-ID: f96293221e5aa24102d9bf30e4f4ef04d5f4fb51

4 years agosupport OpenSSL 3.x cipher IV API change
Damien Miller [Thu, 18 Feb 2021 01:06:25 +0000 (12:06 +1100)] 
support OpenSSL 3.x cipher IV API change

OpenSSL renamed the "get current CIPHER_CTX" IV operation in 3.x.
This uses the new name if available.

https://github.com/openssl/openssl/issues/13411

bz#3238 ok dtucker@

4 years agoprefer login_getpwclass() to login_getclass()
Damien Miller [Thu, 18 Feb 2021 00:25:38 +0000 (11:25 +1100)] 
prefer login_getpwclass() to login_getclass()

FreeBSD has login_getpwclass() that does some special magic for
UID=0. Prefer this to login_getclass() as its easier to emulate
the former with the latter.

Based on FreeBSD PR 37416 via Ed Maste; ok dtucker@

4 years agoFixing quoting for installing moduli on target guest.
Darren Tucker [Wed, 17 Feb 2021 23:45:27 +0000 (10:45 +1100)] 
Fixing quoting for installing moduli on target guest.

4 years agoInstall moduli on target not host.
Darren Tucker [Wed, 17 Feb 2021 23:27:16 +0000 (10:27 +1100)] 
Install moduli on target not host.

4 years agodon't free string returned by login_getcapstr(3)
Damien Miller [Wed, 17 Feb 2021 23:33:58 +0000 (10:33 +1100)] 
don't free string returned by login_getcapstr(3)

OpenBSD and NetBSD require the caller to free strings returned
bu the login_* functions, but FreeBSD requires that callers don't.

Fortunately in this case, we can harmlessly leak as the process is
about to exec the shell/command.

From https://reviews.freebsd.org/D28617 via Ed Maste; ok dtucker@

4 years agoSkip unit tests on sol11 to speed things up.
Darren Tucker [Wed, 17 Feb 2021 23:10:00 +0000 (10:10 +1100)] 
Skip unit tests on sol11 to speed things up.

4 years agoRemove SKIP_UNIT as it needs to be a make arg.
Darren Tucker [Wed, 17 Feb 2021 23:09:27 +0000 (10:09 +1100)] 
Remove SKIP_UNIT as it needs to be a make arg.

4 years agoAlways intall moduli.
Darren Tucker [Wed, 17 Feb 2021 23:05:03 +0000 (10:05 +1100)] 
Always intall moduli.

Allows us to run tests without falling back to a fixed modulus.  Ensure that
the directory exists.

4 years agoQuote SSHD_CONFOPTS in case it contains spaces.
Darren Tucker [Wed, 17 Feb 2021 22:59:09 +0000 (09:59 +1100)] 
Quote SSHD_CONFOPTS in case it contains spaces.

4 years agoFix labels on targets (dots vs underscores).
Darren Tucker [Wed, 17 Feb 2021 22:51:18 +0000 (09:51 +1100)] 
Fix labels on targets (dots vs underscores).

4 years agoMore compact representation of config matrix.
Darren Tucker [Wed, 17 Feb 2021 10:47:48 +0000 (21:47 +1100)] 
More compact representation of config matrix.

4 years agoSkip unit tests on hosted VMs to speed things up.
Darren Tucker [Wed, 17 Feb 2021 10:19:18 +0000 (21:19 +1100)] 
Skip unit tests on hosted VMs to speed things up.

4 years agoMerge macos and ubuntu tests.
Darren Tucker [Wed, 17 Feb 2021 09:21:29 +0000 (20:21 +1100)] 
Merge macos and ubuntu tests.

4 years agoConvert most github hosted tests to new config structure.
Darren Tucker [Wed, 17 Feb 2021 07:41:30 +0000 (18:41 +1100)] 
Convert most github hosted tests to new config structure.

4 years agoOnly run selfhosted tests from selfhosted repo.
Darren Tucker [Wed, 17 Feb 2021 07:27:36 +0000 (18:27 +1100)] 
Only run selfhosted tests from selfhosted repo.

4 years agoAdd self-hosted runners for VMs of other platforms.
Darren Tucker [Fri, 15 Jan 2021 03:11:43 +0000 (14:11 +1100)] 
Add self-hosted runners for VMs of other platforms.

Github only hosts a limited number of platforms, and the runner code
is only supported on slightly wider range of platforms.  To increase
our test coverage beyond that, we run the runner natively on a VM host,
where it runs a jobs that boot VMs of other platforms, waits for them
to come up then runs the build and test by ssh'ing into the guest.
This means that the minimum dependencies for the guests are quite low
(basically just sshd, a compiler and make).

The interface to the VM host is fairly simple (basically 3 scripts:
vmstartup, vmrun and vmshutdown), but those are specific to the VM host
so are not in the public repo.  We also mount the working directory on the
host via sshfs, so things like artifact upload by the runner also work.

As part of this we are moving the per-test-target configs into a single
place (.github/configs) where there will be referenced by a single short
"config" key.  I plan to make the github-hosted runners use this too.

The self-hosted runners are run off a private repo on github since that
prevents third parties from accessing them[0], and since runner quota is
limited on private repos, we avoid running the tests we run on the public
repo.

[0] https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories

4 years agoupstream: Make sure puttygen is new enough to successfully run the
dtucker@openbsd.org [Wed, 17 Feb 2021 03:59:00 +0000 (03:59 +0000)] 
upstream: Make sure puttygen is new enough to successfully run the

PuTTY interop tests, otherwise skip them.

OpenBSD-Regress-ID: 34565bb50b8aec58331ed02a5e9e0a9a929bef51

4 years agoupstream: ssh: add PermitRemoteOpen for remote dynamic forwarding
markus@openbsd.org [Mon, 15 Feb 2021 20:43:15 +0000 (20:43 +0000)] 
upstream: ssh: add PermitRemoteOpen for remote dynamic forwarding

with SOCKS ok djm@, dtucker@

OpenBSD-Commit-ID: 64fe7b6360acc4ea56aa61b66498b5ecc0a96a7c

4 years agoupstream: factor out opt_array_append; ok djm@
markus@openbsd.org [Mon, 15 Feb 2021 20:36:35 +0000 (20:36 +0000)] 
upstream: factor out opt_array_append; ok djm@

OpenBSD-Commit-ID: 571bc5dd35f99c5cf9de6aaeac428b168218e74a

4 years agoupstream: ProxyJump takes "none" to disable processing like
dlg@openbsd.org [Mon, 15 Feb 2021 11:09:22 +0000 (11:09 +0000)] 
upstream: ProxyJump takes "none" to disable processing like

ProxyCommand does

ok djm@ jmc@

OpenBSD-Commit-ID: 941a2399da2193356bdc30b879d6e1692f18b6d3

4 years agoupstream: sftp: add missing lsetstat@openssh.com documentation
djm@openbsd.org [Fri, 12 Feb 2021 03:49:09 +0000 (03:49 +0000)] 
upstream: sftp: add missing lsetstat@openssh.com documentation

patch from Mike Frysinger

OpenBSD-Commit-ID: 9c114db88d505864075bfe7888b7c8745549715b

4 years agoupstream: factor SSH_AGENT_CONSTRAIN_EXTENSION parsing into its own
djm@openbsd.org [Fri, 12 Feb 2021 03:14:18 +0000 (03:14 +0000)] 
upstream: factor SSH_AGENT_CONSTRAIN_EXTENSION parsing into its own

function and remove an unused variable; ok dtucker@

OpenBSD-Commit-ID: e1a938657fbf7ef0ba5e73b30365734a0cc96559

4 years agoAdd __NR_futex_time64 to seccomp sandbox.
Darren Tucker [Wed, 10 Feb 2021 23:18:05 +0000 (10:18 +1100)] 
Add __NR_futex_time64 to seccomp sandbox.

This is apparently needed for (some) 32 bit platforms with glibc 2.33.
Patch from nix at esperi.org.uk and jjelen at redhat.com via bz#3260.

4 years agoAdd a hostname function for systems that don't have it.
Darren Tucker [Fri, 5 Feb 2021 22:37:01 +0000 (09:37 +1100)] 
Add a hostname function for systems that don't have it.

Some systems don't have a hostname command (it's not required by POSIX).
The do have uname -n (which is), but as found by tim@ some others (eg
UnixWare) do not report the FQDN from uname -n.

4 years agoupstream: Roll back the hostname->uname change in rev 1.10. It turns
dtucker@openbsd.org [Fri, 5 Feb 2021 22:03:40 +0000 (22:03 +0000)] 
upstream: Roll back the hostname->uname change in rev 1.10. It turns

out uname -n doesn't do what we need for some platforms in portable, so we'll
fix the original problem (that some other platforms don't have hostname at
all) by providing wrapper function to implement it.

OpenBSD-Regress-ID: 827a707d6201d5a8e196a8c28aec1d2c76c52341

4 years agoupstream: hostname is not specified by POSIX but uname -n is, so use
dtucker@openbsd.org [Fri, 5 Feb 2021 06:01:58 +0000 (06:01 +0000)] 
upstream: hostname is not specified by POSIX but uname -n is, so use

the latter for portability.  Patch from Geert Hendrickx via github PR#208.

OpenBSD-Regress-ID: d6a79c7c4d141a0d05ade4a042eb57dddbce89f3

4 years agoUsing explicit_memset for the explicit_bzero compatibility layer.
David Carlier [Sat, 21 Nov 2020 12:22:23 +0000 (12:22 +0000)] 
Using explicit_memset for the explicit_bzero compatibility layer.

Favoriting the native implementation in this case.

4 years agoDeny (non-fatal) statx in preauth privsep child.
Luca Weiss [Sun, 8 Nov 2020 13:19:23 +0000 (14:19 +0100)] 
Deny (non-fatal) statx in preauth privsep child.

4 years agoupstream: Remove debug message from sigchld handler. While this
dtucker@openbsd.org [Fri, 5 Feb 2021 02:20:23 +0000 (02:20 +0000)] 
upstream: Remove debug message from sigchld handler. While this

works on OpenBSD it can cause problems on other platforms.  From kircherlike
at outlook.com via bz#3259, ok djm@

OpenBSD-Commit-ID: 3e241d7ac1ee77e3de3651780b5dc47b283a7668

4 years agoupstream: whitespace
djm@openbsd.org [Tue, 2 Feb 2021 22:36:59 +0000 (22:36 +0000)] 
upstream: whitespace

OpenBSD-Commit-ID: 544bb092e03fcbecb420196cd0f70af13ea868ad

4 years agoupstream: fix memleaks in private key deserialisation; enforce more
djm@openbsd.org [Tue, 2 Feb 2021 22:36:46 +0000 (22:36 +0000)] 
upstream: fix memleaks in private key deserialisation; enforce more

consistency between redundant fields in private key certificate and private
key body; ok markus@

OpenBSD-Commit-ID: dec344e414d47f0a7adc13aecf3760fe58101240

4 years agoupstream: memleak on error path; ok markus@
djm@openbsd.org [Tue, 2 Feb 2021 22:35:14 +0000 (22:35 +0000)] 
upstream: memleak on error path; ok markus@

OpenBSD-Commit-ID: 2091a36d6ca3980c81891a6c4bdc544e63cb13a8

4 years agoupstream: more strictly enforce KEX state-machine by banning packet
djm@openbsd.org [Sun, 31 Jan 2021 22:55:29 +0000 (22:55 +0000)] 
upstream: more strictly enforce KEX state-machine by banning packet

types once they are received. Fixes memleak caused by duplicate
SSH2_MSG_KEX_DH_GEX_REQUEST (spotted by portable OpenSSH kex_fuzz via
oss-fuzz #30078).

ok markus@

OpenBSD-Commit-ID: 87331c715c095b587d5c88724694cdeb701c9def

4 years agoupstream: Set linesize returned by getline to zero when freeing and
dtucker@openbsd.org [Sun, 31 Jan 2021 10:50:10 +0000 (10:50 +0000)] 
upstream: Set linesize returned by getline to zero when freeing and

NULLing the returned string.  OpenBSD's getline handles this just fine, but
some implementations used by -portable do not.  ok djm@

OpenBSD-Commit-ID: 4d7bd5169d3397654247db9655cc69a9908d165c

4 years agoallow a fuzz case to contain more than one request
Damien Miller [Sat, 30 Jan 2021 05:32:29 +0000 (16:32 +1100)] 
allow a fuzz case to contain more than one request

loop until input buffer empty, no message consumed or 256 messages
processed

4 years agoexpect fuzz cases to have length prefix
Damien Miller [Sat, 30 Jan 2021 05:28:23 +0000 (16:28 +1100)] 
expect fuzz cases to have length prefix

might make life a little easier for the fuzzer, e.g. it can now
produce valid (multi-request) messages by smashing two cases together.

4 years agossh-agent fuzzer
Damien Miller [Sat, 30 Jan 2021 01:03:30 +0000 (12:03 +1100)] 
ssh-agent fuzzer

4 years agomove keys out of kex_fuzz.cc into separate header
Damien Miller [Sat, 30 Jan 2021 01:02:46 +0000 (12:02 +1100)] 
move keys out of kex_fuzz.cc into separate header

add certificates and missing key types

4 years agosome fixed test data (mostly keys) for fuzzing
Damien Miller [Sat, 30 Jan 2021 01:02:10 +0000 (12:02 +1100)] 
some fixed test data (mostly keys) for fuzzing

4 years agoupstream: add a SK_DUMMY_INTEGRATE define that allows the dummy
djm@openbsd.org [Sat, 30 Jan 2021 00:56:38 +0000 (00:56 +0000)] 
upstream: add a SK_DUMMY_INTEGRATE define that allows the dummy

security key middleware to be directly linked; useful for writing fuzzers,
etc.

OpenBSD-Regress-ID: 0ebd00159b58ebd85e61d8270fc02f1e45df1544

4 years agoupstream: fix the values of enum sock_type
djm@openbsd.org [Fri, 29 Jan 2021 06:29:46 +0000 (06:29 +0000)] 
upstream: fix the values of enum sock_type

OpenBSD-Commit-ID: 18d048f4dbfbb159ff500cfc2700b8fb1407facd

4 years agoupstream: give typedef'd struct a struct name; makes the fuzzer I'm
djm@openbsd.org [Fri, 29 Jan 2021 06:28:10 +0000 (06:28 +0000)] 
upstream: give typedef'd struct a struct name; makes the fuzzer I'm

writing a bit easier

OpenBSD-Commit-ID: 1052ab521505a4d8384d67acb3974ef81b8896cb

4 years agofuzz diffie-hellman-group-exchange-sha1 kex too
Damien Miller [Fri, 29 Jan 2021 00:09:14 +0000 (11:09 +1100)] 
fuzz diffie-hellman-group-exchange-sha1 kex too

4 years agosupport for running kex fuzzer with null cipher
Damien Miller [Fri, 29 Jan 2021 00:03:35 +0000 (11:03 +1100)] 
support for running kex fuzzer with null cipher

4 years agomake with -j2 to use available CPUs.
Darren Tucker [Thu, 28 Jan 2021 09:55:16 +0000 (20:55 +1100)] 
make with -j2 to use available CPUs.

4 years agoAdd test against openssl head and libressl head.
Darren Tucker [Thu, 28 Jan 2021 03:31:01 +0000 (14:31 +1100)] 
Add test against openssl head and libressl head.

4 years agoRemove whitespace.
Darren Tucker [Thu, 28 Jan 2021 03:30:50 +0000 (14:30 +1100)] 
Remove whitespace.

4 years agoupstream: fix leak: was double allocating kex->session_id buffer
djm@openbsd.org [Wed, 27 Jan 2021 23:49:46 +0000 (23:49 +0000)] 
upstream: fix leak: was double allocating kex->session_id buffer

OpenBSD-Commit-ID: 3765f4cc3ae1df874dba9102a3588ba7b48b8183

4 years agocorrect kex name in disabled code
Damien Miller [Wed, 27 Jan 2021 21:57:31 +0000 (08:57 +1100)] 
correct kex name in disabled code

4 years agoupstream: this needs kex.h now
djm@openbsd.org [Wed, 27 Jan 2021 10:15:08 +0000 (10:15 +0000)] 
upstream: this needs kex.h now

OpenBSD-Commit-ID: c5a42166c5aa002197217421a971e48be7cb5d41

4 years agoupstream: make ssh->kex->session_id a sshbuf instead of u_char*/size_t
djm@openbsd.org [Wed, 27 Jan 2021 10:05:28 +0000 (10:05 +0000)] 
upstream: make ssh->kex->session_id a sshbuf instead of u_char*/size_t

and use that instead of global variables containing copies of it. feedback/ok
markus@

OpenBSD-Commit-ID: a4b1b1ca4afd2e37cb9f64f737b30a6a7f96af68

4 years agoupstream: remove global variable used to stash compat flags and use the
djm@openbsd.org [Wed, 27 Jan 2021 09:26:53 +0000 (09:26 +0000)] 
upstream: remove global variable used to stash compat flags and use the

purpose-built ssh->compat variable instead; feedback/ok markus@

OpenBSD-Commit-ID: 7c4f200e112dae6bcf99f5bae1a5629288378a06

4 years agoInstall moduli file before tests.
Darren Tucker [Wed, 27 Jan 2021 01:34:07 +0000 (12:34 +1100)] 
Install moduli file before tests.

Reduces warnings during test runs.

4 years agoRun one test with -Werror to catch warnings.
Darren Tucker [Wed, 27 Jan 2021 00:58:26 +0000 (11:58 +1100)] 
Run one test with -Werror to catch warnings.

4 years agoupstream: Logical not bitwise or. ok djm@
dtucker@openbsd.org [Wed, 27 Jan 2021 00:37:26 +0000 (00:37 +0000)] 
upstream: Logical not bitwise or. ok djm@

OpenBSD-Commit-ID: d4dc855cf04951b93c45caa383e1ac9af0a3b0e5

4 years agoupstream: move HostbasedAcceptedAlgorithms to the right place in
naddy@openbsd.org [Tue, 26 Jan 2021 15:40:17 +0000 (15:40 +0000)] 
upstream: move HostbasedAcceptedAlgorithms to the right place in

alphabetical order

OpenBSD-Commit-ID: d766820d33dd874d944c14b0638239adb522c7ec

4 years agoupstream: Remove unused variables leftover from refactoring. ok
dtucker@openbsd.org [Tue, 26 Jan 2021 11:25:01 +0000 (11:25 +0000)] 
upstream: Remove unused variables leftover from refactoring. ok

djm@

OpenBSD-Commit-ID: 8b3ad58bff828fcf874e54b2fc27a4cf1d9505e8

4 years agoupstream: Rename HostbasedKeyTypes (ssh) and
dtucker@openbsd.org [Tue, 26 Jan 2021 05:32:21 +0000 (05:32 +0000)] 
upstream: Rename HostbasedKeyTypes (ssh) and

HostbasedAcceptedKeyTypes (sshd) to HostbasedAcceptedAlgorithms, which more
accurately reflects its effect. This matches a previous change to
PubkeyAcceptedAlgorithms.  The previous names are retained as aliases.  ok
djm@

OpenBSD-Commit-ID: 49451c382adc6e69d3fa0e0663eeef2daa4b199e

4 years agoDisable sntrup761 if compiler doesn't support VLAs.
Darren Tucker [Tue, 26 Jan 2021 03:48:07 +0000 (14:48 +1100)] 
Disable sntrup761 if compiler doesn't support VLAs.

The sntrup761 code sourced from supercop uses variable length
arrays.  Although widely supported, they are not part of the ANSI
C89 spec so if the compiler does not support VLAs, disable the
sntrup761x25519-sha512@openssh.com KEX method by replacing the kex
functions with no-op ones similar to what we do in kexecdh.c.

This should allow OpenSSH to build with a plain C89 compiler again.
Spotted by tim@, ok djm@.

4 years agoupstream: refactor key constraint parsing in ssh-agent
djm@openbsd.org [Tue, 26 Jan 2021 00:54:49 +0000 (00:54 +0000)] 
upstream: refactor key constraint parsing in ssh-agent

Key constraints parsing code previously existed in both the "add regular
key" and "add smartcard key" path. This unifies them but also introduces
more consistency checking: duplicated constraints and constraints that
are nonsensical for a particular situation (e.g. FIDO provider for a
smartcard key) are now banned.

ok markus@

OpenBSD-Commit-ID: 511cb1b1c021ee1d51a4c2d649b937445de7983c

4 years agoupstream: more ssh-agent refactoring
djm@openbsd.org [Tue, 26 Jan 2021 00:53:31 +0000 (00:53 +0000)] 
upstream: more ssh-agent refactoring

Allow confirm_key() to accept an additional reason suffix

Factor publickey userauth parsing out into its own function and allow
it to optionally return things it parsed out of the message to its
caller.

feedback/ok markus@

OpenBSD-Commit-ID: 29006515617d1aa2d8b85cd2bf667e849146477e

4 years agoupstream: make struct hostkeys public; I have no idea why I made it
djm@openbsd.org [Tue, 26 Jan 2021 00:51:30 +0000 (00:51 +0000)] 
upstream: make struct hostkeys public; I have no idea why I made it

opaque originally.

ok markus@

OpenBSD-Commit-ID: e50780b34d4bbe628d69b2405b024dd749d982f3

4 years agoupstream: move check_host_cert() from sshconnect,c to sshkey.c and
djm@openbsd.org [Tue, 26 Jan 2021 00:49:30 +0000 (00:49 +0000)] 
upstream: move check_host_cert() from sshconnect,c to sshkey.c and

refactor it to make it more generally usable and testable.

ok markus@

OpenBSD-Commit-ID: 536f489f5ff38808c1fa711ba58d4579b636f9e4

4 years agoupstream: use recallocarray to allocate the agent sockets table;
djm@openbsd.org [Tue, 26 Jan 2021 00:47:47 +0000 (00:47 +0000)] 
upstream: use recallocarray to allocate the agent sockets table;

also clear socket entries that are being marked as unused.

spinkle in some debug2() spam to make it easier to watch an agent
do its thing.

ok markus

OpenBSD-Commit-ID: 74582c8e82e96afea46f6c7b6813a429cbc75922

4 years agoupstream: factor out common code in the agent client
djm@openbsd.org [Tue, 26 Jan 2021 00:46:17 +0000 (00:46 +0000)] 
upstream: factor out common code in the agent client

Add a ssh_request_reply_decode() function that sends a message to
the agent, reads and parses a success/failure reply.
Use it for all requests that only expect success/failure

ok markus@

OpenBSD-Commit-ID: e0c1f4d5e6cfa525d62581e2b8de93be0cb85adb

4 years agoupstream: make ssh hostbased authentication send the signature
djm@openbsd.org [Mon, 25 Jan 2021 06:00:17 +0000 (06:00 +0000)] 
upstream: make ssh hostbased authentication send the signature

algorithm in its SSH2_MSG_USERAUTH_REQUEST packets instead of the key type.
This make HostbasedAcceptedAlgorithms do what it is supposed to - filter on
signature algorithm and not key type.

spotted with dtucker@ ok markus@

OpenBSD-Commit-ID: 25bffe19f0326972f5728170f7da81d5f45c78c6

4 years agoifdef new instance of sin6_scope_id
Darren Tucker [Sat, 23 Jan 2021 07:26:05 +0000 (18:26 +1100)] 
ifdef new instance of sin6_scope_id

Put inside HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID similar to
existing instance.  Should fix error on UnixWare 7.

4 years agoupstream: Fix long->int for convtime tests here too. Spotted by
dtucker@openbsd.org [Mon, 18 Jan 2021 11:43:34 +0000 (11:43 +0000)] 
upstream: Fix long->int for convtime tests here too. Spotted by

tobhe@.

OpenBSD-Regress-ID: a87094f5863312d00938afba771d25f788c849d0

4 years agoupstream: PubkeyAcceptedKeyTypes->PubkeyAcceptedAlgorithms
dtucker@openbsd.org [Fri, 22 Jan 2021 02:46:40 +0000 (02:46 +0000)] 
upstream: PubkeyAcceptedKeyTypes->PubkeyAcceptedAlgorithms

here too.

OpenBSD-Commit-ID: 3b64a640f8ce8c21d9314da9df7ce2420eefde3a

4 years agoupstream: Rename PubkeyAcceptedKeyTypes keyword to
dtucker@openbsd.org [Fri, 22 Jan 2021 02:44:58 +0000 (02:44 +0000)] 
upstream: Rename PubkeyAcceptedKeyTypes keyword to

PubkeyAcceptedAlgorithms. While the two were originally equivalent, this
actually specifies the signature algorithms that are accepted.  Some key
types (eg RSA) can be used by multiple algorithms (eg ssh-rsa, rsa-sha2-512)
so the old name is becoming increasingly misleading.  The old name is
retained as an alias. Prompted by bz#3253, help & ok djm@, man page help jmc@

OpenBSD-Commit-ID: 0346b2f73f54c43d4e001089759d149bfe402ca5

4 years agoupstream: Change types in convtime() unit test to int to match change
dtucker@openbsd.org [Fri, 15 Jan 2021 02:58:11 +0000 (02:58 +0000)] 
upstream: Change types in convtime() unit test to int to match change

its new type. Add tests for boundary conditions and fix convtime to work up
to INT_MAX. ok djm@

OpenBSD-Regress-ID: ba2b81e9a3257fff204b020affe85b604a44f97e

4 years agoupstream: Make output buffer larger to prevent potential truncation
dtucker@openbsd.org [Fri, 15 Jan 2021 04:31:25 +0000 (04:31 +0000)] 
upstream: Make output buffer larger to prevent potential truncation

warnings from compilers not smart enough to know the strftime calls won't
ever fully fill "to" and "from".  ok djm@

OpenBSD-Commit-ID: 83733f1b01b82da88b9dd1769475952aff10bdd7

4 years agoupstream: Change types in convtime() unit test to int to match
dtucker@openbsd.org [Fri, 15 Jan 2021 02:58:11 +0000 (02:58 +0000)] 
upstream: Change types in convtime() unit test to int to match

change its new type. Add tests for boundary conditions and fix convtime to
work up to INT_MAX. ok djm@

OpenBSD-Commit-ID: 01dc0475f1484ac2f47facdfcf9221f9472145de

4 years agoupstream: In waitfd(), when poll returns early we are subtracting
dtucker@openbsd.org [Fri, 15 Jan 2021 02:32:41 +0000 (02:32 +0000)] 
upstream: In waitfd(), when poll returns early we are subtracting

the elapsed time from the timeout each loop, so we only want to measure the
elapsed time the poll() in that loop, not since the start of the function.
Spotted by chris.xj.zhu at gmail.com, ok djm@

OpenBSD-Commit-ID: 199df060978ee9aa89b8041a3dfaf1bf7ae8dd7a

4 years agoupstream: Minor grammatical correction.
rob@openbsd.org [Thu, 14 Jan 2021 19:45:06 +0000 (19:45 +0000)] 
upstream: Minor grammatical correction.

OK jmc@

OpenBSD-Commit-ID: de0fad0581e212b2750751e479b79c18ff8cac02

4 years agoMerge Mac OS X targets into a single config.
Darren Tucker [Wed, 13 Jan 2021 07:00:57 +0000 (18:00 +1100)] 
Merge Mac OS X targets into a single config.

4 years agoAdd Mac OS X test targets.
Darren Tucker [Tue, 12 Jan 2021 08:22:47 +0000 (19:22 +1100)] 
Add Mac OS X test targets.

4 years agoRemove duplicated declaration in fatal.c .
anatasluo [Mon, 11 Jan 2021 13:51:39 +0000 (13:51 +0000)] 
Remove duplicated declaration in fatal.c .

4 years agoupstream: Correct spelling of persourcenetblocksize in config-dump
dtucker@openbsd.org [Mon, 11 Jan 2021 04:48:22 +0000 (04:48 +0000)] 
upstream: Correct spelling of persourcenetblocksize in config-dump

mode.

OpenBSD-Commit-ID: ecdc49e2b6bde6b6b0e52163d621831f6ac7b13d

4 years agoupstream: Adjust kexfuzz to addr.c/addrmatch.c split.
dtucker@openbsd.org [Sat, 9 Jan 2021 12:31:46 +0000 (12:31 +0000)] 
upstream: Adjust kexfuzz to addr.c/addrmatch.c split.

OpenBSD-Regress-ID: 1d8d23bb548078020be2fb52c4c643efb190f0eb

4 years agoupstream: Update unittests for addr.c/addrmatch.c split.
dtucker@openbsd.org [Sat, 9 Jan 2021 12:24:30 +0000 (12:24 +0000)] 
upstream: Update unittests for addr.c/addrmatch.c split.

OpenBSD-Regress-ID: de2b415fb7af084a91c6ef147a90482d8f771eef

4 years agoupstream: Change convtime() from returning long to returning int.
dtucker@openbsd.org [Mon, 11 Jan 2021 02:12:57 +0000 (02:12 +0000)] 
upstream: Change convtime() from returning long to returning int.

On platforms where sizeof(int) != sizeof(long), convtime could accept values
>MAX_INT which subsequently truncate when stored in an int during config
parsing.  bz#3250, ok djm@

OpenBSD-Commit-ID: 8fc932683d6b4660d52f50911d62bd6639c5db31

4 years agoupstream: add a comma to previous;
jmc@openbsd.org [Sat, 9 Jan 2021 12:51:12 +0000 (12:51 +0000)] 
upstream: add a comma to previous;

OpenBSD-Commit-ID: 9139433701c0aa86a0d3a6c7afe10d1c9c2e0869

4 years agoupstream: Add PerSourceMaxStartups and PerSourceNetBlockSize
dtucker@openbsd.org [Sat, 9 Jan 2021 12:10:02 +0000 (12:10 +0000)] 
upstream: Add PerSourceMaxStartups and PerSourceNetBlockSize

options which provide more fine grained MaxStartups limits.  Man page help
jmc@, feedback & ok djm@

OpenBSD-Commit-ID: e2f68664e3d02c0895b35aa751c48a2af622047b

4 years agoupstream: Move address handling functions out into their own file
dtucker@openbsd.org [Sat, 9 Jan 2021 11:58:50 +0000 (11:58 +0000)] 
upstream: Move address handling functions out into their own file

in order to reuse them for per-source maxstartups limiting.  Supplement with
some additional functions from djm's flowtools that we'll also need.  ok djm@
(as part of a larger diff).

OpenBSD-Commit-ID: e3e7d9ccc6c9b82e25cfef0ec83598e8e2327cbf

4 years agoAdd test against Graphene hardened malloc.
Darren Tucker [Fri, 8 Jan 2021 13:36:05 +0000 (00:36 +1100)] 
Add test against Graphene hardened malloc.

4 years agoupstream: make CheckHostIP default to 'no'. It doesn't provide any
djm@openbsd.org [Fri, 8 Jan 2021 04:49:13 +0000 (04:49 +0000)] 
upstream: make CheckHostIP default to 'no'. It doesn't provide any

perceptible value and makes it much harder for hosts to change host keys,
particularly ones that use IP-based load-balancing.

ok dtucker@

OpenBSD-Commit-ID: 0db98413e82074f78c7d46784b1286d08aee78f0

4 years agoRun tests with sudo for better coverage.
Darren Tucker [Fri, 8 Jan 2021 04:50:41 +0000 (15:50 +1100)] 
Run tests with sudo for better coverage.

4 years agoAdd Ubuntu 16.04 and 20.04 test targets.
Darren Tucker [Fri, 8 Jan 2021 03:26:32 +0000 (14:26 +1100)] 
Add Ubuntu 16.04 and 20.04 test targets.

4 years agoupstream: If a signature operation on a FIDO key fails with a
djm@openbsd.org [Fri, 8 Jan 2021 02:57:24 +0000 (02:57 +0000)] 
upstream: If a signature operation on a FIDO key fails with a

"incorrect PIN" reason and no PIN was initially requested from the user, then
request a PIN and retry the operation.

This smoothes over a few corner cases including FIDO devices that
require PINs for all hosted credentials, biometric FIDO devices that
fall back to requiring PIN when reading the biometric failed, devices
that don't implement reading credProtect status for downloaded keys
and probably a few more cases that I haven't though of yet.

ok dtucker@

OpenBSD-Commit-ID: 176db8518933d6a5bbf81a2e3cf62447158dc878

4 years agoupstream: don't try to use timespeccmp(3) directly as a qsort(3)
djm@openbsd.org [Fri, 8 Jan 2021 02:44:14 +0000 (02:44 +0000)] 
upstream: don't try to use timespeccmp(3) directly as a qsort(3)

comparison function - it returns 0/1 and not the -1/0/1 that qsort expectes.

fixes sftp "ls -ltr" under some circumstances.

Based on patch by Masahiro Matsuya via bz3248.

OpenBSD-Commit-ID: 65b5e9f18bb0d10573868c3516de6e5170adb163

4 years agoupstream: Update the sntrup761 creation script and generated code:
dtucker@openbsd.org [Fri, 8 Jan 2021 02:33:13 +0000 (02:33 +0000)] 
upstream: Update the sntrup761 creation script and generated code:

- remove unneeded header files and typedefs and rely on crypto_api.h  - add
defines to map types used to the crypto_api ones instead of typedefs.  This
 prevents typedef name collisions in -portable.  - remove CRYPTO_NAMESPACE
entirely instead of making it a no-op  - delete unused functions and make the
remaining ones that aren't exported static.

ok djm@

OpenBSD-Commit-ID: 7b9d0cf3acd5a3c1091da8afe00c904d38cf5783

4 years agoupstream: mention that DisableForwarding is valid in a sshd_config
djm@openbsd.org [Fri, 8 Jan 2021 02:19:24 +0000 (02:19 +0000)] 
upstream: mention that DisableForwarding is valid in a sshd_config

Match block reported by Fredrik Eriksson in bz3239

OpenBSD-Commit-ID: 3a71c3d84b597f5e43e4b40d5232797daf0993f6