Commit Graph

11365 Commits

Author SHA1 Message Date
dtucker@openbsd.org b75a80fa83 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
2021-07-19 13:46:13 +10:00
dtucker@openbsd.org 1cc1fd0953 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
2021-07-19 13:04:52 +10:00
dtucker@openbsd.org 33abbe2f41 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
2021-07-19 13:02:55 +10:00
dtucker@openbsd.org f0cd000d8e 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
2021-07-19 12:50:51 +10:00
dtucker@openbsd.org 0075511e27 upstream: Group keygen tests together.
OpenBSD-Regress-ID: 07e2d25c527bb44f03b7c329d893a1f2d6c5c40c
2021-07-19 12:50:12 +10:00
dtucker@openbsd.org 034828820c upstream: Add test for ssh-keygen printing of SSHFP records.
OpenBSD-Regress-ID: fde9566b56eeb980e149bbe157a884838507c46b
2021-07-19 09:23:57 +10:00
djm@openbsd.org 52c3b6985e upstream: wrap some long lines
OpenBSD-Commit-ID: 4f5186b1466656762dae37d3e569438d900c350d
2021-07-17 10:43:23 +10:00
djm@openbsd.org 43ec991a78 upstream: fix sftp on ControlPersist connections, broken by recent
SessionType change; spotted by sthen@

OpenBSD-Commit-ID: 4c5ddc5698790ae6ff50d2a4f8f832f0eeeaa234
2021-07-17 10:43:23 +10:00
djm@openbsd.org 073f45c236 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
2021-07-16 19:21:04 +10:00
jmc@openbsd.org ef7c4e52d5 upstream: reorder SessionType; ok djm
OpenBSD-Commit-ID: c7dd0b39e942b1caf4976a0b1cf0fed33d05418c
2021-07-16 19:21:04 +10:00
Darren Tucker 8aa2f9aeb5 Make whitespace consistent. 2021-07-14 11:27:24 +10:00
Darren Tucker 4f4297ee9b Add ARM64 Linux self-hosted runner. 2021-07-14 11:27:24 +10:00
djm@openbsd.org eda8909d1b 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
2021-07-14 09:49:47 +10:00
djm@openbsd.org 7ae69f2628 upstream: fix some broken tests; clean up output
OpenBSD-Regress-ID: 1d5038edb511dc4ce1622344c1e724626a253566
2021-07-14 09:20:56 +10:00
Darren Tucker f5fc6a4c34 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.
2021-07-12 18:21:26 +10:00
dtucker@openbsd.org fd2d06ae44 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
2021-07-12 17:38:47 +10:00
dtucker@openbsd.org 6c29b387cd upstream: Use existing format_absolute_time() function when
printing cert validity instead of doing it inline.  Part of bz#3329.

OpenBSD-Commit-ID: a13d4e3c4f59644c23745eb02a09b2a4e717c00c
2021-07-12 17:38:47 +10:00
djm@openbsd.org 99981d5f8b upstream: silence redundant error message; reported by Fabian Stelzer
OpenBSD-Commit-ID: 9349a703016579a60557dafd03af2fe1d44e6aa2
2021-07-09 19:57:16 +10:00
John Ericson e860978134 Re-indent krb5 section after pkg-config addition. 2021-07-09 15:35:13 +10:00
John Ericson 32dd2daa56 Support finding Kerberos via pkg-config
This makes cross compilation easier.
2021-07-09 15:27:09 +10:00
Darren Tucker def7a72234 Update comments about EGD to include prngd. 2021-07-09 14:34:06 +10:00
dtucker@openbsd.org b5d23150b4 upstream: Fix a couple of whitespace things. Portable already has
these so this removes two diffs between the two.

OpenBSD-Commit-ID: 769f017ebafd8e741e337b3e9e89eb5ac73c9c56
2021-07-08 14:57:17 +10:00
dtucker@openbsd.org 8f57be9f27 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
2021-07-08 14:51:47 +10:00
dtucker@openbsd.org b75624f873 upstream: Remove comment referencing now-removed
RhostsRSAAuthentication.  ok djm@

OpenBSD-Commit-ID: 3d864bfbd99a1d4429a58e301688f3be464827a9
2021-07-08 14:50:59 +10:00
djm@openbsd.org b67eb12f01 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
2021-07-05 10:27:03 +10:00
dtucker@openbsd.org 8c4ef0943e upstream: Remove obsolete comments about SSHv1 auth methods. ok
djm@

