Commit Graph
186 Commits
Author SHA1 Message Date
[email protected] 1160092983 upstream: Typo fixes, mostly in comments.
From THE-Spellchecker via github PR#620.

OpenBSD-Commit-ID: 64929fafa3caae5a162f23257917ecf33f8a3764
2026-02-07 11:11:45 +11:00
[email protected] 6463960c58 upstream: Implement missing pieces of FIDO/webauthn signature support,
mostly related to certificate handling and enable acceptance of this
signature format by default.  bz3748 GHPR624 GHPR625

Feedback tb / James Zhang; ok tb

OpenBSD-Commit-ID: ce3327b508086b24a3f7a6507aa5c49d8e9505e6
2026-02-06 09:06:47 +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] 2d0d26602f upstream: Support writing ED25519 keys in PKCS8 format. GHPR570 from
Josh Brobst

OpenBSD-Commit-ID: 4f36019a38074b2929335fbe9cb8d9801e3177af
2025-11-25 12:12:00 +11:00
[email protected] c09eeba78a upstream: sshkey_ec_validate_public: zap trailing blank I missed on
review

OpenBSD-Commit-ID: b296bd6056f33fd567ca0d5e9123dac1ec00f037
2025-11-13 15:57:13 +11:00
[email protected] 9bea081888 upstream: Remove some unnecessary checks in
sshkey_ec_validate_public()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Checking nQ == infinity is not needed for cofactor 1 curves.
Checking x and y coordinates against order is not needed either.

patch from Szilárd Pfeiffer, with further refinement by tb@
ok tb@

OpenBSD-Commit-ID: ef985e2be7c64e215d064757d3fc65eb181e8ede
2025-11-07 15:13:17 +11:00
Darren Tucker bcf7c05a47 Fix header name and move return outside of ifdef.
Fixes from Mike Frysinger via Github PR#597.
2025-10-08 11:26:52 +11:00
Darren Tucker 8d57083c06 Use calloc for sshkeys if mmap is not supported.
Based on Github PR#597 from Mike Frysinger, any bugs added by me.
2025-10-07 21:07:05 +11:00
[email protected] a9cbe10da2 upstream: include openssl/bn.h explicitly in files where we use BN_*
makes things simpler for portable; from Mike Frysinger

OpenBSD-Commit-ID: 717e93403fd1108e175afd7451b5a4ab46a598fe
2025-10-03 10:12:15 +10:00
[email protected] ee32a36c62 upstream: Order includes as per KNF and add time.h. Removes diff
vs portable.

OpenBSD-Commit-ID: 38043f0bfa17c48ef6d1a744c2834b4405bc9311
2025-09-05 20:42:52 +10:00
Darren Tucker 53887d8ebc Create replacement util.h if needed.
Remove #ifdef HAVE_UTIL_H wrapper.  ok djm@
2025-09-05 17:27:43 +10:00
[email protected] cc4eb3d694 upstream: simplify algorithm list functions using xextendf(); ok
dtucker@

OpenBSD-Commit-ID: ffc5f8d0c25b95705a8a66c8b634f98d23bd92dc
2025-09-02 21:09:10 +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] a8c0e5c871 upstream: Help OpenSSH's PKCS#11 support kick its meth habit.
The PKCS#11 code in OpenSSH used the libcrypto public key method API
(e.g. the delightfully named RSA_meth_free()) to delegate signing
operations to external keys. This had one advantage - that it was
basically transparent to callers, but also had a big disadvantage -
that we'd manually have to track the method implementations, their
state and their relationships to the underlying PKCS#11 objects.

This rips this out and replaces it with explicit delegation to
PKCS#11 code for externally hosted keys via the ssh-pkcs11-helper
subprocess. This is very similar to how we handle FIDO keys in
OpenSSH (i.e. via ssh-sk-helper). All we need to track now is a
much simpler mapping of public key -> helper subprocess.

Kicking our libcrypto meth dependency also makes it much easier
to support Ed25519 keys in PKCS#11, which will happen in a subsequent
commit.

feedback / ok tb@

OpenBSD-Commit-ID: a5a1eaf57971cf15e0cdc5a513e313541c8a35f0
2025-07-25 09:23:16 +10:00
[email protected] 2d35e24739 upstream: Use EC_POINT_[sg]et_affine_coordinates()
It is available in all supported OpenSSL flavors/versions and the _GFp
variants will be removed from LibreSSL.

ok hshoexer jsing

