]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
2 years agoupstream: missing match localnetwork negation check
djm@openbsd.org [Mon, 17 Jul 2023 06:16:33 +0000 (06:16 +0000)] 
upstream: missing match localnetwork negation check

OpenBSD-Commit-ID: 9a08ed8dae27d3f38cf280f1b28d4e0ff41a737a

2 years agoupstream: - add -P to usage() - sync the arg name to -J in usage()
jmc@openbsd.org [Mon, 17 Jul 2023 05:41:53 +0000 (05:41 +0000)] 
upstream: - add -P to usage() - sync the arg name to -J in usage()

with that in ssh.1 - reformat usage() to match what "man ssh" does on 80width

OpenBSD-Commit-ID: 5235dd7aa42e5bf90ae54579d519f92fc107036e

2 years agoupstream: -P before -p in SYNOPSIS;
jmc@openbsd.org [Mon, 17 Jul 2023 05:38:10 +0000 (05:38 +0000)] 
upstream: -P before -p in SYNOPSIS;

OpenBSD-Commit-ID: 535f5257c779e26c6a662a038d241b017f8cab7c

2 years agoupstream: configuation -> configuration
jsg@openbsd.org [Mon, 17 Jul 2023 05:36:14 +0000 (05:36 +0000)] 
upstream: configuation -> configuration

OpenBSD-Commit-ID: 4776ced33b780f1db0b2902faec99312f26a726b

2 years agoupstream: move other RCSIDs to before their respective license blocks
djm@openbsd.org [Mon, 17 Jul 2023 05:26:38 +0000 (05:26 +0000)] 
upstream: move other RCSIDs to before their respective license blocks

too no code change

OpenBSD-Commit-ID: ef5bf46b57726e4260a63b032b0b5ac3b4fe9cd4

2 years agoupstream: Move RCSID to before license block and away from #includes,
djm@openbsd.org [Mon, 17 Jul 2023 05:22:30 +0000 (05:22 +0000)] 
upstream: Move RCSID to before license block and away from #includes,

