]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
2 years agoupstream: match_user() shouldn't be called with user==NULL unless
djm@openbsd.org [Thu, 6 Apr 2023 03:19:32 +0000 (03:19 +0000)] 
upstream: match_user() shouldn't be called with user==NULL unless

host and ipaddr are also NULL

OpenBSD-Commit-ID: fa3518346c21483e9e01a2e4b9436ae501daf8ea

2 years agoupstream: don't care about glob() return value here.
djm@openbsd.org [Thu, 6 Apr 2023 03:12:32 +0000 (03:12 +0000)] 
upstream: don't care about glob() return value here.

OpenBSD-Commit-ID: 85bb82fea90478a482e9f65a1bec0aa24227fd66

2 years agoupstream: Move up null check and simplify process_escapes.
dtucker@openbsd.org [Mon, 3 Apr 2023 08:10:54 +0000 (08:10 +0000)] 
upstream: Move up null check and simplify process_escapes.

Based on Coverity CID 291863 which points out we check the channel
pointer for NULLness after dereferencing it.  Move this to the start
of the function, and while there simplify initialization of efc a bit.
ok djm@

OpenBSD-Commit-ID: de36e5ad6fde0fe263ca134e986b9095dc59380a

2 years agoneed va_end() after va_copy(); ok dtucker
Damien Miller [Fri, 31 Mar 2023 03:51:20 +0000 (14:51 +1100)] 
need va_end() after va_copy(); ok dtucker

spotted by Coverity

2 years agoupstream: Explicitly ignore return from waitpid here too.
dtucker@openbsd.org [Fri, 31 Mar 2023 05:56:36 +0000 (05:56 +0000)] 
upstream: Explicitly ignore return from waitpid here too.

OpenBSD-Commit-ID: eef2403df083c61028969fc679ee370373eacacb

2 years agoupstream: Explictly ignore return codes
dtucker@openbsd.org [Fri, 31 Mar 2023 04:45:08 +0000 (04:45 +0000)] 
upstream: Explictly ignore return codes

where we don't check them.

OpenBSD-Commit-ID: 1ffb03038ba1b6b72667be50cf5e5e396b5f2740

2 years agoupstream: Return immediately from get_sock_port
dtucker@openbsd.org [Fri, 31 Mar 2023 04:42:29 +0000 (04:42 +0000)] 
upstream: Return immediately from get_sock_port

if sock <0 so we don't call getsockname on a negative FD.  From Coverity
CID 291840, ok djm@

OpenBSD-Commit-ID: de1c1130646230c2eda559831fc6bfd1b61d9618

2 years agoupstream: don't leak arg2 on parse_pubkey_algos error path; ok
djm@openbsd.org [Fri, 31 Mar 2023 04:23:02 +0000 (04:23 +0000)] 
upstream: don't leak arg2 on parse_pubkey_algos error path; ok

dtucker@

OpenBSD-Commit-ID: 7d0270ad3dd102412ca76add2b3760518abdef75

2 years agoupstream: clamp max number of GSSAPI mechanisms to 2048; ok dtucker
djm@openbsd.org [Fri, 31 Mar 2023 04:22:27 +0000 (04:22 +0000)] 
upstream: clamp max number of GSSAPI mechanisms to 2048; ok dtucker

OpenBSD-Commit-ID: ce66db603a913d3dd57063e330cb5494d70722c4

2 years agoupstream: don't print key if printing hostname failed; with/ok
djm@openbsd.org [Fri, 31 Mar 2023 04:21:56 +0000 (04:21 +0000)] 
upstream: don't print key if printing hostname failed; with/ok

dtucker@

OpenBSD-Commit-ID: ad42971a6ee5a46feab2d79f7f656f8cf4b119f3

2 years agoupstream: remove redundant test
djm@openbsd.org [Fri, 31 Mar 2023 04:04:15 +0000 (04:04 +0000)] 
upstream: remove redundant test

OpenBSD-Commit-ID: 6a0b719f9b1ae9d42ad8c5b144c7962c93792f7c

