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

4 years agoupstream: Add testcases from bz#3319 for IPQoS and TunnelDevice
dtucker@openbsd.org [Tue, 8 Jun 2021 07:05:27 +0000 (07:05 +0000)] 
upstream: Add testcases from bz#3319 for IPQoS and TunnelDevice

being overridden on the command line.

OpenBSD-Regress-ID: 801674d5d2d02abd58274a78cab2711f11de14a8

4 years agoupstream: sprinkle some "# comment" at end of configuration lines
djm@openbsd.org [Tue, 8 Jun 2021 06:52:43 +0000 (06:52 +0000)] 
upstream: sprinkle some "# comment" at end of configuration lines

to test comment handling

OpenBSD-Regress-ID: cb82fbf40bda5c257a9f742c63b1798e5a8fdda7

4 years agoupstream: more descriptive failure message
djm@openbsd.org [Tue, 8 Jun 2021 06:51:47 +0000 (06:51 +0000)] 
upstream: more descriptive failure message

OpenBSD-Regress-ID: 5300f6faf1d9e99c0cd10827b51756c5510e3509

4 years agoupstream: test AuthenticationMethods inside a Match block as well
djm@openbsd.org [Mon, 7 Jun 2021 01:16:34 +0000 (01:16 +0000)] 
upstream: test AuthenticationMethods inside a Match block as well

as in the main config section

OpenBSD-Regress-ID: ebe0a686621b7cb8bb003ac520975279c28747f7

4 years agoupstream: prepare for stricter sshd_config parsing that will refuse
djm@openbsd.org [Mon, 7 Jun 2021 00:00:50 +0000 (00:00 +0000)] 
upstream: prepare for stricter sshd_config parsing that will refuse

a config that has {Allow,Deny}{Users,Groups} on a line with no subsequent
arguments. Such lines are permitted but are nonsensical noops ATM

OpenBSD-Regress-ID: ef65463fcbc0bd044e27f3fe400ea56eb4b8f650

4 years agoupstream: switch sshd_config parsing to argv_split()
djm@openbsd.org [Tue, 8 Jun 2021 07:09:42 +0000 (07:09 +0000)] 
upstream: switch sshd_config parsing to argv_split()

similar to the previous commit, this switches sshd_config parsing to
the newer tokeniser. Config parsing will be a little stricter wrt
quote correctness and directives appearing without arguments.

feedback and ok markus@

tested in snaps for the last five or so days - thanks Theo and those who
caught bugs

OpenBSD-Commit-ID: 9c4305631d20c2d194661504ce11e1f68b20d93e

4 years agoupstream: Switch ssh_config parsing to use argv_split()
djm@openbsd.org [Tue, 8 Jun 2021 07:07:15 +0000 (07:07 +0000)] 
upstream: Switch ssh_config parsing to use argv_split()

This fixes a couple of problems with the previous tokeniser,
strdelim()

1. strdelim() is permissive wrt accepting '=' characters. This is
  intended to allow it to tokenise "Option=value" but because it
  cannot keep state, it will incorrectly split "Opt=val=val2".
2. strdelim() has rudimentry handling of quoted strings, but it
  is incomplete and inconsistent. E.g. it doesn't handle escaped
  quotes inside a quoted string.
3. It has no support for stopping on a (unquoted) comment. Because
  of this readconf.c r1.343 added chopping of lines at '#', but
  this caused a regression because these characters may legitimately
  appear inside quoted strings.

The new tokeniser is stricter is a number of cases, including #1 above
but previously it was also possible for some directives to appear
without arguments. AFAIK these were nonsensical in all cases, and the
new tokeniser refuses to accept them.

The new code handles quotes much better, permitting quoted space as
well as escaped closing quotes. Finally, comment handling should be
fixed - the tokeniser will terminate only on unquoted # characters.

feedback & ok markus@

tested in snaps for the last five or so days - thanks Theo and those who
caught bugs

OpenBSD-Commit-ID: dc72fd12af9d5398f4d9e159d671f9269c5b14d5

