OpenBSD CVS

CVS log for src/usr.bin/ssh/ssh-sk.c


[BACK] Up to [local] / src / usr.bin / ssh

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.40 / (download) - annotate - [select for diffs], Wed Jul 19 14:02:27 2023 UTC (9 months, 4 weeks ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.39: +6 -3 lines
Diff to previous 1.39 (colored)

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

Revision 1.39 / (download) - annotate - [select for diffs], Wed Jul 20 03:29:14 2022 UTC (21 months, 4 weeks ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.38: +3 -1 lines
Diff to previous 1.38 (colored)

when enrolling a resident key on a security token, check if a
credential with matching application and user ID strings already
exists. if so, prompt the user for confirmation before overwriting
the credential.

patch from Pedro Martelletto via GHPR329

NB. cranks SSH_SK_VERSION_MAJOR, so any third-party FIDO middleware
implementations will need to adjust

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jan 14 03:35:10 2022 UTC (2 years, 4 months ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.37: +2 -1 lines
Diff to previous 1.37 (colored)

ssh-sk: free a resident key's user id

From Pedro Martelletto; ok dtucker & me

Revision 1.37 / (download) - annotate - [select for diffs], Tue Nov 2 22:56:40 2021 UTC (2 years, 6 months ago) by djm
Branch: MAIN
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

Better handle FIDO keys on tokens that provide user verification (UV)
on the device itself, including biometric keys.

Query the token during key creation to determine whether it supports
on-token UV and, if so, clear the SSH_SK_USER_VERIFICATION_REQD flag
in the key so that ssh(1) doesn't automatically prompty for PIN later.

When making signatures with the key, query the token's capabilities
again and check whether the token is able (right now) to perform user-
verification without a PIN. If it is then the PIN prompt is bypassed
and user verification delegated to the token. If not (e.g. the token
is biometric capable, but no biometric are enrolled), then fall back
to user verification via the usual PIN prompt.

Work by Pedro Martelletto; ok myself and markus@

NB. cranks SSH_SK_VERSION_MAJOR

Revision 1.36 / (download) - annotate - [select for diffs], Thu Oct 28 02:54:18 2021 UTC (2 years, 6 months ago) by djm
Branch: MAIN
Changes since 1.35: +64 -26 lines
Diff to previous 1.35 (colored)

When downloading resident keys from a FIDO token, pass back the
user ID that was used when the key was created and append it to
the filename the key is written to (if it is not the default).

Avoids keys being clobbered if the user created multiple
resident keys with the same application string but different
user IDs.

feedback Pedro Martelletto; ok markus

NB. increments SSH_SK_VERSION_MAJOR

Revision 1.35 / (download) - annotate - [select for diffs], Fri Feb 26 00:16:58 2021 UTC (3 years, 2 months ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.34: +7 -2 lines
Diff to previous 1.34 (colored)

a bit more debugging behind #ifdef DEBUG_SK

Revision 1.34 / (download) - annotate - [select for diffs], Thu Feb 18 02:13:58 2021 UTC (3 years, 2 months ago) by djm
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

unbreak SK_DEBUG builds

from https://github.com/openssh/openssh-portable/pull/225 by
ZenithalHourlyRate

Revision 1.33 / (download) - annotate - [select for diffs], Sun Oct 18 11:32:02 2020 UTC (3 years, 6 months ago) by djm
Branch: MAIN
Changes since 1.32: +42 -45 lines
Diff to previous 1.32 (colored)

use the new variant log macros instead of prepending __func__ and
appending ssh_err(r) manually; ok markus@

Revision 1.32 / (download) - annotate - [select for diffs], Wed Sep 9 03:08:02 2020 UTC (3 years, 8 months ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.31: +30 -14 lines
Diff to previous 1.31 (colored)

when writing an attestation blob for a FIDO key, record all the data
needed to verify the attestation. Previously we were missing the
"authenticator data" that is included in the signature.

spotted by Ian Haken
feedback Pedro Martelletto and Ian Haken; ok markus@

Revision 1.31 / (download) - annotate - [select for diffs], Thu Aug 27 01:08:19 2020 UTC (3 years, 8 months ago) by djm
Branch: MAIN
Changes since 1.30: +3 -2 lines
Diff to previous 1.30 (colored)

preserve verify-required for resident FIDO keys

When downloading a resident, verify-required key from a FIDO token,
preserve the verify-required in the private key that is written to
disk. Previously we weren't doing that because of lack of support
in the middleware API.

from Pedro Martelletto; ok markus@ and myself

Revision 1.30 / (download) - annotate - [select for diffs], Tue Apr 28 04:02:29 2020 UTC (4 years ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.29: +2 -12 lines
Diff to previous 1.29 (colored)

when signing a challenge using a FIDO toke, perform the hashing in the
middleware layer rather than in ssh code. This allows middlewares that
call APIs that perform the hashing implicitly (including Microsoft's
AFAIK). ok markus@

Revision 1.29 / (download) - annotate - [select for diffs], Fri Mar 6 18:25:48 2020 UTC (4 years, 2 months ago) by markus
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

return correct error in sshsk_ed25519_sig; ok djm

Revision 1.28 / (download) - annotate - [select for diffs], Fri Feb 28 01:06:05 2020 UTC (4 years, 2 months ago) by djm
Branch: MAIN
Changes since 1.27: +5 -1 lines
Diff to previous 1.27 (colored)

better error message when trying to use a FIDO key function and
SecurityKeyProvider is empty

Revision 1.27 / (download) - annotate - [select for diffs], Thu Feb 6 22:30:54 2020 UTC (4 years, 3 months ago) by naddy
Branch: MAIN
Changes since 1.26: +12 -14 lines
Diff to previous 1.26 (colored)

Replace "security key" with "authenticator" in program messages.

This replaces "security key" in error/usage/verbose messages and
distinguishes between "authenticator" and "authenticator-hosted key".

ok djm@

Revision 1.26 / (download) - annotate - [select for diffs], Tue Jan 28 08:01:34 2020 UTC (4 years, 3 months ago) by djm
Branch: MAIN
Changes since 1.25: +5 -5 lines
Diff to previous 1.25 (colored)

changes to support FIDO attestation

Allow writing to disk the attestation certificate that is generated by
the FIDO token at key enrollment time. These certificates may be used
by an out-of-band workflow to prove that a particular key is held in
trustworthy hardware.

Allow passing in a challenge that will be sent to the card during
key enrollment. These are needed to build an attestation workflow
that resists replay attacks.

ok markus@

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jan 25 23:13:09 2020 UTC (4 years, 3 months ago) by djm
Branch: MAIN
Changes since 1.24: +4 -2 lines
Diff to previous 1.24 (colored)

improve the error message for u2f enrollment errors by making
ssh-keygen be solely responsible for printing the error message and
convertint some more common error responses from the middleware to
a useful ssherr.h status code. more detail remains visible via -v
of course.

also remove indepedent copy of sk-api.h declarations in sk-usbhid.c
and just include it.

feedback & ok markus@

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jan 6 02:00:47 2020 UTC (4 years, 4 months ago) by djm
Branch: MAIN
Changes since 1.23: +104 -17 lines
Diff to previous 1.23 (colored)

Extends the SK API to accept a set of key/value options for all
operations. These are intended to future-proof the API a little by
making it easier to specify additional fields for without having to
change the API version for each.

At present, only two options are defined: one to explicitly specify
the device for an operation (rather than accepting the middleware's
autoselection) and another to specify the FIDO2 username that may
be used when generating a resident key. These new options may be
invoked at key generation time via ssh-keygen -O

This also implements a suggestion from Markus to avoid "int" in favour
of uint32_t for the algorithm argument in the API, to make implementation
of ssh-sk-client/helper a little easier.

feedback, fixes and ok markus@

Revision 1.23 / (download) - annotate - [select for diffs], Mon Dec 30 09:24:45 2019 UTC (4 years, 4 months ago) by djm
Branch: MAIN
Changes since 1.22: +18 -3 lines
Diff to previous 1.22 (colored)

translate and return error codes; retry on bad PIN

Define some well-known error codes in the SK API and pass
them back via ssh-sk-helper.

Use the new "wrong PIN" error code to retry PIN prompting during
ssh-keygen of resident keys.

feedback and ok markus@

Revision 1.22 / (download) - annotate - [select for diffs], Mon Dec 30 09:24:03 2019 UTC (4 years, 4 months ago) by djm
Branch: MAIN
Changes since 1.21: +11 -11 lines
Diff to previous 1.21 (colored)

improve some error messages; ok markus@

Revision 1.21 / (download) - annotate - [select for diffs], Mon Dec 30 09:23:28 2019 UTC (4 years, 4 months ago) by djm
Branch: MAIN
Changes since 1.20: +17 -14 lines
Diff to previous 1.20 (colored)

SK API and sk-helper error/PIN passing

Allow passing a PIN via the SK API (API major crank) and let the
ssh-sk-helper API follow.

Also enhance the ssh-sk-helper API to support passing back an error
code instead of a complete reply. Will be used to signal "wrong PIN",
etc.

feedback and ok markus@

Revision 1.20 / (download) - annotate - [select for diffs], Mon Dec 30 09:21:16 2019 UTC (4 years, 4 months ago) by djm
Branch: MAIN
Changes since 1.19: +112 -4 lines
Diff to previous 1.19 (colored)

resident keys support in SK API

Adds a sk_load_resident_keys() function to the security key
API that accepts a security key provider and a PIN and returns
a list of keys.

Implement support for this in the usbhid middleware.

feedback and ok markus@

Revision 1.19 / (download) - annotate - [select for diffs], Mon Dec 30 09:20:36 2019 UTC (4 years, 4 months ago) by djm
Branch: MAIN
Changes since 1.18: +64 -37 lines
Diff to previous 1.18 (colored)

Factor out parsing of struct sk_enroll_response

We'll reuse this for extracting resident keys from a device.

feedback and ok markus@

Revision 1.18 / (download) - annotate - [select for diffs], Fri Dec 13 19:09:10 2019 UTC (4 years, 5 months ago) by djm
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

use ssh-sk-helper for all security key signing operations

This extracts and refactors the client interface for ssh-sk-helper
from ssh-agent and generalises it for use by the other programs.
This means that most OpenSSH tools no longer need to link against
libfido2 or directly interact with /dev/uhid*

requested by, feedback and ok markus@

Revision 1.17 / (download) - annotate - [select for diffs], Wed Nov 27 22:32:11 2019 UTC (4 years, 5 months ago) by djm
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

remove stray semicolon after closing brace of function;
from Michael Forney

Revision 1.16 / (download) - annotate - [select for diffs], Tue Nov 19 22:23:19 2019 UTC (4 years, 5 months ago) by djm
Branch: MAIN
Changes since 1.15: +5 -5 lines
Diff to previous 1.15 (colored)

adjust on-wire signature encoding for ecdsa-sk keys to better match
ec25519-sk keys. Discussed with markus@ and Sebastian Kinne

NB. if you are depending on security keys (already?) then make sure you
update both your clients and servers.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Nov 18 16:08:57 2019 UTC (4 years, 5 months ago) by naddy
Branch: MAIN
Changes since 1.14: +15 -1 lines
Diff to previous 1.14 (colored)

add the missing WITH_OPENSSL ifdefs after the ED25519-SK addition; ok djm@

Revision 1.14 / (download) - annotate - [select for diffs], Sat Nov 16 23:17:20 2019 UTC (4 years, 6 months ago) by djm
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

tweak debug message

Revision 1.13 / (download) - annotate - [select for diffs], Sat Nov 16 22:42:30 2019 UTC (4 years, 6 months ago) by djm
Branch: MAIN
Changes since 1.12: +8 -1 lines
Diff to previous 1.12 (colored)

a little debug() in the security key interface

Revision 1.12 / (download) - annotate - [select for diffs], Thu Nov 14 21:27:30 2019 UTC (4 years, 6 months ago) by djm
Branch: MAIN
Changes since 1.11: +16 -1 lines
Diff to previous 1.11 (colored)

directly support U2F/FIDO2 security keys in OpenSSH by linking
against the (previously external) USB HID middleware. The dlopen()
capability still exists for alternate middlewares, e.g. for
Bluetooth, NFC and test/debugging.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Nov 13 20:25:45 2019 UTC (4 years, 6 months ago) by markus
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

fix check for sig_s; noted by qsa at qualys.com

Revision 1.10 / (download) - annotate - [select for diffs], Tue Nov 12 22:38:19 2019 UTC (4 years, 6 months ago) by djm
Branch: MAIN
Changes since 1.9: +3 -2 lines
Diff to previous 1.9 (colored)

allow an empty attestation certificate returned by a security key
enrollment - these are possible for tokens that only offer self-
attestation. This also needs support from the middleware.

ok markus@

Revision 1.9 / (download) - annotate - [select for diffs], Tue Nov 12 19:34:40 2019 UTC (4 years, 6 months ago) by markus
Branch: MAIN
Changes since 1.8: +27 -38 lines
Diff to previous 1.8 (colored)

remove extra layer for ed25519 signature; ok djm@

Revision 1.8 / (download) - annotate - [select for diffs], Tue Nov 12 19:34:00 2019 UTC (4 years, 6 months ago) by markus
Branch: MAIN
Changes since 1.7: +13 -1 lines
Diff to previous 1.7 (colored)

check sig_r and sig_s for ssh-sk keys; ok djm

Revision 1.7 / (download) - annotate - [select for diffs], Tue Nov 12 19:32:30 2019 UTC (4 years, 6 months ago) by markus
Branch: MAIN
Changes since 1.6: +14 -7 lines
Diff to previous 1.6 (colored)

update sk-api to version 2 for ed25519 support; ok djm

Revision 1.6 / (download) - annotate - [select for diffs], Tue Nov 12 19:31:45 2019 UTC (4 years, 6 months ago) by markus
Branch: MAIN
Changes since 1.5: +54 -4 lines
Diff to previous 1.5 (colored)

implement sshsk_ed25519_assemble(); ok djm

Revision 1.5 / (download) - annotate - [select for diffs], Tue Nov 12 19:31:18 2019 UTC (4 years, 6 months ago) by markus
Branch: MAIN
Changes since 1.4: +53 -6 lines
Diff to previous 1.4 (colored)

implement sshsk_ed25519_inner_sig(); ok djm

Revision 1.4 / (download) - annotate - [select for diffs], Tue Nov 12 19:30:50 2019 UTC (4 years, 6 months ago) by markus
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

rename sshsk_ecdsa_sign() to sshsk_sign(); ok djm

Revision 1.3 / (download) - annotate - [select for diffs], Tue Nov 12 19:30:21 2019 UTC (4 years, 6 months ago) by markus
Branch: MAIN
Changes since 1.2: +43 -20 lines
Diff to previous 1.2 (colored)

factor out sshsk_ecdsa_inner_sig(); ok djm@

Revision 1.2 / (download) - annotate - [select for diffs], Tue Nov 12 19:29:54 2019 UTC (4 years, 6 months ago) by markus
Branch: MAIN
Changes since 1.1: +59 -37 lines
Diff to previous 1.1 (colored)

factor out sshsk_ecdsa_assemble(); ok djm@

Revision 1.1 / (download) - annotate - [select for diffs], Thu Oct 31 21:16:20 2019 UTC (4 years, 6 months ago) by djm
Branch: MAIN

U2F/FIDO middleware interface

Supports enrolling (generating) keys and signatures.

feedback & ok markus@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.