1FIDO_CBOR_INFO_NEW(3)    BSD Library Functions Manual    FIDO_CBOR_INFO_NEW(3)
2

NAME

4     fido_cbor_info_new, fido_cbor_info_free, fido_dev_get_cbor_info,
5     fido_cbor_info_aaguid_ptr, fido_cbor_info_extensions_ptr,
6     fido_cbor_info_protocols_ptr, fido_cbor_info_versions_ptr,
7     fido_cbor_info_options_name_ptr, fido_cbor_info_options_value_ptr,
8     fido_cbor_info_aaguid_len, fido_cbor_info_extensions_len,
9     fido_cbor_info_protocols_len, fido_cbor_info_versions_len,
10     fido_cbor_info_options_len, fido_cbor_info_maxmsgsiz,
11     fido_cbor_info_fwversion — FIDO 2 CBOR Info API
12

SYNOPSIS

14     #include <fido.h>
15
16     fido_cbor_info_t *
17     fido_cbor_info_new(void);
18
19     void
20     fido_cbor_info_free(fido_cbor_info_t **ci_p);
21
22     int
23     fido_dev_get_cbor_info(fido_dev_t *dev, fido_cbor_info_t *ci);
24
25     const unsigned char *
26     fido_cbor_info_aaguid_ptr(const fido_cbor_info_t *ci);
27
28     char **
29     fido_cbor_info_extensions_ptr(const fido_cbor_info_t *ci);
30
31     const uint8_t *
32     fido_cbor_info_protocols_ptr(const fido_cbor_info_t *ci);
33
34     char **
35     fido_cbor_info_versions_ptr(const fido_cbor_info_t *ci);
36
37     char **
38     fido_cbor_info_options_name_ptr(const fido_cbor_info_t *ci);
39
40     const bool *
41     fido_cbor_info_options_value_ptr(const fido_cbor_info_t *ci);
42
43     size_t
44     fido_cbor_info_aaguid_len(const fido_cbor_info_t *ci);
45
46     size_t
47     fido_cbor_info_extensions_len(const fido_cbor_info_t *ci);
48
49     size_t
50     fido_cbor_info_protocols_len(const fido_cbor_info_t *ci);
51
52     size_t
53     fido_cbor_info_versions_len(const fido_cbor_info_t *ci);
54
55     size_t
56     fido_cbor_info_options_len(const fido_cbor_info_t *ci);
57
58     uint64_t
59     fido_cbor_info_maxmsgsiz(const fido_cbor_info_t *ci);
60
61     uint64_t
62     fido_cbor_info_fwversion(const fido_cbor_info_t *ci);
63

DESCRIPTION

65     The fido_cbor_info_new() function returns a pointer to a newly allocated,
66     empty fido_cbor_info_t type.  If memory cannot be allocated, NULL is
67     returned.
68
69     The fido_cbor_info_free() function releases the memory backing *ci_p,
70     where *ci_p must have been previously allocated by fido_cbor_info_new().
71     On return, *ci_p is set to NULL.  Either ci_p or *ci_p may be NULL, in
72     which case fido_cbor_info_free() is a NOP.
73
74     The fido_dev_get_cbor_info() function transmits a CTAP_CBOR_GETINFO com‐
75     mand to dev and fills ci with attributes retrieved from the command's
76     response.  The fido_dev_get_cbor_info() function may block.
77
78     The fido_cbor_info_aaguid_ptr(), fido_cbor_info_extensions_ptr(),
79     fido_cbor_info_protocols_ptr(), and fido_cbor_info_versions_ptr() func‐
80     tions return pointers to the AAGUID, supported extensions, PIN protocol
81     and CTAP version strings of ci.  The corresponding length of a given
82     attribute can be obtained by fido_cbor_info_aaguid_len(),
83     fido_cbor_info_extensions_len(), fido_cbor_info_protocols_len(), or
84     fido_cbor_info_versions_len().
85
86     The fido_cbor_info_options_name_ptr() and
87     fido_cbor_info_options_value_ptr() functions return pointers to the array
88     of option names and their respective values in ci.  The length of the
89     options array is returned by fido_cbor_info_options_len().
90
91     The fido_cbor_info_maxmsgsiz() function returns the maximum message size
92     attribute of ci.
93
94     The fido_cbor_info_fwversion() function returns the firmware version
95     attribute of ci.
96
97     A complete example of how to use these functions can be found in the
98     example/info.c file shipped with libfido2.
99

RETURN VALUES

101     The fido_cbor_info_aaguid_ptr(), fido_cbor_info_extensions_ptr(),
102     fido_cbor_info_protocols_ptr(), fido_cbor_info_versions_ptr(),
103     fido_cbor_info_options_name_ptr(), and fido_cbor_info_options_value_ptr()
104     functions return NULL if the respective field in ci is absent.  If not
105     NULL, returned pointers are guaranteed to exist until any API function
106     that takes ci without the const qualifier is invoked.
107

SEE ALSO

109     fido_dev_open(3)
110
111BSD                              May 24, 2018                              BSD
Impressum