]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
4 years agoupstream: support for "cross"-loading files/directories, i.e.
djm@openbsd.org [Sat, 7 Aug 2021 00:02:41 +0000 (00:02 +0000)] 
upstream: support for "cross"-loading files/directories, i.e.

downloading from one SFTP server while simultaneously uploading to another.

feedback & ok markus@

OpenBSD-Commit-ID: 3982878e29d8df0fa4ddc502f5ff6126ac714235

4 years agoupstream: factor our SSH2_FXP_OPEN calls into their own function;
djm@openbsd.org [Sat, 7 Aug 2021 00:01:29 +0000 (00:01 +0000)] 
upstream: factor our SSH2_FXP_OPEN calls into their own function;

"looks fine" markus@

OpenBSD-Commit-ID: d3dea2153f08855c6d9dacc01973248944adeffb

4 years agoupstream: prepare for scp -3 implemented via sftp
djm@openbsd.org [Sat, 7 Aug 2021 00:00:33 +0000 (00:00 +0000)] 
upstream: prepare for scp -3 implemented via sftp

OpenBSD-Commit-ID: 194aac0dd87cb175334b71c2a30623a5ad55bb44

4 years agoupstream: Make diff invocation more portable.
dtucker@openbsd.org [Fri, 6 Aug 2021 09:00:18 +0000 (09:00 +0000)] 
upstream: Make diff invocation more portable.

POSIX does not require diff to have -N, so compare in both directions
with just -r, which should catch missing files in either directory.

OpenBSD-Regress-ID: 0e2ec8594556a6f369ed5a0a90c6806419b845f7

4 years agoupstream: regression test for scp -3
djm@openbsd.org [Wed, 4 Aug 2021 21:28:00 +0000 (21:28 +0000)] 
upstream: regression test for scp -3

OpenBSD-Regress-ID: b44375d125c827754a1f722ec6b6b75b634de05d

4 years agoupstream: Document "ProxyJump none". bz#3334.
dtucker@openbsd.org [Fri, 6 Aug 2021 05:04:42 +0000 (05:04 +0000)] 
upstream: Document "ProxyJump none". bz#3334.

OpenBSD-Commit-ID: f78cc6f55731f2cd35c3a41d5352ac1ee419eba7

4 years agoupstream: Allow for different (but POSIX compliant) behaviour of
dtucker@openbsd.org [Wed, 4 Aug 2021 01:34:55 +0000 (01:34 +0000)] 
upstream: Allow for different (but POSIX compliant) behaviour of

basename(3) and prevent a use-after-free in that case in the new sftp-compat
code.

POSIX allows basename(3) to either return a pointer to static storage
or modify the passed string and return a pointer to that.  OpenBSD does
the former and works as is, but on other platforms "filename" points
into "tmp" which was just freed.  This makes the freeing of tmp
consistent with the other variable in the loop.

Pinpointed by the -portable Valgrind regress test.  ok djm@ deraadt@

OpenBSD-Commit-ID: 750f3c19bd4440e4210e30dd5d7367386e833374

4 years agouse openbsd-compat glob.h is required
Damien Miller [Wed, 4 Aug 2021 01:05:11 +0000 (11:05 +1000)] 
use openbsd-compat glob.h is required

4 years agoMissing space between macro arg and punctuation.
Darren Tucker [Tue, 3 Aug 2021 11:03:23 +0000 (21:03 +1000)] 
Missing space between macro arg and punctuation.

From jmc@

4 years agoAvoid lines >80 chars. From jmc@
Darren Tucker [Tue, 3 Aug 2021 11:02:33 +0000 (21:02 +1000)] 
Avoid lines >80 chars.  From jmc@

4 years agoupstream: regression tests for scp SFTP protocol support; mostly by
djm@openbsd.org [Tue, 3 Aug 2021 01:05:24 +0000 (01:05 +0000)] 
upstream: regression tests for scp SFTP protocol support; mostly by

Jakub Jelen in GHPR#194 ok markus

OpenBSD-Regress-ID: 36f1458525bcb111741ec8547eaf58b13cddc715

4 years agoupstream: Treat doas with arguments as a valid SUDO variable.
anton@openbsd.org [Thu, 29 Jul 2021 15:34:09 +0000 (15:34 +0000)] 
upstream: Treat doas with arguments as a valid SUDO variable.

Allows one to specify SUDO="doas -n" which I do while running make regress.

ok dtucker@

OpenBSD-Regress-ID: 4fe5814b5010dbf0885500d703bea06048d11005

4 years agoupstream: support for using the SFTP protocol for file transfers in
djm@openbsd.org [Mon, 2 Aug 2021 23:38:27 +0000 (23:38 +0000)] 
upstream: support for using the SFTP protocol for file transfers in