2 years agoupstream: don't attempt to decode a ridiculous number of
djm@openbsd.org [Fri, 31 Mar 2023 04:00:37 +0000 (04:00 +0000)] 
upstream: don't attempt to decode a ridiculous number of

attributes; harmless because of bounds elsewhere, but better to be explicit

OpenBSD-Commit-ID: 1a34f4b6896155b80327d15dc7ccf294b538a9f2

2 years agoupstream: remove unused variable; prompted by Coverity CID 291879
djm@openbsd.org [Fri, 31 Mar 2023 03:22:49 +0000 (03:22 +0000)] 
upstream: remove unused variable; prompted by Coverity CID 291879

OpenBSD-Commit-ID: 4c7d20ef776887b0ba1aabcfc1b14690e4ad0a40

2 years agoupstream: Check fd against >=0 instead of >0 in error path. The
dtucker@openbsd.org [Fri, 31 Mar 2023 00:44:29 +0000 (00:44 +0000)] 
upstream: Check fd against >=0 instead of >0 in error path. The

dup could in theory return fd 0 although currently it doesn't in practice.
From Dmitry Belyavskiy vi github PR#238.

OpenBSD-Commit-ID: 4a95f3f7330394dffee5c749d52713cbf3b54846

2 years agoupstream: Ignore return value from muxclient(). It normally loops
dtucker@openbsd.org [Thu, 30 Mar 2023 07:19:50 +0000 (07:19 +0000)] 
upstream: Ignore return value from muxclient(). It normally loops

without returning, but it if returns on failure we immediately exit.
Coverity CID 405050.

OpenBSD-Commit-ID: ab3fde6da384ea588226037c38635a6b2e015295

2 years agodon't call connect() on negative socket
Damien Miller [Fri, 31 Mar 2023 03:17:22 +0000 (14:17 +1100)] 
don't call connect() on negative socket

Coverity CID 405037

2 years agoupstream: return SSH_ERR_KEY_NOT_FOUND if the allowed_signers file
djm@openbsd.org [Thu, 30 Mar 2023 03:05:01 +0000 (03:05 +0000)] 
upstream: return SSH_ERR_KEY_NOT_FOUND if the allowed_signers file

is empty, not SSH_ERR_INTERNAL_ERROR. Also remove some dead code spotted
by Coverity; with/ok dtucker@

OpenBSD-Commit-ID: 898a1e817cda9869554b1f586a434f67bcc3b650

2 years agoupstream: Remove dead code from inside if block.
dtucker@openbsd.org [Thu, 30 Mar 2023 00:49:37 +0000 (00:49 +0000)] 
upstream: Remove dead code from inside if block.

The only way the if statement can be true is if both dup()s fail, and
in that case the tmp2 can never be set. Coverity CID 291805, ok djm@

OpenBSD-Commit-ID: c0d6089b3fb725015462040cd94e23237449f0c8

2 years agochild_set_eng: verify both env pointer and count.
Darren Tucker [Thu, 30 Mar 2023 02:53:29 +0000 (13:53 +1100)] 
child_set_eng: verify both env pointer and count.

If child_set env was called with a NULL env pointer and a non-zero count
it would end up in a null deref, although we don't currently do this.
Prompted by Coverity CID 291850, tweak & ok djm@

2 years agoupstream: Ignore return from sshpkt_disconnect
dtucker@openbsd.org [Wed, 29 Mar 2023 01:07:48 +0000 (01:07 +0000)] 
upstream: Ignore return from sshpkt_disconnect

since we set our own return value for the function.  Coverity CID 291797,
ok djm@

OpenBSD-Commit-ID: 710b57ba954c139240895e23feea41f203201f04

2 years agoupstream: Plug potential mem leak in process_put.
dtucker@openbsd.org [Wed, 29 Mar 2023 00:59:08 +0000 (00:59 +0000)] 
upstream: Plug potential mem leak in process_put.

It allocates abs_dst inside a loop but only frees it on exit, so free
inside the loop if necessary.  Coverity CID 291837, ok djm@

OpenBSD-Commit-ID: a01616503a185519b16f00dde25d34ceaf4ae1a3

2 years agoupstream: fix memory leak; Coverity CID 291848
djm@openbsd.org [Wed, 29 Mar 2023 00:18:35 +0000 (00:18 +0000)] 
upstream: fix memory leak; Coverity CID 291848

