Commit Graph

12128 Commits

Author SHA1 Message Date
Damien Miller 1dba63eb10
crank version 2023-03-16 08:27:54 +11:00
djm@openbsd.org ba7532d0da
upstream: openssh-9.3
OpenBSD-Commit-ID: 8011495f2449c1029bb316bd015eab2e00509848
2023-03-16 08:21:56 +11:00
dtucker@openbsd.org 6fd4daafb9
upstream: Free KRL ptr in addition to its contents.
From Coverity CID 291841, ok djm@

OpenBSD-Commit-ID: f146ba08b1b43af4e0d7ad8c4dae3748b4fa31b6
2023-03-14 18:35:50 +11:00
dtucker@openbsd.org 1d270bd303
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
2023-03-14 18:35:31 +11:00
dtucker@openbsd.org d95af508e7
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
2023-03-12 22:02:18 +11:00
dtucker@openbsd.org 8f287ba60d
upstream: calloc can return NULL but xcalloc can't.
From Coverity CID 291881, ok djm@

OpenBSD-Commit-ID: 50204b755f66b2ec7ac3cfe379d07d85ca161d2b
2023-03-12 22:01:57 +11:00
dtucker@openbsd.org 83a56a49fd
upstream: Explicitly ignore return from fcntl
(... FD_CLOEXEC) here too.  Coverity CID 291853.

OpenBSD-Commit-ID: 99d8b3da9d0be1d07ca8dd8e98800a890349e9b5
2023-03-12 22:01:44 +11:00
Damien Miller 0fda9d704d
bounds checking for getrrsetbyname() replacement;
Spotted by Coverity in CID 405033; ok millert@
2023-03-10 15:59:46 +11:00
dtucker@openbsd.org 89b8df518f
upstream: Plug mem leak on error path. Coverity CID 405026, ok djm@.
OpenBSD-Commit-ID: 8212ca05d01966fb5e72205c592b2257708a2aac
2023-03-10 15:42:37 +11:00
Darren Tucker bf4dae0ad1
Add prototypes for mkstemp replacements.
Should prevent warnings due to our wrapper function.
2023-03-10 14:46:57 +11:00
dtucker@openbsd.org 4e04d68d6a
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
2023-03-10 14:46:25 +11:00
djm@openbsd.org d6d38fd77c
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
2023-03-10 14:02:39 +11:00
dtucker@openbsd.org 7187d3f86b
upstream: Remove no-op (int) > INT_MAX checks
since they can never be true. From Coverity CID 405031, ok djm@

OpenBSD-Commit-ID: 9df3783b181e056595e2bb9edf7ed41d61cf8e84
2023-03-10 13:45:00 +11:00
Darren Tucker 77adde4305
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@
2023-03-10 13:27:29 +11:00
jcs@openbsd.org 633d3dc2a1
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
2023-03-10 10:40:02 +11:00
dtucker@openbsd.org 733030840c
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
2023-03-09 18:32:48 +11:00
djm@openbsd.org 54ac4ab2b5
upstream: include destination constraints for smartcard keys too.
Spotted by Luci Stanescu; ok deraadt@ markus@

OpenBSD-Commit-ID: add879fac6903a1cb1d1e42c4309e5359c3d870f
2023-03-09 18:32:48 +11:00
Darren Tucker bfd1ad01d9
Limit the number of PAM environment variables.
xcalloc has its own limits, but these are specific to PAM.  From
Coverity CID 405198, ok djm@
2023-03-09 18:32:48 +11:00
Darren Tucker a231414970
Limit the number of PAM environment variables.
From Coverity CID 405194, tweaks and ok djm@
2023-03-09 18:32:48 +11:00
dtucker@openbsd.org 36c6c3eff5
upstream: Plug mem leak. Coverity CID 405196, ok djm@
OpenBSD-Commit-ID: 175f09349387c292f626da68f65f334faaa085f2
2023-03-08 17:31:07 +11:00
tb@openbsd.org dfb9b736e1
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
2023-03-08 17:26:57 +11:00
guenther@openbsd.org 51875897b8
upstream: Delete obsolete /* ARGSUSED */ lint comments.
ok miod@ millert@

OpenBSD-Commit-ID: 7be168a570264d59e96a7d2d22e927d45fee0e4c
2023-03-08 17:26:53 +11:00
Darren Tucker a76085bda8
Extra brackets to prevent warning. 2023-03-08 17:26:51 +11:00
djm@openbsd.org 147ae57d4d
upstream: use RSA/SHA256 when testing usability of private key in
agent; with/ok dtucker

