Commit Graph

10799 Commits

Author SHA1 Message Date
dtucker@openbsd.org 03e93c753d upstream: Remove the pre-standardization cipher
rijndael-cbc@lysator.liu.se. It is an alias for aes256-cbc which was
standardized in RFC4253 (2006), has been deprecated and disabled by default
since OpenSSH 7.2 (2016) and was only briefly documented in ssh.1 in 2001.

This will reduce the amount of work the cipher/kex regression tests need
to do by a little bit.  ok markus@ djm@

OpenBSD-Commit-ID: fb460acc18290a998fd70910b19c29b4e4f199ad
2020-12-21 22:35:41 +11:00
djm@openbsd.org a11ca01587 upstream: properly fix ProxyJump parsing; Thanks to tb@ for
pointing out my error (parse_ssh_uri() can return -1/0/1, that I missed).
Reported by Raf Czlonka via bugs@

ok tb@

OpenBSD-Commit-ID: a2991a3794bcaf1ca2b025212cce11cdb5f6b7d6
2020-12-21 22:35:41 +11:00
djm@openbsd.org d97fb87972 upstream: adapt to API change in hostkeys_foreach()/load_hostkeys()
OpenBSD-Regress-ID: dcb468514f32da49a446372453497dc6eeafdbf3
2020-12-21 14:04:08 +11:00
djm@openbsd.org bf7eb3c266 upstream: few more things needs match.c and addrmatch.c now that
log.c calls match_pattern_list()

OpenBSD-Regress-ID: f7c95c76b150d0aeb00a67858b9579b7d1b2db74
2020-12-21 14:04:08 +11:00
Darren Tucker 2c64f24e27 Pull in missing rev 1.2. 2020-12-21 14:02:56 +11:00
djm@openbsd.org 0f504f592d upstream: plumb ssh_conn_info through to sshconnect.c; feedback/ok
markus@

OpenBSD-Commit-ID: e8d14a09cda3f1dc55df08f8a4889beff74e68b0
2020-12-21 10:52:28 +11:00
djm@openbsd.org 729b05f59d upstream: allow UserKnownHostsFile=none; feedback and ok markus@
OpenBSD-Commit-ID: c46d515eac94a35a1d50d5fd71c4b1ca53334b48
2020-12-21 10:52:28 +11:00
djm@openbsd.org b4c7cd1185 upstream: load_hostkeys()/hostkeys_foreach() variants for FILE*
Add load_hostkeys_file() and hostkeys_foreach_file() that accept a
FILE* argument instead of opening the file directly.

Original load_hostkeys() and hostkeys_foreach() are implemented using
these new interfaces.

Add a u_int note field to the hostkey_entry and hostkey_foreach_line
structs that is passed directly from the load_hostkeys() and
hostkeys_foreach() call. This is a lightweight way to annotate results
between different invocations of load_hostkeys().

ok markus@

OpenBSD-Commit-ID: 6ff6db13ec9ee4edfa658b2c38baad0f505d8c20
2020-12-21 10:52:28 +11:00
tobhe@openbsd.org 06fbb386be upstream: Print client kem key with correct length.
ok markus@

OpenBSD-Commit-ID: 91689e14a4fc6c270e265a32d1c8faba63a45755
2020-12-21 10:52:28 +11:00
djm@openbsd.org 0ebead6593 upstream: fix possible error("%s", NULL) on error paths
OpenBSD-Commit-ID: 0b3833c2cb985453ecca1d76803ebb8f3b736a11
2020-12-21 10:52:27 +11:00
djm@openbsd.org d060bc7f6e upstream: refactor client percent_expand() argument passing;
consolidate the common arguments into a single struct and pass that around
instead of using a bunch of globals. ok markus@

OpenBSD-Commit-ID: 035e6d7ca9145ad504f6af5a021943f1958cd19b
2020-12-21 10:52:27 +11:00
djm@openbsd.org 43026da035 upstream: prepare readconf.c for fuzzing; remove fatal calls and
fix some (one-off) memory leaks; ok markus@

