xref: /netbsd-src/external/bsd/libfido2/dist/man/fido2-assert.1 (revision 2d40c4512a84c0d064ec30a492c5e2a14d230bc3)
1ba9bdd8bSchristos.\" Copyright (c) 2018 Yubico AB. All rights reserved.
2*2d40c451Schristos.\"
3*2d40c451Schristos.\" Redistribution and use in source and binary forms, with or without
4*2d40c451Schristos.\" modification, are permitted provided that the following conditions are
5*2d40c451Schristos.\" met:
6*2d40c451Schristos.\"
7*2d40c451Schristos.\"    1. Redistributions of source code must retain the above copyright
8*2d40c451Schristos.\"       notice, this list of conditions and the following disclaimer.
9*2d40c451Schristos.\"    2. Redistributions in binary form must reproduce the above copyright
10*2d40c451Schristos.\"       notice, this list of conditions and the following disclaimer in
11*2d40c451Schristos.\"       the documentation and/or other materials provided with the
12*2d40c451Schristos.\"       distribution.
13*2d40c451Schristos.\"
14*2d40c451Schristos.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15*2d40c451Schristos.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16*2d40c451Schristos.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17*2d40c451Schristos.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18*2d40c451Schristos.\" HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19*2d40c451Schristos.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20*2d40c451Schristos.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21*2d40c451Schristos.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22*2d40c451Schristos.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23*2d40c451Schristos.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24*2d40c451Schristos.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*2d40c451Schristos.\"
26*2d40c451Schristos.\" SPDX-License-Identifier: BSD-2-Clause
27ba9bdd8bSchristos.\"
28ba9bdd8bSchristos.Dd $Mdocdate: November 5 2019 $
29ba9bdd8bSchristos.Dt FIDO2-ASSERT 1
30ba9bdd8bSchristos.Os
31ba9bdd8bSchristos.Sh NAME
32ba9bdd8bSchristos.Nm fido2-assert
33ba9bdd8bSchristos.Nd get/verify a FIDO2 assertion
34ba9bdd8bSchristos.Sh SYNOPSIS
35ba9bdd8bSchristos.Nm
36ba9bdd8bSchristos.Fl G
3795dbdf32Schristos.Op Fl bdhpruv
381fc1e710Schristos.Op Fl t Ar option
39ba9bdd8bSchristos.Op Fl i Ar input_file
40ba9bdd8bSchristos.Op Fl o Ar output_file
41ba9bdd8bSchristos.Ar device
42ba9bdd8bSchristos.Nm
43ba9bdd8bSchristos.Fl V
44ba9bdd8bSchristos.Op Fl dhpv
45ba9bdd8bSchristos.Op Fl i Ar input_file
46ba9bdd8bSchristos.Ar key_file
47ba9bdd8bSchristos.Op Ar type
48ba9bdd8bSchristos.Sh DESCRIPTION
49ba9bdd8bSchristos.Nm
50ba9bdd8bSchristosgets or verifies a FIDO2 assertion.
51ba9bdd8bSchristos.Pp
52ba9bdd8bSchristosThe input of
53ba9bdd8bSchristos.Nm
54ba9bdd8bSchristosis defined by the parameters of the assertion to be obtained/verified.
55ba9bdd8bSchristosSee the
56ba9bdd8bSchristos.Sx INPUT FORMAT
57ba9bdd8bSchristossection for details.
58ba9bdd8bSchristos.Pp
59ba9bdd8bSchristosThe output of
60ba9bdd8bSchristos.Nm
61ba9bdd8bSchristosis defined by the result of the selected operation.
62ba9bdd8bSchristosSee the
63ba9bdd8bSchristos.Sx OUTPUT FORMAT
64ba9bdd8bSchristossection for details.
65ba9bdd8bSchristos.Pp
66ba9bdd8bSchristosIf an assertion is successfully obtained or verified,
67ba9bdd8bSchristos.Nm
68ba9bdd8bSchristosexits 0.
69ba9bdd8bSchristosOtherwise,
70ba9bdd8bSchristos.Nm
71ba9bdd8bSchristosexits 1.
72ba9bdd8bSchristos.Pp
73ba9bdd8bSchristosThe options are as follows:
74ba9bdd8bSchristos.Bl -tag -width Ds
75ba9bdd8bSchristos.It Fl G
76ba9bdd8bSchristosTells
77ba9bdd8bSchristos.Nm
78ba9bdd8bSchristosto obtain a new assertion from
79ba9bdd8bSchristos.Ar device .
80ba9bdd8bSchristos.It Fl V
81ba9bdd8bSchristosTells
82ba9bdd8bSchristos.Nm
83ba9bdd8bSchristosto verify an assertion using the PEM-encoded public key in
84ba9bdd8bSchristos.Ar key_file
85ba9bdd8bSchristosof type
86ba9bdd8bSchristos.Ar type ,
87ba9bdd8bSchristoswhere
88ba9bdd8bSchristos.Ar type
89ba9bdd8bSchristosmay be
90ba9bdd8bSchristos.Em es256
91ba9bdd8bSchristos(denoting ECDSA over NIST P-256 with SHA-256),
92ba9bdd8bSchristos.Em rs256
93ba9bdd8bSchristos(denoting 2048-bit RSA with PKCS#1.5 padding and SHA-256), or
94ba9bdd8bSchristos.Em eddsa
95ba9bdd8bSchristos(denoting EDDSA over Curve25519 with SHA-512).
96ba9bdd8bSchristosIf
97ba9bdd8bSchristos.Ar type
98ba9bdd8bSchristosis not specified,
99ba9bdd8bSchristos.Em es256
100ba9bdd8bSchristosis assumed.
10195dbdf32Schristos.It Fl b
10295dbdf32SchristosRequest the credential's
10395dbdf32Schristos.Dq largeBlobKey ,
10495dbdf32Schristosa 32-byte symmetric key associated with the asserted credential.
105ba9bdd8bSchristos.It Fl h
106ba9bdd8bSchristosIf obtaining an assertion, enable the FIDO2 hmac-secret
107ba9bdd8bSchristosextension.
108ba9bdd8bSchristosIf verifying an assertion, check whether the extension data bit was
109ba9bdd8bSchristossigned by the authenticator.
110ba9bdd8bSchristos.It Fl d
111ba9bdd8bSchristosCauses
112ba9bdd8bSchristos.Nm
113ba9bdd8bSchristosto emit debugging output on
114ba9bdd8bSchristos.Em stderr .
115ba9bdd8bSchristos.It Fl i Ar input_file
116ba9bdd8bSchristosTells
117ba9bdd8bSchristos.Nm
118ba9bdd8bSchristosto read the parameters of the assertion from
119ba9bdd8bSchristos.Ar input_file
120ba9bdd8bSchristosinstead of
121ba9bdd8bSchristos.Em stdin .
122ba9bdd8bSchristos.It Fl o Ar output_file
123ba9bdd8bSchristosTells
124ba9bdd8bSchristos.Nm
125ba9bdd8bSchristosto write output on
126ba9bdd8bSchristos.Ar output_file
127ba9bdd8bSchristosinstead of
128ba9bdd8bSchristos.Em stdout .
129ba9bdd8bSchristos.It Fl p
130ba9bdd8bSchristosIf obtaining an assertion, request user presence.
131ba9bdd8bSchristosIf verifying an assertion, check whether the user presence bit was
132ba9bdd8bSchristossigned by the authenticator.
133ba9bdd8bSchristos.It Fl r
134ba9bdd8bSchristosObtain an assertion using a resident credential.
135ba9bdd8bSchristosIf
136ba9bdd8bSchristos.Fl r
137ba9bdd8bSchristosis specified,
138ba9bdd8bSchristos.Nm
139ba9bdd8bSchristoswill not expect a credential id in its input, and may output
140ba9bdd8bSchristosmultiple assertions.
14195dbdf32SchristosResident credentials are called
14295dbdf32Schristos.Dq discoverable credentials
143*2d40c451Schristosin CTAP 2.1.
1441fc1e710Schristos.It Fl t Ar option
1451fc1e710SchristosToggles a key/value
1461fc1e710Schristos.Ar option ,
1471fc1e710Schristoswhere
1481fc1e710Schristos.Ar option
1491fc1e710Schristosis a string of the form
1501fc1e710Schristos.Dq key=value .
1511fc1e710SchristosThe options supported at present are:
1521fc1e710Schristos.Bl -tag -width Ds
1531fc1e710Schristos.It Cm up Ns = Ns Ar true|false
1541fc1e710SchristosAsks the authenticator for user presence to be enabled or disabled.
1551fc1e710Schristos.It Cm uv Ns = Ns Ar true|false
1561fc1e710SchristosAsks the authenticator for user verification to be enabled or
1571fc1e710Schristosdisabled.
1581fc1e710Schristos.It Cm pin Ns = Ns Ar true|false
1591fc1e710SchristosTells
1601fc1e710Schristos.Nm
1611fc1e710Schristoswhether to prompt for a PIN and request user verification.
1621fc1e710Schristos.El
1631fc1e710Schristos.Pp
1641fc1e710SchristosThe
1651fc1e710Schristos.Fl t
1661fc1e710Schristosoption may be specified multiple times.
167ba9bdd8bSchristos.It Fl u
168ba9bdd8bSchristosObtain an assertion using U2F.
169ba9bdd8bSchristosBy default,
170ba9bdd8bSchristos.Nm
171ba9bdd8bSchristoswill use FIDO2 if supported by the authenticator, and fallback to
172ba9bdd8bSchristosU2F otherwise.
173ba9bdd8bSchristos.It Fl v
174ba9bdd8bSchristosIf obtaining an assertion, prompt the user for a PIN and request
175ba9bdd8bSchristosuser verification from the authenticator.
1761fc1e710SchristosIf verifying an assertion, check whether the user verification bit
1771fc1e710Schristoswas signed by the authenticator.
1781fc1e710Schristos.El
1791fc1e710Schristos.Pp
180ba9bdd8bSchristosIf a
181ba9bdd8bSchristos.Em tty
182ba9bdd8bSchristosis available,
183ba9bdd8bSchristos.Nm
184ba9bdd8bSchristoswill use it to obtain the PIN.
185ba9bdd8bSchristosOtherwise,
186ba9bdd8bSchristos.Em stdin
187ba9bdd8bSchristosis used.
188ba9bdd8bSchristos.Sh INPUT FORMAT
189ba9bdd8bSchristosThe input of
190ba9bdd8bSchristos.Nm
191ba9bdd8bSchristosconsists of base64 blobs and UTF-8 strings separated
192ba9bdd8bSchristosby newline characters ('\\n').
193ba9bdd8bSchristos.Pp
194ba9bdd8bSchristosWhen obtaining an assertion,
195ba9bdd8bSchristos.Nm
196ba9bdd8bSchristosexpects its input to consist of:
197ba9bdd8bSchristos.Pp
198ba9bdd8bSchristos.Bl -enum -offset indent -compact
199ba9bdd8bSchristos.It
200ba9bdd8bSchristosclient data hash (base64 blob);
201ba9bdd8bSchristos.It
202ba9bdd8bSchristosrelying party id (UTF-8 string);
203ba9bdd8bSchristos.It
204ba9bdd8bSchristoscredential id, if credential not resident (base64 blob);
205ba9bdd8bSchristos.It
206ba9bdd8bSchristoshmac salt, if the FIDO2 hmac-secret extension is enabled
207ba9bdd8bSchristos(base64 blob);
208ba9bdd8bSchristos.El
209ba9bdd8bSchristos.Pp
210ba9bdd8bSchristosWhen verifying an assertion,
211ba9bdd8bSchristos.Nm
212ba9bdd8bSchristosexpects its input to consist of:
213ba9bdd8bSchristos.Pp
214ba9bdd8bSchristos.Bl -enum -offset indent -compact
215ba9bdd8bSchristos.It
216ba9bdd8bSchristosclient data hash (base64 blob);
217ba9bdd8bSchristos.It
218ba9bdd8bSchristosrelying party id (UTF-8 string);
219ba9bdd8bSchristos.It
220ba9bdd8bSchristosauthenticator data (base64 blob);
221ba9bdd8bSchristos.It
222ba9bdd8bSchristosassertion signature (base64 blob);
223ba9bdd8bSchristos.El
224ba9bdd8bSchristos.Pp
225ba9bdd8bSchristosUTF-8 strings passed to
226ba9bdd8bSchristos.Nm
227ba9bdd8bSchristosmust not contain embedded newline or NUL characters.
228ba9bdd8bSchristos.Sh OUTPUT FORMAT
229ba9bdd8bSchristosThe output of
230ba9bdd8bSchristos.Nm
231ba9bdd8bSchristosconsists of base64 blobs and UTF-8 strings separated
232ba9bdd8bSchristosby newline characters ('\\n').
233ba9bdd8bSchristos.Pp
234ba9bdd8bSchristosFor each generated assertion,
235ba9bdd8bSchristos.Nm
236ba9bdd8bSchristosoutputs:
237ba9bdd8bSchristos.Pp
238ba9bdd8bSchristos.Bl -enum -offset indent -compact
239ba9bdd8bSchristos.It
240ba9bdd8bSchristosclient data hash (base64 blob);
241ba9bdd8bSchristos.It
242ba9bdd8bSchristosrelying party id (UTF-8 string);
243ba9bdd8bSchristos.It
244ba9bdd8bSchristosauthenticator data (base64 blob);
245ba9bdd8bSchristos.It
246ba9bdd8bSchristosassertion signature (base64 blob);
247ba9bdd8bSchristos.It
248ba9bdd8bSchristosuser id, if credential resident (base64 blob);
249ba9bdd8bSchristos.It
250ba9bdd8bSchristoshmac secret, if the FIDO2 hmac-secret extension is enabled
251ba9bdd8bSchristos(base64 blob);
25295dbdf32Schristos.It
25395dbdf32Schristosthe credential's associated 32-byte symmetric key
25495dbdf32Schristos.Pq Dq largeBlobKey ,
25595dbdf32Schristosif requested (base64 blob).
256ba9bdd8bSchristos.El
257ba9bdd8bSchristos.Pp
258ba9bdd8bSchristosWhen verifying an assertion,
259ba9bdd8bSchristos.Nm
260ba9bdd8bSchristosproduces no output.
261ba9bdd8bSchristos.Sh EXAMPLES
262ba9bdd8bSchristosAssuming
263ba9bdd8bSchristos.Pa cred
264ba9bdd8bSchristoscontains a
265ba9bdd8bSchristos.Em es256
266ba9bdd8bSchristoscredential created according to the steps outlined in
267ba9bdd8bSchristos.Xr fido2-cred 1 ,
268ba9bdd8bSchristosobtain an assertion from an authenticator at
269ba9bdd8bSchristos.Pa /dev/hidraw5
270ba9bdd8bSchristosand verify it:
271ba9bdd8bSchristos.Pp
272ba9bdd8bSchristos.Dl $ echo assertion challenge | openssl sha256 -binary | base64 > assert_param
273ba9bdd8bSchristos.Dl $ echo relying party >> assert_param
274ba9bdd8bSchristos.Dl $ head -1 cred >> assert_param
275ba9bdd8bSchristos.Dl $ tail -n +2 cred > pubkey
276ba9bdd8bSchristos.Dl $ fido2-assert -G -i assert_param /dev/hidraw5 | fido2-assert -V pubkey es256
277ba9bdd8bSchristos.Sh SEE ALSO
278ba9bdd8bSchristos.Xr fido2-cred 1 ,
279ba9bdd8bSchristos.Xr fido2-token 1
280