4 years agoupstream: Check if IPQoS or TunnelDevice are already set before
dtucker@openbsd.org [Tue, 8 Jun 2021 07:02:46 +0000 (07:02 +0000)] 
upstream: Check if IPQoS or TunnelDevice are already set before

overriding. Prevents values in config files from overriding values supplied
on the command line.  bz#3319, ok markus.

OpenBSD-Commit-ID: f3b08b898c324debb9195e6865d8999406938f74

4 years agoupstream: Allow argv_split() to optionally terminate tokenisation
djm@openbsd.org [Tue, 8 Jun 2021 06:54:40 +0000 (06:54 +0000)] 
upstream: Allow argv_split() to optionally terminate tokenisation

when it encounters an unquoted comment.

Add some additional utility function for working with argument
vectors, since we'll be switching to using them to parse
ssh/sshd_config shortly.

ok markus@ as part of a larger diff; tested in snaps

OpenBSD-Commit-ID: fd9c108cef2f713f24e3bc5848861d221bb3a1ac

4 years agoSave logs on failure for upstream test
Darren Tucker [Mon, 7 Jun 2021 09:19:23 +0000 (19:19 +1000)] 
Save logs on failure for upstream test

4 years agoAdd obsdsnap-i386 upstream test target.
Darren Tucker [Mon, 7 Jun 2021 04:36:32 +0000 (14:36 +1000)] 
Add obsdsnap-i386 upstream test target.

4 years agoupstream: fix debug message when finding a private key to match a
djm@openbsd.org [Mon, 7 Jun 2021 03:38:38 +0000 (03:38 +0000)] 
upstream: fix debug message when finding a private key to match a

certificate being attempted for user authentication. Previously it would
print the certificate's path, whereas it was supposed to be showing the
private key's path. Patch from Alex Sherwin via GHPR247

OpenBSD-Commit-ID: d5af3be66d0f22c371dc1fe6195e774a18b2327b

4 years agoupstream: Match host certificates against host public keys, not private
djm@openbsd.org [Sun, 6 Jun 2021 11:34:16 +0000 (11:34 +0000)] 
upstream: Match host certificates against host public keys, not private

keys. Allows use of certificates with private keys held in a ssh-agent.
Reported by Miles Zhou in bz3524; ok dtucker@

OpenBSD-Commit-ID: 25f5bf70003126d19162862d9eb380bf34bac22a

4 years agoupstream: Client-side workaround for a bug in OpenSSH 7.4: this release
djm@openbsd.org [Sun, 6 Jun 2021 03:40:39 +0000 (03:40 +0000)] 
upstream: Client-side workaround for a bug in OpenSSH 7.4: this release

allows RSA/SHA2 signatures for public key authentication but fails to
advertise this correctly via SSH2_MSG_EXT_INFO. This causes clients of these
server to incorrectly match PubkeyAcceptedAlgorithms and potentially refuse
to offer valid keys.

Reported by and based on patch from Gordon Messmer via bz3213, thanks
also for additional analysis by Jakub Jelen. ok dtucker

OpenBSD-Commit-ID: d6d0b7351d5d44c45f3daaa26efac65847a564f7

4 years agoupstream: degrade gracefully if a sftp-server offers the
djm@openbsd.org [Sun, 6 Jun 2021 03:17:02 +0000 (03:17 +0000)] 
upstream: degrade gracefully if a sftp-server offers the

limits@openssh.com extension but fails when the client tries to invoke it.
Reported by Hector Martin via bz3318

OpenBSD-Commit-ID: bd9d1839c41811616ede4da467e25746fcd9b967

4 years agoupstream: the limits@openssh.com extension was incorrectly marked
djm@openbsd.org [Sun, 6 Jun 2021 03:15:39 +0000 (03:15 +0000)] 
upstream: the limits@openssh.com extension was incorrectly marked

as an operation that writes to the filesystem, which made it unavailable in
sftp-server read-only mode. Spotted by Hector Martin via bz3318