OpenBSD-Commit-ID: 91c6aec57b0e7aae9190de188e9fe8933aad5ec5
2020-12-21 10:52:22 +11:00
djm@openbsd.org bef92346c4 upstream: use _PATH_SSH_USER_DIR instead of hardcoded .ssh in path
OpenBSD-Commit-ID: 5c1048468813107baa872f5ee33ba51623630e01
2020-12-14 15:38:50 +11:00
Damien Miller a5ab499bd2 basic KEX fuzzer; adapted from Markus' unittest 2020-12-04 14:01:27 +11:00
Damien Miller 021ff33e38 use options that work with recent clang 2020-12-04 13:57:43 +11:00
djm@openbsd.org e4d1a0b40a upstream: shuffle a few utility functions into sftp-client.c; from
Jakub Jelen

OpenBSD-Commit-ID: fdeb1aae1f6149b193f12cd2af158f948c514a2a
2020-12-04 13:43:01 +11:00
djm@openbsd.org ace12dc64f upstream: make ssh_free(NULL) a no-op
OpenBSD-Commit-ID: 42cb285d94789cefe6608db89c63040ab0a80fa0
2020-12-04 13:43:01 +11:00
djm@openbsd.org 3b98b6e27f upstream: memleak of DH public bignum; found with libfuzzer
OpenBSD-Commit-ID: 0e913b542c3764b100b1571fdb0d0e5cc086fe97
2020-12-04 13:43:01 +11:00
djm@openbsd.org 553b90feed upstream: fix minor memleak of kex->hostkey_alg on rekex
OpenBSD-Commit-ID: 2c3969c74966d4ccdfeff5e5f0df0791919aef50
2020-12-04 13:43:01 +11:00
djm@openbsd.org ac0364b85e upstream: typos: s/hex/kex/ in error messages
OpenBSD-Commit-ID: 43a026c9571dd779ec148de1829cf5a6b6651905
2020-12-04 13:43:01 +11:00
djm@openbsd.org ee22db7c58 upstream: make program name be const
OpenBSD-Commit-ID: ece25680ec637fdf20502721ccb0276691df5384
2020-12-04 13:43:01 +11:00
dtucker@openbsd.org 2bcbf679de upstream: Ignore comments at the end of config lines in ssh_config,
similar to what we already do for sshd_config.  bz#2320, with & ok djm@

OpenBSD-Commit-ID: bdbf9fc5bc72b1a14266f5f61723ed57307a6db4
2020-12-04 13:42:38 +11:00
dtucker@openbsd.org b755264e7d upstream: Include cipher.h for declaration of cipher_by_name.
OpenBSD-Commit-ID: ddfebbca03ca0e14e00bbad9d35f94b99655d032
2020-11-29 00:20:52 +11:00
djm@openbsd.org 022def7bd1 upstream: check result of strchr() against NULL rather than
searched-for characters; from zhongjubin@huawei.com

OpenBSD-Commit-ID: e6f57de1d4a4d25f8db2d44e8d58d847e247a4fe
2020-11-28 23:59:42 +11:00
dtucker@openbsd.org 57bf03f021 upstream: Document ssh-keygen -Z, sanity check its argument earlier and
provide a better error message if it's not correct.  Prompted by bz#2879, ok
djm@ jmc@

OpenBSD-Commit-ID: 484178a173e92230fb1803fb4f206d61f7b58005
2020-11-27 21:37:17 +11:00
djm@openbsd.org 33313ebc1c upstream: Set the specified TOS/DSCP for interactive use prior to
TCP connect. The connection phase of the SSH session is time-sensitive (due
to server side login grace periods) and is frequently interactive (e.g.
entering passwords). The ultimate interactive/bulk TOS/DSCP will be set after
authentication completes.

ok dtucker@

OpenBSD-Commit-ID: f31ab10d9233363a6d2c9996007083ba43a093f1
2020-11-27 13:21:16 +11:00
djm@openbsd.org b2bcec13f1 upstream: clean up passing of struct passwd from monitor to preauth
privsep process. No longer copy entire struct w/ pointer addresses, but pass
remaining scalar fields explicitly,