OpenBSD-Commit-ID: 6060f70966f362d8eb4bec3da2f6c4712fbfb98f
2021-07-05 10:27:03 +10:00
Darren Tucker 88908c9b61 Remove reference to ChallengeResponse.
challenge_response_authentication was removed from the struct, keeping
kbd_interactive_authentication.
2021-07-03 23:00:19 +10:00
Darren Tucker 321874416d Move signal.h up include order to match upstream. 2021-07-03 20:38:09 +10:00
Darren Tucker 4fa83e2d0e Remove old OpenBSD version marker.
Looks like an accidental leftover from a sync.
2021-07-03 20:36:06 +10:00
Darren Tucker 9d5e31f55d 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.
2021-07-03 20:34:19 +10:00
Darren Tucker 888c459925 Remove some whitespace not in upstream.
Reduces diff vs OpenBSD by a small amount.
2021-07-03 20:32:46 +10:00
Darren Tucker 4d2d4d47a1 Replace remaining references to ChallengeResponse.
Portable had a few additional references to ChallengeResponse related to
UsePAM, replaces these with equivalent keyboard-interactive ones.
2021-07-03 19:27:43 +10:00
Darren Tucker 53237ac789 Sync remaining ChallengeResponse removal.
These were omitted from commit 88868fd131.
2021-07-03 19:23:28 +10:00
Darren Tucker 2c9e4b319f Disable rocky84 to figure out why agent test fails 2021-07-03 19:17:31 +10:00
Darren Tucker bfe19197a9 Remove now-unused SSHv1 enums.
sRhostsRSAAuthentication and sRSAAuthentication are protocol 1 options
and are no longer used.
2021-07-02 15:43:28 +10:00
dtucker@openbsd.org c73b02d92d 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
2021-07-02 15:39:29 +10:00
Darren Tucker f841fc9c8c 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.
2021-07-02 15:20:32 +10:00
Damien Miller 0767627cf6 wrap get_random_bytes_prngd() in ifdef
avoid unused static function warning
2021-07-02 14:30:23 +10:00
Darren Tucker f93fdc4de1 Add rocky84 test target. 2021-06-28 13:06:37 +10:00
djm@openbsd.org d443006c0d upstream: fix decoding of X.509 subject name; from Leif Thuresson
via bz3327 ok markus@

OpenBSD-Commit-ID: 0ea2e28f39750dd388b7e317bc43dd997a217ae8
2021-06-25 16:32:34 +10:00
dtucker@openbsd.org 2a5704ec14 upstream: Use better language to refer to the user. From l1ving
via github PR#250, ok jmc@

OpenBSD-Commit-ID: 07ca3526626996613e128aeddf7748c93c4d6bbf
2021-06-25 16:32:34 +10:00
dtucker@openbsd.org 4bdf7a0479 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
2021-06-25 15:14:58 +10:00
Darren Tucker c9f7bba2e6 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@
2021-06-25 15:08:18 +10:00
Darren Tucker 7ebfe4e439 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.
2021-06-18 20:41:45 +10:00
Darren Tucker e409d79667 Try EGD/PRNGD if random device fails.
When built --without-openssl, try EGD/PRGGD (if configured) as a last
resort before failing.
2021-06-18 19:32:11 +10:00
Darren Tucker e43a898043 Split EGD/PRNGD interface into its own file.
This will allow us to use it when building --without-openssl.
2021-06-18 18:32:51 +10:00
Darren Tucker acb2887a76 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.
2021-06-17 21:03:19 +10:00
dtucker@openbsd.org 31fac20c94 upstream: Use $SUDO when reading sshd's pidfile here too.
OpenBSD-Regress-ID: 6bfb0d455d493f24839034a629c5306f84dbd409
2021-06-10 20:15:20 +10:00
dtucker@openbsd.org a3a58acffc 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
2021-06-10 20:14:56 +10:00
dtucker@openbsd.org 249ad4ae51 upstream: Set umask when creating hostkeys to prevent excessive
permissions warning.

OpenBSD-Regress-ID: 382841db0ee28dfef7f7bffbd511803e1b8ab0ef
2021-06-10 20:13:09 +10:00