Commit Graph
364 Commits
Author SHA1 Message Date
[email protected] 81ca1451bf upstream: Add experimental support for a composite post-quantum
signature scheme that combines ML-DSA 44 and Ed25519 using the construction
specified in draft-ietf-lamps-pq-composite-sigs. There's also an early draft
documenting use of the integration of this scheme into SSH as
draft-miller-sshm-mldsa44-ed25519-composite-sigs

This scheme is not enabled by default. To you use, you'll need
to add it to HostKeyAlgorithms, PubkeyAcceptedAlgorithms, etc.
Keys may be generated using "ssh-keygen -t mldsa44-ed25519".

The ML-DSA implementation comes from libcrux. Thanks to
Jonas Schneider-Bensch and Jonathan Protzenko for their work to
make this available.

Consensus is that it's time to get this in to allow people to
experiment with it.

feedback markus@ tb@ logan@ deraadt@

OpenBSD-Commit-ID: 85f2d41e3d3374b4e8c28a45a7c92f153c4489e2
2026-06-14 14:27:52 +10:00
[email protected] 7a59f55e62 upstream: Reorder headers to match KNF and Portable.
ID sync only.

OpenBSD-Commit-ID: b7f9700d07b532eb3720f7bd722b952e31b1752f
2026-02-15 20:07:13 -05:00
[email protected] 07c6413e7b upstream: remove unneeded includes; ok dtucker@
OpenBSD-Commit-ID: bba6e85492276c30c7a9d27dfd3c4c55fa033335
2026-02-15 19:49:47 -05:00
[email protected] 2f51e29b9a upstream: support multiple files in a ssh_config RevokedHostKeys
directive bz3918; ok dtucker

OpenBSD-Commit-ID: 0ad2eacf836f912f347846ab84760799033dd348
2026-02-12 10:30:11 +11:00
[email protected] 3160f2a97e upstream: Add includes used in Portable to reduce diffs.
OpenBSD-Commit-ID: 186c60cf2da0ddb075d5bc4879e87bbd8779b7e4
2026-02-12 10:28:24 +11:00
[email protected] dd49a87bf4 upstream: Remove bug compatibility for implementations that don't
support rekeying. AFAIK this is only an ancient Sun SSH version.

If such an implementation tries to interoperate with OpenSSH, it
will eventually fail when the transport needs rekeying.

This is probably long enough to use it to download a modern SSH
implementation that lacks this problem :)

ok markus@ deraadt@

OpenBSD-Commit-ID: 228a502fee808cf8b7caee23169eb6a1ab1c331a
2025-12-30 11:37:13 +11:00
[email protected] 5166b6cbf2 upstream: When certificate support was added to OpenSSH,
certificates were originally specified to represent any principal if the
principals list was empty.

This was, in retrospect, a mistake as it created a fail-open
situation if a CA could be convinced to accidentally sign a
certificate with no principals. This actually happened in a 3rd-
party CA product (CVE-2024-7594).

Somewhat fortunately, the main pathway for using certificates in
sshd (TrustedUserCAKeys) never supported empty-principals
certificates, so the blast radius of such mistakes was
substantially reduced.

This change removes this footcannon and requires all certificates
include principals sections. It also fixes interpretation of
wildcard principals, and properly enables them for host
certificates only.

This is a behaviour change that will permanently break uses of
certificates with empty principals sections.

ok markus@

OpenBSD-Commit-ID: 0a901f03c567c100724a492cf91e02939904712e
2025-12-22 12:51:24 +11:00
[email protected] 6f28a935cc upstream: consistently use NULL for null pointer constants found
with sparse, ok djm@

OpenBSD-Commit-ID: 1067504b63732d809d0d57ad4bc626818d112772
2025-09-25 17:01:40 +10:00
[email protected] 42fc6b6f9f upstream: memleak of hostkey when downgrading host cert->key; ok
dtucker

OpenBSD-Commit-ID: f6f1f38a8ec144fb615434f6877066cf4610b826
2025-09-15 16:13:23 +10:00
Darren Tucker 59b80707c6 Create replacement sys/time.h if needed.
Remove #ifdef HAVE_SYS_TIME_H wrapper.  ok djm@
2025-09-05 17:48:22 +10:00
Darren Tucker 82fed5110f Create replacement ifaddrs.h if needed.
Remove #ifdef HAVE_IFADDRS_H wrapper.  ok djm@
2025-09-05 17:31:15 +10:00
Darren Tucker 5f09983d1e Create replacement paths.h if needed.
Remove #ifdef HAVE_PATHS_H wrapper.  ok djm@
2025-09-05 17:24:50 +10:00
Darren Tucker d45b17dc5a Create replacement poll.h if needed.
Remove #ifdef HAVE_POLL_H wrapper.  ok djm@
2025-09-05 17:17:52 +10:00
[email protected] a9a3f025d7 upstream: remove experimental support for XMSS keys;
ok deraadt markus

