summaryrefslogtreecommitdiff
path: root/man/fido_dev_set_pin.3
diff options
context:
space:
mode:
Diffstat (limited to 'man/fido_dev_set_pin.3')
-rw-r--r--man/fido_dev_set_pin.388
1 files changed, 88 insertions, 0 deletions
diff --git a/man/fido_dev_set_pin.3 b/man/fido_dev_set_pin.3
new file mode 100644
index 0000000..94f841b
--- /dev/null
+++ b/man/fido_dev_set_pin.3
@@ -0,0 +1,88 @@
1.\" Copyright (c) 2018 Yubico AB. All rights reserved.
2.\" Use of this source code is governed by a BSD-style
3.\" license that can be found in the LICENSE file.
4.\"
5.Dd $Mdocdate: May 25 2018 $
6.Dt FIDO_DEV_SET_PIN 3
7.Os
8.Sh NAME
9.Nm fido_dev_set_pin ,
10.Nm fido_dev_get_retry_count ,
11.Nm fido_dev_reset
12.Nd FIDO 2 device management functions
13.Sh SYNOPSIS
14.In fido.h
15.Ft int
16.Fn fido_dev_set_pin "fido_dev_t *dev" "const char *pin" "const char *oldpin"
17.Ft int
18.Fn fido_dev_get_retry_count "fido_dev_t *dev" "int *retries"
19.Ft int
20.Fn fido_dev_reset "fido_dev_t *dev"
21.Sh DESCRIPTION
22The
23.Fn fido_dev_set_pin
24function sets the PIN of device
25.Fa dev
26to
27.Fa pin ,
28where
29.Fa pin
30is a NUL-terminated UTF-8 string.
31If
32.Fa oldpin
33is not NULL, the device's PIN is changed from
34.Fa oldpin
35to
36.Fa pin ,
37where
38.Fa pin
39and
40.Fa oldpin
41are NUL-terminated UTF-8 strings.
42.Pp
43The
44.Fn fido_dev_get_retry_count
45function fills
46.Fa retries
47with the number of PIN retries left in
48.Fa dev
49before lock-out, where
50.Fa retries
51is an addressable pointer.
52.Pp
53The
54.Fn fido_dev_reset
55function performs a reset on
56.Fa dev ,
57resetting the device's PIN and erasing credentials stored on the
58device.
59.Pp
60Please note that
61.Fn fido_dev_set_pin ,
62.Fn fido_dev_get_retry_count ,
63and
64.Fn fido_dev_reset
65are synchronous and will block if necessary.
66.Sh RETURN VALUES
67The error codes returned by
68.Fn fido_dev_set_pin ,
69.Fn fido_dev_get_retry_count ,
70and
71.Fn fido_dev_reset
72are defined in
73.In fido/err.h .
74On success,
75.Dv FIDO_OK
76is returned.
77.Sh CAVEATS
78Regarding
79.Fn fido_dev_reset ,
80the actual user-flow to perform a reset is outside the scope of the
81FIDO2 specification, and may therefore vary depending on the
82authenticator.
83Yubico authenticators will return
84.Dv FIDO_ERR_NOT_ALLOWED
85if a reset is issued later than 5 seconds after power-up, and
86.Dv FIDO_ERR_ACTION_TIMEOUT
87if the user fails to confirm the reset by touching the key
88within 30 seconds.