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

4 years agoupstream: estructure sntrup761.sh to process all files in a single
dtucker@openbsd.org [Mon, 4 Jan 2021 21:58:58 +0000 (21:58 +0000)] 
upstream: estructure sntrup761.sh to process all files in a single

list, which will make it easier to reorder.  Re-inline int32_MINMAX.  ok
tobhe@

OpenBSD-Commit-ID: d145c6c19b08bb93c9e14bfaa7af589d90f144c0

4 years agoupstream: Prevent redefinition of `crypto_int32' error with gcc3.
tobhe@openbsd.org [Sun, 3 Jan 2021 18:05:21 +0000 (18:05 +0000)] 
upstream: Prevent redefinition of `crypto_int32' error with gcc3.

Fixes compilation on luna88k.

Feedback millert@
Found by and ok aoyama@

OpenBSD-Commit-ID: f305ddfe575a26cc53431af3fde3f4aeebed9ba6

4 years agoUndef int32 after sort routines.
Darren Tucker [Fri, 1 Jan 2021 11:00:49 +0000 (22:00 +1100)] 
Undef int32 after sort routines.

This prevents typedef'ing crypto_int32 twice, in sntrup761.c and
crypto_api.h, which some compilers (at least some GCCs) don't accept.

4 years agofix: missing pieces of previous commit
Damien Miller [Thu, 31 Dec 2020 01:47:22 +0000 (12:47 +1100)] 
fix: missing pieces of previous commit

4 years agoupstream: Use int64_t for intermediate values in int32_MINMAX to
tobhe@openbsd.org [Wed, 30 Dec 2020 14:13:28 +0000 (14:13 +0000)] 
upstream: Use int64_t for intermediate values in int32_MINMAX to

prevent signed 32-bit integer overflow.

Found by and ok djm@
ok markus@

OpenBSD-Commit-ID: 4f0704768e34cf45fdd792bac4011c6971881bb3

4 years agoadapt KEX fuzzer to PQ kex change
Damien Miller [Tue, 29 Dec 2020 01:40:54 +0000 (12:40 +1100)] 
adapt KEX fuzzer to PQ kex change

4 years agoupstream: Adapt to replacement of
djm@openbsd.org [Tue, 29 Dec 2020 01:02:15 +0000 (01:02 +0000)] 
upstream: Adapt to replacement of

sntrup4591761x25519-sha512@tinyssh.org with
sntrup761x25519-sha512@openssh.com.

Also test sntrup761x25519-sha512@openssh.com in unittests/kex

OpenBSD-Regress-ID: cfa3506b2b077a9cac1877fb521efd2641b6030c

4 years agoupstream: Update/replace the experimental post-quantim hybrid key
djm@openbsd.org [Tue, 29 Dec 2020 00:59:15 +0000 (00:59 +0000)] 
upstream: Update/replace the experimental post-quantim hybrid key

exchange method based on Streamlined NTRU Prime (coupled with X25519).

The previous sntrup4591761x25519-sha512@tinyssh.org method is
replaced with sntrup761x25519-sha512@openssh.com. Per the authors,
sntrup4591761 was replaced almost two years ago by sntrup761.

