]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
2 years agoupstream: better error messages
djm@openbsd.org [Fri, 12 May 2023 06:36:27 +0000 (06:36 +0000)] 
upstream: better error messages

OpenBSD-Regress-ID: 55e4186604e80259496d841e690ea2090981bc7a

2 years agoupstream: don't incorrectly truncate logged strings retrieved from
djm@openbsd.org [Thu, 27 Jul 2023 22:26:49 +0000 (22:26 +0000)] 
upstream: don't incorrectly truncate logged strings retrieved from

PKCS#11 modules; based on GHPR406 by Jakub Jelen; ok markus

OpenBSD-Commit-ID: 7ed1082f23a13b38c373008f856fd301d50012f9

2 years agoupstream: make sshd_config AuthorizedPrincipalsCommand and
djm@openbsd.org [Thu, 27 Jul 2023 22:25:17 +0000 (22:25 +0000)] 
upstream: make sshd_config AuthorizedPrincipalsCommand and

AuthorizedKeysCommand accept the %D (routing domain) and a new %C (connection
address/port 4-tuple) as expansion sequences; ok markus

OpenBSD-Commit-ID: ee9a48bf1a74c4ace71b69de69cfdaa2a7388565

2 years agoupstream: increase default KDF work-factor for OpenSSH format
djm@openbsd.org [Thu, 27 Jul 2023 22:23:05 +0000 (22:23 +0000)] 
upstream: increase default KDF work-factor for OpenSSH format

private keys from 16 to 24; { feedback ok } x { deraadt markus }

OpenBSD-Commit-ID: a3afb1383f8ff0a49613d449f02395d9e8d4a9ec

2 years agoPrefer OpenSSL's SHA256 in sk-dummy.so
Darren Tucker [Wed, 26 Jul 2023 16:25:09 +0000 (02:25 +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 agoRetire dfly58 test VM. Add dfly64.
Darren Tucker [Thu, 27 Jul 2023 00:29:44 +0000 (10:29 +1000)] 
Retire dfly58 test VM.  Add dfly64.

2 years agoupstream: make ssh -f (fork after authentication) work properly in
djm@openbsd.org [Wed, 26 Jul 2023 23:06:00 +0000 (23:06 +0000)] 
upstream: make ssh -f (fork after authentication) work properly in

multiplexed cases (inc. ControlPersist). bz3589 bz3589 Based on patches by
Peter Chubb; ok dtucker@

OpenBSD-Commit-ID: a7a2976a54b93e6767dc846b85647e6ec26969ac

2 years agoupstream: man page typos; ok jmc@
naddy@openbsd.org [Sun, 23 Jul 2023 20:04:45 +0000 (20:04 +0000)] 
upstream: man page typos; ok jmc@

OpenBSD-Commit-ID: e6ddfef94b0eb867ad88abe07cedc8ed581c07f0

2 years agoupstream: tweak the allow-remote-pkcs11 text;
jmc@openbsd.org [Thu, 20 Jul 2023 05:43:39 +0000 (05:43 +0000)] 
upstream: tweak the allow-remote-pkcs11 text;

OpenBSD-Commit-ID: bc965460a89edf76865b7279b45cf9cbdebd558a

2 years agoHandle a couple more OpenSSL no-ecc cases.
Darren Tucker [Tue, 25 Jul 2023 03:00:22 +0000 (13:00 +1000)] 
Handle a couple more OpenSSL no-ecc cases.

ok djm@

2 years agodepend
Damien Miller [Thu, 20 Jul 2023 02:53:44 +0000 (12:53 +1000)] 
depend

2 years agoBring back OPENSSL_HAS_ECC to ssh-pkcs11-client
Damien Miller [Thu, 20 Jul 2023 02:53:21 +0000 (12:53 +1000)] 
Bring back OPENSSL_HAS_ECC to ssh-pkcs11-client

2 years agoupstream: Separate ssh-pkcs11-helpers for each p11 module
djm@openbsd.org [Wed, 19 Jul 2023 14:03:45 +0000 (14:03 +0000)] 
upstream: Separate ssh-pkcs11-helpers for each p11 module

Make ssh-pkcs11-client start an independent helper for each provider,
providing better isolation between modules and reliability if a single
module misbehaves.

This also implements reference counting of PKCS#11-hosted keys,
allowing ssh-pkcs11-helper subprocesses to be automatically reaped
when no remaining keys reference them. This fixes some bugs we have
that make PKCS11 keys unusable after they have been deleted, e.g.
https://bugzilla.mindrot.org/show_bug.cgi?id=3125

ok markus@

OpenBSD-Commit-ID: 0ce188b14fe271ab0568f4500070d96c5657244e

2 years agoupstream: Ensure FIDO/PKCS11 libraries contain expected symbols
djm@openbsd.org [Wed, 19 Jul 2023 14:02:27 +0000 (14:02 +0000)] 
upstream: Ensure FIDO/PKCS11 libraries contain expected symbols

This checks via nlist(3) that candidate provider libraries contain one
of the symbols that we will require prior to dlopen(), which can cause
a number of side effects, including execution of constructors.

Feedback deraadt; ok markus

OpenBSD-Commit-ID: 1508a5fbd74e329e69a55b56c453c292029aefbe

2 years agoupstream: Disallow remote addition of FIDO/PKCS11 provider
djm@openbsd.org [Wed, 19 Jul 2023 13:56:33 +0000 (13:56 +0000)] 
upstream: Disallow remote addition of FIDO/PKCS11 provider

libraries to ssh-agent by default.

The old behaviour of allowing remote clients from loading providers
can be restored using `ssh-agent -O allow-remote-pkcs11`.

Detection of local/remote clients requires a ssh(1) that supports
the `session-bind@openssh.com` extension. Forwarding access to a
ssh-agent socket using non-OpenSSH tools may circumvent this control.

ok markus@

OpenBSD-Commit-ID: 4c2bdf79b214ae7e60cc8c39a45501344fa7bd7c

2 years agoupstream: terminate process if requested to load a PKCS#11 provider
djm@openbsd.org [Wed, 19 Jul 2023 13:55:53 +0000 (13:55 +0000)] 
upstream: terminate process if requested to load a PKCS#11 provider

that isn't a PKCS#11 provider; from / ok markus@

OpenBSD-Commit-ID: 39532cf18b115881bb4cfaee32084497aadfa05c

2 years agoagent_fuzz doesn't want stdint.h conditionalised
Damien Miller [Wed, 19 Jul 2023 02:07:18 +0000 (12:07 +1000)] 
agent_fuzz doesn't want stdint.h conditionalised

2 years agoconditionalise stdint.h inclusion on HAVE_STDINT_H
Damien Miller [Tue, 18 Jul 2023 05:41:12 +0000 (15:41 +1000)] 
conditionalise stdint.h inclusion on HAVE_STDINT_H

fixes build on AIX5 at least

2 years agoconditionalise match localnetwork on ifaddrs.h
Damien Miller [Tue, 18 Jul 2023 05:30:45 +0000 (15:30 +1000)] 
conditionalise match localnetwork on ifaddrs.h

Fixes build breakage on platforms that lack getifaddrs()

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