OpenBSD-Commit-ID: ecedca0e1ffa80e0c9ef7c787bc6a972882c596b
2025-05-20 18:03:19 +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] 30c746265e upstream: Remove redundant field of definition check
This will allow us to get rid of EC_GROUP_method_of() in the near future.

ok djm

OpenBSD-Commit-ID: b4a3d2e00990cf5c2ec6881c21ddca67327c2df8
2024-12-05 01:28:46 +11:00
[email protected] e03239f999 upstream: remove some unused defines; ok djm@
OpenBSD-Commit-ID: 81869ee6356fdbff19dae6ff757095e6b24de712
2024-09-24 12:09:35 +10:00
[email protected] 13cc78d016 upstream: be more strict in parsing key type names. Only allow
shortnames (e.g "rsa") in user-interface code and require full SSH protocol
names (e.g. "ssh-rsa") everywhere else.

Prompted by bz3725; ok markus@

OpenBSD-Commit-ID: b3d8de9dac37992eab78adbf84fab2fe0d84b187
2024-09-04 15:38:50 +10:00
Damien Miller cbd3f034bb simplify sshkey_prekey_alloc(); always use mmap 2024-08-21 09:22:28 +10:00
[email protected] 2b17621154 upstream: actually use the length parameter that was passed in rather
than a constant (this makes no difference in practice because the length is
always the same); reported by martin AT nmkd.net

OpenBSD-Commit-ID: 4aecce232c2fe9b16e9217ff6bcb3c848d853e7e
2024-08-20 21:11:38 +10:00
Damien Miller d922762ca1 private key coredump protection for Linux/FreeBSD
platforms not supporting coredump exclusion using mmap/madvise flags
fall back to plain old malloc(3).
2024-08-20 13:55:30 +10:00
[email protected] cc048ca536 upstream: place shielded keys (i.e. keys at rest in RAM) into memory
allocated using mmap(3) with MAP_CONCEAL set. This prevents exposure of the
key material in coredumps, etc (this is in addition to other measures we take
in this area).

ok deraadt@

OpenBSD-Commit-ID: cbbae59f337a00c9858d6358bc65f74e62261369
2024-08-20 13:50:15 +10:00
Damien Miller 2c53d2f32b missed OPENSSL_HAS_ECC case 2024-08-15 15:09:45 +10:00
[email protected] 7bdfc20516 upstream: Convert RSA and ECDSA key to the libcrypto EVP_PKEY API.
DSA remains unconverted as it will be removed within six months.

Based on patches originally from Dmitry Belyavskiy, but significantly
reworked based on feedback from Bob Beck, Joel Sing and especially
Theo Buehler (apologies to anyone I've missed).

ok tb@

OpenBSD-Commit-ID: d098744e89f1dc7e5952a6817bef234eced648b5
2024-08-15 12:07:59 +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] 64ddf77653 upstream: spelling; ok markus@
OpenBSD-Commit-ID: 9d01f2e9d59a999d5d42fc3b3efcf8dfb892e31b
2024-01-08 13:25:21 +11:00
[email protected] 62db354b69 upstream: Move declaration of "len" into the block where it's used.
This lets us compile Portable with -Werror with when OpenSSL doesn't have
Ed25519 support.

OpenBSD-Commit-ID: e02e4b4af351946562a7caee905da60eff16ba29
2023-10-16 20:13:41 +11:00
[email protected] 76e91e7238 upstream: add support for reading ED25519 private keys in PEM PKCS8
format; ok markus@ tb@

OpenBSD-Commit-ID: 01b85c91757e6b057e9b23b8a23f96415c3c7174
2023-10-12 09:59:44 +11:00
[email protected] 84efebf352 upstream: want stdlib.h for free(3)
OpenBSD-Commit-ID: 743af3c6e3ce5e6cecd051668f0327a01f44af29
2023-08-21 14:38:38 +10:00
[email protected] 999a2886ca upstream: increase default KDF work-factor for OpenSSH format
private keys from 16 to 24; { feedback ok } x { deraadt markus }

OpenBSD-Commit-ID: a3afb1383f8ff0a49613d449f02395d9e8d4a9ec
2023-07-28 08:29:20 +10:00
[email protected] c1c2ca1365 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
2023-06-21 15:13:56 +10:00
[email protected] fc437c154e upstream: remove unused variable; prompted by Coverity CID 291879
OpenBSD-Commit-ID: 4c7d20ef776887b0ba1aabcfc1b14690e4ad0a40
2023-03-31 15:06:19 +11:00
Damien Miller 3c527d55f9 Allow building with BoringSSL 2023-03-24 15:26:26 +11:00
[email protected] 25c8a2bbcc upstream: put sshkey_check_rsa_length() back in sshkey.c to unbreak
OPENSSL=no builds