scp, via a new "-M sftp" option. Marked as experimental for now.

Some corner-cases exist, in particular there is no attempt to
provide bug-compatibility with scp's weird "double shell" quoting
rules.

Mostly by Jakub Jelen in GHPR#194 with some tweaks by me. ok markus@
Thanks jmc@ for improving the scp.1 bits.

OpenBSD-Commit-ID: 6ce4c9157ff17b650ace571c9f7793d92874051c

4 years agoupstream: fix a formatting error and add some Xr; from debian at
jmc@openbsd.org [Fri, 30 Jul 2021 14:28:13 +0000 (14:28 +0000)] 
upstream: fix a formatting error and add some Xr; from debian at

helgefjell de

removed references to rlogin etc. as no longer relevant;
suggested by djm

ok djm dtucker

OpenBSD-Commit-ID: 3c431c303068d3aec5bb18573a0bd5e0cd77c5ae

4 years agoupstream: fix a formatting error and mark up known_hosts
jmc@openbsd.org [Fri, 30 Jul 2021 14:25:01 +0000 (14:25 +0000)] 
upstream: fix a formatting error and mark up known_hosts

consistently; issues reported by debian at helgefjell de

ok djm dtucker

OpenBSD-Commit-ID: a1fd8d21dc77f507685443832df0c9700481b0ce

4 years agoupstream: no need to talk about version 2 with the -Q option, so
jmc@openbsd.org [Wed, 28 Jul 2021 05:57:42 +0000 (05:57 +0000)] 
upstream: no need to talk about version 2 with the -Q option, so

rewrite the text to read better;

issue reported by debian at helgefjell de
ok djm dtucker

OpenBSD-Commit-ID: 59fe2e8219c37906740ad062e0fdaea487dbe9cf

4 years agoupstream: word fix; reported by debian at helgefjell de
jmc@openbsd.org [Tue, 27 Jul 2021 14:28:46 +0000 (14:28 +0000)] 
upstream: word fix; reported by debian at helgefjell de

OpenBSD-Commit-ID: 0c6fd22142422a25343c5bd1a618f31618f41ece

4 years agoupstream: standardise the grammar in the options list; issue
jmc@openbsd.org [Tue, 27 Jul 2021 14:14:25 +0000 (14:14 +0000)] 
upstream: standardise the grammar in the options list; issue

reported by debian at helgefjell de

ok dtucker djm

OpenBSD-Commit-ID: 7ac15575045d82f4b205a42cc7d5207fe4c3f8e6

4 years agoCheck for RLIMIT_NOFILE before trying to use it.
Darren Tucker [Mon, 2 Aug 2021 08:56:29 +0000 (18:56 +1000)] 
Check for RLIMIT_NOFILE before trying to use it.

4 years agolastenv is only used in setenv.
Darren Tucker [Tue, 27 Jul 2021 07:45:34 +0000 (17:45 +1000)] 
lastenv is only used in setenv.

Prevents an unused variable warning on platforms that have setenv but
not unsetenv.

4 years agoMove SUDO to "make test" command line.
Darren Tucker [Mon, 26 Jul 2021 02:45:30 +0000 (12:45 +1000)] 
Move SUDO to "make test" command line.

Environment variables don't get passed by vmrun, so move to command
line.

4 years agoSet SUDO for tests and cleanup.
Darren Tucker [Sun, 25 Jul 2021 13:26:36 +0000 (23:26 +1000)] 
Set SUDO for tests and cleanup.

4 years agoPass OPENSSL=no to make tests too.
Darren Tucker [Sun, 25 Jul 2021 12:37:55 +0000 (22:37 +1000)] 
Pass OPENSSL=no to make tests too.

4 years agoupstream: Skip unit and makefile-based key conversion tests when
dtucker@openbsd.org [Sun, 25 Jul 2021 12:27:37 +0000 (12:27 +0000)] 
upstream: Skip unit and makefile-based key conversion tests when

we're building with OPENSSL=no.

OpenBSD-Regress-ID: 20455ed9a977c93f846059d1fcb48e29e2c8d732

4 years agoupstream: Replace OPENSSL as the variable that points to the
dtucker@openbsd.org [Sun, 25 Jul 2021 12:13:03 +0000 (12:13 +0000)] 
upstream: Replace OPENSSL as the variable that points to the

openssl binary with OPENSSL_BIN.  This will allow us to use the OPENSSL
variable from mk.conf or the make(1) command line indicating if we're
building with our without OpenSSL, and ultimately get the regress tests
working in the OPENSSL=no configuration.

OpenBSD-Regress-ID: 2d788fade3264d7803e5b54cae8875963f688c4e