Prompted by Yuichiro NAITO, feedback Thorsten Glaser; ok dtucker@

OpenBSD-Commit-ID: 9925df75a56732c43f3663e70dd15ff413ab3e53
2020-11-27 13:16:32 +11:00
djm@openbsd.org 19af04e223 upstream: when loading PKCS#11 keys, include the key fingerprints
and provider/slot information in debug output.

OpenBSD-Commit-ID: 969a089575d0166a9a364a9901bb6a8d9b8a1431
2020-11-27 11:50:30 +11:00
djm@openbsd.org 9b9465ea85 upstream: when mentioning that the host key has changed, don't
report the type because it is ambiguous as to whether it referred to the
known or new host key. bz3216; ok dtucker@

OpenBSD-Commit-ID: 2d5ce4a83dbcf44e340a572e361decad8aab7bad
2020-11-27 11:50:30 +11:00
Darren Tucker 637017a7dd Use "=" not "==" in string test.
POSIX says "=" is string comparison and some shells (eg HP-UX) will
complain about "==".
2020-11-25 17:38:46 +11:00
Darren Tucker 9880f3480f Restore correct flags during localtime_r check.
We were restoring the wrong thing CPPFLAGS (we used CFLAGS) for any
platform that doesn't have localtime_r.
2020-11-20 17:27:46 +11:00
dtucker@openbsd.org 41935882f4 upstream: When doing an sftp recursive upload or download of a
read-only directory, ensure that the directory is created with write and
execute permissions in the interim so that we can actually complete the
transfer, then set the directory permission as the final step.  (The execute
bit is only likely to be an issue with a non-POSIX server).  bz#3222, ok djm@

OpenBSD-Commit-ID: a82606212f2796e31f0e1af94a63355a7ad5d903
2020-11-20 16:58:18 +11:00
Darren Tucker 0f90440ca7 Add new pselect6_time64 syscall on ARM.
This is apparently needed on armhfp/armv7hl.  bz#3232, patch from
jjelen at redhat.com.
2020-11-20 13:37:54 +11:00
dtucker@openbsd.org 3a7c46c72b upstream: Explicitly initialize all members of the
find_by_key_ctx struct.  Initializing a single member should be enough
(the spec says the remainder should be initialized as per the static
rules) but some GCCs warn on this which prevents us testing with -Werror
on those.  ok deraadt@ djm@

OpenBSD-Commit-ID: 687126e60a27d30f02614760ef3c3ae4e8d6af28
2020-11-20 13:34:52 +11:00
dtucker@openbsd.org 076cb616b8 upstream: draft-ietf-secsh-architecture is now RFC4251.
OpenBSD-Commit-ID: cb0bb58c2711fb5ed519507659be1dcf179ed403
2020-11-20 13:34:46 +11:00
dtucker@openbsd.org 85cceda21f upstream: Specify that the KDF function is bcrypt. Based on github
PR#214 from rafork, ok markus@, mdoc correction jmc@

OpenBSD-Commit-ID: d8f2853e7edbcd483f31b50da77ab80ffa18b4ef
2020-11-17 22:34:57 +11:00
djm@openbsd.org 5b9720f9ad upstream: revert r1.341; it breaks ProxyJump; reported by sthen@
OpenBSD-Commit-ID: 6ac2f945b26cb86d936eed338f77861d6da8356a
2020-11-16 09:36:05 +11:00
djm@openbsd.org 04088725ec upstream: scrub keyboard-interactive authentication prompts coming
from the server through asmprintf() prior to display; suggested by and ok
dtucker@

OpenBSD-Commit-ID: 31fe93367645c37fbfe4691596bf6cf1e3972a58
2020-11-13 18:32:24 +11:00
djm@openbsd.org 5442b491d0 upstream: prefix keyboard interactive prompts with (user@host) to
make it easier to determine which connection they are associated with in
cases like scp -3, ProxyJump, etc. bz#3224 ok dtucker

