]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
4 years agoif unable to add a missing newline, fail
Jakub Jelen [Tue, 29 Sep 2020 10:02:45 +0000 (10:02 +0000)] 
if unable to add a missing newline, fail

SSH-Copy-ID-Upstream: 76b25e18f55499ea9edb4c4d6dc4a80bebc36d95

4 years agouse $AUTH_KEY_DIR, now that we have it
Philip Hands [Tue, 13 Oct 2020 12:12:58 +0000 (14:12 +0200)] 
use $AUTH_KEY_DIR, now that we have it

since that was a change made since jjelen's commit was written

also, quote the variables

SSH-Copy-ID-Upstream: 588cd8e5cbf95f3443d92b9ab27c5d73ceaf6616

4 years agorestorecon the correct directory
Jakub Jelen [Tue, 29 Sep 2020 10:00:01 +0000 (10:00 +0000)] 
restorecon the correct directory

if using different path for authorized_keys file

SSH-Copy-ID-Upstream: 791a3df47b48412c726bff6f7b1d190721e65d51

4 years agoupstream: s/PubkeyAcceptedKeyTypes/PubkeyAcceptedAlgorithms/
djm@openbsd.org [Thu, 25 Feb 2021 03:27:34 +0000 (03:27 +0000)] 
upstream: s/PubkeyAcceptedKeyTypes/PubkeyAcceptedAlgorithms/

OpenBSD-Regress-ID: 3dbc005fa29f69dc23d97e433b6dffed6fe7cb69

4 years agoupstream: Rename pubkeyacceptedkeytypes to pubkeyacceptedalgorithms in
dtucker@openbsd.org [Wed, 24 Feb 2021 23:12:35 +0000 (23:12 +0000)] 
upstream: Rename pubkeyacceptedkeytypes to pubkeyacceptedalgorithms in

test to match change to config-dump output.

OpenBSD-Regress-ID: 74c9a4ad50306be873d032819d5e55c24eb74d5d

4 years agoupstream: Put obsolete aliases for hostbasedalgorithms and
dtucker@openbsd.org [Wed, 24 Feb 2021 01:18:08 +0000 (01:18 +0000)] 
upstream: Put obsolete aliases for hostbasedalgorithms and

pubkeyacceptedalgorithms after their current names so that the config-dump
mode finds and uses the current names.  Spotted by Phil Pennock.

OpenBSD-Commit-ID: 5dd10e93cccfaff3aaaa09060c917adff04a9b15

4 years agoupstream: lots more s/key types/signature algorithms/ mostly in
djm@openbsd.org [Tue, 23 Feb 2021 21:55:08 +0000 (21:55 +0000)] 
upstream: lots more s/key types/signature algorithms/ mostly in

HostbasedAcceptedAlgorithms and HostKeyAlgorithms; prompted by Jakub Jelen

OpenBSD-Commit-ID: 3f719de4385b1a89e4323b2549c66aae050129cb

4 years agoupstream: Correct reference to signature algorithms as keys; from
djm@openbsd.org [Tue, 23 Feb 2021 21:50:18 +0000 (21:50 +0000)] 
upstream: Correct reference to signature algorithms as keys; from

Jakub Jelen

OpenBSD-Commit-ID: 36f7ecee86fc811aa0f8e21e7a872eee044b4be5

4 years agoAdd a couple more test VMs.
Darren Tucker [Tue, 23 Feb 2021 05:05:22 +0000 (16:05 +1100)] 
Add a couple more test VMs.

4 years agoValgrind test: split and move up list.
Darren Tucker [Sun, 21 Feb 2021 21:09:27 +0000 (08:09 +1100)] 
Valgrind test: split and move up list.

Since the valgrind test takes so long it approaches the limit allowed by
github, move it to the head of the list so it's the first one started and
split the longest tests out into a second instance that runs concurrently
with the first.

4 years agoupstream: warn when the user specifies a ForwardAgent path that does
djm@openbsd.org [Tue, 23 Feb 2021 00:05:31 +0000 (00:05 +0000)] 
upstream: warn when the user specifies a ForwardAgent path that does

not exist and exit if ExitOnForwardFailure is set; bz3264

OpenBSD-Commit-ID: 72f7875865e723e464c71bf8692e83110699bf26

4 years agoDisable rlimit sandbox, doesn't work with valgrind
Darren Tucker [Sat, 20 Feb 2021 02:34:02 +0000 (13:34 +1100)] 
Disable rlimit sandbox, doesn't work with valgrind

Only run regress tests, runing unit tests as well makes it run longer
than allowed y github.

4 years agoUpload valgrind logs on failure.
Darren Tucker [Sat, 20 Feb 2021 02:06:25 +0000 (13:06 +1100)] 
Upload valgrind logs on failure.

4 years agoRename "vm" to "os" in selfhosted to match c-cpp.
Darren Tucker [Fri, 19 Feb 2021 11:18:50 +0000 (22:18 +1100)] 
Rename "vm" to "os" in selfhosted to match c-cpp.

Should make it easier to share code or maybe merge at some point.

4 years agoUpload regress failure logs in c-cpp too.
Darren Tucker [Fri, 19 Feb 2021 11:15:22 +0000 (22:15 +1100)] 
Upload regress failure logs in c-cpp too.

4 years agoComment out Solaris 64bit PAM build...
Darren Tucker [Fri, 19 Feb 2021 11:13:36 +0000 (22:13 +1100)] 
Comment out Solaris 64bit PAM build...

until I can figure out why it's failing.

4 years agoActually run Valgrind tests.
Darren Tucker [Thu, 18 Feb 2021 23:20:17 +0000 (10:20 +1100)] 
Actually run Valgrind tests.

4 years agoAdd test against Valgrind.
Darren Tucker [Thu, 18 Feb 2021 23:16:56 +0000 (10:16 +1100)] 
Add test against Valgrind.

4 years agoAdd fbsd12 test target.
Darren Tucker [Thu, 18 Feb 2021 05:30:01 +0000 (16:30 +1100)] 
Add fbsd12 test target.

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