OpenBSD-Commit-ID: 99eec58abe382ecd14b14043b195ee1babb9cf6e
2022-10-28 13:49:01 +11:00
Damien Miller 64af420930 fix merge botch 2022-10-28 12:54:35 +11:00
[email protected] 2726764269 upstream: refactor sshkey_private_deserialize
feedback/ok markus@

OpenBSD-Commit-ID: f5ca6932fdaf840a5e8250becb38315a29b5fc9f
2022-10-28 12:47:01 +11:00
[email protected] 2519a7077a upstream: refactor sshkey_private_serialize_opt()
feedback/ok markus@

OpenBSD-Commit-ID: 61e0fe989897901294efe7c3b6d670cefaf44cbd
2022-10-28 12:47:01 +11:00
[email protected] 11a768adf9 upstream: refactor certify
feedback/ok markus@

OpenBSD-Commit-ID: 35d742992e223eaca3537e6fb3d3002c08eed4f6
2022-10-28 12:47:00 +11:00
[email protected] 3fbc58bb24 upstream: refactor sshkey_sign() and sshkey_verify()
feedback/ok markus@

OpenBSD-Commit-ID: 368e662c128c99d05cc043b1308d2b6c71a4d3cc
2022-10-28 12:47:00 +11:00
[email protected] a1deb6cdbb upstream: refactor sshkey_from_blob_internal()
feedback/ok markus@

OpenBSD-Commit-ID: 1f46c0cbb8060ee9666a02749594ad6658c8e283
2022-10-28 12:46:59 +11:00
[email protected] 7d00799c93 upstream: refactor sshkey_from_private()
feedback/ok markus@

OpenBSD-Commit-ID: e5dbe7a3545930c50f70ee75c867a1e08b382b53
2022-10-28 12:46:59 +11:00
[email protected] 262647c2e9 upstream: factor out key generation
feedback/ok markus@

OpenBSD-Commit-ID: 5b4211bff4de8d9adb84bc72857a8c42c44e7ceb
2022-10-28 12:46:58 +11:00
[email protected] 401c74e7dc upstream: refactor and simplify sshkey_read()
feedback/ok markus@

OpenBSD-Commit-ID: 0d93b7a56e31cd06a8bb0d2191d084ce254b0971
2022-10-28 12:46:57 +11:00
[email protected] 591fed94e6 upstream: factor out public key serialization
feedback/ok markus@

OpenBSD-Commit-ID: a3570c4b97290c5662890aea7328d87f55939033
2022-10-28 12:46:57 +11:00
[email protected] 1e78844ae2 upstream: factor out sshkey_equal_public()
feedback/ok markus@

OpenBSD-Commit-ID: 1368ba114cb37732fe6ec3d89c7e6d27ea6fdc94
2022-10-28 12:46:56 +11:00
[email protected] 25de1c01a8 upstream: begin big refactor of sshkey
Move keytype data and some of the type-specific code (allocation,
cleanup, etc) out into each key type's implementation. Subsequent
commits will move more, with the goal of having each key-*.c file
owning as much of its keytype's implementation as possible.

lots of feedback + ok markus@

OpenBSD-Commit-ID: 0f2b4334f73914344e9e5b3d33522d41762a57ec
2022-10-28 12:46:56 +11:00
[email protected] 07d8771bac upstream: Add a sshkey_check_rsa_length() call for checking the
length of an RSA key; ok markus@

OpenBSD-Commit-ID: de77cd5b11594297eda82edc594b0d32b8535134
2022-09-17 20:38:40 +10:00
[email protected] 457dce2cfe upstream: sshkey_unshield_private() contains a exact duplicate of
the code in private2_check_padding(). Pull private2_check_padding() up so the
code can be reused. From Martin Vahlensieck, ok deraadt@

OpenBSD-Commit-ID: 876884c3f0e62e8fd8d1594bab06900f971c9c85
2022-05-05 11:34:52 +10:00
[email protected] fdb1d58d0d upstream: add a helper function to match a key type to a list of
signature algorithms. RSA keys can make signatures with multiple algorithms,
so some special handling is required. ok markus@

OpenBSD-Commit-ID: 03b41b2bda06fa4cd9c84cef6095033b9e49b6ff
2022-01-07 09:21:38 +11:00