Commit Graph

30 Commits

Author SHA1 Message Date
djm@openbsd.org 6d4fc51adb upstream: avoid NULL deref via ssh-keygen -Y find-principals.
bz3409, reported by Mateusz Adamowski

OpenBSD-Commit-ID: a3b2c02438052ee858e0ee18e5a288586b5df2c5
2022-03-30 15:34:33 +11:00
djm@openbsd.org 15b7199a1f upstream: allow 'ssh-keygen -Y find-principals' to match wildcard
principals in allowed_signers files; from Fabian Stelzer

OpenBSD-Commit-ID: 1e970b9c025b80717dddff5018fe5e6f470c5098
2022-02-02 10:38:59 +11:00
djm@openbsd.org eb1f042142 upstream: NULL deref when using find-principals when matching an
allowed_signers line that contains a namespace restriction, but no
restriction specified on the command-line; report and fix from Fabian Stelzer

OpenBSD-Commit-ID: 4a201b86afb668c908d1a559c6af456a61f4b145
2022-01-05 15:12:39 +11:00
djm@openbsd.org 8249afeec0 upstream: sshsig: return "key not found" when searching empty files
rather than "internal error"

OpenBSD-Commit-ID: e2ccae554c78d7a7cd33fc5d217f35be7e2507ed
2021-11-28 18:28:08 +11:00
djm@openbsd.org 50bea24a9a upstream: missing initialisation for oerrno
OpenBSD-Commit-ID: 05d646bba238080259bec821c831a6f0b48d2a95
2021-11-28 18:28:08 +11:00
djm@openbsd.org 78230b3ec8 upstream: Add ssh-keygen -Y match-principals operation to perform
matching of principals names against an allowed signers file.

Requested by and mostly written by Fabian Stelzer, towards a TOFU
model for SSH signatures in git. Some tweaks by me.

"doesn't bother me" deraadt@

OpenBSD-Commit-ID: 8d1b71f5a4127bc5e10a880c8ea6053394465247
2021-11-27 18:22:41 +11:00
djm@openbsd.org c74aa0eb73 upstream: ssh-keygen -Y find-principals was verifying key validity
when using ca certs but not with simple key lifetimes within the allowed
signers file.

Since it returns the first keys principal it finds this could
result in a principal with an expired key even though a valid
one is just below.

patch from Fabian Stelzer; feedback/ok djm markus

OpenBSD-Commit-ID: b108ed0a76b813226baf683ab468dc1cc79e0905
2021-11-19 08:12:51 +11:00
djm@openbsd.org e4f501bf1d upstream: move cert_filter_principals() to earlier in the file for
reuse; no code change

OpenBSD-Commit-ID: 598fa9528b656b2f38bcc3cf5b6f3869a8c115cf
2021-11-06 21:56:09 +11:00
djm@openbsd.org e0c5088f1c upstream: Add a StdinNull directive to ssh_config(5) that allows
the config file to do the same thing as -n does on the ssh(1) commandline.
Patch from Volker Diels-Grabsch via GHPR231; ok dtucker

OpenBSD-Commit-ID: 66ddf3f15c76796d4dcd22ff464aed1edd62468e
2021-07-23 14:07:19 +10:00
dtucker@openbsd.org 7a92a324a2 upstream: Set linesize returned by getline to zero when freeing and
NULLing the returned string.  OpenBSD's getline handles this just fine, but
some implementations used by -portable do not.  ok djm@

OpenBSD-Commit-ID: 4d7bd5169d3397654247db9655cc69a9908d165c
2021-02-01 09:57:28 +11:00
djm@openbsd.org 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
djm@openbsd.org 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
djm@openbsd.org 39e88aeff9 upstream: Add RCS IDs to the few files that are missing them; from
Pedro Martelletto

OpenBSD-Commit-ID: 39aa37a43d0c75ec87f1659f573d3b5867e4a3b3
2020-08-31 14:34:41 +10:00
djm@openbsd.org 9b8ad93824 upstream: support for user-verified FIDO keys
FIDO2 supports a notion of "user verification" where the user is
required to demonstrate their identity to the token before particular
operations (e.g. signing). Typically this is done by authenticating
themselves using a PIN that has been set on the token.

This adds support for generating and using user verified keys where
the verification happens via PIN (other options might be added in the
future, but none are in common use now). Practically, this adds
another key generation option "verify-required" that yields a key that
requires a PIN before each authentication.

feedback markus@ and Pedro Martelletto; ok markus@

