diff options
Diffstat (limited to 'man/fido_dev_open.3')
-rw-r--r-- | man/fido_dev_open.3 | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/man/fido_dev_open.3 b/man/fido_dev_open.3 new file mode 100644 index 0000000..53e3a12 --- /dev/null +++ b/man/fido_dev_open.3 | |||
@@ -0,0 +1,159 @@ | |||
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_OPEN 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_dev_open , | ||
10 | .Nm fido_dev_close , | ||
11 | .Nm fido_dev_cancel , | ||
12 | .Nm fido_dev_new , | ||
13 | .Nm fido_dev_free , | ||
14 | .Nm fido_dev_force_fido2 , | ||
15 | .Nm fido_dev_force_u2f , | ||
16 | .Nm fido_dev_is_fido2 , | ||
17 | .Nm fido_dev_protocol , | ||
18 | .Nm fido_dev_build , | ||
19 | .Nm fido_dev_flags , | ||
20 | .Nm fido_dev_major , | ||
21 | .Nm fido_dev_minor | ||
22 | .Nd FIDO 2 device open/close and related functions | ||
23 | .Sh SYNOPSIS | ||
24 | .In fido.h | ||
25 | .Ft int | ||
26 | .Fn fido_dev_open "fido_dev_t *dev" "const char *path" | ||
27 | .Ft int | ||
28 | .Fn fido_dev_close "fido_dev_t *dev" | ||
29 | .Ft int | ||
30 | .Fn fido_dev_cancel "fido_dev_t *dev" | ||
31 | .Ft fido_dev_t * | ||
32 | .Fn fido_dev_new "void" | ||
33 | .Ft void | ||
34 | .Fn fido_dev_free "fido_dev_t **dev_p" | ||
35 | .Ft void | ||
36 | .Fn fido_dev_force_fido2 "fido_dev_t *dev" | ||
37 | .Ft void | ||
38 | .Fn fido_dev_force_u2f "fido_dev_t *dev" | ||
39 | .Ft bool | ||
40 | .Fn fido_dev_is_fido2 "const fido_dev_t *dev" | ||
41 | .Ft uint8_t | ||
42 | .Fn fido_dev_protocol "const fido_dev_t *dev" | ||
43 | .Ft uint8_t | ||
44 | .Fn fido_dev_build "const fido_dev_t *dev" | ||
45 | .Ft uint8_t | ||
46 | .Fn fido_dev_flags "const fido_dev_t *dev" | ||
47 | .Ft uint8_t | ||
48 | .Fn fido_dev_major "const fido_dev_t *dev" | ||
49 | .Ft uint8_t | ||
50 | .Fn fido_dev_minor "const fido_dev_t *dev" | ||
51 | .Sh DESCRIPTION | ||
52 | The | ||
53 | .Fn fido_dev_open | ||
54 | function opens the device pointed to by | ||
55 | .Fa path , | ||
56 | where | ||
57 | .Fa dev | ||
58 | is a freshly allocated or otherwise closed | ||
59 | .Vt fido_dev_t . | ||
60 | .Pp | ||
61 | The | ||
62 | .Fn fido_dev_close | ||
63 | function closes the device represented by | ||
64 | .Fa dev . | ||
65 | If | ||
66 | .Fa dev | ||
67 | is already closed, | ||
68 | .Fn fido_dev_close | ||
69 | is a NOP. | ||
70 | .Pp | ||
71 | The | ||
72 | .Fn fido_dev_cancel | ||
73 | function cancels any pending requests on | ||
74 | .Fa dev . | ||
75 | .Pp | ||
76 | The | ||
77 | .Fn fido_dev_new | ||
78 | function returns a pointer to a newly allocated, empty | ||
79 | .Vt fido_dev_t . | ||
80 | If memory cannot be allocated, NULL is returned. | ||
81 | .Pp | ||
82 | The | ||
83 | .Fn fido_dev_free | ||
84 | function releases the memory backing | ||
85 | .Fa *dev_p , | ||
86 | where | ||
87 | .Fa *dev_p | ||
88 | must have been previously allocated by | ||
89 | .Fn fido_dev_new . | ||
90 | On return, | ||
91 | .Fa *dev_p | ||
92 | is set to NULL. | ||
93 | Either | ||
94 | .Fa dev_p | ||
95 | or | ||
96 | .Fa *dev_p | ||
97 | may be NULL, in which case | ||
98 | .Fn fido_dev_free | ||
99 | is a NOP. | ||
100 | .Pp | ||
101 | The | ||
102 | .Fn fido_dev_force_fido2 | ||
103 | function can be used to force CTAP2 communication with | ||
104 | .Fa dev . | ||
105 | .Pp | ||
106 | The | ||
107 | .Fn fido_dev_force_u2f | ||
108 | function can be used to force CTAP1 (U2F) communication with | ||
109 | .Fa dev . | ||
110 | .Pp | ||
111 | The | ||
112 | .Fn fido_dev_is_fido2 | ||
113 | function returns | ||
114 | .Dv true | ||
115 | if | ||
116 | .Fa dev | ||
117 | is a FIDO 2 device. | ||
118 | .Pp | ||
119 | The | ||
120 | .Fn fido_dev_protocol | ||
121 | function returns the CTAPHID protocol version identifier of | ||
122 | .Fa dev . | ||
123 | .Pp | ||
124 | The | ||
125 | .Fn fido_dev_build | ||
126 | function returns the CTAPHID build version number of | ||
127 | .Fa dev . | ||
128 | .Pp | ||
129 | The | ||
130 | .Fn fido_dev_flags | ||
131 | function returns the CTAPHID capabilities flags of | ||
132 | .Fa dev . | ||
133 | .Pp | ||
134 | The | ||
135 | .Fn fido_dev_major | ||
136 | function returns the CTAPHID major version number of | ||
137 | .Fa dev . | ||
138 | .Pp | ||
139 | The | ||
140 | .Fn fido_dev_minor | ||
141 | function returns the CTAPHID minor version number of | ||
142 | .Fa dev . | ||
143 | .Pp | ||
144 | For the format and meaning of the CTAPHID parameters returned by | ||
145 | functions above, please refer to the FIDO Client to Authenticator | ||
146 | Protocol (CTAP) specification. | ||
147 | .Sh RETURN VALUES | ||
148 | On success, | ||
149 | .Fn fido_dev_open | ||
150 | and | ||
151 | .Fn fido_dev_close | ||
152 | return | ||
153 | .Dv FIDO_OK . | ||
154 | On error, a different error code defined in | ||
155 | .In fido/err.h | ||
156 | is returned. | ||
157 | .Sh SEE ALSO | ||
158 | .Xr fido_dev_info_manifest 3 , | ||
159 | .Xr fido_dev_set_io_functions 3 | ||