with/ok dtucker@

OpenBSD-Commit-ID: 37f80cb5d075ead5a00ad1b74175684ab1156ff8

2 years agoupstream: Plug more mem leaks in sftp by making
dtucker@openbsd.org [Tue, 28 Mar 2023 07:44:32 +0000 (07:44 +0000)] 
upstream: Plug more mem leaks in sftp by making

make_absolute_pwd_glob work in the same way as make_absolute: you
pass it a dynamically allocated string and it either returns it, or
frees it and allocates a new one. Patch from emaste at freebsd.org and
https://reviews.freebsd.org/D37253 ok djm@

OpenBSD-Commit-ID: 85f7404e9d47fd28b222fbc412678f3361d2dffc

2 years agoupstream: Remove compat code for OpenSSL < 1.1.*
dtucker@openbsd.org [Tue, 28 Mar 2023 06:12:38 +0000 (06:12 +0000)] 
upstream: Remove compat code for OpenSSL < 1.1.*

since -portable no longer supports them.

OpenBSD-Commit-ID: ea2893783331947cd29a67612b4e56f818f185ff

2 years agoupstream: Remove compat code for OpenSSL 1.0.*
dtucker@openbsd.org [Mon, 27 Mar 2023 23:56:54 +0000 (23:56 +0000)] 
upstream: Remove compat code for OpenSSL 1.0.*

versions now that -portable has dropped support for those versions.

OpenBSD-Regress-ID: 82a8eacd87aec28e4aa19f17246ddde9d5ce7fe7