OpenBSD-Commit-ID: f054465230787e37516c4b57098fc7975e00f067

4 years agoupstream: PROTOCOL.certkeys: update reference from IETF draft to
naddy@openbsd.org [Sat, 5 Jun 2021 13:47:00 +0000 (13:47 +0000)] 
upstream: PROTOCOL.certkeys: update reference from IETF draft to

RFC

Also fix some typos.
ok djm@

OpenBSD-Commit-ID: 5e855b6c5a22b5b13f8ffa3897a868e40d349b44

4 years agoClear notify_pipe from readset if present.
Darren Tucker [Fri, 4 Jun 2021 13:41:29 +0000 (23:41 +1000)] 
Clear notify_pipe from readset if present.

Prevents leaking an implementation detail to the caller.

4 years agospace->tabs.
Darren Tucker [Fri, 4 Jun 2021 13:24:25 +0000 (23:24 +1000)] 
space->tabs.

4 years agoAdd pselect implementation for platforms without.
Darren Tucker [Fri, 4 Jun 2021 08:39:48 +0000 (18:39 +1000)] 
Add pselect implementation for platforms without.

This is basically the existing notify_pipe kludge from serverloop.c
moved behind a pselect interface.  It works by installing a signal
handler that writes to a pipe that the select is watching, then calls
the original handler.

The select call in serverloop will become pselect soon, at which point the
kludge will be removed from thereand will only exist in the compat layer.
Original code by markus, help from djm.

4 years agoauth_log: dont log partial successes as failures
Vincent Brillault [Sun, 24 May 2020 07:15:06 +0000 (09:15 +0200)] 
auth_log: dont log partial successes as failures

By design, 'partial' logins are successful logins, so initially with
authenticated set to 1, for which another authentication is required. As
a result, authenticated is always reset to 0 when partial is set to 1.
However, even if authenticated is 0, those are not failed login
attempts, similarly to attempts with authctxt->postponed set to 1.

4 years agoupstream: The RB_GENERATE_STATIC(3) macro expands to a series of
djm@openbsd.org [Fri, 4 Jun 2021 06:19:07 +0000 (06:19 +0000)] 
upstream: The RB_GENERATE_STATIC(3) macro expands to a series of

function definitions and not a statement, so there should be no semicolon
following them. Patch from Michael Forney

OpenBSD-Commit-ID: c975dd180580f0bdc0a4d5b7d41ab1f5e9b7bedd

4 years agoupstream: rework authorized_keys example section, removing irrelevant
djm@openbsd.org [Fri, 4 Jun 2021 05:59:18 +0000 (05:59 +0000)] 
upstream: rework authorized_keys example section, removing irrelevant

stuff, de-wrapping the example lines and better aligning the examples with
common usage and FAQs; ok jmc

OpenBSD-Commit-ID: d59f1c9281f828148e2a2e49eb9629266803b75c

4 years agoupstream: adjust SetEnv description to clarify $TERM handling
djm@openbsd.org [Fri, 4 Jun 2021 05:10:03 +0000 (05:10 +0000)] 
upstream: adjust SetEnv description to clarify $TERM handling

OpenBSD-Commit-ID: 8b8cc0124856bc1094949d55615e5c44390bcb22

4 years agoupstream: Switch the listening select loop from select() to
dtucker@openbsd.org [Fri, 4 Jun 2021 05:09:08 +0000 (05:09 +0000)] 
upstream: Switch the listening select loop from select() to

pselect() and mask signals while checking signal flags, umasking for pselect
and restoring afterwards. Also restore signals before sighup_restart so they
don't remain blocked after restart.

This prevents a race where a SIGTERM or SIGHUP can arrive between
checking the flag and calling select (eg if sshd is processing a
new connection) resulting in sshd not shutting down until the next
time it receives a new connection.  bz#2158, with & ok djm@

OpenBSD-Commit-ID: bf85bf880fd78e00d7478657644fcda97b9a936f

