]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
39 hours agomention sntrup761x25519-sha512 in manpages V_9_3 anongit/V_9_3 github-selfhosted/V_9_3 github/V_9_3
Damien Miller [Tue, 12 Aug 2025 23:16:34 +0000 (09:16 +1000)] 
mention sntrup761x25519-sha512 in manpages

Spotted by Colin Watson

3 days agosupport sntrup761x25519-sha512 alias
Damien Miller [Mon, 11 Aug 2025 06:08:30 +0000 (16:08 +1000)] 
support sntrup761x25519-sha512 alias

OpenSSH 9.3 supports the sntrup761x25519-sha512@openssh.com
key agreement algorithm. As part of standardisation, this algorithm
has been assigned the name sntrup761x25519-sha512.

This commit enables the existing algorithm under this new name.

2 years agoPrefer OpenSSL's SHA256 in sk-dummy.so
Darren Tucker [Wed, 26 Jul 2023 16:46:45 +0000 (02:46 +1000)] 
Prefer OpenSSL's SHA256 in sk-dummy.so

Previously sk-dummy.so used libc's (or compat's) SHA256 since it may be
built without OpenSSL.  In many cases, however, including both libc's
and OpenSSL's headers together caused conflicting definitions.

We tried working around this (on OpenSSL <1.1 you could define
OPENSSL_NO_SHA, NetBSD had USE_LIBC_SHA2, various #define hacks) with
varying levels of success.  Since OpenSSL >=1.1 removed OPENSSL_NO_SHA
and including most OpenSSL headers would bring sha.h in, even if it
wasn't used directly this was a constant hassle.

Admit defeat and use OpenSSL's SHA256 unless we aren't using OpenSSL
at all.  ok djm@

2 years agoAlso look for gdb error message from OpenIndiana.
Darren Tucker [Mon, 27 Mar 2023 01:22:30 +0000 (12:22 +1100)] 
Also look for gdb error message from OpenIndiana.

2 years agoPrevent conflicts between Solaris SHA2 and OpenSSL.
Darren Tucker [Mon, 27 Mar 2023 23:35:18 +0000 (10:35 +1100)] 
Prevent conflicts between Solaris SHA2 and OpenSSL.

We used to prevent conflicts between native SHA2 headers and OpenSSL's
by setting OPENSSL_NO_SHA but that was removed prior to OpenSSL 1.1.0

2 years agoUpdate runner OS version for hardenedmalloc test.
Darren Tucker [Thu, 22 Jun 2023 23:49:02 +0000 (09:49 +1000)] 
Update runner OS version for hardenedmalloc test.

Hardenedmalloc dropped support for "legacy glibc" versions in their
64dad0a69 so use a newer Ubuntu version for the runner for that test.

2 years agoOpenSSH 9.3p2 V_9_3_P2
Damien Miller [Wed, 19 Jul 2023 06:27:12 +0000 (16:27 +1000)] 
OpenSSH 9.3p2

2 years agoupdate version in README
Damien Miller [Wed, 19 Jul 2023 06:31:09 +0000 (16:31 +1000)] 
update version in README

2 years agoupdate RPM spec versions
Damien Miller [Wed, 19 Jul 2023 06:31:00 +0000 (16:31 +1000)] 
update RPM spec versions

2 years agodisallow remote addition of FIDO/PKCS11 keys
Damien Miller [Fri, 7 Jul 2023 03:30:15 +0000 (13:30 +1000)] 
disallow remote addition of FIDO/PKCS11 keys

Depends on the local client performing the session-bind@openssh.com
operation, so non-OpenSSH local client may circumvent this.

2 years agoterminate pkcs11 process for bad libraries
Damien Miller [Thu, 13 Jul 2023 02:09:34 +0000 (12:09 +1000)] 
terminate pkcs11 process for bad libraries

2 years agodepend V_9_3_P1
Damien Miller [Wed, 15 Mar 2023 21:28:19 +0000 (08:28 +1100)] 
depend

2 years agocrank version
Damien Miller [Wed, 15 Mar 2023 21:27:54 +0000 (08:27 +1100)] 
crank version

2 years agoupstream: openssh-9.3
djm@openbsd.org [Wed, 15 Mar 2023 21:19:57 +0000 (21:19 +0000)] 
upstream: openssh-9.3

OpenBSD-Commit-ID: 8011495f2449c1029bb316bd015eab2e00509848

2 years agoupstream: Free KRL ptr in addition to its contents.
dtucker@openbsd.org [Tue, 14 Mar 2023 07:28:47 +0000 (07:28 +0000)] 
upstream: Free KRL ptr in addition to its contents.

From Coverity CID 291841, ok djm@

OpenBSD-Commit-ID: f146ba08b1b43af4e0d7ad8c4dae3748b4fa31b6

2 years agoupstream: Check pointer for NULL before deref.
dtucker@openbsd.org [Tue, 14 Mar 2023 07:26:25 +0000 (07:26 +0000)] 
upstream: Check pointer for NULL before deref.

None of the existing callers seem to do that, but it's worth checking.
From Coverity CID 291834, ok djm@

OpenBSD-Commit-ID: a0a97113f192a7cb1a2c97b932f677f573cda7a4

2 years agoupstream: Limit number of entries in SSH2_MSG_EXT_INFO
dtucker@openbsd.org [Sun, 12 Mar 2023 10:40:39 +0000 (10:40 +0000)] 
upstream: Limit number of entries in SSH2_MSG_EXT_INFO

request. This is already constrained by the maximum SSH packet size but this
makes it explicit.  Prompted by Coverity CID 291868, ok djm@ markus@

OpenBSD-Commit-ID: aea023819aa44a2dcb9dd0fbec10561896fc3a09

2 years agoupstream: calloc can return NULL but xcalloc can't.
dtucker@openbsd.org [Sun, 12 Mar 2023 09:41:18 +0000 (09:41 +0000)] 
upstream: calloc can return NULL but xcalloc can't.

From Coverity CID 291881, ok djm@

OpenBSD-Commit-ID: 50204b755f66b2ec7ac3cfe379d07d85ca161d2b

2 years agoupstream: Explicitly ignore return from fcntl
dtucker@openbsd.org [Fri, 10 Mar 2023 07:17:08 +0000 (07:17 +0000)] 
upstream: Explicitly ignore return from fcntl

(... FD_CLOEXEC) here too.  Coverity CID 291853.

OpenBSD-Commit-ID: 99d8b3da9d0be1d07ca8dd8e98800a890349e9b5

2 years agobounds checking for getrrsetbyname() replacement;
Damien Miller [Fri, 10 Mar 2023 04:59:46 +0000 (15:59 +1100)] 
bounds checking for getrrsetbyname() replacement;

Spotted by Coverity in CID 405033; ok millert@

2 years agoupstream: Plug mem leak on error path. Coverity CID 405026, ok djm@.
dtucker@openbsd.org [Fri, 10 Mar 2023 04:06:21 +0000 (04:06 +0000)] 
upstream: Plug mem leak on error path. Coverity CID 405026, ok djm@.

OpenBSD-Commit-ID: 8212ca05d01966fb5e72205c592b2257708a2aac

2 years agoAdd prototypes for mkstemp replacements.
Darren Tucker [Fri, 10 Mar 2023 03:46:57 +0000 (14:46 +1100)] 
Add prototypes for mkstemp replacements.

Should prevent warnings due to our wrapper function.

2 years agoupstream: Expliticly ignore return code from fcntl(.. FD_CLOEXEC) since
dtucker@openbsd.org [Fri, 10 Mar 2023 03:01:51 +0000 (03:01 +0000)] 
upstream: Expliticly ignore return code from fcntl(.. FD_CLOEXEC) since

there's not much we can do anyway.  From Coverity CID 291857, ok djm@

OpenBSD-Commit-ID: 051429dd07af8db3fec10d82cdc78d90bb051729

2 years agoupstream: Like sshd_config, some ssh_config options are not
djm@openbsd.org [Fri, 10 Mar 2023 02:32:04 +0000 (02:32 +0000)] 
upstream: Like sshd_config, some ssh_config options are not

first-match-wins. sshd_config.5 was fixed in r1.348, this is the same for
this file

OpenBSD-Commit-ID: 7be55b9351cde449b136afcc52d07aa4113b215e

2 years agoupstream: Remove no-op (int) > INT_MAX checks
dtucker@openbsd.org [Fri, 10 Mar 2023 02:24:56 +0000 (02:24 +0000)] 
upstream: Remove no-op (int) > INT_MAX checks

since they can never be true. From Coverity CID 405031, ok djm@

OpenBSD-Commit-ID: 9df3783b181e056595e2bb9edf7ed41d61cf8e84

2 years agoWrap mkstemp calls with umask set/restore.
Darren Tucker [Fri, 10 Mar 2023 02:27:29 +0000 (13:27 +1100)] 
Wrap mkstemp calls with umask set/restore.

glibc versions 2.06 and earlier did not set a umask on files created by
mkstemp created the world-writable.  Wrap mkstemp to set and restore
the umask.  From Coverity (CIDs 291826 291886 291891), ok djm@

2 years agoupstream: modify parentheses in conditionals to make it clearer what is
jcs@openbsd.org [Thu, 9 Mar 2023 21:06:24 +0000 (21:06 +0000)] 
upstream: modify parentheses in conditionals to make it clearer what is

being assigned and what is being checked

ok djm dtucker

OpenBSD-Commit-ID: 19c10baa46ae559474409f75a5cb3d0eade7a9b8

2 years agoupstream: Re-split the merge of the reorder-hostkeys test.
dtucker@openbsd.org [Thu, 9 Mar 2023 07:11:05 +0000 (07:11 +0000)] 
upstream: Re-split the merge of the reorder-hostkeys test.

In the kex_proposal_populate_entries change I merged the the check for
reordering hostkeys with the actual reordering, but kex_assemble_names
mutates options.hostkeyalgorithms which renders the check ineffective.
Put the check back where it was.  Spotted and tested by jsg@, ok djm@

OpenBSD-Commit-ID: a7469f25a738db5567395d1881e32479a7ffc9de

2 years agoupstream: include destination constraints for smartcard keys too.
djm@openbsd.org [Thu, 9 Mar 2023 06:58:26 +0000 (06:58 +0000)] 
upstream: include destination constraints for smartcard keys too.

Spotted by Luci Stanescu; ok deraadt@ markus@

OpenBSD-Commit-ID: add879fac6903a1cb1d1e42c4309e5359c3d870f

2 years agoLimit the number of PAM environment variables.
Darren Tucker [Thu, 9 Mar 2023 07:24:54 +0000 (18:24 +1100)] 
Limit the number of PAM environment variables.

xcalloc has its own limits, but these are specific to PAM.  From
Coverity CID 405198, ok djm@

2 years agoLimit the number of PAM environment variables.
Darren Tucker [Thu, 9 Mar 2023 07:19:44 +0000 (18:19 +1100)] 
Limit the number of PAM environment variables.

From Coverity CID 405194, tweaks and ok djm@

2 years agoupstream: Plug mem leak. Coverity CID 405196, ok djm@
dtucker@openbsd.org [Wed, 8 Mar 2023 06:21:32 +0000 (06:21 +0000)] 
upstream: Plug mem leak. Coverity CID 405196, ok djm@

OpenBSD-Commit-ID: 175f09349387c292f626da68f65f334faaa085f2

2 years agoupstream: ssh-pkcs11: synchronize error messages with errors
tb@openbsd.org [Wed, 8 Mar 2023 05:33:53 +0000 (05:33 +0000)] 
upstream: ssh-pkcs11: synchronize error messages with errors

A handful of error messages contained incorrect function names or
otherwise inaccurate descriptions. Fix them to match reality.

input/ok djm

OpenBSD-Commit-ID: 165a15db52f75b31e1804b043480c36af09f3411

2 years agoupstream: Delete obsolete /* ARGSUSED */ lint comments.
guenther@openbsd.org [Wed, 8 Mar 2023 04:43:12 +0000 (04:43 +0000)] 
upstream: Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

OpenBSD-Commit-ID: 7be168a570264d59e96a7d2d22e927d45fee0e4c

2 years agoExtra brackets to prevent warning.
Darren Tucker [Wed, 8 Mar 2023 06:25:37 +0000 (17:25 +1100)] 
Extra brackets to prevent warning.

2 years agoupstream: use RSA/SHA256 when testing usability of private key in
djm@openbsd.org [Wed, 8 Mar 2023 00:05:58 +0000 (00:05 +0000)] 
upstream: use RSA/SHA256 when testing usability of private key in

agent; with/ok dtucker

OpenBSD-Commit-ID: fe1382e2fdf23fcae631308e72342bad56066a56

2 years agoupstream: use RSA/SHA256 when testing usability of private key;
djm@openbsd.org [Wed, 8 Mar 2023 00:05:37 +0000 (00:05 +0000)] 
upstream: use RSA/SHA256 when testing usability of private key;

based on fix in bz3546 by Dmitry Belyavskiy; with/ok dtucker

OpenBSD-Commit-ID: 0ef414cc363a832f9fab92a5da0234448bce2eba

2 years agoupstream: refactor to be more readable top to bottom. Prompted by
djm@openbsd.org [Tue, 7 Mar 2023 21:47:42 +0000 (21:47 +0000)] 
upstream: refactor to be more readable top to bottom. Prompted by

Coverity CID 405048 which was a false-positive fd leak; ok dtucker@

OpenBSD-Commit-ID: fc55ec2af622a017defb9b768bf26faefc792c00

2 years agoAdd header changes missed in previous.
Darren Tucker [Tue, 7 Mar 2023 07:34:41 +0000 (18:34 +1100)] 
Add header changes missed in previous.

2 years agoupstream: Fix mem leak in environment setup.
dtucker@openbsd.org [Tue, 7 Mar 2023 06:09:14 +0000 (06:09 +0000)] 
upstream: Fix mem leak in environment setup.

From jjelen at redhat.com via bz#2687, ok djm@

OpenBSD-Commit-ID: 9f9e4ba3cac003e6f81da3bcebd1b9ec43e7f353

2 years agoupstream: Unit test for kex_proposal_populate_entries.
dtucker@openbsd.org [Mon, 6 Mar 2023 12:15:47 +0000 (12:15 +0000)] 
upstream: Unit test for kex_proposal_populate_entries.

OpenBSD-Regress-ID: bdb211d80d572a08bf14b49fe2a58b9ff265c006

2 years agoupstream: fix memory leak in process_read() path; Spotted by James
djm@openbsd.org [Tue, 7 Mar 2023 05:37:26 +0000 (05:37 +0000)] 
upstream: fix memory leak in process_read() path; Spotted by James

Robinson in GHPR363; ok markus@

OpenBSD-Commit-ID: cdc2d98e6478b7e7f3a36976845adae3820429d8

2 years agoupstream: correct size for array argument when changing
djm@openbsd.org [Tue, 7 Mar 2023 01:30:52 +0000 (01:30 +0000)] 
upstream: correct size for array argument when changing

UMAC_OUTPUT_LEN Coverity CID 291845; ok dtucker@

OpenBSD-Commit-ID: 2eb017d10705bb623d4418691f961c930eafaec0

2 years agoupstream: Refactor creation of KEX proposal.
dtucker@openbsd.org [Mon, 6 Mar 2023 12:14:48 +0000 (12:14 +0000)] 
upstream: Refactor creation of KEX proposal.

This adds kex_proposal_populate_entries (and corresponding free) which
populates the KEX proposal array with dynamically allocated strings.
This replaces the previous mix of static and dynamic that has been the
source of previous leaks and bugs.  Remove unused compat functions.
With & ok djm@.

OpenBSD-Commit-ID: f2f99da4aae2233cb18bf9c749320c5e040a9c7b

2 years agoupstream: Fix mem and FILE leaks in moduli screening.
dtucker@openbsd.org [Sun, 5 Mar 2023 09:24:35 +0000 (09:24 +0000)] 
upstream: Fix mem and FILE leaks in moduli screening.

If multiple -Ocheckpoint= options are passed, the earlier ones would
be overwritten and leaked.  If we use an input file that wasn't stdin,
close that.  From Coverity CIDs 291884 and 291894.

OpenBSD-Commit-ID: a4d9d15f572926f841788912e2b282485ad09e8b

2 years agoupstream: Plug mem leak in moduli checkpoint option parsing.
dtucker@openbsd.org [Sun, 5 Mar 2023 08:18:58 +0000 (08:18 +0000)] 
upstream: Plug mem leak in moduli checkpoint option parsing.

From Coverity CID 291894.

OpenBSD-Commit-ID: 9b1aba2d049741ae21c8dc4560a7e29ab17310f4

2 years agoupstream: Remove unused compat.h includes.
dtucker@openbsd.org [Sun, 5 Mar 2023 05:34:09 +0000 (05:34 +0000)] 
upstream: Remove unused compat.h includes.

We've previously removed a lot of the really old compatibility code,
and with it went the need to include compat.h in most of the files that
have it.

OpenBSD-Commit-ID: 5af8baa194be00a3092d17598e88a5b29f7ea2b4

2 years agoupstream: Use time_t for x11 timeout.
dtucker@openbsd.org [Sat, 4 Mar 2023 03:22:59 +0000 (03:22 +0000)] 
upstream: Use time_t for x11 timeout.

Use time_t instead of u_int for remaining x11 timeout checks for 64bit
time_t safety.  From Coverity CIDs 405197 and 405028, ok djm@

OpenBSD-Commit-ID: 356685bfa1fc3d81bd95722d3fc47101cc1a4972

2 years agoupstream: Ensure ms_remain is always initialized
dtucker@openbsd.org [Fri, 3 Mar 2023 10:23:42 +0000 (10:23 +0000)] 
upstream: Ensure ms_remain is always initialized

similar to what we do in ssh_packet_write_wait.  bz#2687, from jjelen
at redhat.com.

OpenBSD-Commit-ID: a50e0541cf823f8d1c72f71ccde925d3dbe6dfac

2 years agoupstream: Check for non-NULL before string
dtucker@openbsd.org [Fri, 3 Mar 2023 09:48:51 +0000 (09:48 +0000)] 
upstream: Check for non-NULL before string

comparison. From jjelen at redhat.com via bz#2687.

OpenBSD-Commit-ID: 0d9b2e0cac88a311b5766b1aef737082583c285f

2 years agoupstream: guard against getsockname(-1, ...) from Coverity CID
djm@openbsd.org [Fri, 3 Mar 2023 05:00:34 +0000 (05:00 +0000)] 
upstream: guard against getsockname(-1, ...) from Coverity CID

291832

OpenBSD-Commit-ID: e58d5227327917d189229b7f0b37d2780f360d5f

2 years agoupstream: some options are not first-match-wins. Mention that there
djm@openbsd.org [Fri, 3 Mar 2023 04:36:20 +0000 (04:36 +0000)] 
upstream: some options are not first-match-wins. Mention that there

are exceptions at the start of the manpage and label some of them in the
option description.

OpenBSD-Commit-ID: 3b74728446fa6fc8742769eeb8c3674e233e84c4

2 years agoupstream: actually print "channeltimeout none" in config dump mode;
djm@openbsd.org [Fri, 3 Mar 2023 04:34:49 +0000 (04:34 +0000)] 
upstream: actually print "channeltimeout none" in config dump mode;

spotted via Coverity CID 405022

OpenBSD-Commit-ID: b074b52bf138b75f08264e8da15880b29c7a630f

2 years agoAdd Coverity badges.
Darren Tucker [Fri, 3 Mar 2023 03:50:03 +0000 (14:50 +1100)] 
Add Coverity badges.

2 years agoupstream: Check return values of dup2. Spotted by Coverity, ok djm@
dtucker@openbsd.org [Fri, 3 Mar 2023 03:12:24 +0000 (03:12 +0000)] 
upstream: Check return values of dup2. Spotted by Coverity, ok djm@

OpenBSD-Commit-ID: 19fb1b53072826d00c67df677731d2f6c1dd602b

2 years agoupstream: Use time_t for x11_refuse_time timeout. We need
dtucker@openbsd.org [Fri, 3 Mar 2023 02:37:58 +0000 (02:37 +0000)] 
upstream: Use time_t for x11_refuse_time timeout. We need

SSH_TIME_T_MAX for this, so move from misc.c to misc.h so it's available.
Fixes a Coverity warning for 64bit time_t safety, ok djm@

OpenBSD-Commit-ID: c69c4c3152cdaab953706db4ccf4d5fd682f7d8d

2 years agoupstream: Check return value from fctnl and warn on failure.
dtucker@openbsd.org [Fri, 3 Mar 2023 02:34:29 +0000 (02:34 +0000)] 
upstream: Check return value from fctnl and warn on failure.

Spotted by Coverity, ok djm@

OpenBSD-Commit-ID: 2097c7db3cf657f1e3a6c5077041bacc63143cab

2 years agoupstream: Remove SUDO in proxy command wrapper. Anything that needs 380/head
dtucker@openbsd.org [Thu, 2 Mar 2023 11:10:27 +0000 (11:10 +0000)] 
upstream: Remove SUDO in proxy command wrapper. Anything that needs

sudo is already run by it, and it breaks if root isn't in sudoers.

OpenBSD-Regress-ID: 6cf22fda32a89c16915f31a6ed9bbdbef2a3bac9

2 years agoupstream: Fix breakage on dhgex test.
dtucker@openbsd.org [Thu, 2 Mar 2023 08:24:41 +0000 (08:24 +0000)] 
upstream: Fix breakage on dhgex test.

This was due to the sshd logs being written to the wrong log file.
While there, make save_debug_logs less verbose, write the name of the
tarball to regress.log and use $SUDO to remove the old symlinks (which
shouldn't be needed, but won't hurt).  Initial problem spotted by anton@.

OpenBSD-Regress-ID: 9c44fb9cd418e6ff31165e7a6c1f9f11a6d19f5b

2 years agoupstream: Quote grep and log message better.
dtucker@openbsd.org [Thu, 2 Mar 2023 08:14:52 +0000 (08:14 +0000)] 
upstream: Quote grep and log message better.

OpenBSD-Regress-ID: 3823d9063127169736aa274b1784cb28e15b64d4

2 years agoupstream: Always call fclose on checkpoints.
dtucker@openbsd.org [Thu, 2 Mar 2023 06:41:56 +0000 (06:41 +0000)] 
upstream: Always call fclose on checkpoints.

In the case of an fprintf failure we would not call fclose which would
leak the FILE pointer.  While we're there, try to clean up the temp file
on failure.  Spotted by Coverity, ok djm@

OpenBSD-Commit-ID: 73c7ccc5d4fcc235f54c6b20767a2815408525ef

2 years agoupstream: Remove old log symlinks
dtucker@openbsd.org [Wed, 1 Mar 2023 21:54:50 +0000 (21:54 +0000)] 
upstream: Remove old log symlinks

before creating new ones. In -portable some platforms don't like
overwriting existing symlinks.

OpenBSD-Regress-ID: 7e7ddc0beb73e945e1c4c58d51c8a125b518120f

2 years agoAdjust test jobs for new log directory.
Darren Tucker [Wed, 1 Mar 2023 12:23:02 +0000 (23:23 +1100)] 
Adjust test jobs for new log directory.

2 years agoupstream: Rework logging for the regression tests.
dtucker@openbsd.org [Wed, 1 Mar 2023 09:29:32 +0000 (09:29 +0000)] 
upstream: Rework logging for the regression tests.

Previously we would log to ssh.log and sshd.log, but that is insufficient
for tests that have more than one concurent ssh/sshd.

Instead, we'll log to separate datestamped files in a $OBJ/log/ and
leave a symlink at the previous location pointing at the most recent
instance with an entry in regress.log showing which files were created
at each point.  This should be sufficient to reconstruct what happened
even for tests that use multiple instances of each program.  If the test
fails, tar up all of the logs for later analysis.

This will let us also capture the output from some of the other tools
which was previously sent to /dev/null although most of those will be
in future commits.

OpenBSD-Regress-ID: f802aa9e7fa51d1a01225c05fb0412d015c33e24

2 years agoupstream: fatal out if allocating banner string fails to avoid
dtucker@openbsd.org [Tue, 28 Feb 2023 21:31:50 +0000 (21:31 +0000)] 
upstream: fatal out if allocating banner string fails to avoid

potential null deref later in sscanf.  Spotted by Coverity, ok deraadt@

OpenBSD-Commit-ID: 74e8d228ac00552e96e9e968dfcccf8dd1f46ad5

2 years agoupstream: Explicitly ignore return from fchmod
dtucker@openbsd.org [Tue, 28 Feb 2023 08:45:24 +0000 (08:45 +0000)] 
upstream: Explicitly ignore return from fchmod

similar to other calls to prevent warning.

OpenBSD-Commit-ID: fdc5287dcee0860b5a493186414226c655b0eb0a

2 years agoupstream: Plug mem leak on globbed ls error path.
dtucker@openbsd.org [Mon, 27 Feb 2023 22:12:40 +0000 (22:12 +0000)] 
upstream: Plug mem leak on globbed ls error path.

 Spotted by Coverity, ok deraadt@

OpenBSD-Commit-ID: de28476025db29820a9a2e56e98b964d8a02861c

2 years agoCast time_t's in debug output to long long.
Darren Tucker [Mon, 27 Feb 2023 10:04:22 +0000 (21:04 +1100)] 
Cast time_t's in debug output to long long.

Should fix Coverity warning about truncation of 64bit time_t.

2 years agoDo shadow expiry calcs using "long long".
Darren Tucker [Mon, 27 Feb 2023 06:28:59 +0000 (17:28 +1100)] 
Do shadow expiry calcs using "long long".

Coverity flags these as potentially not 64bit time_t safe so use
long long for the calculations and debug output.  ok djm@

2 years agoavoid clash between for getopt's struct option
Damien Miller [Mon, 27 Feb 2023 06:07:52 +0000 (17:07 +1100)] 
avoid clash between for getopt's struct option

Since we don't use getopt_long() nothing outside the getopt()
implementation itself uses this structure, so move it into the
source to remove it from visibility and clashes with libc's

ok dtucker@

2 years agoRevert explicit chmods on private keys.
Darren Tucker [Sat, 25 Feb 2023 03:45:41 +0000 (14:45 +1100)] 
Revert explicit chmods on private keys.

This should no longer be needed on Cygwin test runners due to previous
commit.

2 years agoRemove extended ACLs from working dirs.
Darren Tucker [Sat, 25 Feb 2023 03:43:28 +0000 (14:43 +1100)] 
Remove extended ACLs from working dirs.

This should allow umask to work as expected and prevent tests from
failing due to excessive permissions on private keys.

2 years agoExplicitly set permissions on user and host keys.
Darren Tucker [Fri, 24 Feb 2023 02:44:13 +0000 (13:44 +1100)] 
Explicitly set permissions on user and host keys.

On cygwin, the umask might not be sufficient.  Should fix tests on
Github runners.

2 years agoupstream: fix progressmeter corruption on wide displays; bz3534
djm@openbsd.org [Wed, 22 Feb 2023 03:56:43 +0000 (03:56 +0000)] 
upstream: fix progressmeter corruption on wide displays; bz3534

feedback/ok dtucker@

OpenBSD-Commit-ID: f4affee067cec7c182f3e0b307d758e0472762a3

2 years agoupstream: fseek to end of known_hosts before writing to it.
dtucker@openbsd.org [Tue, 21 Feb 2023 06:48:18 +0000 (06:48 +0000)] 
upstream: fseek to end of known_hosts before writing to it.

POSIX and ANSI C require that applications call fseek or similar between
read and writing to a RW file.  OpenBSD doesn't enforce this, but some
(System V derived) platforms need this to prevent it from writing a
spurious extra byte (in this case, a newline).  ok djm@ deraadt@

OpenBSD-Commit-ID: 33e680dcd8110582a93a40a8491024e961f45137

2 years agoAlso run unit tests on AIX VMs.
Darren Tucker [Tue, 21 Feb 2023 06:51:09 +0000 (17:51 +1100)] 
Also run unit tests on AIX VMs.

In the past these tests took too long, but these days it only adds
about 5 min to the run.

2 years agoWrap stdint.h inside ifdef.
Darren Tucker [Tue, 21 Feb 2023 06:38:55 +0000 (17:38 +1100)] 
Wrap stdint.h inside ifdef.

2 years agoAdd includes to ptimeout test.
Mayank Sharma [Mon, 20 Feb 2023 12:07:15 +0000 (17:37 +0530)] 
Add includes to ptimeout test.

Fixes test failures on AIX due to type mismatches.

2 years agoAlways use the openssl binary configure tells us.
Darren Tucker [Mon, 20 Feb 2023 07:24:39 +0000 (18:24 +1100)] 
Always use the openssl binary configure tells us.

This fixes tests on platforms that do not have the openssl tool
installed at all.

2 years agoupstream: Remove now-unused compat bit SSH_BUG_RSASIGMD5. The code
dtucker@openbsd.org [Fri, 17 Feb 2023 04:22:50 +0000 (04:22 +0000)] 
upstream: Remove now-unused compat bit SSH_BUG_RSASIGMD5. The code

to set this was removed in OpenSSH 7.7 when support for SSH implementations
dating back to before RFC standardization were removed.  "burn it all" djm@

OpenBSD-Commit-ID: 6330935fbe23dd00be79891505e06d1ffdac7cda

2 years agoupstream: Remove now-unused compat bit SSH_BUG_BIGENDIANAES. This
dtucker@openbsd.org [Fri, 17 Feb 2023 03:06:18 +0000 (03:06 +0000)] 
upstream: Remove now-unused compat bit SSH_BUG_BIGENDIANAES. This

was previously set for OpenSSH 2.3 (released in 2000) but this check was
removed in OpenSSH 7.7 (2018).  ok djm@ deraadt@

OpenBSD-Commit-ID: 326426ea328707fc9e83305291ab135c87f678af

2 years agowhitespace fixes
Damien Miller [Thu, 16 Feb 2023 23:12:40 +0000 (10:12 +1100)] 
whitespace fixes

2 years agowhitespace at EOL
Damien Miller [Thu, 16 Feb 2023 23:02:08 +0000 (10:02 +1100)] 
whitespace at EOL

2 years agoupstream: Remove SSH_BUG_PASSWORDPAD compat bit
dtucker@openbsd.org [Thu, 16 Feb 2023 10:10:00 +0000 (10:10 +0000)] 
upstream: Remove SSH_BUG_PASSWORDPAD compat bit

since it's no longer used. ok markus@

OpenBSD-Commit-ID: b92c21f56fe4b7f9a54790d6a9650725c226820b

2 years agoupstream: Remove SSH_BUG_IGNOREMSG compat flag
dtucker@openbsd.org [Thu, 16 Feb 2023 07:55:15 +0000 (07:55 +0000)] 
upstream: Remove SSH_BUG_IGNOREMSG compat flag

since it's only applicable to SSH1 and thus no longer used.  ok markus@
"kill it with fire" djm@

OpenBSD-Commit-ID: ea13318b1937795d9db4790d3ce0a6ed01584dab

2 years agoupstream: space between macro and punctuation; sort usage();
jmc@openbsd.org [Fri, 10 Feb 2023 06:41:53 +0000 (06:41 +0000)] 
upstream: space between macro and punctuation; sort usage();

OpenBSD-Commit-ID: 6141610cfca037700730e41f868d1d9124958f8c

2 years agoupstream: space between macro and punctuation;
jmc@openbsd.org [Fri, 10 Feb 2023 06:40:48 +0000 (06:40 +0000)] 
upstream: space between macro and punctuation;

OpenBSD-Commit-ID: abc95e550be9e6d9a7ff64b65c104c7be21ab19e

2 years agoupstream: sort SYNOPSIS;
jmc@openbsd.org [Fri, 10 Feb 2023 06:39:27 +0000 (06:39 +0000)] 
upstream: sort SYNOPSIS;

OpenBSD-Commit-ID: dacd9da33277d5669a51213d880632599c890c1e

2 years agoImprove seccomp compat on older systems.
Darren Tucker [Sat, 11 Feb 2023 01:32:19 +0000 (12:32 +1100)] 
Improve seccomp compat on older systems.

Check if flags to mmap and madvise are defined before using them.
Should fix problems building on older Linux systems that don't have
these.  bz#3537, with & ok djm@.

2 years agoupstream: test -Ohashalg=... and that the default output contains both
djm@openbsd.org [Fri, 10 Feb 2023 05:06:03 +0000 (05:06 +0000)] 
upstream: test -Ohashalg=... and that the default output contains both

specified hash algorithms; prompted by dtucker@

OpenBSD-Regress-ID: 26f309208c8d8b8fa9c5f419767b85f1e9b22f51

2 years agoupstream: let ssh-keygen and ssh-keyscan accept
djm@openbsd.org [Fri, 10 Feb 2023 04:56:30 +0000 (04:56 +0000)] 
upstream: let ssh-keygen and ssh-keyscan accept

-Ohashalg=sha1|sha256 when outputting SSHFP fingerprints to allow algorithm
selection. bz3493 ok dtucker@

OpenBSD-Commit-ID: e6e07fe21318a873bd877f333e189eb963a11b3d

2 years agoupstream: add a `sshd -G` option that parses and prints the
djm@openbsd.org [Fri, 10 Feb 2023 04:47:19 +0000 (04:47 +0000)] 
upstream: add a `sshd -G` option that parses and prints the

effective configuration without attempting to load private keys and perform
other checks. This allows usage of the option before keys have been
generated.

bz3460 feedback/ok dtucker@

OpenBSD-Commit-ID: 774504f629023fc25a559ab1d95401adb3a7fb29

2 years agoupstream: make `ssh -Q CASignatureAlgorithms` work as the manpage says
djm@openbsd.org [Fri, 10 Feb 2023 04:40:28 +0000 (04:40 +0000)] 
upstream: make `ssh -Q CASignatureAlgorithms` work as the manpage says

it should bz3532

OpenBSD-Commit-ID: 0ddb17b3fcbd99bfb5baea4ac5e449620cbd3adc

2 years agoAdd CentOS 7 test targets.
Darren Tucker [Fri, 10 Feb 2023 03:26:44 +0000 (14:26 +1100)] 
Add CentOS 7 test targets.

2 years agoupstream: Test adding terminating newline to known_hosts.
dtucker@openbsd.org [Thu, 9 Feb 2023 09:55:33 +0000 (09:55 +0000)] 
upstream: Test adding terminating newline to known_hosts.

OpenBSD-Regress-ID: 5fc3010ac450195b3fbdeb68e875564968800365

2 years agoupstream: ssh-agent doesn't actually take -v,
dtucker@openbsd.org [Wed, 8 Feb 2023 08:06:03 +0000 (08:06 +0000)] 
upstream: ssh-agent doesn't actually take -v,

so the recently-added ones will result in the test not cleaning up
after itself.  Patch from cjwatson at debian.org vi bz#3536.

OpenBSD-Regress-ID: 1fc8283568f5bf2f918517c2c1e778072cf61b1a

2 years agoupstream: Ensure that there is a terminating newline when adding a new
dtucker@openbsd.org [Thu, 9 Feb 2023 09:54:11 +0000 (09:54 +0000)] 
upstream: Ensure that there is a terminating newline when adding a new

entry to known_hosts.  bz#3529, with git+openssh at limpsquid.nl, ok deraadt@
markus@

OpenBSD-Commit-ID: fa8d90698da1886570512b96f051e266eac105e0

2 years agoReplace 9.1 with 9.2 on CI status page.
Darren Tucker [Mon, 6 Feb 2023 21:43:47 +0000 (08:43 +1100)] 
Replace 9.1 with 9.2 on CI status page.

2 years agoharden Linux seccomp sandbox
Damien Miller [Fri, 3 Feb 2023 05:33:09 +0000 (16:33 +1100)] 
harden Linux seccomp sandbox

Linux mmap(2) and madvise(2) syscalls support quite a number of funky
flags that we don't expect that sshd/libc will ever need. We can
exclude this kernel attack surface by filtering the mmap(2) flags
and the madvise(2) advice arguments.

Similarly, the sandboxed process in sshd is a single-threaded program
that does not use shared memory for synchronisation or communication.
Therefore, there should be no reason for the advanced priority
inheritance futex(2) operations to be necessary. These can also be
excluded.

Motivated by Jann Horn pointing out that there have been kernel bugs
in nearby Linux kernel code, e.g. CVE-2020-29368, CVE-2020-29374 and
CVE-2022-42703.

Feedback Jann Horn, ok dtucker@

2 years agocrank versions in RPM specs V_9_2_P1
Damien Miller [Thu, 2 Feb 2023 12:21:54 +0000 (23:21 +1100)] 
crank versions in RPM specs