]>
Commit | Line | Data |
---|---|---|
3a6ce677 BR |
1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
2 | #pragma once | |
3 | ||
4 | #include <sys/types.h> | |
5 | ||
6 | #include "cryptsetup-util.h" | |
8b3d4ff0 | 7 | #include "libfido2-util.h" |
3a6ce677 BR |
8 | #include "log.h" |
9 | #include "time-util.h" | |
10 | ||
11 | #if HAVE_LIBFIDO2 | |
12 | ||
13 | int acquire_fido2_key( | |
14 | const char *volume_name, | |
15 | const char *friendly_name, | |
16 | const char *device, | |
17 | const char *rp_id, | |
18 | const void *cid, | |
19 | size_t cid_size, | |
20 | const char *key_file, | |
21 | size_t key_file_size, | |
22 | uint64_t key_file_offset, | |
23 | const void *key_data, | |
24 | size_t key_data_size, | |
25 | usec_t until, | |
8b3d4ff0 MB |
26 | bool headless, |
27 | Fido2EnrollFlags required, | |
3a6ce677 | 28 | void **ret_decrypted_key, |
8b3d4ff0 MB |
29 | size_t *ret_decrypted_key_size, |
30 | AskPasswordFlags ask_password_flags); | |
3a6ce677 BR |
31 | |
32 | int find_fido2_auto_data( | |
33 | struct crypt_device *cd, | |
34 | char **ret_rp_id, | |
35 | void **ret_salt, | |
36 | size_t *ret_salt_size, | |
37 | void **ret_cid, | |
38 | size_t *ret_cid_size, | |
8b3d4ff0 MB |
39 | int *ret_keyslot, |
40 | Fido2EnrollFlags *ret_required); | |
3a6ce677 BR |
41 | |
42 | #else | |
43 | ||
44 | static inline int acquire_fido2_key( | |
45 | const char *volume_name, | |
46 | const char *friendly_name, | |
47 | const char *device, | |
48 | const char *rp_id, | |
49 | const void *cid, | |
50 | size_t cid_size, | |
51 | const char *key_file, | |
52 | size_t key_file_size, | |
53 | uint64_t key_file_offset, | |
54 | const void *key_data, | |
55 | size_t key_data_size, | |
56 | usec_t until, | |
8b3d4ff0 MB |
57 | bool headless, |
58 | Fido2EnrollFlags required, | |
3a6ce677 | 59 | void **ret_decrypted_key, |
8b3d4ff0 MB |
60 | size_t *ret_decrypted_key_size, |
61 | AskPasswordFlags ask_password_flags) { | |
3a6ce677 BR |
62 | |
63 | return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), | |
64 | "FIDO2 token support not available."); | |
65 | } | |
66 | ||
67 | static inline int find_fido2_auto_data( | |
68 | struct crypt_device *cd, | |
69 | char **ret_rp_id, | |
70 | void **ret_salt, | |
71 | size_t *ret_salt_size, | |
72 | void **ret_cid, | |
73 | size_t *ret_cid_size, | |
8b3d4ff0 MB |
74 | int *ret_keyslot, |
75 | Fido2EnrollFlags *ret_required) { | |
3a6ce677 BR |
76 | |
77 | return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), | |
78 | "FIDO2 token support not available."); | |
79 | } | |
80 | #endif |