OpenBSD-Commit-ID: 38eaf4df6189acad9e46eddf7cf32d7f6d07df35
2025-08-29 13:58:40 +10:00
[email protected] ab5074dfb6 upstream: fix typo, ok markus dtucker
OpenBSD-Commit-ID: 8f223da7633752162c64a659c6cf55202703d870
2025-08-13 09:20:41 +10:00
[email protected] 0e1b8aa27f upstream: ssh(1): add a warning when the connection negotiates a
non-post quantum safe key agreement algorithm.

Controlled via a new WarnWeakCrypto ssh_config option, defaulting
to on. This option might grow additional weak crypto warnings in
the future.

More details at https://openssh.com/pq.html

mostly by deraadt@ feedback dtucker@ ok deraadt@

OpenBSD-Commit-ID: 974ff243a1eccceac6a1a9d8fab3bcc89d74a2a4
2025-08-11 21:03:29 +10:00
[email protected] 3a61f5ed66 upstream: fix punctuation around host key fingerprints to make them
easier to copy and paste.

Patch from Till Maas via GHPR556; ok dtucker@

OpenBSD-Commit-ID: c0100182a30b6925c8cdb2225b18140264594b7b
2025-05-24 19:46:56 +10:00
[email protected] a32d28d792 upstream: finally remove DSA signature support from OpenSSH.
feedback/ok tb@, ok deraadt@

OpenBSD-Commit-ID: bfe6ee73c1b676c81a2901030c791f8ec888228f
2025-05-07 14:20:14 +10:00
[email protected] 9a9ffee6e1 upstream: support VersionAddendum in the client, mirroring the
option of the same name in the server; bz2745 ok dtucker@

OpenBSD-Commit-ID: 6ff7905b3f9806649bde750515786553fb89cdf4
2024-12-07 21:16:02 +11:00
[email protected] 80fb0eb215 upstream: add explict check for server hostkey type against
HostkeyAlgorithms. Allows HostkeyAlgorithms to disable implicit fallback from
certificate keys to plain keys. ok markus@

OpenBSD-Commit-ID: 364087e4a395ff9b2f42bf3aefdb2090bb23643a
2024-04-30 12:22:35 +10:00
[email protected] 5b28096d31 upstream: correct indentation; no functional change ok tb@
OpenBSD-Commit-ID: dd9702fd43de546bc6a3f4f025c74d6f3692a0d4
2024-04-30 12:22:10 +10:00
[email protected] 4e838120a7 upstream: make DSA key support compile-time optional, defaulting to
on

ok markus@

OpenBSD-Commit-ID: 4f8e98fc1fd6de399d0921d5b31b3127a03f581d
2024-01-11 15:46:22 +11:00
[email protected] c52db01148 upstream: set errno=EAFNOSUPPORT when filtering addresses that don't
match AddressFamily; yields slightly better error message if no address
matches. bz#3526

OpenBSD-Commit-ID: 29cea900ddd8b04a4d1968da5c4a893be2ebd9e6
2023-11-20 13:51:15 +11:00
[email protected] 26f3f3bbc6 upstream: when connecting via socket (the default case), filter
addresses by AddressFamily if one was specified. Fixes the case where, if
CanonicalizeHostname is enabled, ssh may ignore AddressFamily. bz5326; ok
dtucker

OpenBSD-Commit-ID: 6c7d7751f6cd055126b2b268a7b64dcafa447439
2023-11-16 10:05:32 +11:00
[email protected] 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
[email protected] 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
[email protected] f673b49f3b upstream: avoid printf("%s", NULL) if using ssh
-oUserKnownHostsFile=none and a hostkey in one of the system known hosts file
changes; ok dtucker@

OpenBSD-Commit-ID: 7ca87614bfc6da491315536a7f2301434a9fe614
2023-01-13 14:06:37 +11:00
[email protected] 3cae9f92a3 upstream: replace recently-added valid_domain() check for hostnames
going to known_hosts with a more relaxed check for bad characters; previous
commit broke address literals. Reported by/feedback from florian@

OpenBSD-Commit-ID: 10b86dc6a4b206adaa0c11b58b6d5933898d43e0
2022-11-04 09:01:17 +11:00
[email protected] 445363433b upstream: Be more paranoid with host/domain names coming from the
never write a name with bad characters to a known_hosts file.

reported by David Leadbeater, ok deraadt@

OpenBSD-Commit-ID: ba9b25fa8b5490b49398471e0c9657b0cbc7a5ad
2022-10-25 10:16:35 +11:00
[email protected] 92382dbe8b upstream: whitespace
OpenBSD-Commit-ID: a5d015efbfd228dc598ffdef612d2da3a579e5d8
2022-08-26 18:17:57 +10:00
[email protected] ea97ec98c4 upstream: Add period at end of "not known by any other names"
message.  github PR#320 from jschauma, ok djm@