The sntrup761 implementaion, like sntrup4591761 before it, is public
domain code extracted from the SUPERCOP cryptography benchmark
suite (https://bench.cr.yp.to/supercop.html).

Thanks for Daniel J Bernstein for guidance on algorithm selection.
Patch from Tobias Heider; feedback & ok markus@ and myself

(note this both the updated method and the one that it replaced are
disabled by default)

OpenBSD-Commit-ID: 2bf582b772d81ee24e911bb6f4b2aecfd39338ae

4 years agoupstream: tweak the description of KnownHostsCommand in ssh_conf.5,
jmc@openbsd.org [Tue, 22 Dec 2020 07:40:26 +0000 (07:40 +0000)] 
upstream: tweak the description of KnownHostsCommand in ssh_conf.5,

and add entries for it to the -O list in scp.1 and sftp.1;

ok djm

OpenBSD-Commit-ID: aba31ebea03f38f8d218857f7ce16a500c3e4aff

4 years agowhitespace at EOL
Damien Miller [Tue, 22 Dec 2020 08:43:55 +0000 (19:43 +1100)] 
whitespace at EOL

4 years agowhitespace at EOL
Damien Miller [Tue, 22 Dec 2020 08:42:37 +0000 (19:42 +1100)] 
whitespace at EOL

4 years agoImprove AIX text.
Darren Tucker [Tue, 22 Dec 2020 08:21:26 +0000 (19:21 +1100)] 
Improve AIX text.

4 years agoInclude stdio.h for FILE in misc.h.
Darren Tucker [Tue, 22 Dec 2020 07:56:54 +0000 (18:56 +1100)] 
Include stdio.h for FILE in misc.h.

Fixes build on at least OpenBSD.

4 years agoensure $LOGNAME is set in tests
Damien Miller [Tue, 22 Dec 2020 07:31:50 +0000 (18:31 +1100)] 
ensure $LOGNAME is set in tests

4 years agoupstream: more detail for failing tests
djm@openbsd.org [Tue, 22 Dec 2020 06:47:24 +0000 (06:47 +0000)] 
upstream: more detail for failing tests

OpenBSD-Regress-ID: c68c0e5a521cad7e7f68e54c54ebf86d6c10ee1d

4 years agoupstream: regress test for KnownHostsCommand
djm@openbsd.org [Tue, 22 Dec 2020 06:03:36 +0000 (06:03 +0000)] 
upstream: regress test for KnownHostsCommand

OpenBSD-Regress-ID: ffc77464320b6dabdcfa0a72e0df02659233a38a

4 years agoupstream: Remove lines accidentally left behind in the ProxyJump
tb@openbsd.org [Tue, 22 Dec 2020 03:05:31 +0000 (03:05 +0000)] 
upstream: Remove lines accidentally left behind in the ProxyJump

parsing fix r1.345.

ok djm

OpenBSD-Commit-ID: fe767c108c8117bea33767b080ff62eef2c55f5c

4 years agoupstream: add a ssh_config KnownHostsCommand that allows the client
djm@openbsd.org [Tue, 22 Dec 2020 00:15:22 +0000 (00:15 +0000)] 
upstream: add a ssh_config KnownHostsCommand that allows the client

to obtain known_hosts data from a command in addition to the usual files.

The command accepts bunch of %-expansions, including details of the
connection and the offered server host key. Note that the command may
be invoked up to three times per connection (see the manpage for
details).

ok markus@

OpenBSD-Commit-ID: 2433cff4fb323918ae968da6ff38feb99b4d33d0

4 years agoupstream: move subprocess() from auth.c to misc.c
djm@openbsd.org [Tue, 22 Dec 2020 00:12:22 +0000 (00:12 +0000)] 
upstream: move subprocess() from auth.c to misc.c

make privilege dropping optional but allow it via callbacks (to avoid
need to link uidswap.c everywhere)

add some other flags (keep environment, disable strict path safety check)
that make this more useful for client-side use.

feedback & ok markus@

OpenBSD-Commit-ID: a80ea9fdcc156f1a18e9c166122c759fae1637bf

4 years agoupstream: Remove explicit rijndael-cbc@lysator.liu.se test since the
dtucker@openbsd.org [Mon, 21 Dec 2020 22:48:41 +0000 (22:48 +0000)] 
upstream: Remove explicit rijndael-cbc@lysator.liu.se test since the

cipher was removed.

OpenBSD-Regress-ID: aa93cddb4ecd9bc21446a79008a1a53050e64f17

4 years agoupstream: Remove the pre-standardization cipher
dtucker@openbsd.org [Mon, 21 Dec 2020 11:09:32 +0000 (11:09 +0000)] 
upstream: Remove the pre-standardization cipher

rijndael-cbc@lysator.liu.se. It is an alias for aes256-cbc which was
standardized in RFC4253 (2006), has been deprecated and disabled by default
since OpenSSH 7.2 (2016) and was only briefly documented in ssh.1 in 2001.

This will reduce the amount of work the cipher/kex regression tests need
to do by a little bit.  ok markus@ djm@

OpenBSD-Commit-ID: fb460acc18290a998fd70910b19c29b4e4f199ad

4 years agoupstream: properly fix ProxyJump parsing; Thanks to tb@ for
djm@openbsd.org [Mon, 21 Dec 2020 09:19:53 +0000 (09:19 +0000)] 
upstream: properly fix ProxyJump parsing; Thanks to tb@ for

pointing out my error (parse_ssh_uri() can return -1/0/1, that I missed).
Reported by Raf Czlonka via bugs@

ok tb@

OpenBSD-Commit-ID: a2991a3794bcaf1ca2b025212cce11cdb5f6b7d6

4 years agoupstream: adapt to API change in hostkeys_foreach()/load_hostkeys()
djm@openbsd.org [Mon, 21 Dec 2020 01:31:06 +0000 (01:31 +0000)] 
upstream: adapt to API change in hostkeys_foreach()/load_hostkeys()

OpenBSD-Regress-ID: dcb468514f32da49a446372453497dc6eeafdbf3

4 years agoupstream: few more things needs match.c and addrmatch.c now that
djm@openbsd.org [Fri, 16 Oct 2020 14:02:24 +0000 (14:02 +0000)] 
upstream: few more things needs match.c and addrmatch.c now that

log.c calls match_pattern_list()

OpenBSD-Regress-ID: f7c95c76b150d0aeb00a67858b9579b7d1b2db74

4 years agoPull in missing rev 1.2.
Darren Tucker [Mon, 21 Dec 2020 03:02:56 +0000 (14:02 +1100)] 
Pull in missing rev 1.2.

4 years agoupstream: plumb ssh_conn_info through to sshconnect.c; feedback/ok
djm@openbsd.org [Sun, 20 Dec 2020 23:40:19 +0000 (23:40 +0000)] 
upstream: plumb ssh_conn_info through to sshconnect.c; feedback/ok

markus@

OpenBSD-Commit-ID: e8d14a09cda3f1dc55df08f8a4889beff74e68b0

4 years agoupstream: allow UserKnownHostsFile=none; feedback and ok markus@
djm@openbsd.org [Sun, 20 Dec 2020 23:38:00 +0000 (23:38 +0000)] 
upstream: allow UserKnownHostsFile=none; feedback and ok markus@

OpenBSD-Commit-ID: c46d515eac94a35a1d50d5fd71c4b1ca53334b48

4 years agoupstream: load_hostkeys()/hostkeys_foreach() variants for FILE*
djm@openbsd.org [Sun, 20 Dec 2020 23:36:51 +0000 (23:36 +0000)] 
upstream: load_hostkeys()/hostkeys_foreach() variants for FILE*

Add load_hostkeys_file() and hostkeys_foreach_file() that accept a
FILE* argument instead of opening the file directly.

Original load_hostkeys() and hostkeys_foreach() are implemented using
these new interfaces.

Add a u_int note field to the hostkey_entry and hostkey_foreach_line
structs that is passed directly from the load_hostkeys() and
hostkeys_foreach() call. This is a lightweight way to annotate results
between different invocations of load_hostkeys().

ok markus@

OpenBSD-Commit-ID: 6ff6db13ec9ee4edfa658b2c38baad0f505d8c20

4 years agoupstream: Print client kem key with correct length.
tobhe@openbsd.org [Sat, 19 Dec 2020 22:09:21 +0000 (22:09 +0000)] 
upstream: Print client kem key with correct length.

ok markus@

OpenBSD-Commit-ID: 91689e14a4fc6c270e265a32d1c8faba63a45755

4 years agoupstream: fix possible error("%s", NULL) on error paths
djm@openbsd.org [Thu, 17 Dec 2020 23:28:50 +0000 (23:28 +0000)] 
upstream: fix possible error("%s", NULL) on error paths

OpenBSD-Commit-ID: 0b3833c2cb985453ecca1d76803ebb8f3b736a11

4 years agoupstream: refactor client percent_expand() argument passing;
djm@openbsd.org [Thu, 17 Dec 2020 23:26:11 +0000 (23:26 +0000)] 
upstream: refactor client percent_expand() argument passing;

consolidate the common arguments into a single struct and pass that around
instead of using a bunch of globals. ok markus@

OpenBSD-Commit-ID: 035e6d7ca9145ad504f6af5a021943f1958cd19b

4 years agoupstream: prepare readconf.c for fuzzing; remove fatal calls and
djm@openbsd.org [Thu, 17 Dec 2020 23:10:27 +0000 (23:10 +0000)] 
upstream: prepare readconf.c for fuzzing; remove fatal calls and

fix some (one-off) memory leaks; ok markus@

OpenBSD-Commit-ID: 91c6aec57b0e7aae9190de188e9fe8933aad5ec5

4 years agoupstream: use _PATH_SSH_USER_DIR instead of hardcoded .ssh in path
djm@openbsd.org [Mon, 14 Dec 2020 03:13:12 +0000 (03:13 +0000)] 
upstream: use _PATH_SSH_USER_DIR instead of hardcoded .ssh in path

OpenBSD-Commit-ID: 5c1048468813107baa872f5ee33ba51623630e01

4 years agobasic KEX fuzzer; adapted from Markus' unittest
Damien Miller [Fri, 4 Dec 2020 03:01:27 +0000 (14:01 +1100)] 
basic KEX fuzzer; adapted from Markus' unittest

4 years agouse options that work with recent clang
Damien Miller [Fri, 4 Dec 2020 02:57:43 +0000 (13:57 +1100)] 
use options that work with recent clang

4 years agoupstream: shuffle a few utility functions into sftp-client.c; from
djm@openbsd.org [Fri, 4 Dec 2020 02:41:10 +0000 (02:41 +0000)] 
upstream: shuffle a few utility functions into sftp-client.c; from

Jakub Jelen

OpenBSD-Commit-ID: fdeb1aae1f6149b193f12cd2af158f948c514a2a

4 years agoupstream: make ssh_free(NULL) a no-op
djm@openbsd.org [Fri, 4 Dec 2020 02:29:56 +0000 (02:29 +0000)] 
upstream: make ssh_free(NULL) a no-op

OpenBSD-Commit-ID: 42cb285d94789cefe6608db89c63040ab0a80fa0

4 years agoupstream: memleak of DH public bignum; found with libfuzzer
djm@openbsd.org [Fri, 4 Dec 2020 02:29:25 +0000 (02:29 +0000)] 
upstream: memleak of DH public bignum; found with libfuzzer

OpenBSD-Commit-ID: 0e913b542c3764b100b1571fdb0d0e5cc086fe97

4 years agoupstream: fix minor memleak of kex->hostkey_alg on rekex
djm@openbsd.org [Fri, 4 Dec 2020 02:27:57 +0000 (02:27 +0000)] 
upstream: fix minor memleak of kex->hostkey_alg on rekex

OpenBSD-Commit-ID: 2c3969c74966d4ccdfeff5e5f0df0791919aef50

4 years agoupstream: typos: s/hex/kex/ in error messages
djm@openbsd.org [Fri, 4 Dec 2020 02:27:08 +0000 (02:27 +0000)] 
upstream: typos: s/hex/kex/ in error messages

OpenBSD-Commit-ID: 43a026c9571dd779ec148de1829cf5a6b6651905

4 years agoupstream: make program name be const
djm@openbsd.org [Fri, 4 Dec 2020 02:25:13 +0000 (02:25 +0000)] 
upstream: make program name be const

OpenBSD-Commit-ID: ece25680ec637fdf20502721ccb0276691df5384

4 years agoupstream: Ignore comments at the end of config lines in ssh_config,
dtucker@openbsd.org [Mon, 30 Nov 2020 05:36:39 +0000 (05:36 +0000)] 
upstream: Ignore comments at the end of config lines in ssh_config,

similar to what we already do for sshd_config.  bz#2320, with & ok djm@

OpenBSD-Commit-ID: bdbf9fc5bc72b1a14266f5f61723ed57307a6db4

4 years agoupstream: Include cipher.h for declaration of cipher_by_name.
dtucker@openbsd.org [Sat, 28 Nov 2020 12:52:32 +0000 (12:52 +0000)] 
upstream: Include cipher.h for declaration of cipher_by_name.

OpenBSD-Commit-ID: ddfebbca03ca0e14e00bbad9d35f94b99655d032

4 years agoupstream: check result of strchr() against NULL rather than
djm@openbsd.org [Sat, 28 Nov 2020 03:27:59 +0000 (03:27 +0000)] 
upstream: check result of strchr() against NULL rather than

searched-for characters; from zhongjubin@huawei.com

OpenBSD-Commit-ID: e6f57de1d4a4d25f8db2d44e8d58d847e247a4fe

4 years agoupstream: Document ssh-keygen -Z, sanity check its argument earlier and
dtucker@openbsd.org [Fri, 27 Nov 2020 10:12:30 +0000 (10:12 +0000)] 
upstream: Document ssh-keygen -Z, sanity check its argument earlier and

provide a better error message if it's not correct.  Prompted by bz#2879, ok
djm@ jmc@

OpenBSD-Commit-ID: 484178a173e92230fb1803fb4f206d61f7b58005

4 years agoupstream: Set the specified TOS/DSCP for interactive use prior to
djm@openbsd.org [Fri, 27 Nov 2020 00:49:58 +0000 (00:49 +0000)] 
upstream: Set the specified TOS/DSCP for interactive use prior to

TCP connect. The connection phase of the SSH session is time-sensitive (due
to server side login grace periods) and is frequently interactive (e.g.
entering passwords). The ultimate interactive/bulk TOS/DSCP will be set after
authentication completes.

ok dtucker@

OpenBSD-Commit-ID: f31ab10d9233363a6d2c9996007083ba43a093f1

4 years agoupstream: clean up passing of struct passwd from monitor to preauth
djm@openbsd.org [Fri, 27 Nov 2020 00:37:10 +0000 (00:37 +0000)] 
upstream: clean up passing of struct passwd from monitor to preauth

privsep process. No longer copy entire struct w/ pointer addresses, but pass
remaining scalar fields explicitly,

Prompted by Yuichiro NAITO, feedback Thorsten Glaser; ok dtucker@

OpenBSD-Commit-ID: 9925df75a56732c43f3663e70dd15ff413ab3e53

4 years agoupstream: when loading PKCS#11 keys, include the key fingerprints
djm@openbsd.org [Sun, 22 Nov 2020 22:38:26 +0000 (22:38 +0000)] 
upstream: when loading PKCS#11 keys, include the key fingerprints

and provider/slot information in debug output.

OpenBSD-Commit-ID: 969a089575d0166a9a364a9901bb6a8d9b8a1431

4 years agoupstream: when mentioning that the host key has changed, don't
djm@openbsd.org [Sun, 22 Nov 2020 22:37:11 +0000 (22:37 +0000)] 
upstream: when mentioning that the host key has changed, don't

report the type because it is ambiguous as to whether it referred to the
known or new host key. bz3216; ok dtucker@

OpenBSD-Commit-ID: 2d5ce4a83dbcf44e340a572e361decad8aab7bad

4 years agoUse "=" not "==" in string test.
Darren Tucker [Wed, 25 Nov 2020 06:38:46 +0000 (17:38 +1100)] 
Use "=" not "==" in string test.

POSIX says "=" is string comparison and some shells (eg HP-UX) will
complain about "==".

4 years agoRestore correct flags during localtime_r check.
Darren Tucker [Fri, 20 Nov 2020 06:16:51 +0000 (17:16 +1100)] 
Restore correct flags during localtime_r check.

We were restoring the wrong thing CPPFLAGS (we used CFLAGS) for any
platform that doesn't have localtime_r.

4 years agoupstream: When doing an sftp recursive upload or download of a
dtucker@openbsd.org [Fri, 20 Nov 2020 03:16:56 +0000 (03:16 +0000)] 
upstream: When doing an sftp recursive upload or download of a

read-only directory, ensure that the directory is created with write and
execute permissions in the interim so that we can actually complete the
transfer, then set the directory permission as the final step.  (The execute
bit is only likely to be an issue with a non-POSIX server).  bz#3222, ok djm@

OpenBSD-Commit-ID: a82606212f2796e31f0e1af94a63355a7ad5d903

4 years agoAdd new pselect6_time64 syscall on ARM.
Darren Tucker [Fri, 20 Nov 2020 02:37:54 +0000 (13:37 +1100)] 
Add new pselect6_time64 syscall on ARM.

This is apparently needed on armhfp/armv7hl.  bz#3232, patch from
jjelen at redhat.com.

4 years agoupstream: Explicitly initialize all members of the
dtucker@openbsd.org [Fri, 20 Nov 2020 02:14:16 +0000 (02:14 +0000)] 
upstream: Explicitly initialize all members of the

find_by_key_ctx struct.  Initializing a single member should be enough
(the spec says the remainder should be initialized as per the static
rules) but some GCCs warn on this which prevents us testing with -Werror
on those.  ok deraadt@ djm@

OpenBSD-Commit-ID: 687126e60a27d30f02614760ef3c3ae4e8d6af28

4 years agoupstream: draft-ietf-secsh-architecture is now RFC4251.
dtucker@openbsd.org [Thu, 19 Nov 2020 23:05:05 +0000 (23:05 +0000)] 
upstream: draft-ietf-secsh-architecture is now RFC4251.

OpenBSD-Commit-ID: cb0bb58c2711fb5ed519507659be1dcf179ed403

4 years agoupstream: Specify that the KDF function is bcrypt. Based on github
dtucker@openbsd.org [Tue, 17 Nov 2020 11:23:58 +0000 (11:23 +0000)] 
upstream: Specify that the KDF function is bcrypt. Based on github

PR#214 from rafork, ok markus@, mdoc correction jmc@

OpenBSD-Commit-ID: d8f2853e7edbcd483f31b50da77ab80ffa18b4ef

4 years agoupstream: revert r1.341; it breaks ProxyJump; reported by sthen@
djm@openbsd.org [Sun, 15 Nov 2020 22:34:58 +0000 (22:34 +0000)] 
upstream: revert r1.341; it breaks ProxyJump; reported by sthen@

OpenBSD-Commit-ID: 6ac2f945b26cb86d936eed338f77861d6da8356a

4 years agoupstream: scrub keyboard-interactive authentication prompts coming
djm@openbsd.org [Fri, 13 Nov 2020 07:30:44 +0000 (07:30 +0000)] 
upstream: scrub keyboard-interactive authentication prompts coming

from the server through asmprintf() prior to display; suggested by and ok
dtucker@

OpenBSD-Commit-ID: 31fe93367645c37fbfe4691596bf6cf1e3972a58

4 years agoupstream: prefix keyboard interactive prompts with (user@host) to
djm@openbsd.org [Fri, 13 Nov 2020 04:53:12 +0000 (04:53 +0000)] 
upstream: prefix keyboard interactive prompts with (user@host) to

make it easier to determine which connection they are associated with in
cases like scp -3, ProxyJump, etc. bz#3224 ok dtucker

OpenBSD-Commit-ID: 67e6189b04b46c867662f8a6759cf3ecb5f59170

4 years agoRemove use of TIME_WITH_SYS_TIME.
Darren Tucker [Fri, 13 Nov 2020 06:56:11 +0000 (17:56 +1100)] 
Remove use of TIME_WITH_SYS_TIME.

It was only set by the recently removed AC_HEADER_TIME macro, replace
with simple inclusions of both sys/time.h and time.h.  Should prevent
mis-detection of struct timespec.

4 years agoRevert "detect Linux/X32 systems"
Damien Miller [Fri, 13 Nov 2020 03:20:43 +0000 (14:20 +1100)] 
Revert "detect Linux/X32 systems"

This reverts commit 5b56bd0affea7b02b540bdbc4d1d271b0e4fc885.

The approach used was incorrect; discussion in bz#3085

4 years agoSELinux has deprecated security_context_t
Damien Miller [Fri, 13 Nov 2020 02:22:15 +0000 (13:22 +1100)] 
SELinux has deprecated security_context_t

(it was only ever a char* anyway)