where it caused merge conflict in -portable for each commit :(

OpenBSD-Commit-ID: 756ebac963df3245258b962e88150ebab9d5fc20

2 years agoupstream: return SSH_ERR_KRL_BAD_MAGIC when a KRL doesn't contain a
djm@openbsd.org [Mon, 17 Jul 2023 05:20:15 +0000 (05:20 +0000)] 
upstream: return SSH_ERR_KRL_BAD_MAGIC when a KRL doesn't contain a

valid magic number and not SSH_ERR_MESSAGE_INCOMPLETE; the former is needed
to fall back to text revocation lists in some cases; fixes t-cert-hostkey.

OpenBSD-Commit-ID: 5c670a6c0f027e99b7774ef29f18ba088549c7e1

2 years agoavoid AF_LINK on platforms that don't define it
Damien Miller [Mon, 17 Jul 2023 04:56:14 +0000 (14:56 +1000)] 
avoid AF_LINK on platforms that don't define it

2 years agoupstream: Add support for configuration tags to ssh(1).
djm@openbsd.org [Mon, 17 Jul 2023 04:08:31 +0000 (04:08 +0000)] 
upstream: Add support for configuration tags to ssh(1).

This adds a ssh_config(5) "Tag" directive and corresponding
"Match tag" predicate that may be used to select blocks of
configuration similar to the pf.conf(5) keywords of the same
name.

ok markus

OpenBSD-Commit-ID: dc08358e70e702b59ac3e591827e5a96141b06a3

2 years agoupstream: add a "match localnetwork" predicate.
djm@openbsd.org [Mon, 17 Jul 2023 04:04:36 +0000 (04:04 +0000)] 
upstream: add a "match localnetwork" predicate.

This allows matching on the addresses of available network interfaces
and may be used to vary the effective client configuration based on
network location (e.g. to use a ProxyJump when not on a particular
network).

ok markus@

OpenBSD-Commit-ID: cffb6ff9a3803abfc52b5cad0aa190c5e424c139

2 years agoupstream: remove vestigal support for KRL signatures
djm@openbsd.org [Mon, 17 Jul 2023 04:01:10 +0000 (04:01 +0000)] 
upstream: remove vestigal support for KRL signatures

When the KRL format was originally defined, it included support for
signing of KRL objects. However, the code to sign KRLs and verify KRL
signatues was never completed in OpenSSH.

Now, some years later, we have SSHSIG support in ssh-keygen that is
more general, well tested and actually works. So this removes the
semi-finished KRL signing/verification support from OpenSSH and
refactors the remaining code to realise the benefit - primarily, we
no longer need to perform multiple parsing passes over KRL objects.

ok markus@

OpenBSD-Commit-ID: 517437bab3d8180f695c775410c052340e038804

2 years agoupstream: Support for KRL extensions.
djm@openbsd.org [Mon, 17 Jul 2023 03:57:21 +0000 (03:57 +0000)] 
upstream: Support for KRL extensions.

This defines wire formats for optional KRL extensions and implements
parsing of the new submessages. No actual extensions are supported at
this point.

ok markus

OpenBSD-Commit-ID: ae2fcde9a22a9ba7f765bd4f36b3f5901d8c3fa7

2 years agoupstream: Include stdint.h for SIZE_MAX. Fixes OPENSSL=no build.
dtucker@openbsd.org [Fri, 14 Jul 2023 07:44:21 +0000 (07:44 +0000)] 
upstream: Include stdint.h for SIZE_MAX. Fixes OPENSSL=no build.

OpenBSD-Commit-ID: e7c31034a5434f2ead3579b13a7892960651e6b0

2 years agoFix typo in declaration of nmesg.
Darren Tucker [Fri, 14 Jul 2023 07:07:32 +0000 (17:07 +1000)] 
Fix typo in declaration of nmesg.

2 years agoportable-specific int overflow defence-in-depth
Damien Miller [Fri, 14 Jul 2023 05:34:47 +0000 (15:34 +1000)] 
portable-specific int overflow defence-in-depth

These too are unreachable, but we want the code to be safe regardless of
context. Reported by Yair Mizrahi @ JFrog

2 years agoupstream: add defence-in-depth checks for some unreachable integer
djm@openbsd.org [Fri, 14 Jul 2023 05:31:44 +0000 (05:31 +0000)] 
upstream: add defence-in-depth checks for some unreachable integer

overflows reported by Yair Mizrahi @ JFrog; feedback/ok millert@

OpenBSD-Commit-ID: 52af085f4e7ef9f9d8423d8c1840a6a88bda90bd

2 years agoupstream: misplaced debug message
djm@openbsd.org [Mon, 10 Jul 2023 04:51:26 +0000 (04:51 +0000)] 
upstream: misplaced debug message

OpenBSD-Commit-ID: d0f12af0a5067a756aa707bc39a83fa6f58bf7e5

2 years agoreplace deprecate selinux matchpathcon function
Damien Miller [Wed, 12 Jul 2023 01:41:19 +0000 (11:41 +1000)] 
replace deprecate selinux matchpathcon function

This function is apparently deprecated. Documentation on what is the
supposed replacement is is non-existent, so this follows the approach
glibc used https://sourceware.org/git/?p=glibc.git;a=patch;h=f278835f59

ok dtucker@

2 years agoupstream: minleft and maxsign are u_int so cast appropriately. Prompted
dtucker@openbsd.org [Thu, 6 Jul 2023 22:17:59 +0000 (22:17 +0000)] 
upstream: minleft and maxsign are u_int so cast appropriately. Prompted

by github PR#410, ok deraadt.

OpenBSD-Commit-ID: 0514cd51db3ec60239966622a0d3495b15406ddd

2 years agoupstream: add support for unix domain sockets to ssh -W
dlg@openbsd.org [Tue, 4 Jul 2023 03:59:21 +0000 (03:59 +0000)] 
upstream: add support for unix domain sockets to ssh -W

ok djm@ dtucker@

OpenBSD-Commit-ID: 3e6d47567b895c7c28855c7bd614e106c987a6d8

2 years agogss-serv.c: `MAXHOSTNAMELEN` -> `HOST_NAME_MAX`
David Seifert [Fri, 12 May 2023 12:06:01 +0000 (14:06 +0200)] 
gss-serv.c: `MAXHOSTNAMELEN` -> `HOST_NAME_MAX`

`MAXHOSTNAMELEN` is not defined in POSIX, which breaks on musl:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/gethostname.html

Bug: https://bugs.gentoo.org/834044

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 agohandle sysconf(SC_OPEN_MAX) returning > INT_MAX;
Damien Miller [Thu, 22 Jun 2023 05:04:03 +0000 (15:04 +1000)] 
handle sysconf(SC_OPEN_MAX) returning > INT_MAX;

bz3581; ok dtucker

2 years agoupstream: better validate CASignatureAlgorithms in ssh_config and
djm@openbsd.org [Wed, 21 Jun 2023 05:10:26 +0000 (05:10 +0000)] 
upstream: better validate CASignatureAlgorithms in ssh_config and

sshd_config.

Previously this directive would accept certificate algorithm names, but
these were unusable in practice as OpenSSH does not support CA chains.

part of bz3577; ok dtucker@

OpenBSD-Commit-ID: a992d410c8a78ec982701bc3f91043dbdb359912

2 years agoupstream: make `ssh -Q CASignatureAlgorithms` only list signature
djm@openbsd.org [Wed, 21 Jun 2023 05:08:32 +0000 (05:08 +0000)] 
upstream: make `ssh -Q CASignatureAlgorithms` only list signature

algorithms that are valid for CA signing. Previous behaviour was to list all
signing algorithms, including certificate algorithms (OpenSSH certificates do
not support CA chains). part of bz3577; ok dtucker@

OpenBSD-Commit-ID: 99c2b072dbac0f44fd1f2269e3ff6c1b5d7d3e59

2 years agoupstream: handle rlimits > INT_MAX (rlim_t is u64); ok dtucker
djm@openbsd.org [Wed, 21 Jun 2023 05:06:04 +0000 (05:06 +0000)] 
upstream: handle rlimits > INT_MAX (rlim_t is u64); ok dtucker

bz3581

OpenBSD-Commit-ID: 31cf59c041becc0e5ccb0a77106f812c4cd1cd74

2 years agoupstream: prepare for support for connecting to unix domain sockets
djm@openbsd.org [Tue, 20 Jun 2023 23:59:33 +0000 (23:59 +0000)] 
upstream: prepare for support for connecting to unix domain sockets

using ssh -W by explicitly decoding PORT_STREAMLOCAL (a negative number) from
the u32 that's passed over the multiplexing socket; previously code would
just cast, which is UB.

OpenBSD-Commit-ID: e5ac5f40d354096c51e8c118a5c1b2d2b7a31384

2 years agoupstream: reset comment=NULL for each key in do_fingerprint();
djm@openbsd.org [Tue, 20 Jun 2023 00:05:09 +0000 (00:05 +0000)] 
upstream: reset comment=NULL for each key in do_fingerprint();

fixes "no comment" not showing on when running `ssh-keygen -l` on multiple
keys where one has a comment and other following keys do not. Patch from
Markus Kuhn via GHPR407, bz3580

OpenBSD-Commit-ID: 3cce84456fdcd67dc6b84e369f92c6686d111d9b

2 years agoupstream: Store timeouts as int, not u_int as they are limited to
millert@openbsd.org [Mon, 5 Jun 2023 13:24:36 +0000 (13:24 +0000)] 
upstream: Store timeouts as int, not u_int as they are limited to

INT_MAX. Fixes sign compare warnings systems with 32-bit time_t due to type
promotion.  OK djm@

OpenBSD-Commit-ID: 48081e9ad35705c5f1705711704a4c2ff94e87b7

2 years agofixup! if -s & -p specified, mention 'sftp -P' on
Philip Hands [Wed, 24 May 2023 17:41:14 +0000 (19:41 +0200)] 
fixup! if -s & -p specified, mention 'sftp -P' on

success

SSH-Copy-ID-Upstream: 32686e7c65b4fa2846e474d3315102dfa0f043b0

2 years agoMake ssh-copy-id(1) consistent with OpenSSH.
Darren Tucker [Tue, 3 Aug 2021 11:25:48 +0000 (21:25 +1000)] 
Make ssh-copy-id(1) consistent with OpenSSH.

This makes the ssh-copy-id man page more consistent with the rest of the
OpenSSH man pages:
- new sentence, new line
- no sentences >80
- N.B. -> NB
- zap unused .Pp
- zap trailing whitespace

Report from Debian via mindrot bz#3331, diff from jmc at openbsd.org.

SSH-Copy-ID-Upstream: d8974cfb6242316460ed22a1ccc662800a50c5d3

2 years agoif -s & -p specified, mention 'sftp -P' on success
Philip Hands [Wed, 24 May 2023 09:45:43 +0000 (11:45 +0200)] 
if -s & -p specified, mention 'sftp -P' on success

This was inspired by this:
 https://github.com/openssh/openssh-portable/pull/321
but I thought that it was better to not do the sed patching.

BTW the reason one can get away with using $SSH_OPTS throughout, despite
the lowercase -p in there, even if sftp is in use, is that the sftp call
is using the already-established ssh master connection, so the port was
passed to the earlier ssh.

SSH-Copy-ID-Upstream: 1c124d9bfafdbe28a00b683367ebf5750ce12eb2

2 years agodrop whitespace
Philip Hands [Tue, 23 May 2023 21:07:11 +0000 (23:07 +0200)] 
drop whitespace

SSH-Copy-ID-Upstream: e604fae1cdee35c18055d35dcec530cf12ef00ad

2 years agomake -x also apply to the target script
Philip Hands [Tue, 23 May 2023 18:52:13 +0000 (20:52 +0200)] 
make -x also apply to the target script

SSH-Copy-ID-Upstream: 3c4214704f427bd0654adf9b0fc079253db21cf4

2 years agoadd -t option to specify the target path
Philip Hands [Tue, 23 May 2023 14:46:42 +0000 (16:46 +0200)] 
add -t option to specify the target path

Allow the default target path (.ssh/authorized_files) to be over-riden

This was inspired by this MR from Panagiotis Cheilaris <philaris@cs.ntua.gr>

 https://gitlab.com/phil_hands/ssh-copy-id/-/merge_requests/8

SSH-Copy-ID-Upstream: a942a0e076874adb6d8b2f0fb76d6c7918190fcd

2 years agoFix test error for /bin/sh on Solaris 10 and older
Carlos Rodríguez Gili [Tue, 20 Apr 2021 17:23:57 +0000 (19:23 +0200)] 
Fix test error for /bin/sh on Solaris 10 and older

On Solaris 10 and older targets /bin/sh is not POSIX-compliant.
Test -z `...` fails with error 'sh: test: argument expected'.
Using quotes around backticks fixes this and doesn't break
POSIX compatibility.

SSH-Copy-ID-Upstream: 98394072a3f985b2650c1e8eab2fef84e38cc065

2 years agoRemove outdated comment
Jakub Jelen [Tue, 2 Mar 2021 21:34:05 +0000 (21:34 +0000)] 
Remove outdated comment

The commit b068122 removed the code dropping the trailing colon, but the comment stayed leaving the code confusing for future readers

SSH-Copy-ID-Upstream: 930d39f238117cd53810240ec989d0356aa1c1f6

2 years agoSpecial case OpenWrt instead of Dropbear.
Darren Tucker [Wed, 10 May 2023 08:50:46 +0000 (18:50 +1000)] 
Special case OpenWrt instead of Dropbear.

OpenWrt overrides the location of authorized_keys for root.  Currently we
assume that all Dropbear installations behave this way, which is not the
case.  Check for OpenWrt and root user before using that location instead
of assuming that for all Dropbear servers.  Prompted by Github PR#250.

SSH-Copy-ID-Upstream: 0e1f5d443a9967483c33945793107ae3f3e4af2d

2 years agossh-copy-id: add -x option (for debugging)
Philip Hands [Thu, 18 May 2023 16:20:55 +0000 (18:20 +0200)] 
ssh-copy-id: add -x option (for debugging)

This option causes the ssh-copy-id to run with set -x

SSH-Copy-ID-Upstream: a0ee367ea8c0a29c8b4515245e408d2d349e7844

2 years agoupdate copyright notices
Philip Hands [Thu, 18 May 2023 15:14:41 +0000 (17:14 +0200)] 
update copyright notices

SSH-Copy-ID-Upstream: c284ed33b361814ea48ff68cbd01ca525b2bf117

2 years agoupstream: fix AuthorizedPrincipalsCommand when AuthorizedKeysCommand
djm@openbsd.org [Wed, 24 May 2023 23:01:06 +0000 (23:01 +0000)] 
upstream: fix AuthorizedPrincipalsCommand when AuthorizedKeysCommand

appears previously in configuration. Reported by John Meyers in bz3574 ok
dtucker@

OpenBSD-Commit-ID: 1c92e4517284386703936e1d3abaa36cfacf1951

2 years agoupstream: Remove unused prototypes for ssh1 RSA functions.
dtucker@openbsd.org [Wed, 10 May 2023 10:04:20 +0000 (10:04 +0000)] 
upstream: Remove unused prototypes for ssh1 RSA functions.

From lengyijun via github PR#396.

OpenBSD-Commit-ID: 379a5afa8b7a0f3cba0c8a9bcceb4e5e33a5c1ef

2 years agomain(void) to prevent unused variable warning.
Darren Tucker [Tue, 9 May 2023 09:26:56 +0000 (19:26 +1000)] 
main(void) to prevent unused variable warning.

2 years agoRemove warning pragma since clang doesn't like it.
Darren Tucker [Tue, 9 May 2023 09:25:45 +0000 (19:25 +1000)] 
Remove warning pragma since clang doesn't like it.

2 years agoSuppress warning for snprintf truncation test.
Darren Tucker [Tue, 9 May 2023 07:13:33 +0000 (17:13 +1000)] 
Suppress warning for snprintf truncation test.

2 years agoUpdate OpenSSL compat test for 3.x.
Darren Tucker [Tue, 9 May 2023 07:12:50 +0000 (17:12 +1000)] 
Update OpenSSL compat test for 3.x.

2 years agoAdd macos13 PAM test target.
Darren Tucker [Mon, 8 May 2023 10:23:08 +0000 (20:23 +1000)] 
Add macos13 PAM test target.

2 years agoSkip agent-peereid test on macos13.
Darren Tucker [Mon, 8 May 2023 10:14:46 +0000 (20:14 +1000)] 
Skip agent-peereid test on macos13.

sudo -S nobody doesn't work on the github runners (probably a
permission issue) so skip that test.

