diff options
author | nicoo <nicoo@debian.org> | 2020-02-12 13:43:18 +0100 |
---|---|---|
committer | Nicolas Braud-Santoni <nicolas@braud-santoni.eu> | 2020-02-12 13:43:18 +0100 |
commit | 88a8bdd35ca7fb0c1ce70abdd8262d958fedafc1 (patch) | |
tree | ce42d9d46d371c05eed82d8bb1e8aa7b2522a769 /man | |
parent | 4e06e4554b69e678110563b1cf00a258a202dd7b (diff) | |
parent | c79050aa44b8836d836c5dd22a383a073c28b74b (diff) |
Merge upstream release 1.3.0 into debian/sid
Diffstat (limited to 'man')
32 files changed, 3991 insertions, 0 deletions
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt new file mode 100644 index 0000000..c903ab8 --- /dev/null +++ b/man/CMakeLists.txt | |||
@@ -0,0 +1,314 @@ | |||
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 | find_program(MANDOC_PATH mandoc) | ||
6 | message(STATUS "MANDOC_PATH: ${MANDOC_PATH}") | ||
7 | |||
8 | if(CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
9 | find_program(GZIP_PATH gzip) | ||
10 | message(STATUS "GZIP_PATH: ${GZIP_PATH}") | ||
11 | endif() | ||
12 | |||
13 | list(APPEND MAN_SOURCES | ||
14 | eddsa_pk_new.3 | ||
15 | es256_pk_new.3 | ||
16 | fido2-assert.1 | ||
17 | fido2-cred.1 | ||
18 | fido2-token.1 | ||
19 | fido_init.3 | ||
20 | fido_assert_new.3 | ||
21 | fido_assert_allow_cred.3 | ||
22 | fido_assert_set_authdata.3 | ||
23 | fido_assert_verify.3 | ||
24 | fido_bio_dev_get_info.3 | ||
25 | fido_bio_enroll_new.3 | ||
26 | fido_bio_info_new.3 | ||
27 | fido_bio_template.3 | ||
28 | fido_cbor_info_new.3 | ||
29 | fido_cred_new.3 | ||
30 | fido_cred_exclude.3 | ||
31 | fido_credman_metadata_new.3 | ||
32 | fido_cred_set_authdata.3 | ||
33 | fido_cred_verify.3 | ||
34 | fido_dev_get_assert.3 | ||
35 | fido_dev_info_manifest.3 | ||
36 | fido_dev_make_cred.3 | ||
37 | fido_dev_open.3 | ||
38 | fido_dev_set_io_functions.3 | ||
39 | fido_dev_set_pin.3 | ||
40 | fido_strerr.3 | ||
41 | rs256_pk_new.3 | ||
42 | ) | ||
43 | |||
44 | list(APPEND MAN_ALIAS | ||
45 | eddsa_pk_new eddsa_pk_free | ||
46 | eddsa_pk_new eddsa_pk_from_ptr | ||
47 | eddsa_pk_new eddsa_pk_to_EVP_PKEY | ||
48 | es256_pk_new es256_pk_free | ||
49 | es256_pk_new es256_pk_from_EC_KEY | ||
50 | es256_pk_new es256_pk_from_ptr | ||
51 | es256_pk_new es256_pk_to_EVP_PKEY | ||
52 | fido_assert_new fido_assert_authdata_len | ||
53 | fido_assert_new fido_assert_authdata_ptr | ||
54 | fido_assert_new fido_assert_clientdata_hash_len | ||
55 | fido_assert_new fido_assert_clientdata_hash_ptr | ||
56 | fido_assert_new fido_assert_count | ||
57 | fido_assert_new fido_assert_free | ||
58 | fido_assert_new fido_assert_hmac_secret_len | ||
59 | fido_assert_new fido_assert_hmac_secret_ptr | ||
60 | fido_assert_new fido_assert_sigcount | ||
61 | fido_assert_new fido_assert_sig_len | ||
62 | fido_assert_new fido_assert_sig_ptr | ||
63 | fido_assert_new fido_assert_user_display_name | ||
64 | fido_assert_new fido_assert_user_icon | ||
65 | fido_assert_new fido_assert_user_id_len | ||
66 | fido_assert_new fido_assert_user_id_ptr | ||
67 | fido_assert_new fido_assert_user_name | ||
68 | fido_assert_set_authdata fido_assert_set_clientdata_hash | ||
69 | fido_assert_set_authdata fido_assert_set_count | ||
70 | fido_assert_set_authdata fido_assert_set_extensions | ||
71 | fido_assert_set_authdata fido_assert_set_hmac_salt | ||
72 | fido_assert_set_authdata fido_assert_set_rp | ||
73 | fido_assert_set_authdata fido_assert_set_sig | ||
74 | fido_assert_set_authdata fido_assert_set_up | ||
75 | fido_assert_set_authdata fido_assert_set_uv | ||
76 | fido_bio_dev_get_info fido_bio_dev_enroll_begin | ||
77 | fido_bio_dev_get_info fido_bio_dev_enroll_cancel | ||
78 | fido_bio_dev_get_info fido_bio_dev_enroll_continue | ||
79 | fido_bio_dev_get_info fido_bio_dev_enroll_remove | ||
80 | fido_bio_dev_get_info fido_bio_dev_get_template_array | ||
81 | fido_bio_dev_get_info fido_bio_dev_set_template_name | ||
82 | fido_bio_enroll_new fido_bio_enroll_free | ||
83 | fido_bio_enroll_new fido_bio_enroll_last_status | ||
84 | fido_bio_enroll_new fido_bio_enroll_remaining_samples | ||
85 | fido_bio_info_new fido_bio_info_free | ||
86 | fido_bio_info_new fido_bio_info_max_samples | ||
87 | fido_bio_info_new fido_bio_info_type | ||
88 | fido_bio_template fido_bio_template_array_count | ||
89 | fido_bio_template fido_bio_template_array_free | ||
90 | fido_bio_template fido_bio_template_array_new | ||
91 | fido_bio_template fido_bio_template_free | ||
92 | fido_bio_template fido_bio_template_id_len | ||
93 | fido_bio_template fido_bio_template_id_ptr | ||
94 | fido_bio_template fido_bio_template_name | ||
95 | fido_bio_template fido_bio_template_new | ||
96 | fido_bio_template fido_bio_template_set_id | ||
97 | fido_bio_template fido_bio_template_set_name | ||
98 | fido_cbor_info_new fido_cbor_info_aaguid_len | ||
99 | fido_cbor_info_new fido_cbor_info_aaguid_ptr | ||
100 | fido_cbor_info_new fido_cbor_info_extensions_len | ||
101 | fido_cbor_info_new fido_cbor_info_extensions_ptr | ||
102 | fido_cbor_info_new fido_cbor_info_free | ||
103 | fido_cbor_info_new fido_cbor_info_maxmsgsiz | ||
104 | fido_cbor_info_new fido_cbor_info_options_len | ||
105 | fido_cbor_info_new fido_cbor_info_options_name_ptr | ||
106 | fido_cbor_info_new fido_cbor_info_options_value_ptr | ||
107 | fido_cbor_info_new fido_cbor_info_protocols_len | ||
108 | fido_cbor_info_new fido_cbor_info_protocols_ptr | ||
109 | fido_cbor_info_new fido_cbor_info_versions_len | ||
110 | fido_cbor_info_new fido_cbor_info_versions_ptr | ||
111 | fido_cbor_info_new fido_dev_get_cbor_info | ||
112 | fido_cred_new fido_cred_authdata_len | ||
113 | fido_cred_new fido_cred_authdata_ptr | ||
114 | fido_cred_new fido_cred_clientdata_hash_len | ||
115 | fido_cred_new fido_cred_clientdata_hash_ptr | ||
116 | fido_cred_new fido_cred_fmt | ||
117 | fido_cred_new fido_cred_free | ||
118 | fido_cred_new fido_cred_id_len | ||
119 | fido_cred_new fido_cred_id_ptr | ||
120 | fido_cred_new fido_cred_pubkey_len | ||
121 | fido_cred_new fido_cred_pubkey_ptr | ||
122 | fido_cred_new fido_cred_sig_len | ||
123 | fido_cred_new fido_cred_sig_ptr | ||
124 | fido_cred_new fido_cred_x5c_len | ||
125 | fido_cred_new fido_cred_x5c_ptr | ||
126 | fido_credman_metadata_new fido_credman_del_dev_rk | ||
127 | fido_credman_metadata_new fido_credman_get_dev_metadata | ||
128 | fido_credman_metadata_new fido_credman_get_dev_rk | ||
129 | fido_credman_metadata_new fido_credman_get_dev_rp | ||
130 | fido_credman_metadata_new fido_credman_metadata_free | ||
131 | fido_credman_metadata_new fido_credman_rk | ||
132 | fido_credman_metadata_new fido_credman_rk_count | ||
133 | fido_credman_metadata_new fido_credman_rk_existing | ||
134 | fido_credman_metadata_new fido_credman_rk_free | ||
135 | fido_credman_metadata_new fido_credman_rk_new | ||
136 | fido_credman_metadata_new fido_credman_rk_remaining | ||
137 | fido_credman_metadata_new fido_credman_rp_count | ||
138 | fido_credman_metadata_new fido_credman_rp_free | ||
139 | fido_credman_metadata_new fido_credman_rp_id | ||
140 | fido_credman_metadata_new fido_credman_rp_id_hash_len | ||
141 | fido_credman_metadata_new fido_credman_rp_id_hash_ptr | ||
142 | fido_credman_metadata_new fido_credman_rp_name | ||
143 | fido_credman_metadata_new fido_credman_rp_new | ||
144 | fido_cred_set_authdata fido_cred_set_authdata_raw | ||
145 | fido_cred_set_authdata fido_cred_set_clientdata_hash | ||
146 | fido_cred_set_authdata fido_cred_set_extensions | ||
147 | fido_cred_set_authdata fido_cred_set_fmt | ||
148 | fido_cred_set_authdata fido_cred_set_rk | ||
149 | fido_cred_set_authdata fido_cred_set_rp | ||
150 | fido_cred_set_authdata fido_cred_set_sig | ||
151 | fido_cred_set_authdata fido_cred_set_type | ||
152 | fido_cred_set_authdata fido_cred_set_user | ||
153 | fido_cred_set_authdata fido_cred_set_uv | ||
154 | fido_cred_set_authdata fido_cred_set_x509 | ||
155 | fido_dev_info_manifest fido_dev_info_free | ||
156 | fido_dev_info_manifest fido_dev_info_manufacturer_string | ||
157 | fido_dev_info_manifest fido_dev_info_new | ||
158 | fido_dev_info_manifest fido_dev_info_path | ||
159 | fido_dev_info_manifest fido_dev_info_product | ||
160 | fido_dev_info_manifest fido_dev_info_product_string | ||
161 | fido_dev_info_manifest fido_dev_info_ptr | ||
162 | fido_dev_info_manifest fido_dev_info_vendor | ||
163 | fido_dev_open fido_dev_build | ||
164 | fido_dev_open fido_dev_cancel | ||
165 | fido_dev_open fido_dev_close | ||
166 | fido_dev_open fido_dev_flags | ||
167 | fido_dev_open fido_dev_force_fido2 | ||
168 | fido_dev_open fido_dev_force_u2f | ||
169 | fido_dev_open fido_dev_free | ||
170 | fido_dev_open fido_dev_is_fido2 | ||
171 | fido_dev_open fido_dev_major | ||
172 | fido_dev_open fido_dev_minor | ||
173 | fido_dev_open fido_dev_new | ||
174 | fido_dev_open fido_dev_protocol | ||
175 | fido_dev_set_pin fido_dev_get_retry_count | ||
176 | fido_dev_set_pin fido_dev_reset | ||
177 | rs256_pk_new rs256_pk_free | ||
178 | rs256_pk_new rs256_pk_from_ptr | ||
179 | rs256_pk_new rs256_pk_from_RSA | ||
180 | rs256_pk_new rs256_pk_to_EVP_PKEY | ||
181 | ) | ||
182 | |||
183 | list(LENGTH MAN_ALIAS MAN_ALIAS_LEN) | ||
184 | math(EXPR MAN_ALIAS_MAX "${MAN_ALIAS_LEN} - 2") | ||
185 | |||
186 | # man_copy | ||
187 | foreach(f ${MAN_SOURCES}) | ||
188 | add_custom_command(OUTPUT ${f} | ||
189 | COMMAND cp -f ${CMAKE_SOURCE_DIR}/man/${f} . | ||
190 | DEPENDS ${f}) | ||
191 | list(APPEND COPY_FILES ${f}) | ||
192 | endforeach() | ||
193 | |||
194 | # man_lint | ||
195 | foreach(f ${MAN_SOURCES}) | ||
196 | add_custom_command(OUTPUT ${f}.lint | ||
197 | COMMAND mandoc -T lint -W warning ${f} > ${f}.lint | ||
198 | DEPENDS ${f}) | ||
199 | list(APPEND LINT_FILES ${f}.lint) | ||
200 | endforeach() | ||
201 | |||
202 | # man_html | ||
203 | foreach(f ${MAN_SOURCES}) | ||
204 | string(REGEX REPLACE ".[13]" "" g ${f}) | ||
205 | add_custom_command(OUTPUT ${g}.html | ||
206 | COMMAND mandoc -T html -O man="%N.html",style=style.css -I os="Yubico AB" ${f} > ${g}.html | ||
207 | DEPENDS ${f}) | ||
208 | list(APPEND HTML_FILES ${g}.html) | ||
209 | endforeach() | ||
210 | |||
211 | # man_html_partial | ||
212 | foreach(f ${MAN_SOURCES}) | ||
213 | string(REGEX REPLACE ".[13]" "" g ${f}) | ||
214 | add_custom_command(OUTPUT ${g}.partial | ||
215 | COMMAND cat ${CMAKE_SOURCE_DIR}/man/dyc.css > ${g}.partial | ||
216 | COMMAND mandoc -T html -O man="%N.html",fragment ${f} >> ${g}.partial | ||
217 | DEPENDS ${f}) | ||
218 | list(APPEND HTML_PARTIAL_FILES ${g}.partial) | ||
219 | endforeach() | ||
220 | |||
221 | # man_gzip | ||
222 | foreach(f ${MAN_SOURCES}) | ||
223 | add_custom_command(OUTPUT ${f}.gz | ||
224 | COMMAND gzip -c ${f} > ${f}.gz | ||
225 | DEPENDS ${f}) | ||
226 | list(APPEND GZ_FILES ${f}.gz) | ||
227 | endforeach() | ||
228 | |||
229 | macro(define_symlink_target NAME EXT) | ||
230 | foreach(i RANGE 0 ${MAN_ALIAS_MAX} 2) | ||
231 | math(EXPR j "${i} + 1") | ||
232 | list(GET MAN_ALIAS ${i} SRC) | ||
233 | list(GET MAN_ALIAS ${j} DST) | ||
234 | add_custom_command(OUTPUT ${DST}.${EXT} | ||
235 | COMMAND ln -sf ${SRC}.${EXT} ${DST}.${EXT}) | ||
236 | list(APPEND ${NAME}_LINK_FILES ${DST}.${EXT}) | ||
237 | endforeach() | ||
238 | add_custom_target(${NAME} DEPENDS ${${NAME}_LINK_FILES}) | ||
239 | endmacro() | ||
240 | |||
241 | add_custom_target(man_copy DEPENDS ${COPY_FILES}) | ||
242 | add_custom_target(man_lint DEPENDS ${LINT_FILES}) | ||
243 | add_custom_target(man_html DEPENDS ${HTML_FILES}) | ||
244 | add_custom_target(man_html_partial DEPENDS ${HTML_PARTIAL_FILES}) | ||
245 | add_custom_target(man_gzip DEPENDS ${GZ_FILES}) | ||
246 | |||
247 | define_symlink_target(man_symlink 3) | ||
248 | define_symlink_target(man_symlink_html html) | ||
249 | define_symlink_target(man_symlink_html_partial partial) | ||
250 | define_symlink_target(man_symlink_gzip 3.gz) | ||
251 | |||
252 | add_dependencies(man_symlink man_copy) | ||
253 | add_dependencies(man_lint man_symlink) | ||
254 | add_dependencies(man_html man_lint) | ||
255 | add_dependencies(man_symlink_html man_html) | ||
256 | add_dependencies(man_html_partial man_lint) | ||
257 | add_dependencies(man_symlink_html_partial man_html_partial) | ||
258 | add_custom_target(man ALL) | ||
259 | |||
260 | if(MANDOC_PATH) | ||
261 | add_dependencies(man man_symlink_html) | ||
262 | add_dependencies(man_gzip man_lint) | ||
263 | install(FILES ${CMAKE_SOURCE_DIR}/man/style.css | ||
264 | DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/libfido2) | ||
265 | foreach(f ${MAN_SOURCES}) | ||
266 | string(REGEX REPLACE ".[13]" "" f ${f}) | ||
267 | install(FILES ${CMAKE_BINARY_DIR}/man/${f}.html | ||
268 | DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/libfido2) | ||
269 | endforeach() | ||
270 | foreach(i RANGE 0 ${MAN_ALIAS_MAX} 2) | ||
271 | math(EXPR j "${i} + 1") | ||
272 | list(GET MAN_ALIAS ${j} DST) | ||
273 | install(FILES ${CMAKE_BINARY_DIR}/man/${DST}.html | ||
274 | DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/libfido2) | ||
275 | endforeach() | ||
276 | endif() | ||
277 | |||
278 | if(GZIP_PATH) | ||
279 | add_dependencies(man_gzip man_copy) | ||
280 | add_dependencies(man_symlink_gzip man_gzip) | ||
281 | add_dependencies(man man_symlink_gzip) | ||
282 | foreach(f ${MAN_SOURCES}) | ||
283 | if (${f} MATCHES ".1$") | ||
284 | install(FILES ${CMAKE_BINARY_DIR}/man/${f}.gz | ||
285 | DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1") | ||
286 | elseif(${f} MATCHES ".3$") | ||
287 | install(FILES ${CMAKE_BINARY_DIR}/man/${f}.gz | ||
288 | DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man3") | ||
289 | endif() | ||
290 | endforeach() | ||
291 | foreach(i RANGE 0 ${MAN_ALIAS_MAX} 2) | ||
292 | math(EXPR j "${i} + 1") | ||
293 | list(GET MAN_ALIAS ${j} DST) | ||
294 | install(FILES ${CMAKE_BINARY_DIR}/man/${DST}.3.gz | ||
295 | DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man3) | ||
296 | endforeach() | ||
297 | elseif(NOT MSVC) | ||
298 | add_dependencies(man man_symlink) | ||
299 | foreach(f ${MAN_SOURCES}) | ||
300 | if (${f} MATCHES ".1$") | ||
301 | install(FILES ${CMAKE_BINARY_DIR}/man/${f} | ||
302 | DESTINATION "${CMAKE_INSTALL_PREFIX}/man/man1") | ||
303 | elseif(${f} MATCHES ".3$") | ||
304 | install(FILES ${CMAKE_BINARY_DIR}/man/${f} | ||
305 | DESTINATION "${CMAKE_INSTALL_PREFIX}/man/man3") | ||
306 | endif() | ||
307 | endforeach() | ||
308 | foreach(i RANGE 0 ${MAN_ALIAS_MAX} 2) | ||
309 | math(EXPR j "${i} + 1") | ||
310 | list(GET MAN_ALIAS ${j} DST) | ||
311 | install(FILES ${CMAKE_BINARY_DIR}/man/${DST}.3 | ||
312 | DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man3) | ||
313 | endforeach() | ||
314 | endif() | ||
diff --git a/man/NOTES b/man/NOTES new file mode 100644 index 0000000..4a461ff --- /dev/null +++ b/man/NOTES | |||
@@ -0,0 +1,4 @@ | |||
1 | To generate .partial files for https://developers.yubico.com/: | ||
2 | |||
3 | $ make -C build man_symlink_html_partial | ||
4 | $ (cd build/man && pax -p p -r -w *.partial /tmp/partial) | ||
diff --git a/man/dyc.css b/man/dyc.css new file mode 100644 index 0000000..1ff5b59 --- /dev/null +++ b/man/dyc.css | |||
@@ -0,0 +1,14 @@ | |||
1 | <style> | ||
2 | table.head, table.foot { width: 100%; } | ||
3 | td.head-rtitle, td.foot-os { text-align: right; } | ||
4 | td.head-vol { text-align: center; } | ||
5 | div.Pp { margin: 1ex 0ex; } | ||
6 | div.Nd, div.Bf, div.Op { display: inline; } | ||
7 | span.Pa, span.Ad { font-style: italic; } | ||
8 | span.Ms { font-weight: bold; } | ||
9 | dl.Bl-diag > dt { font-weight: bold; } | ||
10 | code.Nm, code.Fl, code.Cm, code.Ic, code.In, code.Fd, code.Fn, | ||
11 | code.Cd { font-weight: bold; font-family: monospace; } | ||
12 | var { font-family: monospace; } | ||
13 | .Sh { font-size: 1.5em; padding-top: 1em; padding-bottom: 1em; } | ||
14 | </style> | ||
diff --git a/man/eddsa_pk_new.3 b/man/eddsa_pk_new.3 new file mode 100644 index 0000000..65bf9a9 --- /dev/null +++ b/man/eddsa_pk_new.3 | |||
@@ -0,0 +1,122 @@ | |||
1 | .\" Copyright (c) 2019 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 15 2019 $ | ||
6 | .Dt EDDSA_PK_NEW 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm eddsa_pk_new , | ||
10 | .Nm eddsa_pk_free , | ||
11 | .Nm eddsa_pk_from_EVP_PKEY , | ||
12 | .Nm eddsa_pk_from_ptr , | ||
13 | .Nm eddsa_pk_to_EVP_PKEY | ||
14 | .Nd FIDO 2 COSE EDDSA API | ||
15 | .Sh SYNOPSIS | ||
16 | .In openssl/evp.h | ||
17 | .In fido/eddsa.h | ||
18 | .Ft eddsa_pk_t * | ||
19 | .Fn eddsa_pk_new "void" | ||
20 | .Ft void | ||
21 | .Fn eddsa_pk_free "eddsa_pk_t **pkp" | ||
22 | .Ft int | ||
23 | .Fn eddsa_pk_from_EVP_PKEY "eddsa_pk_t *pk" "const EVP_PKEY *pkey" | ||
24 | .Ft int | ||
25 | .Fn eddsa_pk_from_ptr "eddsa_pk_t *pk" "const void *ptr" "size_t len" | ||
26 | .Ft EVP_PKEY * | ||
27 | .Fn eddsa_pk_to_EVP_PKEY "const eddsa_pk_t *pk" | ||
28 | .Sh DESCRIPTION | ||
29 | EDDSA is the name given in the CBOR Object Signing and Encryption | ||
30 | (COSE) RFC to EDDSA over Curve25519 with SHA-512. | ||
31 | The COSE EDDSA API of | ||
32 | .Em libfido2 | ||
33 | is an auxiliary API with routines to convert between the different | ||
34 | EDDSA public key types used in | ||
35 | .Em libfido2 | ||
36 | and | ||
37 | .Em OpenSSL . | ||
38 | .Pp | ||
39 | In | ||
40 | .Em libfido2 , | ||
41 | EDDSA public keys are abstracted by the | ||
42 | .Vt eddsa_pk_t | ||
43 | type. | ||
44 | .Pp | ||
45 | The | ||
46 | .Fn eddsa_pk_new | ||
47 | function returns a pointer to a newly allocated, empty | ||
48 | .Vt eddsa_pk_t | ||
49 | type. | ||
50 | If memory cannot be allocated, NULL is returned. | ||
51 | .Pp | ||
52 | The | ||
53 | .Fn eddsa_pk_free | ||
54 | function releases the memory backing | ||
55 | .Fa *pkp , | ||
56 | where | ||
57 | .Fa *pkp | ||
58 | must have been previously allocated by | ||
59 | .Fn eddsa_pk_new . | ||
60 | On return, | ||
61 | .Fa *pkp | ||
62 | is set to NULL. | ||
63 | Either | ||
64 | .Fa pkp | ||
65 | or | ||
66 | .Fa *pkp | ||
67 | may be NULL, in which case | ||
68 | .Fn eddsa_pk_free | ||
69 | is a NOP. | ||
70 | .Pp | ||
71 | The | ||
72 | .Fn eddsa_pk_from_EVP_PKEY | ||
73 | function fills | ||
74 | .Fa pk | ||
75 | with the contents of | ||
76 | .Fa pkey . | ||
77 | No references to | ||
78 | .Fa pkey | ||
79 | are kept. | ||
80 | .Pp | ||
81 | The | ||
82 | .Fn eddsa_pk_from_ptr | ||
83 | function fills | ||
84 | .Fa pk | ||
85 | with the contents of | ||
86 | .Fa ptr , | ||
87 | where | ||
88 | .Fa ptr | ||
89 | points to | ||
90 | .Fa len | ||
91 | bytes. | ||
92 | No references to | ||
93 | .Fa ptr | ||
94 | are kept. | ||
95 | .Pp | ||
96 | The | ||
97 | .Fn eddsa_pk_to_EVP_PKEY | ||
98 | function converts | ||
99 | .Fa pk | ||
100 | to a newly allocated | ||
101 | .Fa EVP_PKEY | ||
102 | type with a reference count of 1. | ||
103 | No internal references to the returned pointer are kept. | ||
104 | If an error occurs, | ||
105 | .Fn eddsa_pk_to_EVP_PKEY | ||
106 | returns NULL. | ||
107 | .Sh RETURN VALUES | ||
108 | The | ||
109 | .Fn eddsa_pk_from_EC_KEY | ||
110 | and | ||
111 | .Fn eddsa_pk_from_ptr | ||
112 | functions return | ||
113 | .Dv FIDO_OK | ||
114 | on success. | ||
115 | On error, a different error code defined in | ||
116 | .In fido/err.h | ||
117 | is returned. | ||
118 | .Sh SEE ALSO | ||
119 | .Xr es256_pk_new 3 , | ||
120 | .Xr fido_assert_verify 3 , | ||
121 | .Xr fido_cred_pubkey_ptr 3 , | ||
122 | .Xr rs256_pk_new 3 | ||
diff --git a/man/es256_pk_new.3 b/man/es256_pk_new.3 new file mode 100644 index 0000000..48eda0b --- /dev/null +++ b/man/es256_pk_new.3 | |||
@@ -0,0 +1,122 @@ | |||
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 24 2018 $ | ||
6 | .Dt ES256_PK_NEW 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm es256_pk_new , | ||
10 | .Nm es256_pk_free , | ||
11 | .Nm es256_pk_from_EC_KEY , | ||
12 | .Nm es256_pk_from_ptr , | ||
13 | .Nm es256_pk_to_EVP_PKEY | ||
14 | .Nd FIDO 2 COSE ES256 API | ||
15 | .Sh SYNOPSIS | ||
16 | .In openssl/ec.h | ||
17 | .In fido/es256.h | ||
18 | .Ft es256_pk_t * | ||
19 | .Fn es256_pk_new "void" | ||
20 | .Ft void | ||
21 | .Fn es256_pk_free "es256_pk_t **pkp" | ||
22 | .Ft int | ||
23 | .Fn es256_pk_from_EC_KEY "es256_pk_t *pk" "const EC_KEY *ec" | ||
24 | .Ft int | ||
25 | .Fn es256_pk_from_ptr "es256_pk_t *pk" "const void *ptr" "size_t len" | ||
26 | .Ft EVP_PKEY * | ||
27 | .Fn es256_pk_to_EVP_PKEY "const es256_pk_t *pk" | ||
28 | .Sh DESCRIPTION | ||
29 | ES256 is the name given in the CBOR Object Signing and Encryption | ||
30 | (COSE) RFC to ECDSA over P-256 with SHA-256. | ||
31 | The COSE ES256 API of | ||
32 | .Em libfido2 | ||
33 | is an auxiliary API with routines to convert between the different | ||
34 | ECDSA public key types used in | ||
35 | .Em libfido2 | ||
36 | and | ||
37 | .Em OpenSSL . | ||
38 | .Pp | ||
39 | In | ||
40 | .Em libfido2 , | ||
41 | ES256 public keys are abstracted by the | ||
42 | .Vt es256_pk_t | ||
43 | type. | ||
44 | .Pp | ||
45 | The | ||
46 | .Fn es256_pk_new | ||
47 | function returns a pointer to a newly allocated, empty | ||
48 | .Vt es256_pk_t | ||
49 | type. | ||
50 | If memory cannot be allocated, NULL is returned. | ||
51 | .Pp | ||
52 | The | ||
53 | .Fn es256_pk_free | ||
54 | function releases the memory backing | ||
55 | .Fa *pkp , | ||
56 | where | ||
57 | .Fa *pkp | ||
58 | must have been previously allocated by | ||
59 | .Fn es256_pk_new . | ||
60 | On return, | ||
61 | .Fa *pkp | ||
62 | is set to NULL. | ||
63 | Either | ||
64 | .Fa pkp | ||
65 | or | ||
66 | .Fa *pkp | ||
67 | may be NULL, in which case | ||
68 | .Fn es256_pk_free | ||
69 | is a NOP. | ||
70 | .Pp | ||
71 | The | ||
72 | .Fn es256_pk_from_EC_KEY | ||
73 | function fills | ||
74 | .Fa pk | ||
75 | with the contents of | ||
76 | .Fa ec . | ||
77 | No references to | ||
78 | .Fa ec | ||
79 | are kept. | ||
80 | .Pp | ||
81 | The | ||
82 | .Fn es256_pk_from_ptr | ||
83 | function fills | ||
84 | .Fa pk | ||
85 | with the contents of | ||
86 | .Fa ptr , | ||
87 | where | ||
88 | .Fa ptr | ||
89 | points to | ||
90 | .Fa len | ||
91 | bytes. | ||
92 | No references to | ||
93 | .Fa ptr | ||
94 | are kept. | ||
95 | .Pp | ||
96 | The | ||
97 | .Fn es256_pk_to_EVP_PKEY | ||
98 | function converts | ||
99 | .Fa pk | ||
100 | to a newly allocated | ||
101 | .Fa EVP_PKEY | ||
102 | type with a reference count of 1. | ||
103 | No internal references to the returned pointer are kept. | ||
104 | If an error occurs, | ||
105 | .Fn es256_pk_to_EVP_PKEY | ||
106 | returns NULL. | ||
107 | .Sh RETURN VALUES | ||
108 | The | ||
109 | .Fn es256_pk_from_EC_KEY | ||
110 | and | ||
111 | .Fn es256_pk_from_ptr | ||
112 | functions return | ||
113 | .Dv FIDO_OK | ||
114 | on success. | ||
115 | On error, a different error code defined in | ||
116 | .In fido/err.h | ||
117 | is returned. | ||
118 | .Sh SEE ALSO | ||
119 | .Xr eddsa_pk_new 3 , | ||
120 | .Xr fido_assert_verify 3 , | ||
121 | .Xr fido_cred_pubkey_ptr 3 , | ||
122 | .Xr rs256_pk_new 3 | ||
diff --git a/man/fido2-assert.1 b/man/fido2-assert.1 new file mode 100644 index 0000000..67883e2 --- /dev/null +++ b/man/fido2-assert.1 | |||
@@ -0,0 +1,220 @@ | |||
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: November 5 2019 $ | ||
6 | .Dt FIDO2-ASSERT 1 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido2-assert | ||
10 | .Nd get/verify a FIDO 2 assertion | ||
11 | .Sh SYNOPSIS | ||
12 | .Nm | ||
13 | .Fl G | ||
14 | .Op Fl dhpruv | ||
15 | .Op Fl i Ar input_file | ||
16 | .Op Fl o Ar output_file | ||
17 | .Ar device | ||
18 | .Nm | ||
19 | .Fl V | ||
20 | .Op Fl dhpv | ||
21 | .Op Fl i Ar input_file | ||
22 | .Ar key_file | ||
23 | .Op Ar type | ||
24 | .Sh DESCRIPTION | ||
25 | .Nm | ||
26 | gets or verifies a FIDO 2 assertion. | ||
27 | .Pp | ||
28 | The input of | ||
29 | .Nm | ||
30 | is defined by the parameters of the assertion to be obtained/verified. | ||
31 | See the | ||
32 | .Sx INPUT FORMAT | ||
33 | section for details. | ||
34 | .Pp | ||
35 | The output of | ||
36 | .Nm | ||
37 | is defined by the result of the selected operation. | ||
38 | See the | ||
39 | .Sx OUTPUT FORMAT | ||
40 | section for details. | ||
41 | .Pp | ||
42 | If an assertion is successfully obtained or verified, | ||
43 | .Nm | ||
44 | exits 0. | ||
45 | Otherwise, | ||
46 | .Nm | ||
47 | exits 1. | ||
48 | .Pp | ||
49 | The options are as follows: | ||
50 | .Bl -tag -width Ds | ||
51 | .It Fl G | ||
52 | Tells | ||
53 | .Nm | ||
54 | to obtain a new assertion from | ||
55 | .Ar device . | ||
56 | .It Fl V | ||
57 | Tells | ||
58 | .Nm | ||
59 | to verify an assertion using the PEM-encoded public key in | ||
60 | .Ar key_file | ||
61 | of type | ||
62 | .Ar type , | ||
63 | where | ||
64 | .Ar type | ||
65 | may be | ||
66 | .Em es256 | ||
67 | (denoting ECDSA over NIST P-256 with SHA-256), | ||
68 | .Em rs256 | ||
69 | (denoting 2048-bit RSA with PKCS#1.5 padding and SHA-256), or | ||
70 | .Em eddsa | ||
71 | (denoting EDDSA over Curve25519 with SHA-512). | ||
72 | If | ||
73 | .Ar type | ||
74 | is not specified, | ||
75 | .Em es256 | ||
76 | is assumed. | ||
77 | .It Fl h | ||
78 | If obtaining an assertion, enable the FIDO2 hmac-secret | ||
79 | extension. | ||
80 | If verifying an assertion, check whether the extension data bit was | ||
81 | signed by the authenticator. | ||
82 | .It Fl d | ||
83 | Causes | ||
84 | .Nm | ||
85 | to emit debugging output on | ||
86 | .Em stderr . | ||
87 | .It Fl i Ar input_file | ||
88 | Tells | ||
89 | .Nm | ||
90 | to read the parameters of the assertion from | ||
91 | .Ar input_file | ||
92 | instead of | ||
93 | .Em stdin . | ||
94 | .It Fl o Ar output_file | ||
95 | Tells | ||
96 | .Nm | ||
97 | to write output on | ||
98 | .Ar output_file | ||
99 | instead of | ||
100 | .Em stdout . | ||
101 | .It Fl p | ||
102 | If obtaining an assertion, request user presence. | ||
103 | If verifying an assertion, check whether the user presence bit was | ||
104 | signed by the authenticator. | ||
105 | .It Fl r | ||
106 | Obtain an assertion using a resident credential. | ||
107 | If | ||
108 | .Fl r | ||
109 | is specified, | ||
110 | .Nm | ||
111 | will not expect a credential id in its input, and may output | ||
112 | multiple assertions. | ||
113 | .It Fl u | ||
114 | Obtain an assertion using U2F. | ||
115 | By default, | ||
116 | .Nm | ||
117 | will use FIDO2 if supported by the authenticator, and fallback to | ||
118 | U2F otherwise. | ||
119 | .It Fl v | ||
120 | If obtaining an assertion, prompt the user for a PIN and request | ||
121 | user verification from the authenticator. | ||
122 | If a | ||
123 | .Em tty | ||
124 | is available, | ||
125 | .Nm | ||
126 | will use it to obtain the PIN. | ||
127 | Otherwise, | ||
128 | .Em stdin | ||
129 | is used. | ||
130 | If verifying an assertion, check whether the user verification bit | ||
131 | was signed by the authenticator. | ||
132 | .El | ||
133 | .Sh INPUT FORMAT | ||
134 | The input of | ||
135 | .Nm | ||
136 | consists of base64 blobs and UTF-8 strings separated | ||
137 | by newline characters ('\\n'). | ||
138 | .Pp | ||
139 | When obtaining an assertion, | ||
140 | .Nm | ||
141 | expects its input to consist of: | ||
142 | .Pp | ||
143 | .Bl -enum -offset indent -compact | ||
144 | .It | ||
145 | client data hash (base64 blob); | ||
146 | .It | ||
147 | relying party id (UTF-8 string); | ||
148 | .It | ||
149 | credential id, if credential not resident (base64 blob); | ||
150 | .It | ||
151 | hmac salt, if the FIDO2 hmac-secret extension is enabled | ||
152 | (base64 blob); | ||
153 | .El | ||
154 | .Pp | ||
155 | When verifying an assertion, | ||
156 | .Nm | ||
157 | expects its input to consist of: | ||
158 | .Pp | ||
159 | .Bl -enum -offset indent -compact | ||
160 | .It | ||
161 | client data hash (base64 blob); | ||
162 | .It | ||
163 | relying party id (UTF-8 string); | ||
164 | .It | ||
165 | authenticator data (base64 blob); | ||
166 | .It | ||
167 | assertion signature (base64 blob); | ||
168 | .El | ||
169 | .Pp | ||
170 | UTF-8 strings passed to | ||
171 | .Nm | ||
172 | must not contain embedded newline or NUL characters. | ||
173 | .Sh OUTPUT FORMAT | ||
174 | The output of | ||
175 | .Nm | ||
176 | consists of base64 blobs and UTF-8 strings separated | ||
177 | by newline characters ('\\n'). | ||
178 | .Pp | ||
179 | For each generated assertion, | ||
180 | .Nm | ||
181 | outputs: | ||
182 | .Pp | ||
183 | .Bl -enum -offset indent -compact | ||
184 | .It | ||
185 | client data hash (base64 blob); | ||
186 | .It | ||
187 | relying party id (UTF-8 string); | ||
188 | .It | ||
189 | authenticator data (base64 blob); | ||
190 | .It | ||
191 | assertion signature (base64 blob); | ||
192 | .It | ||
193 | user id, if credential resident (base64 blob); | ||
194 | .It | ||
195 | hmac secret, if the FIDO2 hmac-secret extension is enabled | ||
196 | (base64 blob); | ||
197 | .El | ||
198 | .Pp | ||
199 | When verifying an assertion, | ||
200 | .Nm | ||
201 | produces no output. | ||
202 | .Sh EXAMPLES | ||
203 | Assuming | ||
204 | .Pa cred | ||
205 | contains a | ||
206 | .Em es256 | ||
207 | credential created according to the steps outlined in | ||
208 | .Xr fido2-cred 1 , | ||
209 | obtain an assertion from an authenticator at | ||
210 | .Pa /dev/hidraw5 | ||
211 | and verify it: | ||
212 | .Pp | ||
213 | .Dl $ echo assertion challenge | openssl sha256 -binary | base64 > assert_param | ||
214 | .Dl $ echo relying party >> assert_param | ||
215 | .Dl $ head -1 cred >> assert_param | ||
216 | .Dl $ tail -n +2 cred > pubkey | ||
217 | .Dl $ fido2-assert -G -i assert_param /dev/hidraw5 | fido2-assert -V pubkey es256 | ||
218 | .Sh SEE ALSO | ||
219 | .Xr fido2-cred 1 , | ||
220 | .Xr fido2-token 1 | ||
diff --git a/man/fido2-cred.1 b/man/fido2-cred.1 new file mode 100644 index 0000000..d9bf7d2 --- /dev/null +++ b/man/fido2-cred.1 | |||
@@ -0,0 +1,238 @@ | |||
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: November 5 2019 $ | ||
6 | .Dt FIDO2-CRED 1 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido2-cred | ||
10 | .Nd make/verify a FIDO 2 credential | ||
11 | .Sh SYNOPSIS | ||
12 | .Nm | ||
13 | .Fl M | ||
14 | .Op Fl dhqruv | ||
15 | .Op Fl i Ar input_file | ||
16 | .Op Fl o Ar output_file | ||
17 | .Ar device | ||
18 | .Op Ar type | ||
19 | .Nm | ||
20 | .Fl V | ||
21 | .Op Fl dhv | ||
22 | .Op Fl i Ar input_file | ||
23 | .Op Fl o Ar output_file | ||
24 | .Op Ar type | ||
25 | .Sh DESCRIPTION | ||
26 | .Nm | ||
27 | makes or verifies a FIDO 2 credential. | ||
28 | .Pp | ||
29 | A credential | ||
30 | .Ar type | ||
31 | may be | ||
32 | .Em es256 | ||
33 | (denoting ECDSA over NIST P-256 with SHA-256), | ||
34 | .Em rs256 | ||
35 | (denoting 2048-bit RSA with PKCS#1.5 padding and SHA-256), or | ||
36 | .Em eddsa | ||
37 | (denoting EDDSA over Curve25519 with SHA-512). | ||
38 | If | ||
39 | .Ar type | ||
40 | is not specified, | ||
41 | .Em es256 | ||
42 | is assumed. | ||
43 | .Pp | ||
44 | When making a credential, the authenticator may require the user | ||
45 | to authenticate with a PIN. | ||
46 | If the | ||
47 | .Fl q | ||
48 | option is not specified, | ||
49 | .Nm | ||
50 | will prompt the user for the PIN. | ||
51 | If a | ||
52 | .Em tty | ||
53 | is available, | ||
54 | .Nm | ||
55 | will use it to obtain the PIN. | ||
56 | Otherwise, | ||
57 | .Em stdin | ||
58 | is used. | ||
59 | .Pp | ||
60 | The input of | ||
61 | .Nm | ||
62 | is defined by the parameters of the credential to be made/verified. | ||
63 | See the | ||
64 | .Sx INPUT FORMAT | ||
65 | section for details. | ||
66 | .Pp | ||
67 | The output of | ||
68 | .Nm | ||
69 | is defined by the result of the selected operation. | ||
70 | See the | ||
71 | .Sx OUTPUT FORMAT | ||
72 | section for details. | ||
73 | .Pp | ||
74 | If a credential is successfully created or verified, | ||
75 | .Nm | ||
76 | exits 0. | ||
77 | Otherwise, | ||
78 | .Nm | ||
79 | exits 1. | ||
80 | .Pp | ||
81 | The options are as follows: | ||
82 | .Bl -tag -width Ds | ||
83 | .It Fl M | ||
84 | Tells | ||
85 | .Nm | ||
86 | to make a new credential on | ||
87 | .Ar device . | ||
88 | .It Fl V | ||
89 | Tells | ||
90 | .Nm | ||
91 | to verify a credential. | ||
92 | .It Fl d | ||
93 | Causes | ||
94 | .Nm | ||
95 | to emit debugging output on | ||
96 | .Em stderr . | ||
97 | .It Fl h | ||
98 | If making a credential, enable the FIDO2 hmac-secret extension. | ||
99 | If verifying a credential, check whether the extension data bit was | ||
100 | signed by the authenticator. | ||
101 | .It Fl i Ar input_file | ||
102 | Tells | ||
103 | .Nm | ||
104 | to read the parameters of the credential from | ||
105 | .Ar input_file | ||
106 | instead of | ||
107 | .Em stdin . | ||
108 | .It Fl o Ar output_file | ||
109 | Tells | ||
110 | .Nm | ||
111 | to write output on | ||
112 | .Ar output_file | ||
113 | instead of | ||
114 | .Em stdout . | ||
115 | .It Fl q | ||
116 | Tells | ||
117 | .Nm | ||
118 | to be quiet. | ||
119 | If a PIN is required and | ||
120 | .Fl q | ||
121 | is specified, | ||
122 | .Nm | ||
123 | will fail. | ||
124 | .It Fl r | ||
125 | Create a resident credential. | ||
126 | .It Fl u | ||
127 | Create a U2F credential. | ||
128 | By default, | ||
129 | .Nm | ||
130 | will use FIDO2 if supported by the authenticator, and fallback to | ||
131 | U2F otherwise. | ||
132 | .It Fl v | ||
133 | If making a credential, request user verification. | ||
134 | If verifying a credential, check whether the user verification bit | ||
135 | was signed by the authenticator. | ||
136 | .El | ||
137 | .Sh INPUT FORMAT | ||
138 | The input of | ||
139 | .Nm | ||
140 | consists of base64 blobs and UTF-8 strings separated | ||
141 | by newline characters ('\\n'). | ||
142 | .Pp | ||
143 | When making a credential, | ||
144 | .Nm | ||
145 | expects its input to consist of: | ||
146 | .Pp | ||
147 | .Bl -enum -offset indent -compact | ||
148 | .It | ||
149 | client data hash (base64 blob); | ||
150 | .It | ||
151 | relying party id (UTF-8 string); | ||
152 | .It | ||
153 | user name (UTF-8 string); | ||
154 | .It | ||
155 | user id (base64 blob). | ||
156 | .El | ||
157 | .Pp | ||
158 | When verifying a credential, | ||
159 | .Nm | ||
160 | expects its input to consist of: | ||
161 | .Pp | ||
162 | .Bl -enum -offset indent -compact | ||
163 | .It | ||
164 | client data hash (base64 blob); | ||
165 | .It | ||
166 | relying party id (UTF-8 string); | ||
167 | .It | ||
168 | credential format (UTF-8 string); | ||
169 | .It | ||
170 | authenticator data (base64 blob); | ||
171 | .It | ||
172 | credential id (base64 blob); | ||
173 | .It | ||
174 | attestation signature (base64 blob); | ||
175 | .It | ||
176 | attestation certificate (optional, base64 blob). | ||
177 | .El | ||
178 | .Pp | ||
179 | UTF-8 strings passed to | ||
180 | .Nm | ||
181 | must not contain embedded newline or NUL characters. | ||
182 | .Sh OUTPUT FORMAT | ||
183 | The output of | ||
184 | .Nm | ||
185 | consists of base64 blobs, UTF-8 strings, and PEM-encoded public | ||
186 | keys separated by newline characters ('\\n'). | ||
187 | .Pp | ||
188 | Upon the successful generation of a credential, | ||
189 | .Nm | ||
190 | outputs: | ||
191 | .Pp | ||
192 | .Bl -enum -offset indent -compact | ||
193 | .It | ||
194 | client data hash (base64 blob); | ||
195 | .It | ||
196 | relying party id (UTF-8 string); | ||
197 | .It | ||
198 | credential format (UTF-8 string); | ||
199 | .It | ||
200 | authenticator data (base64 blob); | ||
201 | .It | ||
202 | credential id (base64 blob); | ||
203 | .It | ||
204 | attestation signature (base64 blob); | ||
205 | .It | ||
206 | attestation certificate, if present (base64 blob). | ||
207 | .El | ||
208 | .Pp | ||
209 | Upon the successful verification of a credential, | ||
210 | .Nm | ||
211 | outputs: | ||
212 | .Pp | ||
213 | .Bl -enum -offset indent -compact | ||
214 | .It | ||
215 | credential id (base64 blob); | ||
216 | .It | ||
217 | PEM-encoded credential key. | ||
218 | .El | ||
219 | .Sh EXAMPLES | ||
220 | Create a new | ||
221 | .Em es256 | ||
222 | credential on | ||
223 | .Pa /dev/hidraw5 , | ||
224 | verify it, and save the id and the public key of the credential in | ||
225 | .Em cred : | ||
226 | .Pp | ||
227 | .Dl $ echo credential challenge | openssl sha256 -binary | base64 > cred_param | ||
228 | .Dl $ echo relying party >> cred_param | ||
229 | .Dl $ echo user name >> cred_param | ||
230 | .Dl $ dd if=/dev/urandom bs=1 count=32 | base64 >> cred_param | ||
231 | .Dl $ fido2-cred -M -i cred_param /dev/hidraw5 | fido2-cred -V -o cred | ||
232 | .Sh SEE ALSO | ||
233 | .Xr fido2-assert 1 , | ||
234 | .Xr fido2-token 1 | ||
235 | .Sh CAVEATS | ||
236 | Please note that | ||
237 | .Nm | ||
238 | handles Basic Attestation and Self Attestation transparently. | ||
diff --git a/man/fido2-token.1 b/man/fido2-token.1 new file mode 100644 index 0000000..d5a5734 --- /dev/null +++ b/man/fido2-token.1 | |||
@@ -0,0 +1,158 @@ | |||
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: September 13 2019 $ | ||
6 | .Dt FIDO2-TOKEN 1 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido2-token | ||
10 | .Nd find and manage a FIDO 2 authenticator | ||
11 | .Sh SYNOPSIS | ||
12 | .Nm | ||
13 | .Op Fl CR | ||
14 | .Op Fl d | ||
15 | .Ar device | ||
16 | .Nm | ||
17 | .Fl D | ||
18 | .Op Fl de | ||
19 | .Fl i | ||
20 | .Ar id | ||
21 | .Ar device | ||
22 | .Nm | ||
23 | .Fl I | ||
24 | .Op Fl cd | ||
25 | .Op Fl k Ar rp_id Fl i Ar cred_id | ||
26 | .Ar device | ||
27 | .Nm | ||
28 | .Fl L | ||
29 | .Op Fl der | ||
30 | .Op Fl k Ar rp_id | ||
31 | .Op device | ||
32 | .Nm | ||
33 | .Fl S | ||
34 | .Op Fl de | ||
35 | .Op Fl i Ar template_id Fl n Ar template_name | ||
36 | .Ar device | ||
37 | .Nm | ||
38 | .Fl V | ||
39 | .Sh DESCRIPTION | ||
40 | .Nm | ||
41 | manages a FIDO 2 authenticator. | ||
42 | .Pp | ||
43 | The options are as follows: | ||
44 | .Bl -tag -width Ds | ||
45 | .It Fl C Ar device | ||
46 | Changes the PIN of | ||
47 | .Ar device . | ||
48 | The user will be prompted for the current and new PINs. | ||
49 | .It Fl D Fl i Ar id Ar device | ||
50 | Deletes the resident credential specified by | ||
51 | .Ar id | ||
52 | from | ||
53 | .Ar device , | ||
54 | where | ||
55 | .Ar id | ||
56 | is the credential's base64-encoded id. | ||
57 | The user will be prompted for the PIN. | ||
58 | .It Fl D Fl e Fl i Ar id Ar device | ||
59 | Deletes the biometric enrollment specified by | ||
60 | .Ar id | ||
61 | from | ||
62 | .Ar device , | ||
63 | where | ||
64 | .Ar id | ||
65 | is the enrollment's template base64-encoded id. | ||
66 | The user will be prompted for the PIN. | ||
67 | .It Fl I Ar device | ||
68 | Retrieves information on | ||
69 | .Ar device . | ||
70 | .It Fl I Fl c Ar device | ||
71 | Retrieves resident credential metadata from | ||
72 | .Ar device . | ||
73 | The user will be prompted for the PIN. | ||
74 | .It Fl I Fl k Ar rp_id Fl i Ar cred_id Ar device | ||
75 | Prints the credential id (base64-encoded) and public key | ||
76 | (PEM encoded) of the resident credential specified by | ||
77 | .Ar rp_id | ||
78 | and | ||
79 | .Ar cred_id , | ||
80 | where | ||
81 | .Ar rp_id | ||
82 | is a UTF-8 relying party id, and | ||
83 | .Ar cred_id | ||
84 | is a base64-encoded credential id. | ||
85 | The user will be prompted for the PIN. | ||
86 | .It Fl L | ||
87 | Produces a list of authenticators found by the operating system. | ||
88 | .It Fl L Fl e Ar device | ||
89 | Produces a list of biometric enrollments on | ||
90 | .Ar device . | ||
91 | The user will be prompted for the PIN. | ||
92 | .It Fl L Fl r Ar device | ||
93 | Produces a list of relying parties with resident credentials on | ||
94 | .Ar device . | ||
95 | The user will be prompted for the PIN. | ||
96 | .It Fl L Fl k Ar rp_id Ar device | ||
97 | Produces a list of resident credentials corresponding to | ||
98 | relying party | ||
99 | .Ar rp_id | ||
100 | on | ||
101 | .Ar device . | ||
102 | The user will be prompted for the PIN. | ||
103 | .It Fl R | ||
104 | Performs a reset on | ||
105 | .Ar device . | ||
106 | .Nm | ||
107 | will NOT prompt for confirmation. | ||
108 | .It Fl S | ||
109 | Sets the PIN of | ||
110 | .Ar device . | ||
111 | The user will be prompted for the PIN. | ||
112 | .It Fl S Fl e Ar device | ||
113 | Performs a new biometric enrollment on | ||
114 | .Ar device . | ||
115 | The user will be prompted for the PIN. | ||
116 | .It Fl S Fl e Fl i Ar template_id Fl n Ar template_name Ar device | ||
117 | Sets the friendly name of the biometric enrollment specified by | ||
118 | .Ar template_id | ||
119 | to | ||
120 | .Ar template_name | ||
121 | on | ||
122 | .Ar device , | ||
123 | where | ||
124 | .Ar template_id | ||
125 | is base64-encoded and | ||
126 | .Ar template_name | ||
127 | is a UTF-8 string. | ||
128 | The user will be prompted for the PIN. | ||
129 | .It Fl V | ||
130 | Prints version information. | ||
131 | .It Fl d | ||
132 | Causes | ||
133 | .Nm | ||
134 | to emit debugging output on | ||
135 | .Em stderr . | ||
136 | .El | ||
137 | .Pp | ||
138 | If a | ||
139 | .Em tty | ||
140 | is available, | ||
141 | .Nm | ||
142 | will use it to prompt for PINs. | ||
143 | Otherwise, | ||
144 | .Em stdin | ||
145 | is used. | ||
146 | .Pp | ||
147 | .Nm | ||
148 | exits 0 on success and 1 on error. | ||
149 | .Sh SEE ALSO | ||
150 | .Xr fido2-assert 1 , | ||
151 | .Xr fido2-cred 1 | ||
152 | .Sh CAVEATS | ||
153 | The actual user-flow to perform a reset is outside the scope of the | ||
154 | FIDO2 specification, and may therefore vary depending on the | ||
155 | authenticator. | ||
156 | Yubico authenticators do not allow resets after 5 seconds from | ||
157 | power-up, and expect a reset to be confirmed by the user through | ||
158 | touch within 30 seconds. | ||
diff --git a/man/fido_assert_allow_cred.3 b/man/fido_assert_allow_cred.3 new file mode 100644 index 0000000..bbe6e4d --- /dev/null +++ b/man/fido_assert_allow_cred.3 | |||
@@ -0,0 +1,47 @@ | |||
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 23 2018 $ | ||
6 | .Dt FIDO_ASSERT_ALLOW_CRED 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_assert_allow_cred | ||
10 | .Nd appends a credential ID to the list of credentials allowed in an assertion | ||
11 | .Sh SYNOPSIS | ||
12 | .In fido.h | ||
13 | .Ft int | ||
14 | .Fn fido_assert_allow_cred "fido_assert_t *assert" "const unsigned char *ptr" "size_t len" | ||
15 | .Sh DESCRIPTION | ||
16 | The | ||
17 | .Fn fido_assert_allow_cred | ||
18 | function adds | ||
19 | .Fa ptr | ||
20 | to the list of credentials allowed in | ||
21 | .Fa assert , | ||
22 | where | ||
23 | .Fa ptr | ||
24 | points to a credential ID of | ||
25 | .Fa len | ||
26 | bytes. | ||
27 | A copy of | ||
28 | .Fa ptr | ||
29 | is made, and no references to the passed pointer are kept. | ||
30 | If | ||
31 | .Fn fido_assert_allow_cred | ||
32 | fails, the existing list of allowed credentials is preserved. | ||
33 | .Pp | ||
34 | For the format of a FIDO 2 credential ID, please refer to the | ||
35 | Web Authentication (webauthn) standard. | ||
36 | .Sh RETURN VALUES | ||
37 | The error codes returned by | ||
38 | .Fn fido_assert_allow_cred | ||
39 | are defined in | ||
40 | .In fido/err.h . | ||
41 | On success, | ||
42 | .Dv FIDO_OK | ||
43 | is returned. | ||
44 | .Sh SEE ALSO | ||
45 | .Xr fido_assert_new 3 , | ||
46 | .Xr fido_assert_set_authdata 3 , | ||
47 | .Xr fido_dev_get_assert 3 | ||
diff --git a/man/fido_assert_new.3 b/man/fido_assert_new.3 new file mode 100644 index 0000000..0c2f92f --- /dev/null +++ b/man/fido_assert_new.3 | |||
@@ -0,0 +1,190 @@ | |||
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: October 22 2019 $ | ||
6 | .Dt FIDO_ASSERT_NEW 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_assert_new , | ||
10 | .Nm fido_assert_free , | ||
11 | .Nm fido_assert_count , | ||
12 | .Nm fido_assert_user_display_name , | ||
13 | .Nm fido_assert_user_icon , | ||
14 | .Nm fido_assert_user_name , | ||
15 | .Nm fido_assert_authdata_ptr , | ||
16 | .Nm fido_assert_clientdata_hash_ptr , | ||
17 | .Nm fido_assert_hmac_secret_ptr , | ||
18 | .Nm fido_assert_user_id_ptr , | ||
19 | .Nm fido_assert_sig_ptr , | ||
20 | .Nm fido_assert_authdata_len , | ||
21 | .Nm fido_assert_clientdata_hash_len , | ||
22 | .Nm fido_assert_hmac_secret_len , | ||
23 | .Nm fido_assert_user_id_len , | ||
24 | .Nm fido_assert_sig_len , | ||
25 | .Nm fido_assert_sigcount | ||
26 | .Nd FIDO 2 assertion API | ||
27 | .Sh SYNOPSIS | ||
28 | .In fido.h | ||
29 | .Ft fido_assert_t * | ||
30 | .Fn fido_assert_new "void" | ||
31 | .Ft void | ||
32 | .Fn fido_assert_free "fido_assert_t **assert_p" | ||
33 | .Ft size_t | ||
34 | .Fn fido_assert_count "const fido_assert_t *assert" | ||
35 | .Ft const char * | ||
36 | .Fn fido_assert_user_display_name "const fido_assert_t *assert" "size_t idx" | ||
37 | .Ft const char * | ||
38 | .Fn fido_assert_user_icon "const fido_assert_t *assert" "size_t idx" | ||
39 | .Ft const char * | ||
40 | .Fn fido_assert_user_name "const fido_assert_t *assert" "size_t idx" | ||
41 | .Ft const unsigned char * | ||
42 | .Fn fido_assert_authdata_ptr "const fido_assert_t *assert" "size_t idx" | ||
43 | .Ft const unsigned char * | ||
44 | .Fn fido_assert_clientdata_hash_ptr "const fido_assert_t *assert" | ||
45 | .Ft const unsigned char * | ||
46 | .Fn fido_assert_hmac_secret_ptr "const fido_assert_t *assert" "size_t idx" | ||
47 | .Ft const unsigned char * | ||
48 | .Fn fido_assert_user_id_ptr "const fido_assert_t *assert" "size_t idx" | ||
49 | .Ft const unsigned char * | ||
50 | .Fn fido_assert_sig_ptr "const fido_assert_t *assert" "size_t idx" | ||
51 | .Ft size_t | ||
52 | .Fn fido_assert_authdata_len "const fido_assert_t *assert" "size_t idx" | ||
53 | .Ft size_t | ||
54 | .Fn fido_assert_clientdata_hash_len "const fido_assert_t *assert" | ||
55 | .Ft size_t | ||
56 | .Fn fido_assert_hmac_secret_len "const fido_assert_t *assert" "size_t idx" | ||
57 | .Ft size_t | ||
58 | .Fn fido_assert_user_id_len "const fido_assert_t *assert" "size_t idx" | ||
59 | .Ft size_t | ||
60 | .Fn fido_assert_sig_len "const fido_assert_t *assert" "size_t idx" | ||
61 | .Ft uint32_t | ||
62 | .Fn fido_assert_sigcount "const fido_assert_t *assert" "size_t idx" | ||
63 | .Sh DESCRIPTION | ||
64 | FIDO 2 assertions are abstracted in | ||
65 | .Em libfido2 | ||
66 | by the | ||
67 | .Vt fido_assert_t | ||
68 | type. | ||
69 | The functions described in this page allow a | ||
70 | .Vt fido_assert_t | ||
71 | type to be allocated, deallocated, and inspected. | ||
72 | For other operations on | ||
73 | .Vt fido_assert_t , | ||
74 | please refer to | ||
75 | .Xr fido_assert_set_authdata 3 , | ||
76 | .Xr fido_assert_allow_cred 3 , | ||
77 | .Xr fido_assert_verify 3 , | ||
78 | and | ||
79 | .Xr fido_dev_get_assert 3 . | ||
80 | .Pp | ||
81 | The | ||
82 | .Fn fido_assert_new | ||
83 | function returns a pointer to a newly allocated, empty | ||
84 | .Vt fido_assert_t | ||
85 | type. | ||
86 | If memory cannot be allocated, NULL is returned. | ||
87 | .Pp | ||
88 | The | ||
89 | .Fn fido_assert_free | ||
90 | function releases the memory backing | ||
91 | .Fa *assert_p , | ||
92 | where | ||
93 | .Fa *assert_p | ||
94 | must have been previously allocated by | ||
95 | .Fn fido_assert_new . | ||
96 | On return, | ||
97 | .Fa *assert_p | ||
98 | is set to NULL. | ||
99 | Either | ||
100 | .Fa assert_p | ||
101 | or | ||
102 | .Fa *assert_p | ||
103 | may be NULL, in which case | ||
104 | .Fn fido_assert_free | ||
105 | is a NOP. | ||
106 | .Pp | ||
107 | The | ||
108 | .Fn fido_assert_count | ||
109 | function returns the number of statements in | ||
110 | .Fa assert . | ||
111 | .Pp | ||
112 | The | ||
113 | .Fn fido_assert_user_display_name , | ||
114 | .Fn fido_assert_user_icon , | ||
115 | and | ||
116 | .Fn fido_assert_user_name , | ||
117 | functions return pointers to the user display name, icon, and | ||
118 | name attributes of statement | ||
119 | .Fa idx | ||
120 | in | ||
121 | .Fa assert . | ||
122 | If not NULL, the values returned by these functions point to | ||
123 | NUL-terminated UTF-8 strings. | ||
124 | .Pp | ||
125 | The | ||
126 | .Fn fido_assert_user_id_ptr , | ||
127 | .Fn fido_assert_authdata_ptr , | ||
128 | .Fn fido_assert_hmac_secret_ptr , | ||
129 | and | ||
130 | .Fn fido_assert_sig_ptr | ||
131 | functions return pointers to the user ID, authenticator data, | ||
132 | hmac-secret, and signature attributes of statement | ||
133 | .Fa idx | ||
134 | in | ||
135 | .Fa assert . | ||
136 | The | ||
137 | .Fn fido_assert_user_id_len , | ||
138 | .Fn fido_assert_authdata_len , | ||
139 | .Fn fido_assert_hmac_secret_len , | ||
140 | and | ||
141 | .Fn fido_assert_sig_len | ||
142 | functions can be used to retrieve the corresponding length of a | ||
143 | specific attribute. | ||
144 | .Pp | ||
145 | The | ||
146 | .Fn fido_assert_sigcount | ||
147 | function can be used to obtain the signature counter of statement | ||
148 | .Fa idx | ||
149 | in | ||
150 | .Fa assert . | ||
151 | .Pp | ||
152 | Please note that the first statement in | ||
153 | .Fa assert | ||
154 | has an | ||
155 | .Fa idx | ||
156 | (index) value of 0. | ||
157 | .Pp | ||
158 | The authenticator data and signature parts of an assertion | ||
159 | statement are typically passed to a FIDO 2 server for verification. | ||
160 | .Pp | ||
161 | The | ||
162 | .Fn fido_assert_clientdata_hash_ptr | ||
163 | function returns a pointer to the client data hash of | ||
164 | .Fa assert . | ||
165 | The corresponding length can be obtained by | ||
166 | .Fn fido_assert_clientdata_hash_len . | ||
167 | .Sh RETURN VALUES | ||
168 | The | ||
169 | .Fn fido_assert_user_display_name , | ||
170 | .Fn fido_assert_user_icon , | ||
171 | .Fn fido_assert_user_name , | ||
172 | .Fn fido_assert_authdata_ptr , | ||
173 | .Fn fido_assert_clientdata_hash_ptr , | ||
174 | .Fn fido_assert_user_id_ptr , | ||
175 | and | ||
176 | .Fn fido_assert_sig_ptr | ||
177 | functions return NULL if the respective field in | ||
178 | .Fa assert | ||
179 | is not set. | ||
180 | If not NULL, returned pointers are guaranteed to exist until any API | ||
181 | function that takes | ||
182 | .Fa assert | ||
183 | without the | ||
184 | .Em const | ||
185 | qualifier is invoked. | ||
186 | .Sh SEE ALSO | ||
187 | .Xr fido_assert_allow_cred 3 , | ||
188 | .Xr fido_assert_set_authdata 3 , | ||
189 | .Xr fido_assert_verify 3 , | ||
190 | .Xr fido_dev_get_assert 3 | ||
diff --git a/man/fido_assert_set_authdata.3 b/man/fido_assert_set_authdata.3 new file mode 100644 index 0000000..29a86c1 --- /dev/null +++ b/man/fido_assert_set_authdata.3 | |||
@@ -0,0 +1,194 @@ | |||
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 23 2018 $ | ||
6 | .Dt FIDO_ASSERT_SET_AUTHDATA 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_assert_set_authdata , | ||
10 | .Nm fido_assert_set_authdata_raw , | ||
11 | .Nm fido_assert_set_clientdata_hash , | ||
12 | .Nm fido_assert_set_count , | ||
13 | .Nm fido_assert_set_extensions , | ||
14 | .Nm fido_assert_set_hmac_salt , | ||
15 | .Nm fido_assert_set_up , | ||
16 | .Nm fido_assert_set_uv , | ||
17 | .Nm fido_assert_set_rp , | ||
18 | .Nm fido_assert_set_sig | ||
19 | .Nd set parameters of a FIDO 2 assertion | ||
20 | .Sh SYNOPSIS | ||
21 | .In fido.h | ||
22 | .Bd -literal | ||
23 | typedef enum { | ||
24 | FIDO_OPT_OMIT = 0, /* use authenticator's default */ | ||
25 | FIDO_OPT_FALSE, /* explicitly set option to false */ | ||
26 | FIDO_OPT_TRUE, /* explicitly set option to true */ | ||
27 | } fido_opt_t; | ||
28 | .Ed | ||
29 | .Ft int | ||
30 | .Fn fido_assert_set_authdata "fido_assert_t *assert" " size_t idx" "const unsigned char *ptr" "size_t len" | ||
31 | .Ft int | ||
32 | .Fn fido_assert_set_authdata_raw "fido_assert_t *assert" " size_t idx" "const unsigned char *ptr" "size_t len" | ||
33 | .Ft int | ||
34 | .Fn fido_assert_set_clientdata_hash "fido_assert_t *assert" "const unsigned char *ptr" "size_t len" | ||
35 | .Ft int | ||
36 | .Fn fido_assert_set_count "fido_assert_t *assert" "size_t n" | ||
37 | .Ft int | ||
38 | .Fn fido_assert_set_extensions "fido_assert_t *assert" "int flags" | ||
39 | .Ft int | ||
40 | .Fn fido_assert_set_hmac_salt "fido_assert_t *assert" "const unsigned char *ptr" "size_t len" | ||
41 | .Ft int | ||
42 | .Fn fido_assert_set_up "fido_assert_t *assert" "fido_opt_t up" | ||
43 | .Ft int | ||
44 | .Fn fido_assert_set_uv "fido_assert_t *assert" "fido_opt_t uv" | ||
45 | .Ft int | ||
46 | .Fn fido_assert_set_rp "fido_assert_t *assert" "const char *id" | ||
47 | .Ft int | ||
48 | .Fn fido_assert_set_sig "fido_assert_t *assert" "size_t idx" "const unsigned char *ptr" "size_t len" | ||
49 | .Sh DESCRIPTION | ||
50 | The | ||
51 | .Nm | ||
52 | set of functions define the various parameters of a FIDO 2 | ||
53 | assertion, allowing a | ||
54 | .Fa fido_assert_t | ||
55 | type to be prepared for a subsequent call to | ||
56 | .Xr fido_dev_get_assert 3 | ||
57 | or | ||
58 | .Xr fido_assert_verify 3 . | ||
59 | For the complete specification of a FIDO 2 assertion and the format | ||
60 | of its constituent parts, please refer to the Web Authentication | ||
61 | (webauthn) standard. | ||
62 | .Pp | ||
63 | The | ||
64 | .Fn fido_assert_set_count | ||
65 | function sets the number of assertion statements in | ||
66 | .Fa assert | ||
67 | to | ||
68 | .Fa n . | ||
69 | .Pp | ||
70 | The | ||
71 | .Fn fido_assert_set_authdata | ||
72 | and | ||
73 | .Fn fido_assert_set_sig | ||
74 | functions set the authenticator data and signature parts of the | ||
75 | statement with index | ||
76 | .Fa idx | ||
77 | of | ||
78 | .Fa assert | ||
79 | to | ||
80 | .Fa ptr , | ||
81 | where | ||
82 | .Fa ptr | ||
83 | points to | ||
84 | .Fa len | ||
85 | bytes. | ||
86 | A copy of | ||
87 | .Fa ptr | ||
88 | is made, and no references to the passed pointer are kept. | ||
89 | Please note that the first assertion statement of | ||
90 | .Fa assert | ||
91 | has an | ||
92 | .Fa idx | ||
93 | of | ||
94 | .Em 0 . | ||
95 | The authenticator data passed to | ||
96 | .Fn fido_assert_set_authdata | ||
97 | must be a CBOR-encoded byte string, as obtained from | ||
98 | .Fn fido_assert_authdata_ptr . | ||
99 | Alternatively, a raw binary blob may be passed to | ||
100 | .Fn fido_assert_set_authdata_raw . | ||
101 | .Pp | ||
102 | The | ||
103 | .Fn fido_assert_set_clientdata_hash | ||
104 | and | ||
105 | .Fn fido_assert_set_hmac_salt | ||
106 | functions set the client data hash and hmac-salt parts of | ||
107 | .Fa assert | ||
108 | to | ||
109 | .Fa ptr , | ||
110 | where | ||
111 | .Fa ptr | ||
112 | points to | ||
113 | .Fa len | ||
114 | bytes. | ||
115 | A copy of | ||
116 | .Fa ptr | ||
117 | is made, and no references to the passed pointer are kept. | ||
118 | .Pp | ||
119 | The | ||
120 | .Fn fido_assert_set_rp | ||
121 | function sets the relying party | ||
122 | .Fa id | ||
123 | of | ||
124 | .Fa assert , | ||
125 | where | ||
126 | .Fa id | ||
127 | is a NUL-terminated UTF-8 string. | ||
128 | The content of | ||
129 | .Fa id | ||
130 | is copied, and no references to the passed pointer are kept. | ||
131 | .Pp | ||
132 | The | ||
133 | .Fn fido_assert_set_extensions | ||
134 | function sets the extensions of | ||
135 | .Fa assert | ||
136 | to the bitmask | ||
137 | .Fa flags . | ||
138 | At the moment, only the | ||
139 | .Dv FIDO_EXT_HMAC_SECRET | ||
140 | extension is supported. | ||
141 | If | ||
142 | .Fa flags | ||
143 | is zero, the extensions of | ||
144 | .Fa assert | ||
145 | are cleared. | ||
146 | .Pp | ||
147 | The | ||
148 | .Fn fido_assert_set_up | ||
149 | and | ||
150 | .Fn fido_assert_set_uv | ||
151 | functions set the | ||
152 | .Fa up | ||
153 | (user presence) and | ||
154 | .Fa uv | ||
155 | (user verification) | ||
156 | attributes of | ||
157 | .Fa assert . | ||
158 | Both are | ||
159 | .Dv FIDO_OPT_OMIT | ||
160 | by default, allowing the authenticator to use its default settings. | ||
161 | .Pp | ||
162 | Use of the | ||
163 | .Nm | ||
164 | set of functions may happen in two distinct situations: | ||
165 | when asking a FIDO device to produce a series of assertion | ||
166 | statements, prior to | ||
167 | .Xr fido_dev_get_assert 3 | ||
168 | (i.e, in the context of a FIDO client), or when verifying assertion | ||
169 | statements using | ||
170 | .Xr fido_assert_verify 3 | ||
171 | (i.e, in the context of a FIDO server). | ||
172 | .Pp | ||
173 | For a complete description of the generation of a FIDO 2 assertion | ||
174 | and its verification, please refer to the FIDO 2 specification. | ||
175 | An example of how to use the | ||
176 | .Nm | ||
177 | set of functions can be found in the | ||
178 | .Pa examples/assert.c | ||
179 | file shipped with | ||
180 | .Em libfido2 . | ||
181 | .Sh RETURN VALUES | ||
182 | The | ||
183 | .Nm | ||
184 | functions return | ||
185 | .Dv FIDO_OK | ||
186 | on success. | ||
187 | The error codes returned by the | ||
188 | .Nm | ||
189 | set of functions are defined in | ||
190 | .In fido/err.h . | ||
191 | .Sh SEE ALSO | ||
192 | .Xr fido_assert_allow_cred 3 , | ||
193 | .Xr fido_assert_verify 3 , | ||
194 | .Xr fido_dev_get_assert 3 | ||
diff --git a/man/fido_assert_verify.3 b/man/fido_assert_verify.3 new file mode 100644 index 0000000..82e64e1 --- /dev/null +++ b/man/fido_assert_verify.3 | |||
@@ -0,0 +1,79 @@ | |||
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 24 2018 $ | ||
6 | .Dt FIDO_ASSERT_VERIFY 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_assert_verify | ||
10 | .Nd verifies the signature of a FIDO 2 assertion statement | ||
11 | .Sh SYNOPSIS | ||
12 | .In fido.h | ||
13 | .Ft int | ||
14 | .Fn fido_assert_verify "fido_assert_t *assert" "size_t idx" "int cose_alg" "const void *pk" | ||
15 | .Sh DESCRIPTION | ||
16 | The | ||
17 | .Fn fido_assert_verify | ||
18 | function verifies whether the signature contained in statement index | ||
19 | .Fa idx | ||
20 | of | ||
21 | .Fa assert | ||
22 | matches the parameters of the assertion. | ||
23 | Before using | ||
24 | .Fn fido_assert_verify | ||
25 | in a sensitive context, the reader is strongly encouraged to make | ||
26 | herself familiar with the FIDO 2 assertion statement process | ||
27 | as defined in the Web Authentication (webauthn) standard. | ||
28 | .Pp | ||
29 | A brief description follows: | ||
30 | .Pp | ||
31 | The | ||
32 | .Fn fido_assert_verify | ||
33 | function verifies whether the client data hash, relying party ID, | ||
34 | user presence and user verification attributes of | ||
35 | .Fa assert | ||
36 | have been attested by the holder of the private counterpart of | ||
37 | the public key | ||
38 | .Fa pk | ||
39 | of COSE type | ||
40 | .Fa cose_alg , | ||
41 | where | ||
42 | .Fa cose_alg | ||
43 | is | ||
44 | .Dv COSE_ES256 , | ||
45 | .Dv COSE_RS256 , | ||
46 | or | ||
47 | .Dv COSE_EDDSA , | ||
48 | and | ||
49 | .Fa pk | ||
50 | points to a | ||
51 | .Vt es256_pk_t , | ||
52 | .Vt rs256_pk_t , | ||
53 | or | ||
54 | .Vt eddsa_pk_t | ||
55 | type accordingly. | ||
56 | .Pp | ||
57 | Please note that the first statement in | ||
58 | .Fa assert | ||
59 | has an | ||
60 | .Fa idx | ||
61 | of 0. | ||
62 | .Sh RETURN VALUES | ||
63 | The error codes returned by | ||
64 | .Fn fido_assert_verify | ||
65 | are defined in | ||
66 | .In fido/err.h . | ||
67 | If | ||
68 | statement | ||
69 | .Fa idx | ||
70 | of | ||
71 | .Fa assert | ||
72 | passes verification with | ||
73 | .Fa pk , | ||
74 | then | ||
75 | .Dv FIDO_OK | ||
76 | is returned. | ||
77 | .Sh SEE ALSO | ||
78 | .Xr fido_assert_new 3 , | ||
79 | .Xr fido_assert_set_authdata 3 | ||
diff --git a/man/fido_bio_dev_get_info.3 b/man/fido_bio_dev_get_info.3 new file mode 100644 index 0000000..bde1396 --- /dev/null +++ b/man/fido_bio_dev_get_info.3 | |||
@@ -0,0 +1,120 @@ | |||
1 | .\" Copyright (c) 2019 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: September 13 2019 $ | ||
6 | .Dt FIDO_BIO_DEV_GET_INFO 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_bio_dev_get_info , | ||
10 | .Nm fido_bio_dev_enroll_begin , | ||
11 | .Nm fido_bio_dev_enroll_continue , | ||
12 | .Nm fido_bio_dev_enroll_cancel , | ||
13 | .Nm fido_bio_dev_enroll_remove , | ||
14 | .Nm fido_bio_dev_get_template_array , | ||
15 | .Nm fido_bio_dev_set_template_name | ||
16 | .Nd FIDO 2 biometric authenticator API | ||
17 | .Sh SYNOPSIS | ||
18 | .In fido.h | ||
19 | .In fido/bio.h | ||
20 | .Ft int | ||
21 | .Fn fido_bio_dev_get_info "fido_dev_t *dev" "fido_bio_info_t *info" | ||
22 | .Ft int | ||
23 | .Fn fido_bio_dev_enroll_begin "fido_dev_t *dev" "fido_bio_template_t *template" "fido_bio_enroll_t *enroll" "uint32_t timeout_ms" "const char *pin" | ||
24 | .Ft int | ||
25 | .Fn fido_bio_dev_enroll_continue "fido_dev_t *dev" "const fido_bio_template_t *template" "fido_bio_enroll_t *enroll" "uint32_t timeout_ms" | ||
26 | .Ft int | ||
27 | .Fn fido_bio_dev_enroll_cancel "fido_dev_t *dev" | ||
28 | .Ft int | ||
29 | .Fn fido_bio_dev_enroll_remove "fido_dev_t *dev" "const fido_bio_template_t *template" "const char *pin" | ||
30 | .Ft int | ||
31 | .Fn fido_bio_dev_get_template_array "fido_dev_t *dev" "fido_bio_template_array_t *template_array" "const char *pin" | ||
32 | .Ft int | ||
33 | .Fn fido_bio_dev_set_template_name "fido_dev_t *dev" "const fido_bio_template_t *template" "const char *pin" | ||
34 | .Sh DESCRIPTION | ||
35 | The functions described in this page allow biometric | ||
36 | templates on a FIDO2 authenticator to be listed, created, | ||
37 | removed, and customised. | ||
38 | For a description of the types involved, please refer to | ||
39 | .Xr fido_bio_info_new 3 , | ||
40 | .Xr fido_bio_enroll_new 3 , | ||
41 | and | ||
42 | .Xr fido_bio_template 3 . | ||
43 | .Pp | ||
44 | The | ||
45 | .Fn fido_bio_dev_get_info | ||
46 | function populates | ||
47 | .Fa info | ||
48 | with sensor information from | ||
49 | .Fa dev . | ||
50 | .Pp | ||
51 | The | ||
52 | .Fn fido_bio_dev_enroll_begin | ||
53 | function initiates a biometric enrollment on | ||
54 | .Fa dev , | ||
55 | instructing the authenticator to wait | ||
56 | .Fa timeout_ms | ||
57 | milliseconds. | ||
58 | On success, | ||
59 | .Fa template | ||
60 | and | ||
61 | .Fa enroll | ||
62 | will be populated with the newly created template's | ||
63 | information and enrollment status, respectively. | ||
64 | .Pp | ||
65 | The | ||
66 | .Fn fido_bio_dev_enroll_continue | ||
67 | function continues an ongoing enrollment on | ||
68 | .Fa dev , | ||
69 | instructing the authenticator to wait | ||
70 | .Fa timeout_ms | ||
71 | milliseconds. | ||
72 | On success, | ||
73 | .Fa enroll | ||
74 | will be updated to reflect the status of the biometric | ||
75 | enrollment. | ||
76 | .Pp | ||
77 | The | ||
78 | .Fn fido_bio_dev_enroll_cancel | ||
79 | function cancels an ongoing enrollment on | ||
80 | .Fa dev . | ||
81 | .Pp | ||
82 | The | ||
83 | .Fn fido_bio_dev_enroll_remove | ||
84 | function removes | ||
85 | .Fa template | ||
86 | from | ||
87 | .Fa dev . | ||
88 | .Pp | ||
89 | The | ||
90 | .Fn fido_bio_dev_get_template_array | ||
91 | function populates | ||
92 | .Fa template_array | ||
93 | with the templates currently enrolled on | ||
94 | .Fa dev . | ||
95 | .Pp | ||
96 | The | ||
97 | .Fn fido_bio_dev_set_template_name | ||
98 | function sets the friendly name of | ||
99 | .Fa template | ||
100 | on | ||
101 | .Fa dev . | ||
102 | .Pp | ||
103 | The error codes returned by | ||
104 | .Fn fido_bio_dev_get_info , | ||
105 | .Fn fido_bio_dev_enroll_begin , | ||
106 | .Fn fido_bio_dev_enroll_continue , | ||
107 | .Fn fido_bio_dev_enroll_cancel , | ||
108 | .Fn fido_bio_dev_enroll_remove , | ||
109 | .Fn fido_bio_dev_get_template_array , | ||
110 | and | ||
111 | .Fn fido_bio_dev_set_template_name | ||
112 | are defined in | ||
113 | .In fido/err.h . | ||
114 | On success, | ||
115 | .Dv FIDO_OK | ||
116 | is returned. | ||
117 | .Sh SEE ALSO | ||
118 | .Xr fido_bio_enroll_new 3 , | ||
119 | .Xr fido_bio_info_new 3 , | ||
120 | .Xr fido_bio_template 3 | ||
diff --git a/man/fido_bio_enroll_new.3 b/man/fido_bio_enroll_new.3 new file mode 100644 index 0000000..3db3e7a --- /dev/null +++ b/man/fido_bio_enroll_new.3 | |||
@@ -0,0 +1,95 @@ | |||
1 | .\" Copyright (c) 2019 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: September 13 2019 $ | ||
6 | .Dt FIDO_BIO_ENROLL_NEW 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_bio_enroll_new , | ||
10 | .Nm fido_bio_enroll_free , | ||
11 | .Nm fido_bio_enroll_last_status , | ||
12 | .Nm fido_bio_enroll_remaining_samples | ||
13 | .Nd FIDO 2 biometric enrollment API | ||
14 | .Sh SYNOPSIS | ||
15 | .In fido.h | ||
16 | .In fido/bio.h | ||
17 | .Bd -literal | ||
18 | #define FIDO_BIO_ENROLL_FP_GOOD 0x00 | ||
19 | #define FIDO_BIO_ENROLL_FP_TOO_HIGH 0x01 | ||
20 | #define FIDO_BIO_ENROLL_FP_TOO_LOW 0x02 | ||
21 | #define FIDO_BIO_ENROLL_FP_TOO_LEFT 0x03 | ||
22 | #define FIDO_BIO_ENROLL_FP_TOO_RIGHT 0x04 | ||
23 | #define FIDO_BIO_ENROLL_FP_TOO_FAST 0x05 | ||
24 | #define FIDO_BIO_ENROLL_FP_TOO_SLOW 0x06 | ||
25 | #define FIDO_BIO_ENROLL_FP_POOR_QUALITY 0x07 | ||
26 | #define FIDO_BIO_ENROLL_FP_TOO_SKEWED 0x08 | ||
27 | #define FIDO_BIO_ENROLL_FP_TOO_SHORT 0x09 | ||
28 | #define FIDO_BIO_ENROLL_FP_MERGE_FAILURE 0x0a | ||
29 | #define FIDO_BIO_ENROLL_FP_EXISTS 0x0b | ||
30 | #define FIDO_BIO_ENROLL_FP_DATABASE_FULL 0x0c | ||
31 | #define FIDO_BIO_ENROLL_NO_USER_ACTIVITY 0x0d | ||
32 | #define FIDO_BIO_ENROLL_NO_USER_PRESENCE_TRANSITION 0x0e | ||
33 | .Ed | ||
34 | .Ft fido_bio_enroll_t * | ||
35 | .Fn fido_bio_enroll_new "void" | ||
36 | .Ft void | ||
37 | .Fn fido_bio_enroll_free "fido_bio_enroll_t **enroll_p" | ||
38 | .Ft uint8_t | ||
39 | .Fn fido_bio_enroll_last_status "const fido_bio_enroll_t *enroll" | ||
40 | .Ft uint8_t | ||
41 | .Fn fido_bio_enroll_remaining_samples "const fido_bio_enroll_t *enroll" | ||
42 | .Sh DESCRIPTION | ||
43 | Ongoing FIDO 2 biometric enrollments are abstracted in | ||
44 | .Em libfido2 | ||
45 | by the | ||
46 | .Vt fido_bio_enroll_t | ||
47 | type. | ||
48 | .Pp | ||
49 | The functions described in this page allow a | ||
50 | .Vt fido_bio_enroll_t | ||
51 | type to be allocated, deallocated, and inspected. | ||
52 | For device operations on | ||
53 | .Vt fido_bio_enroll_t , | ||
54 | please refer to | ||
55 | .Xr fido_bio_dev_get_info 3 . | ||
56 | .Pp | ||
57 | The | ||
58 | .Fn fido_bio_enroll_new | ||
59 | function returns a pointer to a newly allocated, empty | ||
60 | .Vt fido_bio_enroll_t | ||
61 | type. | ||
62 | If memory cannot be allocated, NULL is returned. | ||
63 | .Pp | ||
64 | The | ||
65 | .Fn fido_bio_enroll_free | ||
66 | function releases the memory backing | ||
67 | .Fa *enroll_p , | ||
68 | where | ||
69 | .Fa *enroll_p | ||
70 | must have been previously allocated by | ||
71 | .Fn fido_bio_enroll_new . | ||
72 | On return, | ||
73 | .Fa *enroll_p | ||
74 | is set to NULL. | ||
75 | Either | ||
76 | .Fa enroll_p | ||
77 | or | ||
78 | .Fa *enroll_p | ||
79 | may be NULL, in which case | ||
80 | .Fn fido_bio_enroll_free | ||
81 | is a NOP. | ||
82 | .Pp | ||
83 | The | ||
84 | .Fn fido_bio_enroll_last_status | ||
85 | function returns the enrollment status of | ||
86 | .Fa enroll . | ||
87 | .Pp | ||
88 | The | ||
89 | .Fn fido_bio_enroll_remaining_samples | ||
90 | function returns the number of samples left for | ||
91 | .Fa enroll | ||
92 | to complete. | ||
93 | .Sh SEE ALSO | ||
94 | .Xr fido_bio_dev_get_info 3 , | ||
95 | .Xr fido_bio_template 3 | ||
diff --git a/man/fido_bio_info_new.3 b/man/fido_bio_info_new.3 new file mode 100644 index 0000000..c827333 --- /dev/null +++ b/man/fido_bio_info_new.3 | |||
@@ -0,0 +1,81 @@ | |||
1 | .\" Copyright (c) 2019 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: September 13 2019 $ | ||
6 | .Dt FIDO_BIO_INFO_NEW 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_bio_info_new , | ||
10 | .Nm fido_bio_info_free , | ||
11 | .Nm fido_bio_info_type , | ||
12 | .Nm fido_bio_info_max_samples | ||
13 | .Nd FIDO 2 biometric sensor information API | ||
14 | .Sh SYNOPSIS | ||
15 | .In fido.h | ||
16 | .In fido/bio.h | ||
17 | .Ft fido_bio_info_t * | ||
18 | .Fn fido_bio_info_new "void" | ||
19 | .Ft void | ||
20 | .Fn fido_bio_info_free "fido_bio_info_t **info_p" | ||
21 | .Ft uint8_t | ||
22 | .Fn fido_bio_info_type "const fido_bio_info_t *info" | ||
23 | .Ft uint8_t | ||
24 | .Fn fido_bio_info_max_samples "const fido_bio_info_t *info" | ||
25 | .Sh DESCRIPTION | ||
26 | Biometric sensor metadata is abstracted in | ||
27 | .Em libfido2 | ||
28 | by the | ||
29 | .Vt fido_bio_info_t | ||
30 | type. | ||
31 | .Pp | ||
32 | The functions described in this page allow a | ||
33 | .Vt fido_bio_info_t | ||
34 | type to be allocated, deallocated, and inspected. | ||
35 | For device operations on | ||
36 | .Vt fido_bio_info_t , | ||
37 | please refer to | ||
38 | .Xr fido_bio_dev_get_info 3 . | ||
39 | .Pp | ||
40 | The | ||
41 | .Fn fido_bio_info_new | ||
42 | function returns a pointer to a newly allocated, empty | ||
43 | .Vt fido_bio_info_t | ||
44 | type. | ||
45 | If memory cannot be allocated, NULL is returned. | ||
46 | .Pp | ||
47 | The | ||
48 | .Fn fido_bio_info_free | ||
49 | function releases the memory backing | ||
50 | .Fa *info_p , | ||
51 | where | ||
52 | .Fa *info_p | ||
53 | must have been previously allocated by | ||
54 | .Fn fido_bio_info_new . | ||
55 | On return, | ||
56 | .Fa *info_p | ||
57 | is set to NULL. | ||
58 | Either | ||
59 | .Fa info_p | ||
60 | or | ||
61 | .Fa *info_p | ||
62 | may be NULL, in which case | ||
63 | .Fn fido_bio_info_free | ||
64 | is a NOP. | ||
65 | .Pp | ||
66 | The | ||
67 | .Fn fido_bio_info_type | ||
68 | function returns the fingerprint sensor type, which is | ||
69 | .Dv 1 | ||
70 | for touch sensors, and | ||
71 | .Dv 2 | ||
72 | for swipe sensors. | ||
73 | .Pp | ||
74 | The | ||
75 | .Fn fido_bio_info_max_samples | ||
76 | function returns the maximum number of successful samples | ||
77 | required for enrollment. | ||
78 | .Sh SEE ALSO | ||
79 | .Xr fido_bio_dev_get_info 3 , | ||
80 | .Xr fido_bio_enroll_new 3 , | ||
81 | .Xr fido_bio_template 3 | ||
diff --git a/man/fido_bio_template.3 b/man/fido_bio_template.3 new file mode 100644 index 0000000..6140926 --- /dev/null +++ b/man/fido_bio_template.3 | |||
@@ -0,0 +1,169 @@ | |||
1 | .\" Copyright (c) 2019 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: September 13 2019 $ | ||
6 | .Dt FIDO_BIO_TEMPLATE 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_bio_template , | ||
10 | .Nm fido_bio_template_array_count , | ||
11 | .Nm fido_bio_template_array_free , | ||
12 | .Nm fido_bio_template_array_new , | ||
13 | .Nm fido_bio_template_free , | ||
14 | .Nm fido_bio_template_id_len , | ||
15 | .Nm fido_bio_template_id_ptr , | ||
16 | .Nm fido_bio_template_name , | ||
17 | .Nm fido_bio_template_new , | ||
18 | .Nm fido_bio_template_set_id , | ||
19 | .Nm fido_bio_template_set_name | ||
20 | .Nd FIDO 2 biometric template API | ||
21 | .Sh SYNOPSIS | ||
22 | .In fido.h | ||
23 | .In fido/bio.h | ||
24 | .Ft fido_bio_template_t * | ||
25 | .Fn fido_bio_template_new "void" | ||
26 | .Ft void | ||
27 | .Fn fido_bio_template_free "fido_bio_template_t **template_p" | ||
28 | .Ft const char * | ||
29 | .Fn fido_bio_template_name "const fido_bio_template_t *template" | ||
30 | .Ft const unsigned char * | ||
31 | .Fn fido_bio_template_id_ptr "const fido_bio_template_t *template" | ||
32 | .Ft size_t | ||
33 | .Fn fido_bio_template_id_len "const fido_bio_template_t *template" | ||
34 | .Ft int | ||
35 | .Fn fido_bio_template_set_id "fido_bio_template_t *template" "const unsigned char *ptr" "size_t len" | ||
36 | .Ft int | ||
37 | .Fn fido_bio_template_set_name "fido_bio_template_t *template" "const char *name" | ||
38 | .Ft fido_bio_template_array_t * | ||
39 | .Fn fido_bio_template_array_new "void" | ||
40 | .Ft void | ||
41 | .Fn fido_bio_template_array_free "fido_bio_template_array_t **template_array_p" | ||
42 | .Ft size_t | ||
43 | .Fn fido_bio_template_array_count "const fido_bio_template_array_t *template_array" | ||
44 | .Ft const fido_bio_template_t * | ||
45 | .Fn fido_bio_template "const fido_bio_template_array_t *template_array" "size_t idx" | ||
46 | .Sh DESCRIPTION | ||
47 | Existing FIDO 2 biometric enrollments are abstracted in | ||
48 | .Em libfido2 | ||
49 | by the | ||
50 | .Vt fido_bio_template_t | ||
51 | and | ||
52 | .Vt fido_bio_template_array_t | ||
53 | types. | ||
54 | .Pp | ||
55 | The functions described in this page allow a | ||
56 | .Vt fido_bio_template_t | ||
57 | type to be allocated, deallocated, changed, and inspected, | ||
58 | and a | ||
59 | .Vt fido_bio_template_array_t | ||
60 | type to be allocated, deallocated, and inspected. | ||
61 | For device operations on | ||
62 | .Vt fido_bio_template_t | ||
63 | and | ||
64 | .Vt fido_bio_template_array_t , | ||
65 | please refer to | ||
66 | .Xr fido_bio_dev_get_info 3 . | ||
67 | .Pp | ||
68 | The | ||
69 | .Fn fido_bio_template_new | ||
70 | function returns a pointer to a newly allocated, empty | ||
71 | .Vt fido_bio_template_t | ||
72 | type. | ||
73 | If memory cannot be allocated, NULL is returned. | ||
74 | .Pp | ||
75 | The | ||
76 | .Fn fido_bio_template_free | ||
77 | function releases the memory backing | ||
78 | .Fa *template_p , | ||
79 | where | ||
80 | .Fa *template_p | ||
81 | must have been previously allocated by | ||
82 | .Fn fido_bio_template_new . | ||
83 | On return, | ||
84 | .Fa *template_p | ||
85 | is set to NULL. | ||
86 | Either | ||
87 | .Fa template_p | ||
88 | or | ||
89 | .Fa *template_p | ||
90 | may be NULL, in which case | ||
91 | .Fn fido_bio_template_free | ||
92 | is a NOP. | ||
93 | .Pp | ||
94 | The | ||
95 | .Fn fido_bio_template_name | ||
96 | function returns a pointer to a NUL-terminated string containing | ||
97 | the friendly name of | ||
98 | .Fa template , | ||
99 | or NULL if | ||
100 | .Fa template | ||
101 | does not have a friendly name set. | ||
102 | .Pp | ||
103 | The | ||
104 | .Fn fido_bio_template_id_ptr | ||
105 | function returns a pointer to the template id of | ||
106 | .Fa template , | ||
107 | or NULL if | ||
108 | .Fa template | ||
109 | does not have an id. | ||
110 | The corresponding length can be obtained by | ||
111 | .Fn fido_bio_template_id_len . | ||
112 | .Pp | ||
113 | The | ||
114 | .Fn fido_bio_template_set_name | ||
115 | function sets the friendly name of | ||
116 | .Fa template | ||
117 | to | ||
118 | .Fa name . | ||
119 | If | ||
120 | .Fa name | ||
121 | is NULL, the friendly name of | ||
122 | .Fa template | ||
123 | is unset. | ||
124 | .Pp | ||
125 | The | ||
126 | .Fn fido_bio_template_array_new | ||
127 | function returns a pointer to a newly allocated, empty | ||
128 | .Vt fido_bio_template_array_t | ||
129 | type. | ||
130 | If memory cannot be allocated, NULL is returned. | ||
131 | .Pp | ||
132 | The | ||
133 | .Fn fido_bio_template_array_free | ||
134 | function releases the memory backing | ||
135 | .Fa *template_array_p , | ||
136 | where | ||
137 | .Fa *template_array_p | ||
138 | must have been previously allocated by | ||
139 | .Fn fido_bio_template_array_new . | ||
140 | On return, | ||
141 | .Fa *template_array_p | ||
142 | is set to NULL. | ||
143 | Either | ||
144 | .Fa template_array_p | ||
145 | or | ||
146 | .Fa *template_array_p | ||
147 | may be NULL, in which case | ||
148 | .Fn fido_bio_template_array_free | ||
149 | is a NOP. | ||
150 | .Pp | ||
151 | The | ||
152 | .Fn fido_bio_template_array_count | ||
153 | function returns the number of templates in | ||
154 | .Fa template_array . | ||
155 | .Pp | ||
156 | The | ||
157 | .Fn fido_bio_template | ||
158 | function returns a pointer to the template at index | ||
159 | .Fa idx | ||
160 | in | ||
161 | .Fa template_array . | ||
162 | Please note that the first template in | ||
163 | .Fa template_array | ||
164 | has an | ||
165 | .Fa idx | ||
166 | (index) value of 0. | ||
167 | .Sh SEE ALSO | ||
168 | .Xr fido_bio_dev_get_info 3 , | ||
169 | .Xr fido_bio_enroll_new 3 | ||
diff --git a/man/fido_cbor_info_new.3 b/man/fido_cbor_info_new.3 new file mode 100644 index 0000000..d1e4c41 --- /dev/null +++ b/man/fido_cbor_info_new.3 | |||
@@ -0,0 +1,153 @@ | |||
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 24 2018 $ | ||
6 | .Dt FIDO_CBOR_INFO_NEW 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_cbor_info_new , | ||
10 | .Nm fido_cbor_info_free , | ||
11 | .Nm fido_dev_get_cbor_info , | ||
12 | .Nm fido_cbor_info_aaguid_ptr , | ||
13 | .Nm fido_cbor_info_extensions_ptr , | ||
14 | .Nm fido_cbor_info_protocols_ptr , | ||
15 | .Nm fido_cbor_info_versions_ptr , | ||
16 | .Nm fido_cbor_info_options_name_ptr , | ||
17 | .Nm fido_cbor_info_options_value_ptr , | ||
18 | .Nm fido_cbor_info_aaguid_len , | ||
19 | .Nm fido_cbor_info_extensions_len , | ||
20 | .Nm fido_cbor_info_protocols_len , | ||
21 | .Nm fido_cbor_info_versions_len , | ||
22 | .Nm fido_cbor_info_options_len , | ||
23 | .Nm fido_cbor_info_maxmsgsiz | ||
24 | .Nd FIDO 2 CBOR Info API | ||
25 | .Sh SYNOPSIS | ||
26 | .In fido.h | ||
27 | .Ft fido_cbor_info_t * | ||
28 | .Fn fido_cbor_info_new "void" | ||
29 | .Ft void | ||
30 | .Fn fido_cbor_info_free "fido_cbor_info_t **ci_p" | ||
31 | .Ft int | ||
32 | .Fn fido_dev_get_cbor_info "fido_dev_t *dev" "fido_cbor_info_t *ci" | ||
33 | .Ft const unsigned char * | ||
34 | .Fn fido_cbor_info_aaguid_ptr "const fido_cbor_info_t *ci" | ||
35 | .Ft char ** | ||
36 | .Fn fido_cbor_info_extensions_ptr "const fido_cbor_info_t *ci" | ||
37 | .Ft const uint8_t * | ||
38 | .Fn fido_cbor_info_protocols_ptr "const fido_cbor_info_t *ci" | ||
39 | .Ft char ** | ||
40 | .Fn fido_cbor_info_versions_ptr "const fido_cbor_info_t *ci" | ||
41 | .Ft char ** | ||
42 | .Fn fido_cbor_info_options_name_ptr "const fido_cbor_info_t *ci" | ||
43 | .Ft const bool * | ||
44 | .Fn fido_cbor_info_options_value_ptr "const fido_cbor_info_t *ci" | ||
45 | .Ft size_t | ||
46 | .Fn fido_cbor_info_aaguid_len "const fido_cbor_info_t *ci" | ||
47 | .Ft size_t | ||
48 | .Fn fido_cbor_info_extensions_len "const fido_cbor_info_t *ci" | ||
49 | .Ft size_t | ||
50 | .Fn fido_cbor_info_protocols_len "const fido_cbor_info_t *ci" | ||
51 | .Ft size_t | ||
52 | .Fn fido_cbor_info_versions_len "const fido_cbor_info_t *ci" | ||
53 | .Ft size_t | ||
54 | .Fn fido_cbor_info_options_len "const fido_cbor_info_t *ci" | ||
55 | .Ft uint64_t | ||
56 | .Fn fido_cbor_info_maxmsgsiz "const fido_cbor_info_t *ci" | ||
57 | .Sh DESCRIPTION | ||
58 | The | ||
59 | .Fn fido_cbor_info_new | ||
60 | function returns a pointer to a newly allocated, empty | ||
61 | .Vt fido_cbor_info_t | ||
62 | type. | ||
63 | If memory cannot be allocated, NULL is returned. | ||
64 | .Pp | ||
65 | The | ||
66 | .Fn fido_cbor_info_free | ||
67 | function releases the memory backing | ||
68 | .Fa *ci_p , | ||
69 | where | ||
70 | .Fa *ci_p | ||
71 | must have been previously allocated by | ||
72 | .Fn fido_cbor_info_new . | ||
73 | On return, | ||
74 | .Fa *ci_p | ||
75 | is set to NULL. | ||
76 | Either | ||
77 | .Fa ci_p | ||
78 | or | ||
79 | .Fa *ci_p | ||
80 | may be NULL, in which case | ||
81 | .Fn fido_cbor_info_free | ||
82 | is a NOP. | ||
83 | .Pp | ||
84 | The | ||
85 | .Fn fido_dev_get_cbor_info | ||
86 | function transmits a | ||
87 | .Dv CTAP_CBOR_GETINFO | ||
88 | command to | ||
89 | .Fa dev | ||
90 | and fills | ||
91 | .Fa ci | ||
92 | with attributes retrieved from the command's response. | ||
93 | The | ||
94 | .Fn fido_dev_get_cbor_info | ||
95 | function may block. | ||
96 | .Pp | ||
97 | The | ||
98 | .Fn fido_cbor_info_aaguid_ptr , | ||
99 | .Fn fido_cbor_info_extensions_ptr , | ||
100 | .Fn fido_cbor_info_protocols_ptr , | ||
101 | and | ||
102 | .Fn fido_cbor_info_versions_ptr | ||
103 | functions return pointers to the AAGUID, supported extensions, | ||
104 | PIN protocol and CTAP version strings of | ||
105 | .Fa ci . | ||
106 | The corresponding length of a given attribute can be | ||
107 | obtained by | ||
108 | .Fn fido_cbor_info_aaguid_len , | ||
109 | .Fn fido_cbor_info_extensions_len , | ||
110 | .Fn fido_cbor_info_protocols_len , | ||
111 | or | ||
112 | .Fn fido_cbor_info_versions_len . | ||
113 | .Pp | ||
114 | The | ||
115 | .Fn fido_cbor_info_options_name_ptr | ||
116 | and | ||
117 | .Fn fido_cbor_info_options_value_ptr | ||
118 | functions return pointers to the array of option names and their | ||
119 | respective values | ||
120 | in | ||
121 | .Fa ci . | ||
122 | The length of the options array is returned by | ||
123 | .Fn fido_cbor_info_options_len . | ||
124 | .Pp | ||
125 | The | ||
126 | .Fn fido_cbor_info_maxmsgsiz | ||
127 | function returns the maximum message size of | ||
128 | .Fa ci . | ||
129 | .Pp | ||
130 | A complete example of how to use these functions can be found in the | ||
131 | .Pa example/info.c | ||
132 | file shipped with | ||
133 | .Em libfido2 . | ||
134 | .Sh RETURN VALUES | ||
135 | The | ||
136 | .Fn fido_cbor_info_aaguid_ptr , | ||
137 | .Fn fido_cbor_info_extensions_ptr , | ||
138 | .Fn fido_cbor_info_protocols_ptr , | ||
139 | .Fn fido_cbor_info_versions_ptr , | ||
140 | .Fn fido_cbor_info_options_name_ptr , | ||
141 | and | ||
142 | .Fn fido_cbor_info_options_value_ptr | ||
143 | functions return NULL if the respective field in | ||
144 | .Fa ci | ||
145 | is absent. | ||
146 | If not NULL, returned pointers are guaranteed to exist until any | ||
147 | API function that takes | ||
148 | .Fa ci | ||
149 | without the | ||
150 | .Em const | ||
151 | qualifier is invoked. | ||
152 | .Sh SEE ALSO | ||
153 | .Xr fido_dev_open 3 | ||
diff --git a/man/fido_cred_exclude.3 b/man/fido_cred_exclude.3 new file mode 100644 index 0000000..700d6af --- /dev/null +++ b/man/fido_cred_exclude.3 | |||
@@ -0,0 +1,60 @@ | |||
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 23 2018 $ | ||
6 | .Dt FIDO_CRED_EXCLUDE 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_cred_exclude | ||
10 | .Nd appends a credential ID to a credential's list of excluded credentials | ||
11 | .Sh SYNOPSIS | ||
12 | .In fido.h | ||
13 | .Ft int | ||
14 | .Fn fido_cred_exclude "fido_cred_t *cred" "const unsigned char *ptr" "size_t len" | ||
15 | .Sh DESCRIPTION | ||
16 | The | ||
17 | .Fn fido_cred_exclude | ||
18 | function adds | ||
19 | .Fa ptr | ||
20 | to the list of credentials excluded by | ||
21 | .Fa cred , | ||
22 | where | ||
23 | .Fa ptr | ||
24 | points to a credential ID of | ||
25 | .Fa len | ||
26 | bytes. | ||
27 | A copy of | ||
28 | .Fa ptr | ||
29 | is made, and no references to the passed pointer are kept. | ||
30 | If | ||
31 | .Fn fido_cred_exclude | ||
32 | fails, the existing list of excluded credentials is preserved. | ||
33 | .Pp | ||
34 | If | ||
35 | .Nm | ||
36 | returns success and | ||
37 | .Fa cred | ||
38 | is later passed to | ||
39 | .Xr fido_dev_make_cred 3 | ||
40 | on a device that contains the credential | ||
41 | denoted by | ||
42 | .Fa ptr , | ||
43 | then | ||
44 | .Xr fido_dev_make_cred 3 | ||
45 | will fail. | ||
46 | .Pp | ||
47 | For the format of a FIDO 2 credential ID, please refer to the | ||
48 | Web Authentication (webauthn) standard. | ||
49 | .Sh RETURN VALUES | ||
50 | The error codes returned by | ||
51 | .Fn fido_cred_exclude | ||
52 | are defined in | ||
53 | .In fido/err.h . | ||
54 | On success, | ||
55 | .Dv FIDO_OK | ||
56 | is returned. | ||
57 | .Sh SEE ALSO | ||
58 | .Xr fido_cred_new 3 , | ||
59 | .Xr fido_cred_set_authdata 3 , | ||
60 | .Xr fido_dev_make_cred 3 | ||
diff --git a/man/fido_cred_new.3 b/man/fido_cred_new.3 new file mode 100644 index 0000000..47eeba8 --- /dev/null +++ b/man/fido_cred_new.3 | |||
@@ -0,0 +1,157 @@ | |||
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 23 2018 $ | ||
6 | .Dt FIDO_CRED_NEW 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_cred_new , | ||
10 | .Nm fido_cred_free , | ||
11 | .Nm fido_cred_fmt , | ||
12 | .Nm fido_cred_authdata_ptr , | ||
13 | .Nm fido_cred_clientdata_hash_ptr , | ||
14 | .Nm fido_cred_id_ptr , | ||
15 | .Nm fido_cred_pubkey_ptr , | ||
16 | .Nm fido_cred_sig_ptr , | ||
17 | .Nm fido_cred_x5c_ptr , | ||
18 | .Nm fido_cred_authdata_len , | ||
19 | .Nm fido_cred_clientdata_hash_len , | ||
20 | .Nm fido_cred_id_len , | ||
21 | .Nm fido_cred_pubkey_len , | ||
22 | .Nm fido_cred_sig_len , | ||
23 | .Nm fido_cred_x5c_len | ||
24 | .Nd FIDO 2 credential API | ||
25 | .Sh SYNOPSIS | ||
26 | .In fido.h | ||
27 | .Ft fido_cred_t * | ||
28 | .Fn fido_cred_new "void" | ||
29 | .Ft void | ||
30 | .Fn fido_cred_free "fido_cred_t **cred_p" | ||
31 | .Ft const char * | ||
32 | .Fn fido_cred_fmt "const fido_cred_t *cred" | ||
33 | .Ft const unsigned char * | ||
34 | .Fn fido_cred_authdata_ptr "const fido_cred_t *cred" | ||
35 | .Ft const unsigned char * | ||
36 | .Fn fido_cred_clientdata_hash_ptr "const fido_cred_t *cred" | ||
37 | .Ft const unsigned char * | ||
38 | .Fn fido_cred_id_ptr "const fido_cred_t *cred" | ||
39 | .Ft const unsigned char * | ||
40 | .Fn fido_cred_pubkey_ptr "const fido_cred_t *cred" | ||
41 | .Ft const unsigned char * | ||
42 | .Fn fido_cred_sig_ptr "const fido_cred_t *cred" | ||
43 | .Ft const unsigned char * | ||
44 | .Fn fido_cred_x5c_ptr "const fido_cred_t *cred" | ||
45 | .Ft size_t | ||
46 | .Fn fido_cred_authdata_len "const fido_cred_t *cred" | ||
47 | .Ft size_t | ||
48 | .Fn fido_cred_clientdata_hash_len "const fido_cred_t *cred" | ||
49 | .Ft size_t | ||
50 | .Fn fido_cred_id_len "const fido_cred_t *cred" | ||
51 | .Ft size_t | ||
52 | .Fn fido_cred_pubkey_len "const fido_cred_t *cred" | ||
53 | .Ft size_t | ||
54 | .Fn fido_cred_sig_len "const fido_cred_t *cred" | ||
55 | .Ft size_t | ||
56 | .Fn fido_cred_x5c_len "const fido_cred_t *cred" | ||
57 | .Sh DESCRIPTION | ||
58 | FIDO 2 credentials are abstracted in | ||
59 | .Em libfido2 | ||
60 | by the | ||
61 | .Vt fido_cred_t | ||
62 | type. | ||
63 | The functions described in this page allow a | ||
64 | .Vt fido_cred_t | ||
65 | type to be allocated, deallocated, and inspected. | ||
66 | For other operations on | ||
67 | .Vt fido_cred_t , | ||
68 | please refer to | ||
69 | .Xr fido_cred_set_authdata 3 , | ||
70 | .Xr fido_cred_exclude 3 , | ||
71 | .Xr fido_cred_verify 3 , | ||
72 | and | ||
73 | .Xr fido_dev_make_cred 3 . | ||
74 | .Pp | ||
75 | The | ||
76 | .Fn fido_cred_new | ||
77 | function returns a pointer to a newly allocated, empty | ||
78 | .Vt fido_cred_t | ||
79 | type. | ||
80 | If memory cannot be allocated, NULL is returned. | ||
81 | .Pp | ||
82 | The | ||
83 | .Fn fido_cred_free | ||
84 | function releases the memory backing | ||
85 | .Fa *cred_p , | ||
86 | where | ||
87 | .Fa *cred_p | ||
88 | must have been previously allocated by | ||
89 | .Fn fido_cred_new . | ||
90 | On return, | ||
91 | .Fa *cred_p | ||
92 | is set to NULL. | ||
93 | Either | ||
94 | .Fa cred_p | ||
95 | or | ||
96 | .Fa *cred_p | ||
97 | may be NULL, in which case | ||
98 | .Fn fido_cred_free | ||
99 | is a NOP. | ||
100 | .Pp | ||
101 | The | ||
102 | .Fn fido_cred_fmt | ||
103 | function returns a pointer to a NUL-terminated string containing | ||
104 | the format of | ||
105 | .Fa cred , | ||
106 | or NULL if | ||
107 | .Fa cred | ||
108 | does not have a format set. | ||
109 | .Pp | ||
110 | The | ||
111 | .Fn fido_cred_authdata_ptr , | ||
112 | .Fn fido_cred_clientdata_hash_ptr , | ||
113 | .Fn fido_cred_id_ptr , | ||
114 | .Fn fido_cred_pubkey_ptr , | ||
115 | .Fn fido_cred_sig_ptr , | ||
116 | and | ||
117 | .Fn fido_cred_x5c_ptr | ||
118 | functions return pointers to the authenticator data, client data | ||
119 | hash, ID, public key, signature and x509 certificate parts of | ||
120 | .Fa cred , | ||
121 | or NULL if the respective entry is not set. | ||
122 | .Pp | ||
123 | The corresponding length can be obtained by | ||
124 | .Fn fido_cred_authdata_len , | ||
125 | .Fn fido_cred_clientdata_hash_len , | ||
126 | .Fn fido_cred_id_len , | ||
127 | .Fn fido_cred_pubkey_len , | ||
128 | and | ||
129 | .Fn fido_cred_sig_len . | ||
130 | .Pp | ||
131 | The authenticator data, x509 certificate, and signature parts of a | ||
132 | credential are typically passed to a FIDO 2 server for verification. | ||
133 | .Sh RETURN VALUES | ||
134 | The authenticator data returned by | ||
135 | .Fn fido_cred_authdata_ptr | ||
136 | is a CBOR-encoded byte string, as obtained from the authenticator. | ||
137 | .Pp | ||
138 | If not NULL, pointers returned by | ||
139 | .Fn fido_cred_fmt , | ||
140 | .Fn fido_cred_authdata_ptr , | ||
141 | .Fn fido_cred_clientdata_hash_ptr , | ||
142 | .Fn fido_cred_id_ptr , | ||
143 | .Fn fido_cred_pubkey_ptr , | ||
144 | .Fn fido_cred_sig_ptr , | ||
145 | and | ||
146 | .Fn fido_cred_x5c_ptr | ||
147 | are guaranteed to exist until any API function that takes | ||
148 | .Fa cred | ||
149 | without the | ||
150 | .Em const | ||
151 | qualifier is invoked. | ||
152 | .Sh SEE ALSO | ||
153 | .Xr fido_cred_exclude 3 , | ||
154 | .Xr fido_cred_set_authdata 3 , | ||
155 | .Xr fido_cred_verify 3 , | ||
156 | .Xr fido_credman_metadata_new 3 , | ||
157 | .Xr fido_dev_make_cred 3 | ||
diff --git a/man/fido_cred_set_authdata.3 b/man/fido_cred_set_authdata.3 new file mode 100644 index 0000000..8b087fa --- /dev/null +++ b/man/fido_cred_set_authdata.3 | |||
@@ -0,0 +1,240 @@ | |||
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 23 2018 $ | ||
6 | .Dt FIDO_CRED_SET_AUTHDATA 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_cred_set_authdata , | ||
10 | .Nm fido_cred_set_authdata_raw , | ||
11 | .Nm fido_cred_set_x509 , | ||
12 | .Nm fido_cred_set_sig , | ||
13 | .Nm fido_cred_set_clientdata_hash , | ||
14 | .Nm fido_cred_set_rp , | ||
15 | .Nm fido_cred_set_user , | ||
16 | .Nm fido_cred_set_extensions , | ||
17 | .Nm fido_cred_set_rk , | ||
18 | .Nm fido_cred_set_uv , | ||
19 | .Nm fido_cred_set_fmt , | ||
20 | .Nm fido_cred_set_type | ||
21 | .Nd set parameters of a FIDO 2 credential | ||
22 | .Sh SYNOPSIS | ||
23 | .In fido.h | ||
24 | .Bd -literal | ||
25 | typedef enum { | ||
26 | FIDO_OPT_OMIT = 0, /* use authenticator's default */ | ||
27 | FIDO_OPT_FALSE, /* explicitly set option to false */ | ||
28 | FIDO_OPT_TRUE, /* explicitly set option to true */ | ||
29 | } fido_opt_t; | ||
30 | .Ed | ||
31 | .Ft int | ||
32 | .Fn fido_cred_set_authdata "fido_cred_t *cred" "const unsigned char *ptr" "size_t len" | ||
33 | .Ft int | ||
34 | .Fn fido_cred_set_authdata_raw "fido_cred_t *cred" "const unsigned char *ptr" "size_t len" | ||
35 | .Ft int | ||
36 | .Fn fido_cred_set_x509 "fido_cred_t *cred" "const unsigned char *ptr" "size_t len" | ||
37 | .Ft int | ||
38 | .Fn fido_cred_set_sig "fido_cred_t *cred" "const unsigned char *ptr" "size_t len" | ||
39 | .Ft int | ||
40 | .Fn fido_cred_set_clientdata_hash "fido_cred_t *cred" "const unsigned char *ptr" "size_t len" | ||
41 | .Ft int | ||
42 | .Fn fido_cred_set_rp "fido_cred_t *cred" "const char *id" "const char *name" | ||
43 | .Ft int | ||
44 | .Fn fido_cred_set_user "fido_cred_t *cred" "const unsigned char *user_id" "size_t user_id_len" "const char *name" "const char *display_name" "const char *icon" | ||
45 | .Ft int | ||
46 | .Fn fido_cred_set_extensions "fido_cred_t *cred" "int flags" | ||
47 | .Ft int | ||
48 | .Fn fido_cred_set_rk "fido_cred_t *cred" "fido_opt_t rk" | ||
49 | .Ft int | ||
50 | .Fn fido_cred_set_uv "fido_cred_t *cred" "fido_opt_t uv" | ||
51 | .Ft int | ||
52 | .Fn fido_cred_set_fmt "fido_cred_t *cred" "const char *ptr" | ||
53 | .Ft int | ||
54 | .Fn fido_cred_set_type "fido_cred_t *cred" "int cose_alg" | ||
55 | .Sh DESCRIPTION | ||
56 | The | ||
57 | .Nm | ||
58 | set of functions define the various parameters of a FIDO 2 | ||
59 | credential, allowing a | ||
60 | .Fa fido_cred_t | ||
61 | type to be prepared for a subsequent call to | ||
62 | .Xr fido_dev_make_cred 3 | ||
63 | or | ||
64 | .Xr fido_cred_verify 3 . | ||
65 | For the complete specification of a FIDO 2 credential and the format | ||
66 | of its constituent parts, please refer to the Web Authentication | ||
67 | (webauthn) standard. | ||
68 | .Pp | ||
69 | The | ||
70 | .Fn fido_cred_set_authdata , | ||
71 | .Fn fido_cred_set_x509 , | ||
72 | .Fn fido_cred_set_sig , | ||
73 | and | ||
74 | .Fn fido_cred_set_clientdata_hash | ||
75 | functions set the authenticator data, attestation certificate, | ||
76 | signature and client data hash parts of | ||
77 | .Fa cred | ||
78 | to | ||
79 | .Fa ptr , | ||
80 | where | ||
81 | .Fa ptr | ||
82 | points to | ||
83 | .Fa len | ||
84 | bytes. | ||
85 | A copy of | ||
86 | .Fa ptr | ||
87 | is made, and no references to the passed pointer are kept. | ||
88 | The authenticator data passed to | ||
89 | .Fn fido_cred_set_authdata | ||
90 | must be a CBOR-encoded byte string, as obtained from | ||
91 | .Fn fido_cred_authdata_ptr . | ||
92 | Alternatively, a raw binary blob may be passed to | ||
93 | .Fn fido_cred_set_authdata_raw . | ||
94 | .Pp | ||
95 | The | ||
96 | .Fn fido_cred_set_rp | ||
97 | function sets the relying party | ||
98 | .Fa id | ||
99 | and | ||
100 | .Fa name | ||
101 | parameters of | ||
102 | .Fa cred , | ||
103 | where | ||
104 | .Fa id | ||
105 | and | ||
106 | .Fa name | ||
107 | are NUL-terminated UTF-8 strings. | ||
108 | The contents of | ||
109 | .Fa id | ||
110 | and | ||
111 | .Fa name | ||
112 | are copied, and no references to the passed pointers are kept. | ||
113 | .Pp | ||
114 | The | ||
115 | .Fn fido_cred_set_user | ||
116 | function sets the user attributes of | ||
117 | .Fa cred , | ||
118 | where | ||
119 | .Fa user_id | ||
120 | points to | ||
121 | .Fa user_id_len | ||
122 | bytes and | ||
123 | .Fa name , | ||
124 | .Fa display_name , | ||
125 | and | ||
126 | .Fa icon | ||
127 | are NUL-terminated UTF-8 strings. | ||
128 | The contents of | ||
129 | .Fa user_id , | ||
130 | .Fa name , | ||
131 | .Fa display_name , | ||
132 | and | ||
133 | .Fa icon | ||
134 | are copied, and no references to the passed pointers are kept. | ||
135 | Previously set user attributes are flushed. | ||
136 | The | ||
137 | .Fa user_id , | ||
138 | .Fa name , | ||
139 | .Fa display_name , | ||
140 | and | ||
141 | .Fa icon | ||
142 | parameters may be NULL. | ||
143 | .Pp | ||
144 | The | ||
145 | .Fn fido_cred_set_extensions | ||
146 | function sets the extensions of | ||
147 | .Fa cred | ||
148 | to the bitmask | ||
149 | .Fa flags . | ||
150 | At the moment, only the | ||
151 | .Dv FIDO_EXT_HMAC_SECRET | ||
152 | extension is supported. | ||
153 | If | ||
154 | .Fa flags | ||
155 | is zero, the extensions of | ||
156 | .Fa cred | ||
157 | are cleared. | ||
158 | .Pp | ||
159 | The | ||
160 | .Fn fido_cred_set_rk | ||
161 | and | ||
162 | .Fn fido_cred_set_uv | ||
163 | functions set the | ||
164 | .Em rk | ||
165 | (resident key) | ||
166 | and | ||
167 | .Em uv | ||
168 | (user verification) | ||
169 | attributes of | ||
170 | .Fa cred . | ||
171 | Both are | ||
172 | .Dv FIDO_OPT_OMIT | ||
173 | by default, allowing the authenticator to use its default settings. | ||
174 | .Pp | ||
175 | The | ||
176 | .Fn fido_cred_set_fmt | ||
177 | function sets the format of | ||
178 | .Fa cred | ||
179 | to | ||
180 | .Fa fmt , | ||
181 | where | ||
182 | .Fa fmt | ||
183 | must be either | ||
184 | .Vt "packed" | ||
185 | (the format used in FIDO 2) | ||
186 | or | ||
187 | .Vt "fido-u2f" | ||
188 | (the format used by U2F). | ||
189 | A copy of | ||
190 | .Fa fmt | ||
191 | is made, and no references to the passed pointer are kept. | ||
192 | Note that not all authenticators support FIDO2 and therefore may not | ||
193 | be able to generate | ||
194 | .Vt "packed" . | ||
195 | .Pp | ||
196 | The | ||
197 | .Fn fido_cred_set_type | ||
198 | function sets the type of | ||
199 | .Fa cred to | ||
200 | .Fa cose_alg , | ||
201 | where | ||
202 | .Fa cose_alg | ||
203 | is | ||
204 | .Dv COSE_ES256 , | ||
205 | .Dv COSE_RS256 , | ||
206 | or | ||
207 | .Dv COSE_EDDSA . | ||
208 | The type of a credential may only be set once. | ||
209 | Note that not all authenticators support COSE_RS256 or COSE_EDDSA. | ||
210 | .Pp | ||
211 | Use of the | ||
212 | .Nm | ||
213 | set of functions may happen in two distinct situations: | ||
214 | when generating a new credential on a FIDO device, prior to | ||
215 | .Xr fido_dev_make_cred 3 | ||
216 | (i.e, in the context of a FIDO client), or when validating | ||
217 | a generated credential using | ||
218 | .Xr fido_cred_verify 3 | ||
219 | (i.e, in the context of a FIDO server). | ||
220 | .Pp | ||
221 | For a complete description of the generation of a FIDO 2 credential | ||
222 | and its verification, please refer to the FIDO 2 specification. | ||
223 | A concrete utilisation example of the | ||
224 | .Nm | ||
225 | set of functions can be found in the | ||
226 | .Pa cred.c | ||
227 | example shipped with | ||
228 | .Em libfido2 . | ||
229 | .Sh RETURN VALUES | ||
230 | The error codes returned by the | ||
231 | .Nm | ||
232 | set of functions are defined in | ||
233 | .In fido/err.h . | ||
234 | On success, | ||
235 | .Dv FIDO_OK | ||
236 | is returned. | ||
237 | .Sh SEE ALSO | ||
238 | .Xr fido_cred_exclude 3 , | ||
239 | .Xr fido_cred_verify 3 , | ||
240 | .Xr fido_dev_make_cred 3 | ||
diff --git a/man/fido_cred_verify.3 b/man/fido_cred_verify.3 new file mode 100644 index 0000000..c75b9a1 --- /dev/null +++ b/man/fido_cred_verify.3 | |||
@@ -0,0 +1,64 @@ | |||
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 23 2018 $ | ||
6 | .Dt FIDO_CRED_VERIFY 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_cred_verify | ||
10 | .Nd verifies the signature of a FIDO 2 credential | ||
11 | .Sh SYNOPSIS | ||
12 | .In fido.h | ||
13 | .Ft int | ||
14 | .Fn fido_cred_verify "const fido_cred_t *cred" | ||
15 | .Sh DESCRIPTION | ||
16 | The | ||
17 | .Fn fido_cred_verify | ||
18 | function verifies whether the signature contained in | ||
19 | .Fa cred | ||
20 | matches the attributes of the credential. | ||
21 | Before using | ||
22 | .Fn fido_cred_verify | ||
23 | in a sensitive context, the reader is strongly encouraged to make | ||
24 | herself familiar with the FIDO 2 credential attestation process | ||
25 | as defined in the Web Authentication (webauthn) standard. | ||
26 | .Pp | ||
27 | A brief description follows: | ||
28 | .Pp | ||
29 | The | ||
30 | .Fn fido_cred_verify | ||
31 | function verifies whether the client data hash, relying party ID, | ||
32 | credential ID, type, and resident key and user verification | ||
33 | attributes of | ||
34 | .Fa cred | ||
35 | have been attested by the holder of the private counterpart of | ||
36 | the public key contained in the credential's x509 certificate. | ||
37 | .Pp | ||
38 | Please note that the x509 certificate itself is not verified. | ||
39 | .Pp | ||
40 | The attestation statement formats supported by | ||
41 | .Fn fido_cred_verify | ||
42 | are | ||
43 | .Em packed | ||
44 | and | ||
45 | .Em fido-u2f . | ||
46 | The attestation type implemented by | ||
47 | .Fn fido_cred_verify | ||
48 | is | ||
49 | .Em Basic Attestation . | ||
50 | The attestation key pair is assumed to be of the type ES256. | ||
51 | Other attestation formats and types are not supported. | ||
52 | .Sh RETURN VALUES | ||
53 | The error codes returned by | ||
54 | .Fn fido_cred_verify | ||
55 | are defined in | ||
56 | .In fido/err.h . | ||
57 | If | ||
58 | .Fa cred | ||
59 | passes verification, then | ||
60 | .Dv FIDO_OK | ||
61 | is returned. | ||
62 | .Sh SEE ALSO | ||
63 | .Xr fido_cred_new 3 , | ||
64 | .Xr fido_cred_set_authdata 3 | ||
diff --git a/man/fido_credman_metadata_new.3 b/man/fido_credman_metadata_new.3 new file mode 100644 index 0000000..16f0192 --- /dev/null +++ b/man/fido_credman_metadata_new.3 | |||
@@ -0,0 +1,299 @@ | |||
1 | .\" Copyright (c) 2019 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: June 28 2019 $ | ||
6 | .Dt FIDO_CREDMAN_METADATA_NEW 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_credman_metadata_new , | ||
10 | .Nm fido_credman_rk_new , | ||
11 | .Nm fido_credman_rp_new , | ||
12 | .Nm fido_credman_metadata_free , | ||
13 | .Nm fido_credman_rk_free , | ||
14 | .Nm fido_credman_rp_free , | ||
15 | .Nm fido_credman_rk_existing , | ||
16 | .Nm fido_credman_rk_remaining , | ||
17 | .Nm fido_credman_rk , | ||
18 | .Nm fido_credman_rk_count , | ||
19 | .Nm fido_credman_rp_id , | ||
20 | .Nm fido_credman_rp_name , | ||
21 | .Nm fido_credman_rp_count , | ||
22 | .Nm fido_credman_rp_id_hash_ptr , | ||
23 | .Nm fido_credman_rp_id_hash_len , | ||
24 | .Nm fido_credman_get_dev_metadata , | ||
25 | .Nm fido_credman_get_dev_rk , | ||
26 | .Nm fido_credman_del_dev_rk , | ||
27 | .Nm fido_credman_get_dev_rp | ||
28 | .Nd FIDO 2 credential management API | ||
29 | .Sh SYNOPSIS | ||
30 | .In fido.h | ||
31 | .In fido/credman.h | ||
32 | .Ft fido_credman_metadata_t * | ||
33 | .Fn fido_credman_metadata_new "void" | ||
34 | .Ft fido_credman_rk_t * | ||
35 | .Fn fido_credman_rk_new "void" | ||
36 | .Ft fido_credman_rp_t * | ||
37 | .Fn fido_credman_rp_new "void" | ||
38 | .Ft void | ||
39 | .Fn fido_credman_metadata_free "fido_credman_metadata_t **metadata_p" | ||
40 | .Ft void | ||
41 | .Fn fido_credman_rk_free "fido_credman_rk_t **rk_p" | ||
42 | .Ft void | ||
43 | .Fn fido_credman_rp_free "fido_credman_rp_t **rp_p" | ||
44 | .Ft uint64_t | ||
45 | .Fn fido_credman_rk_existing "const fido_credman_metadata_t *metadata" | ||
46 | .Ft uint64_t | ||
47 | .Fn fido_credman_rk_remaining "const fido_credman_metadata_t *metadata" | ||
48 | .Ft const fido_cred_t * | ||
49 | .Fn fido_credman_rk "const fido_credman_rk_t *rk" "size_t idx" | ||
50 | .Ft size_t | ||
51 | .Fn fido_credman_rk_count "const fido_credman_rk_t *rk" | ||
52 | .Ft const char * | ||
53 | .Fn fido_credman_rp_id "const fido_credman_rp_t *rp" "size_t idx" | ||
54 | .Ft const char * | ||
55 | .Fn fido_credman_rp_name "const fido_credman_rp_t *rp" "size_t idx" | ||
56 | .Ft size_t | ||
57 | .Fn fido_credman_rp_count "const fido_credman_rp_t *rp" | ||
58 | .Ft const unsigned char * | ||
59 | .Fn fido_credman_rp_id_hash_ptr "const fido_credman_rp_t *rp" "size_t idx" | ||
60 | .Ft size_t | ||
61 | .Fn fido_credman_rp_id_hash_len "const fido_credman_rp_t *" "size_t idx" | ||
62 | .Ft int | ||
63 | .Fn fido_credman_get_dev_metadata "fido_dev_t *dev" "fido_credman_metadata_t *metadata" "const char *pin" | ||
64 | .Ft int | ||
65 | .Fn fido_credman_get_dev_rk "fido_dev_t *dev" "const char *rp_id" "fido_credman_rk_t *rk" "const char *pin" | ||
66 | .Ft int | ||
67 | .Fn fido_credman_del_dev_rk "fido_dev_t *dev" const unsigned char *cred_id" "size_t cred_id_len" "const char *pin" | ||
68 | .Ft int | ||
69 | .Fn fido_credman_get_dev_rp "fido_dev_t *dev" "fido_credman_rp_t *rp" "const char *pin" | ||
70 | .Sh DESCRIPTION | ||
71 | The credential management API of | ||
72 | .Em libfido2 | ||
73 | allows resident credentials on a FIDO2 authenticator to be listed, | ||
74 | inspected, and removed. | ||
75 | Please note that not all authenticators support credential management. | ||
76 | To obtain information on what an authenticator supports, please | ||
77 | refer to | ||
78 | .Xr fido_cbor_info_new 3 . | ||
79 | .Pp | ||
80 | The | ||
81 | .Vt fido_credman_metadata_t | ||
82 | type abstracts credential management metadata. | ||
83 | .Pp | ||
84 | The | ||
85 | .Fn fido_credman_metadata_new | ||
86 | function returns a pointer to a newly allocated, empty | ||
87 | .Vt fido_credman_metadata_t | ||
88 | type. | ||
89 | If memory cannot be allocated, NULL is returned. | ||
90 | .Pp | ||
91 | The | ||
92 | .Fn fido_credman_metadata_free | ||
93 | function releases the memory backing | ||
94 | .Fa *metadata_p , | ||
95 | where | ||
96 | .Fa *metadata_p | ||
97 | must have been previously allocated by | ||
98 | .Fn fido_credman_metadata_new . | ||
99 | On return, | ||
100 | .Fa *metadata_p | ||
101 | is set to NULL. | ||
102 | Either | ||
103 | .Fa metadata_p | ||
104 | or | ||
105 | .Fa *metadata_p | ||
106 | may be NULL, in which case | ||
107 | .Fn fido_credman_metadata_free | ||
108 | is a NOP. | ||
109 | .Pp | ||
110 | The | ||
111 | .Fn fido_credman_get_dev_metadata | ||
112 | function populates | ||
113 | .Fa metadata | ||
114 | with information retrieved from | ||
115 | .Fa dev . | ||
116 | A valid | ||
117 | .Fa pin | ||
118 | must be provided. | ||
119 | .Pp | ||
120 | The | ||
121 | .Fn fido_credman_rk_existing | ||
122 | function inspects | ||
123 | .Fa metadata | ||
124 | and returns the number of resident credentials on the | ||
125 | authenticator. | ||
126 | The | ||
127 | .Fn fido_credman_rk_remaining | ||
128 | function inspects | ||
129 | .Fa metadata | ||
130 | and returns the estimated number of resident credentials that can | ||
131 | be created on the authenticator. | ||
132 | .Pp | ||
133 | The | ||
134 | .Vt fido_credman_rk_t | ||
135 | type abstracts the set of resident credentials belonging to a | ||
136 | given relying party. | ||
137 | .Pp | ||
138 | The | ||
139 | .Fn fido_credman_rk_new | ||
140 | function returns a pointer to a newly allocated, empty | ||
141 | .Vt fido_credman_rk_t | ||
142 | type. | ||
143 | If memory cannot be allocated, NULL is returned. | ||
144 | .Pp | ||
145 | The | ||
146 | .Fn fido_credman_rk_free | ||
147 | function releases the memory backing | ||
148 | .Fa *rk_p , | ||
149 | where | ||
150 | .Fa *rk_p | ||
151 | must have been previously allocated by | ||
152 | .Fn fido_credman_rk_new . | ||
153 | On return, | ||
154 | .Fa *rk_p | ||
155 | is set to NULL. | ||
156 | Either | ||
157 | .Fa rk_p | ||
158 | or | ||
159 | .Fa *rk_p | ||
160 | may be NULL, in which case | ||
161 | .Fn fido_credman_rk_free | ||
162 | is a NOP. | ||
163 | .Pp | ||
164 | The | ||
165 | .Fn fido_credman_get_dev_rk | ||
166 | function populates | ||
167 | .Fa rk | ||
168 | with the set of resident credentials belonging to | ||
169 | .Fa rp_id | ||
170 | in | ||
171 | .Fa dev . | ||
172 | A valid | ||
173 | .Fa pin | ||
174 | must be provided. | ||
175 | .Pp | ||
176 | The | ||
177 | .Fn fido_credman_rk_count | ||
178 | function returns the number of resident credentials in | ||
179 | .Fa rk . | ||
180 | The | ||
181 | .Fn fido_credman_rk | ||
182 | function returns a pointer to the credential at index | ||
183 | .Fa idx | ||
184 | in | ||
185 | .Fa rk . | ||
186 | Please note that the first credential in | ||
187 | .Fa rk | ||
188 | has an | ||
189 | .Fa idx | ||
190 | (index) value of 0. | ||
191 | .Pp | ||
192 | The | ||
193 | .Fn fido_credman_del_dev_rk | ||
194 | function deletes the resident credential identified by | ||
195 | .Fa cred_id | ||
196 | from | ||
197 | .Fa dev , | ||
198 | where | ||
199 | .Fa cred_id | ||
200 | points to | ||
201 | .Fa cred_id_len | ||
202 | bytes. | ||
203 | A valid | ||
204 | .Fa pin | ||
205 | must be provided. | ||
206 | .Pp | ||
207 | The | ||
208 | .Vt fido_credman_rp_t | ||
209 | type abstracts information about a relying party. | ||
210 | .Pp | ||
211 | The | ||
212 | .Fn fido_credman_rp_new | ||
213 | function returns a pointer to a newly allocated, empty | ||
214 | .Vt fido_credman_rp_t | ||
215 | type. | ||
216 | If memory cannot be allocated, NULL is returned. | ||
217 | .Pp | ||
218 | The | ||
219 | .Fn fido_credman_rp_free | ||
220 | function releases the memory backing | ||
221 | .Fa *rp_p , | ||
222 | where | ||
223 | .Fa *rp_p | ||
224 | must have been previously allocated by | ||
225 | .Fn fido_credman_rp_new . | ||
226 | On return, | ||
227 | .Fa *rp_p | ||
228 | is set to NULL. | ||
229 | Either | ||
230 | .Fa rp_p | ||
231 | or | ||
232 | .Fa *rp_p | ||
233 | may be NULL, in which case | ||
234 | .Fn fido_credman_rp_free | ||
235 | is a NOP. | ||
236 | .Pp | ||
237 | The | ||
238 | .Fn fido_credman_get_dev_rp | ||
239 | function populates | ||
240 | .Fa rp | ||
241 | with information about relying parties with resident credentials | ||
242 | in | ||
243 | .Fa dev . | ||
244 | A valid | ||
245 | .Fa pin | ||
246 | must be provided. | ||
247 | .Pp | ||
248 | The | ||
249 | .Fn fido_credman_rp_count | ||
250 | function returns the number of relying parties in | ||
251 | .Fa rp . | ||
252 | .Pp | ||
253 | The | ||
254 | .Fn fido_credman_rp_id | ||
255 | and | ||
256 | .Fn fido_credman_rp_name | ||
257 | functions return pointers to the id and name of relying party | ||
258 | .Fa idx | ||
259 | in | ||
260 | .Fa rp . | ||
261 | If not NULL, the values returned by these functions point to | ||
262 | NUL-terminated UTF-8 strings. | ||
263 | Please note that the first relying party in | ||
264 | .Fa rp | ||
265 | has an | ||
266 | .Fa idx | ||
267 | (index) value of 0. | ||
268 | .Pp | ||
269 | The | ||
270 | .Fn fido_credman_rp_id_hash_ptr | ||
271 | function returns a pointer to the hashed id of relying party | ||
272 | .Fa idx | ||
273 | in | ||
274 | .Fa rp . | ||
275 | The corresponding length can be obtained by | ||
276 | .Fn fido_credman_rp_id_hash_len . | ||
277 | Please note that the first relying party in | ||
278 | .Fa rp | ||
279 | has an | ||
280 | .Fa idx | ||
281 | (index) value of 0. | ||
282 | .Sh RETURN VALUES | ||
283 | The | ||
284 | .Fn fido_credman_get_dev_metadata , | ||
285 | .Fn fido_credman_get_dev_rk , | ||
286 | .Fn fido_credman_del_dev_rk , | ||
287 | and | ||
288 | .Fn fido_credman_get_dev_rp | ||
289 | functions return | ||
290 | .Dv FIDO_OK | ||
291 | on success. | ||
292 | On error, a different error code defined in | ||
293 | .In fido/err.h | ||
294 | is returned. | ||
295 | Functions returning pointers are not guaranteed to succeed, and | ||
296 | should have their return values checked for NULL. | ||
297 | .Sh SEE ALSO | ||
298 | .Xr fido_cbor_info_new 3 , | ||
299 | .Xr fido_cred_new 3 | ||
diff --git a/man/fido_dev_get_assert.3 b/man/fido_dev_get_assert.3 new file mode 100644 index 0000000..2e33fc5 --- /dev/null +++ b/man/fido_dev_get_assert.3 | |||
@@ -0,0 +1,76 @@ | |||
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 24 2018 $ | ||
6 | .Dt FIDO_DEV_GET_ASSERT 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_dev_get_assert | ||
10 | .Nd obtains an assertion from a FIDO device | ||
11 | .Sh SYNOPSIS | ||
12 | .In fido.h | ||
13 | .Ft int | ||
14 | .Fn fido_dev_get_assert "fido_dev_t *dev" " fido_assert_t *assert" "const char *pin" | ||
15 | .Sh DESCRIPTION | ||
16 | The | ||
17 | .Fn fido_dev_get_assert | ||
18 | function asks the FIDO device represented by | ||
19 | .Fa dev | ||
20 | for an assertion according to the following parameters defined in | ||
21 | .Fa assert : | ||
22 | .Pp | ||
23 | .Bl -dash -compact | ||
24 | .It | ||
25 | .Nm relying party ID ; | ||
26 | .It | ||
27 | .Nm client data hash ; | ||
28 | .It | ||
29 | .Nm list of allowed credential IDs ; | ||
30 | .It | ||
31 | .Nm user presence and user verification attributes . | ||
32 | .El | ||
33 | .Pp | ||
34 | See | ||
35 | .Xr fido_assert_set_authdata 3 | ||
36 | for information on how these values are set. | ||
37 | .Pp | ||
38 | If a PIN is not needed to authenticate the request against | ||
39 | .Fa dev , | ||
40 | then | ||
41 | .Fa pin | ||
42 | may be NULL. | ||
43 | Otherwise | ||
44 | .Fa pin | ||
45 | must point to a NUL-terminated UTF-8 string. | ||
46 | .Pp | ||
47 | After a successful call to | ||
48 | .Fn fido_dev_get_assert , | ||
49 | the | ||
50 | .Xr fido_assert_count 3 , | ||
51 | .Xr fido_assert_user_display_name 3 , | ||
52 | .Xr fido_assert_user_icon 3 , | ||
53 | .Xr fido_assert_user_name 3 , | ||
54 | .Xr fido_assert_authdata_ptr 3 , | ||
55 | .Xr fido_assert_user_id_ptr 3 , | ||
56 | .Xr fido_assert_sig_ptr 3 , | ||
57 | and | ||
58 | .Xr fido_assert_sigcount 3 | ||
59 | functions may be invoked on | ||
60 | .Fa assert | ||
61 | to retrieve the various attributes of the generated assertion. | ||
62 | .Pp | ||
63 | Please note that | ||
64 | .Fn fido_dev_get_assert | ||
65 | is synchronous and will block if necessary. | ||
66 | .Sh RETURN VALUES | ||
67 | The error codes returned by | ||
68 | .Fn fido_dev_get_assert | ||
69 | are defined in | ||
70 | .In fido/err.h . | ||
71 | On success, | ||
72 | .Dv FIDO_OK | ||
73 | is returned. | ||
74 | .Sh SEE ALSO | ||
75 | .Xr fido_assert_new 3 , | ||
76 | .Xr fido_assert_set_authdata 3 | ||
diff --git a/man/fido_dev_info_manifest.3 b/man/fido_dev_info_manifest.3 new file mode 100644 index 0000000..22519e2 --- /dev/null +++ b/man/fido_dev_info_manifest.3 | |||
@@ -0,0 +1,143 @@ | |||
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_INFO_MANIFEST 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_dev_info_manifest , | ||
10 | .Nm fido_dev_info_new , | ||
11 | .Nm fido_dev_info_free , | ||
12 | .Nm fido_dev_info_ptr , | ||
13 | .Nm fido_dev_info_path , | ||
14 | .Nm fido_dev_info_product , | ||
15 | .Nm fido_dev_info_vendor , | ||
16 | .Nm fido_dev_info_manufacturer_string , | ||
17 | .Nm fido_dev_info_product_string | ||
18 | .Nd FIDO 2 device discovery functions | ||
19 | .Sh SYNOPSIS | ||
20 | .In fido.h | ||
21 | .Ft int | ||
22 | .Fn fido_dev_info_manifest "fido_dev_info_t *devlist" "size_t ilen" "size_t *olen" | ||
23 | .Ft fido_dev_info_t * | ||
24 | .Fn fido_dev_info_new "size_t n" | ||
25 | .Ft void | ||
26 | .Fn fido_dev_info_free "fido_dev_info_t **devlist_p" "size_t n" | ||
27 | .Ft const fido_dev_info_t * | ||
28 | .Fn fido_dev_info_ptr "const fido_dev_info_t *devlist" "size_t i" | ||
29 | .Ft const char * | ||
30 | .Fn fido_dev_info_path "const fido_dev_info_t *di" | ||
31 | .Ft int16_t | ||
32 | .Fn fido_dev_info_product "const fido_dev_info_t *di" | ||
33 | .Ft int16_t | ||
34 | .Fn fido_dev_info_vendor "const fido_dev_info_t *di" | ||
35 | .Ft const char * | ||
36 | .Fn fido_dev_info_manufacturer_string "const fido_dev_info_t *di" | ||
37 | .Ft const char * | ||
38 | .Fn fido_dev_info_product_string "const fido_dev_info_t *di" | ||
39 | .Sh DESCRIPTION | ||
40 | The | ||
41 | .Fn fido_dev_info_manifest | ||
42 | function fills | ||
43 | .Fa devlist | ||
44 | with up to | ||
45 | .Fa ilen | ||
46 | FIDO devices found by the underlying operating system. | ||
47 | Currently only USB HID devices are supported. | ||
48 | The number of discovered devices is returned in | ||
49 | .Fa olen , | ||
50 | where | ||
51 | .Fa olen | ||
52 | is an addressable pointer. | ||
53 | .Pp | ||
54 | The | ||
55 | .Fn fido_dev_info_new | ||
56 | function returns a pointer to a newly allocated, empty device list | ||
57 | with | ||
58 | .Fa n | ||
59 | available slots. | ||
60 | If memory is not available, NULL is returned. | ||
61 | .Pp | ||
62 | The | ||
63 | .Fn fido_dev_info_free | ||
64 | function releases the memory backing | ||
65 | .Fa *devlist_p , | ||
66 | where | ||
67 | .Fa *devlist_p | ||
68 | must have been previously allocated by | ||
69 | .Fn fido_dev_info_new . | ||
70 | The number | ||
71 | .Fa n | ||
72 | of allocated slots must also be provided. | ||
73 | On return, | ||
74 | .Fa *devlist_p | ||
75 | is set to NULL. | ||
76 | Either | ||
77 | .Fa devlist_p | ||
78 | or | ||
79 | .Fa *devlist_p | ||
80 | may be NULL, in which case | ||
81 | .Fn fido_dev_info_free | ||
82 | is a NOP. | ||
83 | .Pp | ||
84 | The | ||
85 | .Fn fido_dev_info_ptr | ||
86 | function returns a pointer to slot number | ||
87 | .Fa i | ||
88 | of | ||
89 | .Fa devlist . | ||
90 | It is the caller's responsibility to ensure that | ||
91 | .Fa i | ||
92 | is bounded. | ||
93 | Please note that the first slot has index 0. | ||
94 | .Pp | ||
95 | The | ||
96 | .Fn fido_dev_info_path | ||
97 | returns the filesystem path or subsystem-specific identification | ||
98 | string of | ||
99 | .Fa di . | ||
100 | .Pp | ||
101 | The | ||
102 | .Fn fido_dev_info_product | ||
103 | function returns the product ID of | ||
104 | .Fa di . | ||
105 | .Pp | ||
106 | The | ||
107 | .Fn fido_dev_info_vendor | ||
108 | function returns the vendor ID of | ||
109 | .Fa di . | ||
110 | .Pp | ||
111 | The | ||
112 | .Fn fido_dev_info_manufacturer_string | ||
113 | function returns the manufacturer string of | ||
114 | .Fa di . | ||
115 | .Pp | ||
116 | The | ||
117 | .Fn fido_dev_info_product_string | ||
118 | function returns the product string of | ||
119 | .Fa di . | ||
120 | .Pp | ||
121 | An example of how to use the functions described in this document | ||
122 | can be found in the | ||
123 | .Pa examples/manifest.c | ||
124 | file shipped with | ||
125 | .Em libfido2 . | ||
126 | .Sh RETURN VALUES | ||
127 | The | ||
128 | .Fn fido_dev_info_manifest | ||
129 | function always returns | ||
130 | .Dv FIDO_OK . | ||
131 | If a discovery error occurs, the | ||
132 | .Fa olen | ||
133 | pointer is set to 0. | ||
134 | .Pp | ||
135 | The pointers returned by | ||
136 | .Fn fido_dev_info_ptr , | ||
137 | .Fn fido_dev_info_path , | ||
138 | .Fn fido_dev_info_manufacturer_string , | ||
139 | and | ||
140 | .Fn fido_dev_info_product_string | ||
141 | are guaranteed to exist until | ||
142 | .Fn fido_dev_info_free | ||
143 | is called on the corresponding device list. | ||
diff --git a/man/fido_dev_make_cred.3 b/man/fido_dev_make_cred.3 new file mode 100644 index 0000000..ccaf788 --- /dev/null +++ b/man/fido_dev_make_cred.3 | |||
@@ -0,0 +1,77 @@ | |||
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 23 2018 $ | ||
6 | .Dt FIDO_DEV_MAKE_CRED 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_dev_make_cred | ||
10 | .Nd generates a new credential on a FIDO device | ||
11 | .Sh SYNOPSIS | ||
12 | .In fido.h | ||
13 | .Ft int | ||
14 | .Fn fido_dev_make_cred "fido_dev_t *dev" " fido_cred_t *cred" "const char *pin" | ||
15 | .Sh DESCRIPTION | ||
16 | The | ||
17 | .Fn fido_dev_make_cred | ||
18 | function asks the FIDO device represented by | ||
19 | .Fa dev | ||
20 | to generate a new credential according to the following parameters | ||
21 | defined in | ||
22 | .Fa cred : | ||
23 | .Pp | ||
24 | .Bl -dash -compact | ||
25 | .It | ||
26 | .Nm type ; | ||
27 | .It | ||
28 | .Nm client data hash ; | ||
29 | .It | ||
30 | .Nm relying party ; | ||
31 | .It | ||
32 | .Nm user attributes ; | ||
33 | .It | ||
34 | .Nm list of excluded credential IDs ; | ||
35 | .It | ||
36 | .Nm resident key and user verification attributes . | ||
37 | .El | ||
38 | .Pp | ||
39 | See | ||
40 | .Xr fido_cred_set_authdata 3 | ||
41 | for information on how these values are set. | ||
42 | .Pp | ||
43 | If a PIN is not needed to authenticate the request against | ||
44 | .Fa dev , | ||
45 | then | ||
46 | .Fa pin | ||
47 | may be NULL. | ||
48 | Otherwise | ||
49 | .Fa pin | ||
50 | must point to a NUL-terminated UTF-8 string. | ||
51 | .Pp | ||
52 | After a successful call to | ||
53 | .Fn fido_dev_make_cred , | ||
54 | the | ||
55 | .Xr fido_cred_authdata_ptr 3 , | ||
56 | .Xr fido_cred_pubkey_ptr 3 , | ||
57 | .Xr fido_cred_x5c_ptr 3 , | ||
58 | and | ||
59 | .Xr fido_cred_sig_ptr 3 | ||
60 | functions may be invoked on | ||
61 | .Fa cred | ||
62 | to retrieve the various parts of the generated credential. | ||
63 | .Pp | ||
64 | Please note that | ||
65 | .Fn fido_dev_make_cred | ||
66 | is synchronous and will block if necessary. | ||
67 | .Sh RETURN VALUES | ||
68 | The error codes returned by | ||
69 | .Fn fido_dev_make_cred | ||
70 | are defined in | ||
71 | .In fido/err.h . | ||
72 | On success, | ||
73 | .Dv FIDO_OK | ||
74 | is returned. | ||
75 | .Sh SEE ALSO | ||
76 | .Xr fido_cred_new 3 , | ||
77 | .Xr fido_cred_set_authdata 3 | ||
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 | ||
diff --git a/man/fido_dev_set_io_functions.3 b/man/fido_dev_set_io_functions.3 new file mode 100644 index 0000000..adc4a9e --- /dev/null +++ b/man/fido_dev_set_io_functions.3 | |||
@@ -0,0 +1,95 @@ | |||
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_IO_FUNCTIONS 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_dev_set_io_functions | ||
10 | .Nd FIDO 2 device I/O interface | ||
11 | .Sh SYNOPSIS | ||
12 | .In fido.h | ||
13 | .Bd -literal | ||
14 | typedef void *fido_dev_io_open_t(const char *); | ||
15 | typedef void fido_dev_io_close_t(void *); | ||
16 | typedef int fido_dev_io_read_t(void *, unsigned char *, size_t, int); | ||
17 | typedef int fido_dev_io_write_t(void *, const unsigned char *, size_t); | ||
18 | |||
19 | typedef struct fido_dev_io { | ||
20 | fido_dev_io_open_t *open; | ||
21 | fido_dev_io_close_t *close; | ||
22 | fido_dev_io_read_t *read; | ||
23 | fido_dev_io_write_t *write; | ||
24 | } fido_dev_io_t; | ||
25 | .Ed | ||
26 | .Ft int | ||
27 | .Fn fido_dev_set_io_functions "fido_dev_t *dev" "const fido_dev_io_t *io" | ||
28 | .Sh DESCRIPTION | ||
29 | The | ||
30 | .Nm | ||
31 | interface defines the I/O handlers used to talk to | ||
32 | .Fa dev . | ||
33 | Its usage is optional. | ||
34 | By default, | ||
35 | .Em libfido2 | ||
36 | will use the operating system's native HID interface to talk to | ||
37 | a FIDO device. | ||
38 | .Pp | ||
39 | A | ||
40 | .Vt fido_dev_io_open_t | ||
41 | function is expected to return a non-NULL opaque pointer on success, | ||
42 | and NULL on error. | ||
43 | The returned opaque pointer is never dereferenced by | ||
44 | .Em libfido2 . | ||
45 | .Pp | ||
46 | A | ||
47 | .Vt fido_dev_io_close_t | ||
48 | function receives the opaque handle obtained from | ||
49 | .Vt fido_dev_io_open_t . | ||
50 | It is not expected to be idempotent. | ||
51 | .Pp | ||
52 | A | ||
53 | .Vt fido_dev_io_read_t | ||
54 | function reads from | ||
55 | .Fa dev . | ||
56 | The first parameter taken is the opaque handle obtained from | ||
57 | .Vt fido_dev_io_open_t . | ||
58 | The read buffer is pointed to by the second parameter, and the | ||
59 | third parameter holds its size. | ||
60 | Finally, the last argument passed to | ||
61 | .Vt fido_dev_io_read_t | ||
62 | is the number of milliseconds the caller is willing to sleep, | ||
63 | should the call need to block. | ||
64 | If this value holds -1, | ||
65 | .Vt fido_dev_io_read_t | ||
66 | may block indefinitely. | ||
67 | The number of bytes read is returned. | ||
68 | On error, -1 is returned. | ||
69 | .Pp | ||
70 | Conversely, a | ||
71 | .Vt fido_dev_io_write_t | ||
72 | function writes to | ||
73 | .Fa dev . | ||
74 | The first parameter taken is the opaque handle returned by | ||
75 | .Vt fido_dev_io_open_t . | ||
76 | The write buffer is pointed to by the second parameter, and the | ||
77 | third parameter holds its size. | ||
78 | A | ||
79 | .Vt fido_dev_io_write_t | ||
80 | function may block. | ||
81 | The number of bytes written is returned. | ||
82 | On error, -1 is returned. | ||
83 | .Pp | ||
84 | No references to | ||
85 | .Fa io | ||
86 | are held by | ||
87 | .Fn fido_dev_set_io_functions . | ||
88 | .Sh RETURN VALUES | ||
89 | On success, | ||
90 | .Fn fido_dev_set_io_functions | ||
91 | returns | ||
92 | .Dv FIDO_OK . | ||
93 | On error, a different error code defined in | ||
94 | .In fido/err.h | ||
95 | is returned. | ||
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 | ||
22 | The | ||
23 | .Fn fido_dev_set_pin | ||
24 | function sets the PIN of device | ||
25 | .Fa dev | ||
26 | to | ||
27 | .Fa pin , | ||
28 | where | ||
29 | .Fa pin | ||
30 | is a NUL-terminated UTF-8 string. | ||
31 | If | ||
32 | .Fa oldpin | ||
33 | is not NULL, the device's PIN is changed from | ||
34 | .Fa oldpin | ||
35 | to | ||
36 | .Fa pin , | ||
37 | where | ||
38 | .Fa pin | ||
39 | and | ||
40 | .Fa oldpin | ||
41 | are NUL-terminated UTF-8 strings. | ||
42 | .Pp | ||
43 | The | ||
44 | .Fn fido_dev_get_retry_count | ||
45 | function fills | ||
46 | .Fa retries | ||
47 | with the number of PIN retries left in | ||
48 | .Fa dev | ||
49 | before lock-out, where | ||
50 | .Fa retries | ||
51 | is an addressable pointer. | ||
52 | .Pp | ||
53 | The | ||
54 | .Fn fido_dev_reset | ||
55 | function performs a reset on | ||
56 | .Fa dev , | ||
57 | resetting the device's PIN and erasing credentials stored on the | ||
58 | device. | ||
59 | .Pp | ||
60 | Please note that | ||
61 | .Fn fido_dev_set_pin , | ||
62 | .Fn fido_dev_get_retry_count , | ||
63 | and | ||
64 | .Fn fido_dev_reset | ||
65 | are synchronous and will block if necessary. | ||
66 | .Sh RETURN VALUES | ||
67 | The error codes returned by | ||
68 | .Fn fido_dev_set_pin , | ||
69 | .Fn fido_dev_get_retry_count , | ||
70 | and | ||
71 | .Fn fido_dev_reset | ||
72 | are defined in | ||
73 | .In fido/err.h . | ||
74 | On success, | ||
75 | .Dv FIDO_OK | ||
76 | is returned. | ||
77 | .Sh CAVEATS | ||
78 | Regarding | ||
79 | .Fn fido_dev_reset , | ||
80 | the actual user-flow to perform a reset is outside the scope of the | ||
81 | FIDO2 specification, and may therefore vary depending on the | ||
82 | authenticator. | ||
83 | Yubico authenticators will return | ||
84 | .Dv FIDO_ERR_NOT_ALLOWED | ||
85 | if a reset is issued later than 5 seconds after power-up, and | ||
86 | .Dv FIDO_ERR_ACTION_TIMEOUT | ||
87 | if the user fails to confirm the reset by touching the key | ||
88 | within 30 seconds. | ||
diff --git a/man/fido_init.3 b/man/fido_init.3 new file mode 100644 index 0000000..7f38948 --- /dev/null +++ b/man/fido_init.3 | |||
@@ -0,0 +1,40 @@ | |||
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_INIT 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_init | ||
10 | .Nd initialise the FIDO 2 library | ||
11 | .Sh SYNOPSIS | ||
12 | .In fido.h | ||
13 | .Ft void | ||
14 | .Fn fido_init "int flags" | ||
15 | .Sh DESCRIPTION | ||
16 | The | ||
17 | .Fn fido_init | ||
18 | function initialises the | ||
19 | .Em libfido2 | ||
20 | library. | ||
21 | Its invocation must precede that of any other | ||
22 | .Em libfido2 | ||
23 | function. | ||
24 | If | ||
25 | .Dv FIDO_DEBUG | ||
26 | is set in | ||
27 | .Fa flags , | ||
28 | then | ||
29 | debug output will be emitted by | ||
30 | .Em libfido2 | ||
31 | on | ||
32 | .Em stderr . | ||
33 | Alternatively, the | ||
34 | .Ev FIDO_DEBUG | ||
35 | environment variable may be set. | ||
36 | .Sh SEE ALSO | ||
37 | .Xr fido_assert_new 3 , | ||
38 | .Xr fido_cred_new 3 , | ||
39 | .Xr fido_dev_info_manifest 3 , | ||
40 | .Xr fido_dev_open 3 | ||
diff --git a/man/fido_strerr.3 b/man/fido_strerr.3 new file mode 100644 index 0000000..05c86b9 --- /dev/null +++ b/man/fido_strerr.3 | |||
@@ -0,0 +1,27 @@ | |||
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_STRERR 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_strerr | ||
10 | .Nd FIDO 2 error codes | ||
11 | .Sh SYNOPSIS | ||
12 | .In fido.h | ||
13 | .Ft const char * | ||
14 | .Fn fido_strerr "int n" | ||
15 | .Sh DESCRIPTION | ||
16 | The | ||
17 | .Fn fido_strerr | ||
18 | function translates the error code | ||
19 | .Fa n | ||
20 | into a readable string, | ||
21 | where | ||
22 | .Fa n | ||
23 | is an error code defined in | ||
24 | .In fido/err.h . | ||
25 | .Fn fido_strerr | ||
26 | never returns NULL. | ||
27 | Returned pointers point to static strings. | ||
diff --git a/man/rs256_pk_new.3 b/man/rs256_pk_new.3 new file mode 100644 index 0000000..4ad0ebe --- /dev/null +++ b/man/rs256_pk_new.3 | |||
@@ -0,0 +1,122 @@ | |||
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 24 2018 $ | ||
6 | .Dt RS256_PK_NEW 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm rs256_pk_new , | ||
10 | .Nm rs256_pk_free , | ||
11 | .Nm rs256_pk_from_RSA , | ||
12 | .Nm rs256_pk_from_ptr , | ||
13 | .Nm rs256_pk_to_EVP_PKEY | ||
14 | .Nd FIDO 2 COSE RS256 API | ||
15 | .Sh SYNOPSIS | ||
16 | .In openssl/rsa.h | ||
17 | .In fido/rs256.h | ||
18 | .Ft rs256_pk_t * | ||
19 | .Fn rs256_pk_new "void" | ||
20 | .Ft void | ||
21 | .Fn rs256_pk_free "rs256_pk_t **pkp" | ||
22 | .Ft int | ||
23 | .Fn rs256_pk_from_RSA "rs256_pk_t *pk" "const RSA *rsa" | ||
24 | .Ft int | ||
25 | .Fn rs256_pk_from_ptr "rs256_pk_t *pk" "const void *ptr" "size_t len" | ||
26 | .Ft EVP_PKEY * | ||
27 | .Fn rs256_pk_to_EVP_PKEY "const rs256_pk_t *pk" | ||
28 | .Sh DESCRIPTION | ||
29 | RS256 is the name given in the CBOR Object Signing and Encryption | ||
30 | (COSE) RFC to PKCS#1.5 2048-bit RSA with SHA-256. | ||
31 | The COSE RS256 API of | ||
32 | .Em libfido2 | ||
33 | is an auxiliary API with routines to convert between the different | ||
34 | RSA public key types used in | ||
35 | .Em libfido2 | ||
36 | and | ||
37 | .Em OpenSSL . | ||
38 | .Pp | ||
39 | In | ||
40 | .Em libfido2 , | ||
41 | RS256 public keys are abstracted by the | ||
42 | .Vt rs256_pk_t | ||
43 | type. | ||
44 | .Pp | ||
45 | The | ||
46 | .Fn rs256_pk_new | ||
47 | function returns a pointer to a newly allocated, empty | ||
48 | .Vt rs256_pk_t | ||
49 | type. | ||
50 | If memory cannot be allocated, NULL is returned. | ||
51 | .Pp | ||
52 | The | ||
53 | .Fn rs256_pk_free | ||
54 | function releases the memory backing | ||
55 | .Fa *pkp , | ||
56 | where | ||
57 | .Fa *pkp | ||
58 | must have been previously allocated by | ||
59 | .Fn rs256_pk_new . | ||
60 | On return, | ||
61 | .Fa *pkp | ||
62 | is set to NULL. | ||
63 | Either | ||
64 | .Fa pkp | ||
65 | or | ||
66 | .Fa *pkp | ||
67 | may be NULL, in which case | ||
68 | .Fn rs256_pk_free | ||
69 | is a NOP. | ||
70 | .Pp | ||
71 | The | ||
72 | .Fn rs256_pk_from_RSA | ||
73 | function fills | ||
74 | .Fa pk | ||
75 | with the contents of | ||
76 | .Fa rsa . | ||
77 | No references to | ||
78 | .Fa rsa | ||
79 | are kept. | ||
80 | .Pp | ||
81 | The | ||
82 | .Fn rs256_pk_from_ptr | ||
83 | function fills | ||
84 | .Fa pk | ||
85 | with the contents of | ||
86 | .Fa ptr , | ||
87 | where | ||
88 | .Fa ptr | ||
89 | points to | ||
90 | .Fa len | ||
91 | bytes. | ||
92 | No references to | ||
93 | .Fa ptr | ||
94 | are kept. | ||
95 | .Pp | ||
96 | The | ||
97 | .Fn rs256_pk_to_EVP_PKEY | ||
98 | function converts | ||
99 | .Fa pk | ||
100 | to a newly allocated | ||
101 | .Fa EVP_PKEY | ||
102 | type with a reference count of 1. | ||
103 | No internal references to the returned pointer are kept. | ||
104 | If an error occurs, | ||
105 | .Fn rs256_pk_to_EVP_PKEY | ||
106 | returns NULL. | ||
107 | .Sh RETURN VALUES | ||
108 | The | ||
109 | .Fn rs256_pk_from_RSA | ||
110 | and | ||
111 | .Fn rs256_pk_from_ptr | ||
112 | functions return | ||
113 | .Dv FIDO_OK | ||
114 | on success. | ||
115 | On error, a different error code defined in | ||
116 | .In fido/err.h | ||
117 | is returned. | ||
118 | .Sh SEE ALSO | ||
119 | .Xr eddsa_pk_new 3 , | ||
120 | .Xr es256_pk_new 3 , | ||
121 | .Xr fido_assert_verify 3 , | ||
122 | .Xr fido_cred_pubkey_ptr 3 | ||
diff --git a/man/style.css b/man/style.css new file mode 100644 index 0000000..8c223fa --- /dev/null +++ b/man/style.css | |||
@@ -0,0 +1,24 @@ | |||
1 | * { margin: 0; padding: 0; } | ||
2 | |||
3 | body { | ||
4 | font-family: monospace; | ||
5 | font-size: 1em; | ||
6 | margin: 2% auto; | ||
7 | max-width: 54em; | ||
8 | } | ||
9 | |||
10 | ul { margin-left: 1em; } | ||
11 | a { color: #009900; } | ||
12 | .Sh { font-size: 1em; padding-top: 1em; padding-bottom: 1em; } | ||
13 | .foot { padding-top: 1em; } | ||
14 | |||
15 | table.head, table.foot { width: 100%; } | ||
16 | td.head-rtitle, td.foot-os { text-align: right; } | ||
17 | td.head-vol { text-align: center; } | ||
18 | div.Pp { margin: 1ex 0ex; } | ||
19 | div.Nd, div.Bf, div.Op { display: inline; } | ||
20 | span.Pa, span.Ad { font-style: italic; } | ||
21 | span.Ms { font-weight: bold; } | ||
22 | dl.Bl-diag > dt { font-weight: bold; } | ||
23 | code.Nm, code.Fl, code.Cm, code.Ic, code.In, code.Fd, code.Fn, | ||
24 | code.Cd { font-weight: bold; font-family: inherit; } | ||