OpenBSD-Commit-ID: 57fd461e4366f87c47502c5614ec08573e6d6a15
2020-08-27 11:28:36 +10:00
markus@openbsd.org 5732d58020 upstream: do not leak oprincipals; ok djm
OpenBSD-Commit-ID: 4691d9387eab36f8fda48f5d8009756ed13a7c4c
2020-03-13 13:18:31 +11:00
markus@openbsd.org 46e5c4c8ff upstream: correct return code; ok djm
OpenBSD-Commit-ID: 319d09e3b7f4b2bc920c67244d9ff6426b744810
2020-03-13 13:18:31 +11:00
markus@openbsd.org 31c39e7840 upstream: principalsp is optional, pubkey required; ok djm
OpenBSD-Commit-ID: 2cc3ea5018c28ed97edaccd7f17d2cc796f01024
2020-03-13 13:18:31 +11:00
markus@openbsd.org 15be29e1e3 upstream: sshsig: return correct error, fix null-deref; ok djm
OpenBSD-Commit-ID: 1d1af7cd538b8b23e621cf7ab84f11e7a923edcd
2020-03-13 13:13:30 +11:00
djm@openbsd.org 72a8bea2d7 upstream: ssh-keygen -Y find-principals fixes based on feedback
from Markus:

use "principals" instead of principal, as allowed_signers lines may list
multiple.

When the signing key is a certificate, emit only principals that match
the certificate principal list.

NB. the command -Y name changes: "find-principal" => "find-principals"

ok markus@

OpenBSD-Commit-ID: ab575946ff9a55624cd4e811bfd338bf3b1d0faf
2020-01-25 11:27:29 +11:00
djm@openbsd.org 56cffcc09f upstream: add a new signature operations "find-principal" to look
up the principal associated with a signature from an allowed-signers file.
Work by Sebastian Kinne; ok dtucker@

OpenBSD-Commit-ID: 6f782cc7e18e38fcfafa62af53246a1dcfe74e5d
2020-01-23 13:45:24 +11:00
djm@openbsd.org e2031b05c7 upstream: factor out parsing of allowed-signers lines
OpenBSD-Commit-ID: 85ee6aeff608371826019ea85e55bfa87f79d06e
2020-01-22 17:17:51 +11:00
djm@openbsd.org b7e74ea072 upstream: Add new structure for signature options
This is populated during signature verification with additional fields
that are present in and covered by the signature. At the moment, it is
only used to record security key-specific options, especially the flags
field.

with and ok markus@

OpenBSD-Commit-ID: 338a1f0e04904008836130bedb9ece4faafd4e49
2019-11-25 12:23:33 +11:00
djm@openbsd.org 9a14c64c38 upstream: Refactor signing - use sshkey_sign for everything,
including the new U2F signatures.

Don't use sshsk_ecdsa_sign() directly, instead make it reachable via
sshkey_sign() like all other signature operations. This means that
we need to add a provider argument to sshkey_sign(), so most of this
change is mechanically adding that.

Suggested by / ok markus@

OpenBSD-Commit-ID: d5193a03fcfa895085d91b2b83d984a9fde76c8c
2019-11-01 09:46:10 +11:00
djm@openbsd.org b5a89eec41 upstream: make signature format match PROTOCO
=?UTF-8?q?=20as=20a=20string,=20not=20raw=20bytes.=20Spotted=20by=20Manta?=
=?UTF-8?q?s=20Mikul=C4=97nas?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

OpenBSD-Commit-ID: 80fcc6d52893f80c6de2bedd65353cebfebcfa8f
2019-10-02 18:08:17 +10:00
djm@openbsd.org 69159afe24 upstream: memleak on error path; found by libfuzzer
OpenBSD-Commit-ID: 34d44cb0fb5bdb5fcbc6b02b804e71b20a7a5fc7
2019-09-05 15:44:19 +10:00
djm@openbsd.org bab6feb01f upstream: expose allowed_signers options parsing code in header for
fuzzing

rename to make more consistent with philosophically-similar auth
options parsing API.

OpenBSD-Commit-ID: 0c67600ef04187f98e2912ca57b60c22a8025b7c
2019-09-05 14:56:51 +10:00
naddy@openbsd.org 0f44e5956c upstream: repair typo and editing mishap
OpenBSD-Commit-ID: d125ab720ca71ccf9baf83e08ddc8c12a328597e
2019-09-05 14:56:51 +10:00
Damien Miller 1a72c0dd89 portability fixes for sshsig 2019-09-03 18:44:10 +10:00
djm@openbsd.org d637c4aee6 upstream: sshsig tweaks and improvements from and suggested by
Markus

ok markus/me

OpenBSD-Commit-ID: ea4f46ad5a16b27af96e08c4877423918c4253e9
2019-09-03 18:40:24 +10:00
djm@openbsd.org 2a9c9f7272 upstream: sshsig: lightweight signature and verification ability
for OpenSSH

This adds a simple manual signature scheme to OpenSSH.
Signatures can be made and verified using ssh-keygen -Y sign|verify

Signatures embed the key used to make them. At verification time, this
is matched via principal name against an authorized_keys-like list
of allowed signers.

Mostly by Sebastian Kinne w/ some tweaks by me

ok markus@

OpenBSD-Commit-ID: 2ab568e7114c933346616392579d72be65a4b8fb
2019-09-03 18:40:23 +10:00