2 years agoInclude config.guess in debug output.
Darren Tucker [Mon, 8 May 2023 10:14:28 +0000 (20:14 +1000)] 
Include config.guess in debug output.

2 years agoHandle OpenSSL >=3 ABI compatibility.
Darren Tucker [Mon, 8 May 2023 10:12:59 +0000 (20:12 +1000)] 
Handle OpenSSL >=3 ABI compatibility.

Beyond OpenSSL 3.0, the ABI compatibility guarantees are wider (only
major must match instead of major and minor in earlier versions).
bz#3548, ok djm@

2 years agoupstream: Import regenerated moduli.
dtucker@openbsd.org [Mon, 1 May 2023 08:57:29 +0000 (08:57 +0000)] 
upstream: Import regenerated moduli.

OpenBSD-Commit-ID: 3d5f811cfcaed8cc4a97e1db49ac61bdf118113c

2 years agoAdd macos-13 test target.
Darren Tucker [Mon, 1 May 2023 01:45:14 +0000 (11:45 +1000)] 
Add macos-13 test target.

Also flatten OS list for clarity.

2 years agoupstream: adjust ftruncate() logic to handle servers that reorder
djm@openbsd.org [Sun, 30 Apr 2023 22:54:22 +0000 (22:54 +0000)] 
upstream: adjust ftruncate() logic to handle servers that reorder