OpenBSD-Commit-ID: 67e6189b04b46c867662f8a6759cf3ecb5f59170
2020-11-13 18:32:24 +11:00
Darren Tucker 2992e4e701 Remove use of TIME_WITH_SYS_TIME.
It was only set by the recently removed AC_HEADER_TIME macro, replace
with simple inclusions of both sys/time.h and time.h.  Should prevent
mis-detection of struct timespec.
2020-11-13 17:56:11 +11:00
Damien Miller e3f27006f1 Revert "detect Linux/X32 systems"
This reverts commit 5b56bd0aff.

The approach used was incorrect; discussion in bz#3085
2020-11-13 14:20:43 +11:00
Damien Miller e51dc7fab6 SELinux has deprecated security_context_t
(it was only ever a char* anyway)
2020-11-13 13:46:28 +11:00
Darren Tucker b79add37d1 Remove obsolete AC_HEADER_TIME macro.
AC_HEADER_TIME is marked as obsolete in autoconf-2.70 and as far as I
can tell everything we have that might be old enough to need it doesn't.
2020-11-13 13:43:30 +11:00
djm@openbsd.org d5d05cdb3d upstream: when prompting the user to accept a new hostkey, display
any other host names/addresses already associated with the key. E.g.

> The authenticity of host 'test (10.0.0.1)' can't be established.
> ECDSA key fingerprint is SHA256:milU4MODXm8iJQI18wlsbPG7Yup+34fuNNmV08qDnax.
> This host key is known by the following other names/addresses:
>     ~/.ssh/known_hosts:1: host.example.org,10.0.0.1
>     ~/.ssh/known_hosts:2: [hashed name]
>     ~/.ssh/known_hosts:3: [hashed name]
>     ~/.ssh/known_hosts:4: host
>     ~/.ssh/known_hosts:5: [host]:2222
> Are you sure you want to continue connecting (yes/no/[fingerprint])?

feedback and ok markus@

OpenBSD-Commit-ID: f6f58a77b49f1368b5883b3a1f776447cfcc7ef4
2020-11-13 09:58:55 +11:00
dtucker@openbsd.org 819b44e8b9 upstream: Prevent integer overflow when ridiculously large
ConnectTimeout is specified, capping the effective value (for most platforms)
at 24 days. bz#3229, ok djm@

OpenBSD-Commit-ID: 62d4c4b7b87d111045f8e9f28b5b532d17ac5bc0
2020-11-13 09:58:55 +11:00
djm@openbsd.org add926dd1b upstream: fix logic error that broke URI parsing in ProxyJump
directives; ok dtucker@

OpenBSD-Commit-ID: 96d48839b1704882a0e9a77898f5e14b2d222705
2020-11-12 10:53:03 +11:00
claudio@openbsd.org 4340dd4392 upstream: Free the previously allocated msg buffer after writing it
out. OK djm@

OpenBSD-Commit-ID: 18c055870fc75e4cb9f926c86c7543e2e21d7fa4
2020-11-12 10:53:03 +11:00
Darren Tucker fcf429a4c6 Prevent excessively long username going to PAM.
This is a mitigation for a buffer overflow in Solaris' PAM username
handling (CVE-2020-14871), and is only enabled for Sun-derived PAM
implementations.  This is not a problem in sshd itself, it only
prevents sshd from being used as a vector to attack Solaris' PAM.
It does not prevent the bug in PAM from being exploited via some other
PAM application.

Based on github PR#212 from Mike Scott but implemented slightly
differently.  ok tim@ djm@
2020-11-11 14:05:30 +11:00
djm@openbsd.org 10dce8ff68 upstream: unbreak; missing NULL check
OpenBSD-Commit-ID: 6613dfab488123f454d348ef496824476b8c11c0
2020-11-09 10:20:13 +11:00
djm@openbsd.org d5a0cd4fc4 upstream: when requesting a security key touch on stderr, inform the
user once the touch has been recorded; requested by claudio@ ok markus@

OpenBSD-Commit-ID: 3b76ee444490e546b9ea7f879e4092ee0d256233
2020-11-09 09:39:22 +11:00