]>
Commit | Line | Data |
---|---|---|
a032b68d | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
46cdbd49 BR |
2 | #pragma once |
3 | ||
4 | #include <sys/types.h> | |
5 | ||
3a6ce677 | 6 | #include "cryptsetup-util.h" |
46cdbd49 BR |
7 | #include "log.h" |
8 | #include "time-util.h" | |
9 | ||
10 | #if HAVE_P11KIT | |
11 | ||
12 | int decrypt_pkcs11_key( | |
3a6ce677 | 13 | const char *volume_name, |
46cdbd49 BR |
14 | const char *friendly_name, |
15 | const char *pkcs11_uri, | |
16 | const char *key_file, | |
17 | size_t key_file_size, | |
18 | uint64_t key_file_offset, | |
a10f5d05 MB |
19 | const void *key_data, |
20 | size_t key_data_size, | |
46cdbd49 | 21 | usec_t until, |
8b3d4ff0 | 22 | bool headless, |
46cdbd49 BR |
23 | void **ret_decrypted_key, |
24 | size_t *ret_decrypted_key_size); | |
25 | ||
3a6ce677 BR |
26 | int find_pkcs11_auto_data( |
27 | struct crypt_device *cd, | |
28 | char **ret_uri, | |
29 | void **ret_encrypted_key, | |
30 | size_t *ret_encrypted_key_size, | |
31 | int *ret_keyslot); | |
32 | ||
46cdbd49 BR |
33 | #else |
34 | ||
35 | static inline int decrypt_pkcs11_key( | |
3a6ce677 | 36 | const char *volume_name, |
46cdbd49 BR |
37 | const char *friendly_name, |
38 | const char *pkcs11_uri, | |
39 | const char *key_file, | |
40 | size_t key_file_size, | |
41 | uint64_t key_file_offset, | |
a10f5d05 MB |
42 | const void *key_data, |
43 | size_t key_data_size, | |
46cdbd49 | 44 | usec_t until, |
8b3d4ff0 | 45 | bool headless, |
46cdbd49 BR |
46 | void **ret_decrypted_key, |
47 | size_t *ret_decrypted_key_size) { | |
48 | ||
49 | return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), | |
50 | "PKCS#11 Token support not available."); | |
51 | } | |
52 | ||
3a6ce677 BR |
53 | static inline int find_pkcs11_auto_data( |
54 | struct crypt_device *cd, | |
55 | char **ret_uri, | |
56 | void **ret_encrypted_key, | |
57 | size_t *ret_encrypted_key_size, | |
58 | int *ret_keyslot) { | |
59 | ||
60 | return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), | |
61 | "PKCS#11 Token support not available."); | |
62 | } | |
63 | ||
46cdbd49 | 64 | #endif |