OpenBSD-Commit-ID: bd60809803c4bfd3ebb7c5c4d918b10e275266f2
2022-06-03 13:38:21 +10:00
[email protected] 5e950d7657 upstream: ssh-add side of destination constraints
Have ssh-add accept a list of "destination constraints" that allow
restricting where keys may be used in conjunction with a ssh-agent/ssh
that supports session ID/hostkey binding.

Constraints are specified as either "[user@]host-pattern" or
"host-pattern>[user@]host-pattern".

The first form permits a key to be used to authenticate as the
specified user to the specified host.

The second form permits a key that has previously been permitted
for use at a host to be available via a forwarded agent to an
additional host.

For example, constraining a key with "user1@host_a" and
"host_a>host_b". Would permit authentication as "user1" at
"host_a", and allow the key to be available on an agent forwarded
to "host_a" only for authentication to "host_b". The key would not
be visible on agent forwarded to other hosts or usable for
authentication there.

Internally, destination constraints use host keys to identify hosts.
The host patterns are used to obtain lists of host keys for that
destination that are communicated to the agent. The user/hostkeys are
encoded using a new [email protected] key
constraint.

host keys are looked up in the default client user/system known_hosts
files. It is possible to override this set on the command-line.

feedback Jann Horn & markus@
ok markus@

OpenBSD-Commit-ID: ef47fa9ec0e3c2a82e30d37ef616e245df73163e
2021-12-20 09:25:17 +11:00
Darren Tucker 53237ac789 Sync remaining ChallengeResponse removal.
These were omitted from commit 88868fd131.
2021-07-03 19:23:28 +10:00
[email protected] 2a5704ec14 upstream: Use better language to refer to the user. From l1ving
via github PR#250, ok jmc@

OpenBSD-Commit-ID: 07ca3526626996613e128aeddf7748c93c4d6bbf
2021-06-25 16:32:34 +10:00
[email protected] aae4b4d358 upstream: Allow argv_split() to optionally terminate tokenisation
when it encounters an unquoted comment.

Add some additional utility function for working with argument
vectors, since we'll be switching to using them to parse
ssh/sshd_config shortly.

ok markus@ as part of a larger diff; tested in snaps

OpenBSD-Commit-ID: fd9c108cef2f713f24e3bc5848861d221bb3a1ac
2021-06-08 17:12:51 +10:00
[email protected] 31d8d231eb upstream: highly polished whitespace, mostly fixing spaces-for-tab
and bad indentation on continuation lines. Prompted by GHPR#185

OpenBSD-Commit-ID: e5c81f0cbdcc6144df1ce468ec1bac366d8ad6e9
2021-04-03 17:23:02 +11:00
[email protected] cffd033817 upstream: typo in other_hostkeys_message() display output, ok djm
OpenBSD-Commit-ID: 276f58afc97b6f5826e0be58380b737603dbf5f5
2021-03-04 09:43:28 +11:00
Damien Miller 6248b86074 Revert "ssh: optional bind interface if bind address specified."
This reverts commit 5a878a71a3.

Apologies - I accidentally pushed this.
2021-02-26 16:45:50 +11:00
Dmitrii Turlupov 5a878a71a3 ssh: optional bind interface if bind address specified.
Allows the -b and -B options to be used together.
For example, when the interface is in the VRF.
2021-02-26 15:46:47 +11:00
[email protected] 3b44f2513c upstream: move check_host_cert() from sshconnect,c to sshkey.c and
refactor it to make it more generally usable and testable.

ok markus@

OpenBSD-Commit-ID: 536f489f5ff38808c1fa711ba58d4579b636f9e4
2021-01-26 12:21:48 +11:00
[email protected] da4bf0db94 upstream: add a ssh_config KnownHostsCommand that allows the client
to obtain known_hosts data from a command in addition to the usual files.

The command accepts bunch of %-expansions, including details of the
connection and the offered server host key. Note that the command may
be invoked up to three times per connection (see the manpage for
details).

ok markus@

OpenBSD-Commit-ID: 2433cff4fb323918ae968da6ff38feb99b4d33d0
2020-12-22 15:43:59 +11:00
[email protected] 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
[email protected] 729b05f59d upstream: allow UserKnownHostsFile=none; feedback and ok markus@
OpenBSD-Commit-ID: c46d515eac94a35a1d50d5fd71c4b1ca53334b48
2020-12-21 10:52:28 +11:00
[email protected] 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
[email protected] 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
[email protected] 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
[email protected] 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
[email protected] 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
[email protected] 816036f142 upstream: use the new variant log macros instead of prepending
__func__ and appending ssh_err(r) manually; ok markus@

OpenBSD-Commit-ID: 1f14b80bcfa85414b2a1a6ff714fb5362687ace8
2020-10-18 23:46:29 +11:00
[email protected] a336ce8c2c upstream: Zap unused family parameter from ssh_connect_direct()
sshconnect.c r1.241 from 2013 made it unused;  found while reading code.

OK djm

OpenBSD-Commit-ID: 219ba6d7f9925d0b7992918612680399d86712b5
2020-10-14 11:57:13 +11:00