4 years agoupstream: Skip RFC4716 format import and export tests when built
dtucker@openbsd.org [Sat, 24 Jul 2021 02:57:28 +0000 (02:57 +0000)] 
upstream: Skip RFC4716 format import and export tests when built

without OpenSSL.

OpenBSD-Regress-ID: d2c2d5d38c1acc2b88cc99cfe00a2eb8bb39dfa4

4 years agoupstream: Don't omit ssh-keygen -y from usage when built without
dtucker@openbsd.org [Sat, 24 Jul 2021 02:51:14 +0000 (02:51 +0000)] 
upstream: Don't omit ssh-keygen -y from usage when built without

OpenSSL.  It is actually available, albeit only for ed25519 keys.

OpenBSD-Commit-ID: 7a254c33d0e6a55c30c6b016a8d298d3cb7a7674

4 years agoupstream: Exclude key conversion options from usage when built
dtucker@openbsd.org [Sat, 24 Jul 2021 02:08:13 +0000 (02:08 +0000)] 
upstream: Exclude key conversion options from usage when built

without OpenSSL since those are not available, similar to what we currently
do with the moduli screening options.  We can also use this to skip the
conversion regression tests in this case.

OpenBSD-Commit-ID: 3c82caa398cf99cd4518c23bba5a2fc66b16bafe

4 years agoTest OpenBSD upstream with and without OpenSSL.
Darren Tucker [Sat, 24 Jul 2021 03:02:51 +0000 (13:02 +1000)] 
Test OpenBSD upstream with and without OpenSSL.

4 years agoupstream: test for first-match-wins in authorized_keys environment=
djm@openbsd.org [Sat, 24 Jul 2021 01:54:23 +0000 (01:54 +0000)] 
upstream: test for first-match-wins in authorized_keys environment=

options

OpenBSD-Regress-ID: 1517c90276fe84b5dc5821c59f88877fcc34c0e8

4 years agoupstream: Simplify keygen-convert by using $SSH_KEYTYPES directly.
dtucker@openbsd.org [Fri, 23 Jul 2021 05:53:02 +0000 (05:53 +0000)] 
upstream: Simplify keygen-convert by using $SSH_KEYTYPES directly.

OpenBSD-Regress-ID: cdbe408ec3671ea9ee9b55651ee551370d2a4108

4 years agoupstream: don't leak environment= variable when it is not the first
djm@openbsd.org [Sat, 24 Jul 2021 01:55:19 +0000 (01:55 +0000)] 
upstream: don't leak environment= variable when it is not the first

match

OpenBSD-Commit-ID: 7fbdc3dfe0032deaf003fd937eeb4d434ee4efe0

4 years agoupstream: punctuation;
jmc@openbsd.org [Fri, 23 Jul 2021 06:01:17 +0000 (06:01 +0000)] 
upstream: punctuation;

OpenBSD-Commit-ID: 64be152e378c45975073ab1c07e0db7eddd15806

4 years agoupstream: mention in comment that read_passphrase(..., RP_ALLOW_STDIN)
djm@openbsd.org [Fri, 23 Jul 2021 05:56:47 +0000 (05:56 +0000)] 
upstream: mention in comment that read_passphrase(..., RP_ALLOW_STDIN)

will try to use askpass first. bz3314

convert a couple of debug() -> debug_f() while here

OpenBSD-Commit-ID: c7e812aebc28fcc5db06d4710e0f73613dee545c

4 years agoupstream: Test conversion of ed25519 and ecdsa keys too.
dtucker@openbsd.org [Fri, 23 Jul 2021 05:07:16 +0000 (05:07 +0000)] 
upstream: Test conversion of ed25519 and ecdsa keys too.

OpenBSD-Regress-ID: 3676d2d00e58e0d6d37f2878f108cc2b83bbe4bb

4 years agoupstream: Add test for exporting pubkey from a passphrase-protected
dtucker@openbsd.org [Fri, 23 Jul 2021 04:56:21 +0000 (04:56 +0000)] 
upstream: Add test for exporting pubkey from a passphrase-protected

private key.

OpenBSD-Regress-ID: da99d93e7b235fbd5b5aaa01efc411225e6ba8ac

4 years agoupstream: regression test for time-limited signature keys
djm@openbsd.org [Fri, 23 Jul 2021 03:54:55 +0000 (03:54 +0000)] 
upstream: regression test for time-limited signature keys

OpenBSD-Regress-ID: 2a6f3bd900dbee0a3c96f1ff23e032c93ab392bc

4 years agoupstream: note successful authentication method in final "Authenticated
djm@openbsd.org [Fri, 23 Jul 2021 05:24:02 +0000 (05:24 +0000)] 
upstream: note successful authentication method in final "Authenticated

to ..." message and partial auth success messages (all at LogLevel=verbose)
ok dtucker@