OpenBSD-Commit-ID: fe1382e2fdf23fcae631308e72342bad56066a56
2023-03-08 11:06:57 +11:00
djm@openbsd.org 27fd251bc9
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
2023-03-08 11:06:57 +11:00
djm@openbsd.org eee9f3fc3d
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
2023-03-08 11:06:56 +11:00
Darren Tucker 42a06b29a4
Add header changes missed in previous. 2023-03-07 18:34:41 +11:00
dtucker@openbsd.org 4710077096
upstream: Fix mem leak in environment setup.
From jjelen at redhat.com via bz#2687, ok djm@

OpenBSD-Commit-ID: 9f9e4ba3cac003e6f81da3bcebd1b9ec43e7f353
2023-03-07 17:32:03 +11:00
dtucker@openbsd.org 03acc50d0c
upstream: Unit test for kex_proposal_populate_entries.
OpenBSD-Regress-ID: bdb211d80d572a08bf14b49fe2a58b9ff265c006
2023-03-07 17:31:57 +11:00
djm@openbsd.org 3f9231c2e1
upstream: fix memory leak in process_read() path; Spotted by James
Robinson in GHPR363; ok markus@

OpenBSD-Commit-ID: cdc2d98e6478b7e7f3a36976845adae3820429d8
2023-03-07 16:38:40 +11:00
djm@openbsd.org c5e6e89083
upstream: correct size for array argument when changing
UMAC_OUTPUT_LEN Coverity CID 291845; ok dtucker@

OpenBSD-Commit-ID: 2eb017d10705bb623d4418691f961c930eafaec0
2023-03-07 16:38:39 +11:00
dtucker@openbsd.org 9641753e0f
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
2023-03-06 23:31:52 +11:00
dtucker@openbsd.org aa59d6a489
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
2023-03-05 20:33:29 +11:00
dtucker@openbsd.org 23b8cb4176
upstream: Plug mem leak in moduli checkpoint option parsing.
From Coverity CID 291894.

OpenBSD-Commit-ID: 9b1aba2d049741ae21c8dc4560a7e29ab17310f4
2023-03-05 19:33:39 +11:00
dtucker@openbsd.org fc7f8f2188
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
2023-03-05 19:27:31 +11:00
dtucker@openbsd.org 6c165c3624
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
2023-03-04 14:43:21 +11:00
dtucker@openbsd.org 4a3918f51b
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
2023-03-04 14:43:10 +11:00
dtucker@openbsd.org e44846a448
upstream: Check for non-NULL before string
comparison. From jjelen at redhat.com via bz#2687.

OpenBSD-Commit-ID: 0d9b2e0cac88a311b5766b1aef737082583c285f
2023-03-04 14:42:56 +11:00
djm@openbsd.org 1842d523fa
upstream: guard against getsockname(-1, ...) from Coverity CID
291832

OpenBSD-Commit-ID: e58d5227327917d189229b7f0b37d2780f360d5f
2023-03-03 16:12:05 +11:00
djm@openbsd.org 78571a5fe9
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
2023-03-03 16:12:04 +11:00
djm@openbsd.org d1c1b3272e
upstream: actually print "channeltimeout none" in config dump mode;
spotted via Coverity CID 405022

OpenBSD-Commit-ID: b074b52bf138b75f08264e8da15880b29c7a630f
2023-03-03 16:12:04 +11:00
Darren Tucker 8bf61e9561
Add Coverity badges. 2023-03-03 14:50:03 +11:00
dtucker@openbsd.org 93291bd723
upstream: Check return values of dup2. Spotted by Coverity, ok djm@
OpenBSD-Commit-ID: 19fb1b53072826d00c67df677731d2f6c1dd602b
2023-03-03 14:49:14 +11:00
dtucker@openbsd.org e37261dff3
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
2023-03-03 14:16:42 +11:00
dtucker@openbsd.org 32755a98c2
upstream: Check return value from fctnl and warn on failure.
Spotted by Coverity, ok djm@

OpenBSD-Commit-ID: 2097c7db3cf657f1e3a6c5077041bacc63143cab
2023-03-03 14:14:12 +11:00
dtucker@openbsd.org 5fc60e8246
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
2023-03-02 22:33:12 +11:00
dtucker@openbsd.org 0d514659b2
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
2023-03-02 19:32:21 +11:00
dtucker@openbsd.org 860201201d
upstream: Quote grep and log message better.
OpenBSD-Regress-ID: 3823d9063127169736aa274b1784cb28e15b64d4
2023-03-02 19:32:18 +11:00
dtucker@openbsd.org 03a03c6002
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
2023-03-02 18:24:51 +11:00
dtucker@openbsd.org 13fe8f9785
upstream: Remove old log symlinks
before creating new ones. In -portable some platforms don't like
overwriting existing symlinks.

OpenBSD-Regress-ID: 7e7ddc0beb73e945e1c4c58d51c8a125b518120f
2023-03-02 17:43:00 +11:00