1FIDO_DEV_OPEN(3) BSD Library Functions Manual FIDO_DEV_OPEN(3)
2
4 fido_dev_open, fido_dev_close, fido_dev_cancel, fido_dev_new,
5 fido_dev_free, fido_dev_force_fido2, fido_dev_force_u2f,
6 fido_dev_is_fido2, fido_dev_supports_credman,
7 fido_dev_supports_cred_prot, fido_dev_supports_pin, fido_dev_has_pin,
8 fido_dev_protocol, fido_dev_build, fido_dev_flags, fido_dev_major,
9 fido_dev_minor — FIDO 2 device open/close and related functions
10
12 #include <fido.h>
13
14 int
15 fido_dev_open(fido_dev_t *dev, const char *path);
16
17 int
18 fido_dev_close(fido_dev_t *dev);
19
20 int
21 fido_dev_cancel(fido_dev_t *dev);
22
23 fido_dev_t *
24 fido_dev_new(void);
25
26 void
27 fido_dev_free(fido_dev_t **dev_p);
28
29 void
30 fido_dev_force_fido2(fido_dev_t *dev);
31
32 void
33 fido_dev_force_u2f(fido_dev_t *dev);
34
35 bool
36 fido_dev_is_fido2(const fido_dev_t *dev);
37
38 bool
39 fido_dev_supports_credman(const fido_dev_t *dev);
40
41 bool
42 fido_dev_supports_cred_prot(const fido_dev_t *dev);
43
44 bool
45 fido_dev_supports_pin(const fido_dev_t *dev);
46
47 bool
48 fido_dev_has_pin(const fido_dev_t *dev);
49
50 uint8_t
51 fido_dev_protocol(const fido_dev_t *dev);
52
53 uint8_t
54 fido_dev_build(const fido_dev_t *dev);
55
56 uint8_t
57 fido_dev_flags(const fido_dev_t *dev);
58
59 uint8_t
60 fido_dev_major(const fido_dev_t *dev);
61
62 uint8_t
63 fido_dev_minor(const fido_dev_t *dev);
64
66 The fido_dev_open() function opens the device pointed to by path, where
67 dev is a freshly allocated or otherwise closed fido_dev_t.
68
69 The fido_dev_close() function closes the device represented by dev. If
70 dev is already closed, fido_dev_close() is a NOP.
71
72 The fido_dev_cancel() function cancels any pending requests on dev.
73
74 The fido_dev_new() function returns a pointer to a newly allocated, empty
75 fido_dev_t. If memory cannot be allocated, NULL is returned.
76
77 The fido_dev_free() function releases the memory backing *dev_p, where
78 *dev_p must have been previously allocated by fido_dev_new(). On return,
79 *dev_p is set to NULL. Either dev_p or *dev_p may be NULL, in which case
80 fido_dev_free() is a NOP.
81
82 The fido_dev_force_fido2() function can be used to force CTAP2 communica‐
83 tion with dev.
84
85 The fido_dev_force_u2f() function can be used to force CTAP1 (U2F) commu‐
86 nication with dev.
87
88 The fido_dev_is_fido2() function returns true if dev is a FIDO 2 device.
89
90 The fido_dev_supports_credman() function returns true if dev supports
91 FIDO 2.1 Credential Management.
92
93 The fido_dev_supports_cred_prot() function returns true if dev supports
94 FIDO 2.1 Credential Protection.
95
96 The fido_dev_supports_pin() function returns true if dev supports FIDO
97 2.0 Client PINs.
98
99 The fido_dev_has_pin() function returns true if dev has a FIDO 2.0 Client
100 PIN set.
101
102 The fido_dev_protocol() function returns the CTAPHID protocol version
103 identifier of dev.
104
105 The fido_dev_build() function returns the CTAPHID build version number of
106 dev.
107
108 The fido_dev_flags() function returns the CTAPHID capabilities flags of
109 dev.
110
111 The fido_dev_major() function returns the CTAPHID major version number of
112 dev.
113
114 The fido_dev_minor() function returns the CTAPHID minor version number of
115 dev.
116
117 For the format and meaning of the CTAPHID parameters returned by func‐
118 tions above, please refer to the FIDO Client to Authenticator Protocol
119 (CTAP) specification.
120
122 On success, fido_dev_open() and fido_dev_close() return FIDO_OK. On er‐
123 ror, a different error code defined in <fido/err.h> is returned.
124
126 fido_dev_info_manifest(3), fido_dev_set_io_functions(3)
127
128BSD May 25, 2018 BSD