requests.

sftp/scp will ftruncate the destination file after a transfer completes,
to deal with the case where a longer destination file already existed.
We tracked the highest contiguous block transferred to deal with this
case, but our naive tracking doesn't deal with servers that reorder
requests - a misfeature strictly permitted by the protocol but seldom
implemented.

Adjust the logic to ftruncate() at the highest absolute block received
when the transfer is successful. feedback deraadt@ ok markus@

prompted by https://github.com/openssh/openssh-portable/commit/9b733#commitcomment-110679778

OpenBSD-Commit-ID: 4af7fac75958ad8507b4fea58706f3ff0cfddb1b

2 years agoupstream: Check for ProxyJump=none in CanonicalizeHostname logic.
djm@openbsd.org [Wed, 26 Apr 2023 01:36:03 +0000 (01:36 +0000)] 
upstream: Check for ProxyJump=none in CanonicalizeHostname logic.

Previously ssh would incorrectly refuse to canonicalise the hostname
if ProxyJump was explicitly set to "none" when CanonicalizeHostname=yes

bz3567; ok dtucker

OpenBSD-Commit-ID: 80a58e43c3a32f97361282f756ec8d3f37989efd

2 years agoupstream: remove duplicate signal.h include
jsg@openbsd.org [Wed, 12 Apr 2023 14:22:04 +0000 (14:22 +0000)] 
upstream: remove duplicate signal.h include