2 years agoPrevent conflicts between Solaris SHA2 and OpenSSL.
Darren Tucker [Tue, 28 Mar 2023 07:06:42 +0000 (18:06 +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 agoRemove HEADER_SHA_H from previous...
Darren Tucker [Tue, 28 Mar 2023 01:44:03 +0000 (12:44 +1100)] 
Remove HEADER_SHA_H from previous...

since it causes more problems than it solves.

2 years agoReplace OPENSSL_NO_SHA with HEADER_SHA_H.
Darren Tucker [Mon, 27 Mar 2023 23:35:18 +0000 (10:35 +1100)] 
Replace OPENSSL_NO_SHA with HEADER_SHA_H.

Since this test doesn't use OpenSSL's SHA2 and may cause conflicts we
don't want to include it, but OPENSSL_NO_SHA was removed beginning in
OpenSSL's 1.1 series.

2 years agoConfigure with --target instead of deprecated form.
Darren Tucker [Mon, 27 Mar 2023 22:50:06 +0000 (09:50 +1100)] 
Configure with --target instead of deprecated form.

2 years agoPass rpath when building 64bit Solaris.
Darren Tucker [Mon, 27 Mar 2023 11:05:29 +0000 (22:05 +1100)] 
Pass rpath when building 64bit Solaris.

2 years agoExplicitly disable OpenSSL on AIX test VM.
Darren Tucker [Mon, 27 Mar 2023 08:21:19 +0000 (19:21 +1100)] 
Explicitly disable OpenSSL on AIX test VM.

2 years agoupstream: Add RevokedHostKeys to percent expansion test.
dtucker@openbsd.org [Mon, 27 Mar 2023 03:56:50 +0000 (03:56 +0000)] 
upstream: Add RevokedHostKeys to percent expansion test.

OpenBSD-Regress-ID: c077fd12a38005dd53d878c5b944154dec88d2ff

2 years agoupstream: Add tilde and environment variable expansion to
dtucker@openbsd.org [Mon, 27 Mar 2023 03:56:11 +0000 (03:56 +0000)] 
upstream: Add tilde and environment variable expansion to

RevokedHostKeys. bz#3552, ok djm@

OpenBSD-Commit-ID: ce5d8e0219b63cded594c17d4c2958c06918ec0d

2 years agoupstream: fix test: getnameinfo returns a non-zero value on error, not
djm@openbsd.org [Mon, 27 Mar 2023 03:31:05 +0000 (03:31 +0000)] 
upstream: fix test: getnameinfo returns a non-zero value on error, not

(neccessarily) -1. From GHPR#384

OpenBSD-Commit-ID: d35e2b71268f66f5543a7ea68751972b3ae22b25

2 years agoupstream: scp: when copying local->remote, check that source file
djm@openbsd.org [Mon, 27 Mar 2023 03:25:08 +0000 (03:25 +0000)] 
upstream: scp: when copying local->remote, check that source file

exists before opening SFTP connection to the server. Based on GHPR#370 ok
dtucker, markus

OpenBSD-Commit-ID: b4dd68e15bfe22ce4fac9960a1066a2b721e54fb

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 agoExplicitly disable security key test on aix51 VM.
Darren Tucker [Mon, 27 Mar 2023 00:08:00 +0000 (11:08 +1100)] 
Explicitly disable security key test on aix51 VM.

We don't know how to build the shared objects required for the security
key tests so skip them.

2 years agoSplit libcrypto and other config flags.
Darren Tucker [Sun, 26 Mar 2023 03:49:43 +0000 (14:49 +1100)] 
Split libcrypto and other config flags.

This should allow the automatic OpenSSL version selection in the tests
to work better.

2 years agoSpecify test target if we build without OpenSSL.
Darren Tucker [Sun, 26 Mar 2023 03:39:45 +0000 (14:39 +1100)] 
Specify test target if we build without OpenSSL.

When we decide we can't use the versions of OpenSSL available, also
restrict the tests we run to avoid the ones that need OpenSSL.

2 years agoFind suitable OpenSSL version.
Darren Tucker [Sun, 26 Mar 2023 03:22:53 +0000 (14:22 +1100)] 
Find suitable OpenSSL version.

Check the installed OpenSSL versions for a suitable one, and if there
isn't (and we don't have a specific version configured) then build
without OpenSSL.

2 years agoGithub testing support for BoringSSL
Damien Miller [Fri, 24 Mar 2023 04:02:52 +0000 (15:02 +1100)] 
Github testing support for BoringSSL

2 years agoBoringSSL doesn't support EC_POINT_point2bn()
Damien Miller [Fri, 24 Mar 2023 04:34:29 +0000 (15:34 +1100)] 
BoringSSL doesn't support EC_POINT_point2bn()

so don't invoke it in unittest

2 years agoanother ERR_load_CRYPTO_strings() vestige
Damien Miller [Fri, 24 Mar 2023 04:34:05 +0000 (15:34 +1100)] 
another ERR_load_CRYPTO_strings() vestige

2 years agodon't use obsolete ERR_load_CRYPTO_strings()
Damien Miller [Fri, 24 Mar 2023 04:24:05 +0000 (15:24 +1100)] 
don't use obsolete ERR_load_CRYPTO_strings()

OpenSSL (and elsewhere in OpenSSH) uses ERR_load_crypto_strings()

2 years agoAllow building with BoringSSL
Damien Miller [Fri, 24 Mar 2023 04:23:05 +0000 (15:23 +1100)] 
Allow building with BoringSSL

2 years agoput back SSLeay_version compat in configure test
Damien Miller [Fri, 24 Mar 2023 04:21:18 +0000 (15:21 +1100)] 
put back SSLeay_version compat in configure test

Needed to detect old versions and give good "your version is bad"
messages at configure time; spotted by dtucker@

2 years agoremove support for old libcrypto
Damien Miller [Fri, 24 Mar 2023 02:56:25 +0000 (13:56 +1100)] 
remove support for old libcrypto

OpenSSH now requires LibreSSL 3.1.0 or greater or
OpenSSL 1.1.1 or greater

with/ok dtucker@

2 years agoTest latest OpenSSL 1.1, 3.0 and LibreSSL 3.7.
Darren Tucker [Sun, 19 Mar 2023 04:36:13 +0000 (15:36 +1100)] 
Test latest OpenSSL 1.1, 3.0 and LibreSSL 3.7.

2 years agoShow 9.3 branch instead of 9.2.
Darren Tucker [Thu, 16 Mar 2023 10:38:04 +0000 (21:38 +1100)] 
Show 9.3 branch instead of 9.2.

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