OpenBSD-Commit-ID: 06834b89ceb89f8f16c5321d368a66c08f441984

4 years agoupstream: Add a ForkAfterAuthentication ssh_config(5) counterpart
djm@openbsd.org [Fri, 23 Jul 2021 04:04:52 +0000 (04:04 +0000)] 
upstream: Add a ForkAfterAuthentication ssh_config(5) counterpart

to the ssh(1) -f flag. Last part of GHPR231 from Volker Diels-Grabsch. ok
dtucker

OpenBSD-Commit-ID: b18aeda12efdebe2093d55263c90fe4ea0bce0d3

4 years agoupstream: Add a StdinNull directive to ssh_config(5) that allows
djm@openbsd.org [Fri, 23 Jul 2021 04:00:59 +0000 (04:00 +0000)] 
upstream: Add a StdinNull directive to ssh_config(5) that allows

the config file to do the same thing as -n does on the ssh(1) commandline.
Patch from Volker Diels-Grabsch via GHPR231; ok dtucker

OpenBSD-Commit-ID: 66ddf3f15c76796d4dcd22ff464aed1edd62468e

4 years agoupstream: make authorized_keys environment="..." directives
djm@openbsd.org [Fri, 23 Jul 2021 03:57:20 +0000 (03:57 +0000)] 
upstream: make authorized_keys environment="..." directives

first-match-wins and more strictly limit their maximum number; prompted by
OOM reported by OSS-fuzz (35470).

feedback and ok dtucker@

OpenBSD-Commit-ID: 01f63fc10dcd995e7aed9c378ad879161af83121

4 years agoupstream: Let allowed signers files used by ssh-keygen(1)
djm@openbsd.org [Fri, 23 Jul 2021 03:37:52 +0000 (03:37 +0000)] 
upstream: Let allowed signers files used by ssh-keygen(1)

signatures support key lifetimes, and allow the verification mode to specify
a signature time to check at. This is intended for use by git to support
signing objects using ssh keys. ok dtucker@

OpenBSD-Commit-ID: 3e2c67b7dcd94f0610194d1e8e4907829a40cf31

4 years agoupstream: Use SUDO when setting up hostkey.
dtucker@openbsd.org [Mon, 19 Jul 2021 08:48:33 +0000 (08:48 +0000)] 
upstream: Use SUDO when setting up hostkey.

OpenBSD-Regress-ID: 990cf4481cab8dad62e90818a9b4b36c533851a7

4 years agoupstream: Increase time margin for rekey tests. Should help
dtucker@openbsd.org [Mon, 19 Jul 2021 05:08:54 +0000 (05:08 +0000)] 
upstream: Increase time margin for rekey tests. Should help

reliability on very heavily loaded hosts.

OpenBSD-Regress-ID: 4c28a0fce3ea89ebde441d7091464176e9730533

4 years agoAdd sshfp-connect.sh file missed in previous.
Darren Tucker [Mon, 19 Jul 2021 03:47:51 +0000 (13:47 +1000)] 
Add sshfp-connect.sh file missed in previous.

4 years agoupstream: Ensure that all returned SSHFP records for the specified host
dtucker@openbsd.org [Mon, 19 Jul 2021 03:13:28 +0000 (03:13 +0000)] 
upstream: Ensure that all returned SSHFP records for the specified host

name and hostkey type match instead of only one.  While there, simplify the
code somewhat and add some debugging.  Based on discussion in bz#3322, ok
djm@.

OpenBSD-Commit-ID: 0a6a0a476eb7f9dfe8fe2c05a1a395e3e9b22ee4

4 years agoupstream: Id sync only, -portable already has this.
dtucker@openbsd.org [Mon, 19 Jul 2021 02:21:50 +0000 (02:21 +0000)] 
upstream: Id sync only, -portable already has this.

Put dh_set_moduli_file call inside ifdef WITH_OPENSSL. Fixes
build with OPENSSL=no.

OpenBSD-Commit-ID: af54abbebfb12bcde6219a44d544e18204defb15

4 years agoupstream: Add test for host key verification via SSHFP records. This
dtucker@openbsd.org [Mon, 19 Jul 2021 02:46:34 +0000 (02:46 +0000)] 
upstream: Add test for host key verification via SSHFP records. This

requires some external setup to operate so is disabled by default (see
comments in sshfp-connect.sh).

OpenBSD-Regress-ID: c52c461bd1df3a803d17498917d156ef64512fd9

4 years agoupstream: Add ed25519 key and test SSHFP export of it. Only test
dtucker@openbsd.org [Mon, 19 Jul 2021 02:29:28 +0000 (02:29 +0000)] 
upstream: Add ed25519 key and test SSHFP export of it. Only test

