]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
f18edd8a | 2 | #pragma once |
294bd454 | 3 | |
0d12936d LP |
4 | #include "macro.h" |
5 | ||
294bd454 ZJS |
6 | #if HAVE_LIBCRYPTSETUP |
7 | #include <libcryptsetup.h> | |
8 | ||
0d12936d LP |
9 | extern int (*sym_crypt_activate_by_passphrase)(struct crypt_device *cd, const char *name, int keyslot, const char *passphrase, size_t passphrase_size, uint32_t flags); |
10 | #if HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY | |
11 | extern int (*sym_crypt_activate_by_signed_key)(struct crypt_device *cd, const char *name, const char *volume_key, size_t volume_key_size, const char *signature, size_t signature_size, uint32_t flags); | |
12 | #endif | |
13 | extern int (*sym_crypt_activate_by_volume_key)(struct crypt_device *cd, const char *name, const char *volume_key, size_t volume_key_size, uint32_t flags); | |
14 | extern int (*sym_crypt_deactivate_by_name)(struct crypt_device *cd, const char *name, uint32_t flags); | |
15 | extern int (*sym_crypt_format)(struct crypt_device *cd, const char *type, const char *cipher, const char *cipher_mode, const char *uuid, const char *volume_key, size_t volume_key_size, void *params); | |
16 | extern void (*sym_crypt_free)(struct crypt_device *cd); | |
17 | extern const char *(*sym_crypt_get_dir)(void); | |
18 | extern int (*sym_crypt_get_verity_info)(struct crypt_device *cd, struct crypt_params_verity *vp); | |
19 | extern int (*sym_crypt_init)(struct crypt_device **cd, const char *device); | |
20 | extern int (*sym_crypt_init_by_name)(struct crypt_device **cd, const char *name); | |
21 | extern int (*sym_crypt_keyslot_add_by_volume_key)(struct crypt_device *cd, int keyslot, const char *volume_key, size_t volume_key_size, const char *passphrase, size_t passphrase_size); | |
22 | extern int (*sym_crypt_load)(struct crypt_device *cd, const char *requested_type, void *params); | |
23 | extern int (*sym_crypt_resize)(struct crypt_device *cd, const char *name, uint64_t new_size); | |
24 | extern int (*sym_crypt_set_data_device)(struct crypt_device *cd, const char *device); | |
25 | extern void (*sym_crypt_set_debug_level)(int level); | |
26 | extern void (*sym_crypt_set_log_callback)(struct crypt_device *cd, void (*log)(int level, const char *msg, void *usrptr), void *usrptr); | |
27 | extern int (*sym_crypt_volume_key_get)(struct crypt_device *cd, int keyslot, char *volume_key, size_t *volume_key_size, const char *passphrase, size_t passphrase_size); | |
28 | ||
29 | int dlopen_cryptsetup(void); | |
294bd454 ZJS |
30 | |
31 | DEFINE_TRIVIAL_CLEANUP_FUNC(struct crypt_device *, crypt_free); | |
0d12936d | 32 | DEFINE_TRIVIAL_CLEANUP_FUNC(struct crypt_device *, sym_crypt_free); |
691c2e2e | 33 | |
efc3b12f | 34 | void cryptsetup_enable_logging(struct crypt_device *cd); |
0d12936d | 35 | |
294bd454 | 36 | #endif |