4 years agoupstream: allow ssh_config SetEnv to override $TERM, which is otherwise
djm@openbsd.org [Fri, 4 Jun 2021 05:02:40 +0000 (05:02 +0000)] 
upstream: allow ssh_config SetEnv to override $TERM, which is otherwise

handled specially by the protocol. Useful in ~/.ssh/config to set TERM to
something generic (e.g. "xterm" instead of "xterm-256color") for destinations
that lack terminfo entries. feedback and ok dtucker@

OpenBSD-Commit-ID: 38b1ef4d5bc159c7d9d589d05e3017433e2d5758

4 years agoupstream: correct extension name "no-presence-required" =>
djm@openbsd.org [Fri, 4 Jun 2021 04:02:21 +0000 (04:02 +0000)] 
upstream: correct extension name "no-presence-required" =>

"no-touch-required"

document "verify-required" option

OpenBSD-Commit-ID: 1879ff4062cf61d79b515e433aff0bf49a6c55c5

4 years agoRetire fbsd7 test target.
Darren Tucker [Wed, 2 Jun 2021 03:54:11 +0000 (13:54 +1000)] 
Retire fbsd7 test target.

It's the slowest of the selfhosted targets (since it's 32bit but has
most of the crypto algos). We still have coverage for 32bit i386.

4 years agoCheck for $OPENSSL in md5 fallback too.
Darren Tucker [Wed, 2 Jun 2021 01:21:40 +0000 (11:21 +1000)] 
Check for $OPENSSL in md5 fallback too.

4 years agoAdd dfly60 target.
Darren Tucker [Wed, 2 Jun 2021 01:17:54 +0000 (11:17 +1000)] 
Add dfly60 target.

4 years agoupstream: Merge back shell portability changes
dtucker@openbsd.org [Wed, 2 Jun 2021 00:17:45 +0000 (00:17 +0000)] 
upstream: Merge back shell portability changes

bringing it back in sync with -portable.

OpenBSD-Regress-ID: c07905ba931e66ad7d849b87b7d19648007175d1

4 years agoupstream: Use a default value for $OPENSSL,
dtucker@openbsd.org [Tue, 1 Jun 2021 23:56:20 +0000 (23:56 +0000)] 
upstream: Use a default value for $OPENSSL,

allowing it to be overridden. Do the same in the PuTTY tests since it's
needed there and not exported by test-exec.sh.

OpenBSD-Regress-ID: c49dcd6aa7602a8606b7afa192196ca1fa65de16

4 years agoupstream: Find openssl binary via environment variable. This
dtucker@openbsd.org [Mon, 24 May 2021 10:25:18 +0000 (10:25 +0000)] 
upstream: Find openssl binary via environment variable. This

allows overriding if necessary (eg in -portable where we're testing against a
specific version of OpenSSL).

OpenBSD-Regress-ID: 491f39cae9e762c71aa4bf045803d077139815c5

4 years agoupstream: fix memleak in test
djm@openbsd.org [Fri, 21 May 2021 04:03:47 +0000 (04:03 +0000)] 
upstream: fix memleak in test

OpenBSD-Regress-ID: 5e529d0982aa04666604936df43242e97a7a6f81

4 years agoupstream: also check contents of remaining string
djm@openbsd.org [Fri, 21 May 2021 03:59:01 +0000 (03:59 +0000)] 
upstream: also check contents of remaining string

OpenBSD-Regress-ID: d526fa07253f4eebbc7d6205a0ab3d491ec71a28

4 years agoupstream: unit test for misc.c:strdelim() that mostly servces to
djm@openbsd.org [Fri, 21 May 2021 03:48:07 +0000 (03:48 +0000)] 
upstream: unit test for misc.c:strdelim() that mostly servces to

highlight its inconsistencies

OpenBSD-Regress-ID: 8d2bf970fcc01ccc6e36a5065f89b9c7fa934195

4 years agoPut minix3 config in the host-specific block.
Darren Tucker [Thu, 27 May 2021 11:23:15 +0000 (21:23 +1000)] 
Put minix3 config in the host-specific block.