RSA SSHFP export if we have RSA functionality compiled in.

OpenBSD-Regress-ID: b4ff5181b8c9a5862e7f0ecdd96108622333a9af

4 years agoupstream: Group keygen tests together.
dtucker@openbsd.org [Mon, 19 Jul 2021 00:16:26 +0000 (00:16 +0000)] 
upstream: Group keygen tests together.

OpenBSD-Regress-ID: 07e2d25c527bb44f03b7c329d893a1f2d6c5c40c

4 years agoupstream: Add test for ssh-keygen printing of SSHFP records.
dtucker@openbsd.org [Sun, 18 Jul 2021 23:10:10 +0000 (23:10 +0000)] 
upstream: Add test for ssh-keygen printing of SSHFP records.

OpenBSD-Regress-ID: fde9566b56eeb980e149bbe157a884838507c46b

4 years agoupstream: wrap some long lines
djm@openbsd.org [Sat, 17 Jul 2021 00:38:11 +0000 (00:38 +0000)] 
upstream: wrap some long lines

OpenBSD-Commit-ID: 4f5186b1466656762dae37d3e569438d900c350d

4 years agoupstream: fix sftp on ControlPersist connections, broken by recent
djm@openbsd.org [Sat, 17 Jul 2021 00:36:53 +0000 (00:36 +0000)] 
upstream: fix sftp on ControlPersist connections, broken by recent

SessionType change; spotted by sthen@

OpenBSD-Commit-ID: 4c5ddc5698790ae6ff50d2a4f8f832f0eeeaa234

4 years agoupstream: Explicitly check for and start time-based rekeying in the
djm@openbsd.org [Fri, 16 Jul 2021 09:00:23 +0000 (09:00 +0000)] 
upstream: Explicitly check for and start time-based rekeying in the

client and server mainloops.

Previously the rekey timeout could expire but rekeying would not start
until a packet was sent or received. This could cause us to spin in
select() on the rekey timeout if the connection was quiet.

ok markus@

OpenBSD-Commit-ID: 4356cf50d7900f3df0a8f2117d9e07c91b9ff987

4 years agoupstream: reorder SessionType; ok djm
jmc@openbsd.org [Wed, 14 Jul 2021 06:46:38 +0000 (06:46 +0000)] 
upstream: reorder SessionType; ok djm

OpenBSD-Commit-ID: c7dd0b39e942b1caf4976a0b1cf0fed33d05418c

4 years agoMake whitespace consistent.
Darren Tucker [Wed, 14 Jul 2021 01:26:50 +0000 (11:26 +1000)] 
Make whitespace consistent.

4 years agoAdd ARM64 Linux self-hosted runner.
Darren Tucker [Wed, 14 Jul 2021 01:26:12 +0000 (11:26 +1000)] 
Add ARM64 Linux self-hosted runner.

4 years agoupstream: add a SessionType directive to ssh_config, allowing the
djm@openbsd.org [Tue, 13 Jul 2021 23:48:36 +0000 (23:48 +0000)] 
upstream: add a SessionType directive to ssh_config, allowing the

configuration file to offer equivalent control to the -N (no session) and -s
(subsystem) command-line flags.

Part of GHPR#231 by Volker Diels-Grabsch with some minor tweaks;
feedback and ok dtucker@

OpenBSD-Commit-ID: 726ee931dd4c5cc7f1d7a187b26f41257f9a2d12

4 years agoupstream: fix some broken tests; clean up output
djm@openbsd.org [Mon, 12 Jul 2021 02:12:22 +0000 (02:12 +0000)] 
upstream: fix some broken tests; clean up output

OpenBSD-Regress-ID: 1d5038edb511dc4ce1622344c1e724626a253566

4 years agoAdd configure-time detection for SSH_TIME_T_MAX.
Darren Tucker [Mon, 12 Jul 2021 08:00:05 +0000 (18:00 +1000)] 
Add configure-time detection for SSH_TIME_T_MAX.