OpenBSD-Commit-ID: 30c0a34d74d91ddd0e6992525da70d3293392f70

2 years agoupstream: fix double words ok dtucker@
jsg@openbsd.org [Wed, 12 Apr 2023 08:53:54 +0000 (08:53 +0000)] 
upstream: fix double words ok dtucker@

OpenBSD-Commit-ID: 44d3223902fbce5276422bdc8063ab72a4078489

2 years agoTest against LibreSSL 3.7.2.
Darren Tucker [Tue, 11 Apr 2023 06:49:19 +0000 (16:49 +1000)] 
Test against LibreSSL 3.7.2.

2 years agoremove unused upper-case const strings in fmtfp
Damien Miller [Thu, 6 Apr 2023 04:33:10 +0000 (14:33 +1000)] 
remove unused upper-case const strings in fmtfp

no float format that uses upper-case is supported nor are hex floats.
ok dtucker

2 years agoupstream: simplify sshsig_find_principals() similar to what happened to
djm@openbsd.org [Thu, 6 Apr 2023 03:56:02 +0000 (03:56 +0000)] 
upstream: simplify sshsig_find_principals() similar to what happened to

sshsig_check_allowed_keys() in r1.31, removing some dead code

OpenBSD-Commit-ID: a493e628d4d6c08f878c276d998f4313ba61702d

2 years agoupstream: remove redundant ssh!=NULL check; we'd already
djm@openbsd.org [Thu, 6 Apr 2023 03:21:31 +0000 (03:21 +0000)] 
upstream: remove redundant ssh!=NULL check; we'd already

dereferenced it

OpenBSD-Commit-ID: 852bf12591ec5a9fb12dcbde9b1fd3945ad0df3c

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.