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 — FIDO 2 CBOR Info
11     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

DESCRIPTION

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

RETURN VALUES

95     The fido_cbor_info_aaguid_ptr(), fido_cbor_info_extensions_ptr(),
96     fido_cbor_info_protocols_ptr(), fido_cbor_info_versions_ptr(),
97     fido_cbor_info_options_name_ptr(), and fido_cbor_info_options_value_ptr()
98     functions return NULL if the respective field in ci is absent.  If not
99     NULL, returned pointers are guaranteed to exist until any API function
100     that takes ci without the const qualifier is invoked.
101

SEE ALSO

103     fido_dev_open(3)
104
105BSD                              May 10, 2020                              BSD
Impressum