Should fix printing cert times exceeding INT_MAX (bz#3329) on platforms
were time_t is a long long.  The limit used is for the signed type, so if
some system has a 32bit unsigned time_t then the lower limit will still
be imposed and we would need to add some way to detect this.  Anyone using
an unsigned 64bit can let us know when it starts being a problem.

4 years agoupstream: Make limit for time_t test unconditional in the
dtucker@openbsd.org [Mon, 12 Jul 2021 06:22:57 +0000 (06:22 +0000)] 
upstream: Make limit for time_t test unconditional in the

format_absolute_time fix for bz#3329 that allows printing of timestamps past
INT_MAX. This was incorrectly included with the previous commit.   Based on
discussion with djm@.

OpenBSD-Commit-ID: 835936f6837c86504b07cabb596b613600cf0f6e

4 years agoupstream: Use existing format_absolute_time() function when
dtucker@openbsd.org [Mon, 12 Jul 2021 06:08:57 +0000 (06:08 +0000)] 
upstream: Use existing format_absolute_time() function when

printing cert validity instead of doing it inline.  Part of bz#3329.

OpenBSD-Commit-ID: a13d4e3c4f59644c23745eb02a09b2a4e717c00c

4 years agoupstream: silence redundant error message; reported by Fabian Stelzer
djm@openbsd.org [Fri, 9 Jul 2021 09:55:56 +0000 (09:55 +0000)] 
upstream: silence redundant error message; reported by Fabian Stelzer

OpenBSD-Commit-ID: 9349a703016579a60557dafd03af2fe1d44e6aa2

4 years agoRe-indent krb5 section after pkg-config addition.
John Ericson [Sat, 26 Dec 2020 16:40:49 +0000 (11:40 -0500)] 
Re-indent krb5 section after pkg-config addition.

4 years agoSupport finding Kerberos via pkg-config
John Ericson [Sat, 26 Dec 2020 16:40:49 +0000 (11:40 -0500)] 
Support finding Kerberos via pkg-config

This makes cross compilation easier.

4 years agoUpdate comments about EGD to include prngd.
Darren Tucker [Fri, 9 Jul 2021 04:34:06 +0000 (14:34 +1000)] 
Update comments about EGD to include prngd.

4 years agoupstream: Fix a couple of whitespace things. Portable already has
dtucker@openbsd.org [Mon, 5 Jul 2021 01:21:07 +0000 (01:21 +0000)] 
upstream: Fix a couple of whitespace things. Portable already has

these so this removes two diffs between the two.

OpenBSD-Commit-ID: 769f017ebafd8e741e337b3e9e89eb5ac73c9c56

4 years agoupstream: Order includes as per style(9). Portable already has
dtucker@openbsd.org [Mon, 5 Jul 2021 01:16:46 +0000 (01:16 +0000)] 
upstream: Order includes as per style(9). Portable already has

these so this removes a handful of diffs between the two.

OpenBSD-Commit-ID: 8bd7452d809b199c19bfc49511a798f414eb4a77

4 years agoupstream: Remove comment referencing now-removed
dtucker@openbsd.org [Mon, 5 Jul 2021 00:50:25 +0000 (00:50 +0000)] 
upstream: Remove comment referencing now-removed

RhostsRSAAuthentication.  ok djm@

OpenBSD-Commit-ID: 3d864bfbd99a1d4429a58e301688f3be464827a9

4 years agoupstream: allow spaces to appear in usernames for local to remote,
djm@openbsd.org [Mon, 5 Jul 2021 00:25:42 +0000 (00:25 +0000)] 
upstream: allow spaces to appear in usernames for local to remote,

and scp -3 remote to remote copies. with & ok dtucker bz#1164

OpenBSD-Commit-ID: e9b550f3a85ffbb079b6720833da31317901d6dd

4 years agoupstream: Remove obsolete comments about SSHv1 auth methods. ok
dtucker@openbsd.org [Fri, 2 Jul 2021 07:20:44 +0000 (07:20 +0000)] 
upstream: Remove obsolete comments about SSHv1 auth methods. ok

djm@

OpenBSD-Commit-ID: 6060f70966f362d8eb4bec3da2f6c4712fbfb98f

4 years agoRemove reference to ChallengeResponse.
Darren Tucker [Sat, 3 Jul 2021 13:00:19 +0000 (23:00 +1000)] 
Remove reference to ChallengeResponse.

challenge_response_authentication was removed from the struct, keeping
kbd_interactive_authentication.

4 years agoMove signal.h up include order to match upstream.
Darren Tucker [Sat, 3 Jul 2021 10:38:09 +0000 (20:38 +1000)] 
Move signal.h up include order to match upstream.

4 years agoRemove old OpenBSD version marker.
Darren Tucker [Sat, 3 Jul 2021 10:36:06 +0000 (20:36 +1000)] 
Remove old OpenBSD version marker.

Looks like an accidental leftover from a sync.

4 years agoRemove duplicate error on error path.
Darren Tucker [Sat, 3 Jul 2021 10:34:19 +0000 (20:34 +1000)] 
Remove duplicate error on error path.

There's an extra error() call on the listen error path, it looks like
its removal was missed during an upstream sync.

4 years agoRemove some whitespace not in upstream.
Darren Tucker [Sat, 3 Jul 2021 10:32:46 +0000 (20:32 +1000)] 
Remove some whitespace not in upstream.

Reduces diff vs OpenBSD by a small amount.

4 years agoReplace remaining references to ChallengeResponse.
Darren Tucker [Sat, 3 Jul 2021 09:27:43 +0000 (19:27 +1000)] 
Replace remaining references to ChallengeResponse.

Portable had a few additional references to ChallengeResponse related to
UsePAM, replaces these with equivalent keyboard-interactive ones.

4 years agoSync remaining ChallengeResponse removal.
Darren Tucker [Sat, 3 Jul 2021 09:23:28 +0000 (19:23 +1000)] 
Sync remaining ChallengeResponse removal.

These were omitted from commit 88868fd131.

4 years agoDisable rocky84 to figure out why agent test fails
Darren Tucker [Sat, 3 Jul 2021 09:17:31 +0000 (19:17 +1000)] 
Disable rocky84 to figure out why agent test fails

4 years agoRemove now-unused SSHv1 enums.
Darren Tucker [Fri, 2 Jul 2021 05:43:28 +0000 (15:43 +1000)] 
Remove now-unused SSHv1 enums.

sRhostsRSAAuthentication and sRSAAuthentication are protocol 1 options
and are no longer used.

4 years agoupstream: Remove references to ChallengeResponseAuthentication in
dtucker@openbsd.org [Fri, 2 Jul 2021 05:11:20 +0000 (05:11 +0000)] 
upstream: Remove references to ChallengeResponseAuthentication in

favour of KbdInteractiveAuthentication.  The former is what was in SSHv1, the
latter is what is in SSHv2 (RFC4256) and they were treated as somewhat but
not entirely equivalent.  We retain the old name as deprecated alias so
config files continue to work and a reference in the man page for people
looking for it.

Prompted by bz#3303 which pointed out the discrepancy between the two
when used with Match.  Man page help & ok jmc@, with & ok djm@

OpenBSD-Commit-ID: 2c1bff8e5c9852cfcdab1f3ea94dfef5a22f3b7e

4 years agoFix ifdefs around get_random_bytes_prngd.
Darren Tucker [Fri, 2 Jul 2021 05:20:32 +0000 (15:20 +1000)] 
Fix ifdefs around get_random_bytes_prngd.

get_random_bytes_prngd() is used if either of PRNGD_PORT or PRNGD_SOCKET
are defined, so adjust ifdef accordingly.

4 years agowrap get_random_bytes_prngd() in ifdef
Damien Miller [Fri, 2 Jul 2021 04:30:23 +0000 (14:30 +1000)] 
wrap get_random_bytes_prngd() in ifdef

avoid unused static function warning

4 years agoAdd rocky84 test target.
Darren Tucker [Mon, 28 Jun 2021 03:06:37 +0000 (13:06 +1000)] 
Add rocky84 test target.

4 years agoupstream: fix decoding of X.509 subject name; from Leif Thuresson
djm@openbsd.org [Fri, 25 Jun 2021 06:30:22 +0000 (06:30 +0000)] 
upstream: fix decoding of X.509 subject name; from Leif Thuresson

via bz3327 ok markus@

OpenBSD-Commit-ID: 0ea2e28f39750dd388b7e317bc43dd997a217ae8

4 years agoupstream: Use better language to refer to the user. From l1ving
dtucker@openbsd.org [Fri, 25 Jun 2021 06:20:39 +0000 (06:20 +0000)] 
upstream: Use better language to refer to the user. From l1ving

via github PR#250, ok jmc@

OpenBSD-Commit-ID: 07ca3526626996613e128aeddf7748c93c4d6bbf

4 years agoupstream: Replace SIGCHLD/notify_pipe kludge with pselect.
dtucker@openbsd.org [Fri, 25 Jun 2021 03:38:17 +0000 (03:38 +0000)] 
upstream: Replace SIGCHLD/notify_pipe kludge with pselect.

Previously sshd's SIGCHLD handler would wake up select() by writing a
byte to notify_pipe.  We can remove this by blocking SIGCHLD, checking
for child terminations then passing the original signal mask through
to pselect.  This ensures that the pselect will immediately wake up if
a child terminates between wait()ing on them and the pselect.

In -portable, for platforms that do not have pselect the kludge is still
there but is hidden behind a pselect interface.

Based on other changes for bz#2158, ok djm@

OpenBSD-Commit-ID: 202c85de0b3bdf1744fe53529a05404c5480d813

4 years agoMove closefrom() to before first malloc.
Darren Tucker [Fri, 25 Jun 2021 05:08:18 +0000 (15:08 +1000)] 
Move closefrom() to before first malloc.

When built against tcmalloc, tcmalloc allocates a descriptor for its
internal use, so calling closefrom() afterward causes the descriptor
number to be reused resulting in a corrupted connection.  Moving the
closefrom a little earlier should resolve this.  From kircherlike at
outlook.com via bz#3321, ok djm@

4 years agoPut second -lssh in link line for sftp-server.
Darren Tucker [Fri, 18 Jun 2021 10:41:45 +0000 (20:41 +1000)] 
Put second -lssh in link line for sftp-server.

When building --without-openssl the recent port-prngd.c change adds
a dependency on atomicio, but since nothing else in sftp-server uses
it, the linker may not find it.  Add a second -lssh similar to other
binaries.

4 years agoTry EGD/PRNGD if random device fails.
Darren Tucker [Fri, 18 Jun 2021 08:34:08 +0000 (18:34 +1000)] 
Try EGD/PRNGD if random device fails.

When built --without-openssl, try EGD/PRGGD (if configured) as a last
resort before failing.

4 years agoSplit EGD/PRNGD interface into its own file.
Darren Tucker [Fri, 18 Jun 2021 08:32:51 +0000 (18:32 +1000)] 
Split EGD/PRNGD interface into its own file.

This will allow us to use it when building --without-openssl.

4 years agoHandle GIDs > 2^31 in getgrouplist.
Darren Tucker [Thu, 17 Jun 2021 11:03:19 +0000 (21:03 +1000)] 
Handle GIDs > 2^31 in getgrouplist.

When compiled in 32bit mode, the getgrouplist implementation may fail
for GIDs greater than LONG_MAX.  Analysis and change from ralf.winkel
at tui.com.

4 years agoupstream: Use $SUDO when reading sshd's pidfile here too.
dtucker@openbsd.org [Thu, 10 Jun 2021 09:46:28 +0000 (09:46 +0000)] 
upstream: Use $SUDO when reading sshd's pidfile here too.

OpenBSD-Regress-ID: 6bfb0d455d493f24839034a629c5306f84dbd409

4 years agoupstream: Use $SUDO when reading sshd's pidfile in case it was
dtucker@openbsd.org [Thu, 10 Jun 2021 09:43:51 +0000 (09:43 +0000)] 
upstream: Use $SUDO when reading sshd's pidfile in case it was

created with a very restrictive umask.  This resyncs with -portable.

OpenBSD-Regress-ID: 07fd2af06df759d4f64b82c59094accca1076a5d

4 years agoupstream: Set umask when creating hostkeys to prevent excessive
dtucker@openbsd.org [Thu, 10 Jun 2021 09:37:59 +0000 (09:37 +0000)] 
upstream: Set umask when creating hostkeys to prevent excessive

permissions warning.

OpenBSD-Regress-ID: 382841db0ee28dfef7f7bffbd511803e1b8ab0ef

4 years agoupstream: Add regress test for SIGHUP restart
dtucker@openbsd.org [Thu, 10 Jun 2021 03:45:31 +0000 (03:45 +0000)] 
upstream: Add regress test for SIGHUP restart

while handling active and unauthenticated clients.  Should catch anything
similar to the pselect bug just fixed in sshd.c.

OpenBSD-Regress-ID: 3b3c19b5e75e43af1ebcb9586875b3ae3a4cac73

4 years agoupstream: Continue accept loop when pselect
dtucker@openbsd.org [Thu, 10 Jun 2021 03:14:14 +0000 (03:14 +0000)] 
upstream: Continue accept loop when pselect

returns -1, eg if it was interrupted by a signal.  This should prevent
the hang discovered by sthen@ wherein sshd receives a SIGHUP while it has
an unauthenticated child and goes on to a blocking read on a notify_pipe.
feedback deraadt@, ok djm@

OpenBSD-Commit-ID: 0243c1c5544fca0974dae92cd4079543a3fceaa0

4 years agoupstream: test that UserKnownHostsFile correctly accepts multiple
djm@openbsd.org [Tue, 8 Jun 2021 22:30:27 +0000 (22:30 +0000)] 
upstream: test that UserKnownHostsFile correctly accepts multiple

arguments; would have caught readconf.c r1.356 regression

OpenBSD-Regress-ID: 71ca54e66c2a0211b04999263e56390b1f323a6a

4 years agoupstream: fix regression in r1.356: for ssh_config options that
djm@openbsd.org [Tue, 8 Jun 2021 22:06:12 +0000 (22:06 +0000)] 
upstream: fix regression in r1.356: for ssh_config options that

accepted multiple string arguments, ssh was only recording the first.
Reported by Lucas via bugs@

OpenBSD-Commit-ID: 7cbf182f7449bf1cb7c5b4452667dc2b41170d6d

4 years agoupstream: test argv_split() optional termination on comments
djm@openbsd.org [Tue, 8 Jun 2021 07:40:12 +0000 (07:40 +0000)] 
upstream: test argv_split() optional termination on comments

OpenBSD-Regress-ID: 9fd1c4a27a409897437c010cfd79c54b639a059c