]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/home/homework-luks.h
homectl: add support for enrolling FIDO2 HMAC-SECRET tokens
[thirdparty/systemd.git] / src / home / homework-luks.h
CommitLineData
70a5db58
LP
1/* SPDX-License-Identifier: LGPL-2.1+ */
2#pragma once
3
4#include "crypt-util.h"
5#include "homework.h"
6#include "user-record.h"
7
8int home_prepare_luks(UserRecord *h, bool already_activated, const char *force_image_path, char ***pkcs11_decrypted_passwords, HomeSetup *setup, UserRecord **ret_luks_home);
9
10int home_activate_luks(UserRecord *h, char ***pkcs11_decrypted_passwords, UserRecord **ret_home);
11int home_deactivate_luks(UserRecord *h);
28a7f106 12int home_trim_luks(UserRecord *h);
70a5db58
LP
13
14int home_store_header_identity_luks(UserRecord *h, HomeSetup *setup, UserRecord *old_home);
15
16int home_create_luks(UserRecord *h, char **pkcs11_decrypted_passwords, char **effective_passwords, UserRecord **ret_home);
17
18int home_validate_update_luks(UserRecord *h, HomeSetup *setup);
19
20int home_resize_luks(UserRecord *h, bool already_activated, char ***pkcs11_decrypted_passwords, HomeSetup *setup, UserRecord **ret_home);
21
22int home_passwd_luks(UserRecord *h, HomeSetup *setup, char **pkcs11_decrypted_passwords, char **effective_passwords);
23
24int home_lock_luks(UserRecord *h);
25int home_unlock_luks(UserRecord *h, char ***pkcs11_decrypted_passwords);
26
27static inline uint64_t luks_volume_key_size_convert(struct crypt_device *cd) {
28 int k;
29
30 assert(cd);
31
32 /* Convert the "int" to uint64_t, which we usually use for byte sizes stored on disk. */
33
34 k = crypt_get_volume_key_size(cd);
35 if (k <= 0)
36 return UINT64_MAX;
37
38 return (uint64_t) k;
39}
28a7f106
LP
40
41int run_fitrim(int root_fd);
42int run_fitrim_by_path(const char *root_path);
43int run_fallocate(int backing_fd, const struct stat *st);
44int run_fallocate_by_path(const char *backing_path);