repart: Do offline encryption instead of online
Offline encryption can be done without mounting the luks device. For now we still use loop devices to split out the partition we want to write to but in a later commit we'll replace this with a regular file. For offline encryption, we need to keep 2x the luks header size space free at the end of the partition, so this means our encrypted partitions will be 16M larger than before.
This commit is contained in:
@@ -64,6 +64,18 @@ static inline int crypt_token_max(_unused_ const char *type) {
|
||||
#endif
|
||||
extern crypt_token_info (*sym_crypt_token_status)(struct crypt_device *cd, int token, const char **type);
|
||||
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);
|
||||
#if HAVE_CRYPT_REENCRYPT_INIT_BY_PASSPHRASE
|
||||
extern int (*sym_crypt_reencrypt_init_by_passphrase)(struct crypt_device *cd, const char *name, const char *passphrase, size_t passphrase_size, int keyslot_old, int keyslot_new, const char *cipher, const char *cipher_mode, const struct crypt_params_reencrypt *params);
|
||||
#endif
|
||||
#if HAVE_CRYPT_REENCRYPT
|
||||
extern int (*sym_crypt_reencrypt)(struct crypt_device *cd, int (*progress)(uint64_t size, uint64_t offset, void *usrptr));
|
||||
#endif
|
||||
extern int (*sym_crypt_metadata_locking)(struct crypt_device *cd, int enable);
|
||||
#if HAVE_CRYPT_SET_DATA_OFFSET
|
||||
extern int (*sym_crypt_set_data_offset)(struct crypt_device *cd, uint64_t data_offset);
|
||||
#endif
|
||||
extern int (*sym_crypt_header_restore)(struct crypt_device *cd, const char *requested_type, const char *backup_file);
|
||||
extern int (*sym_crypt_volume_key_keyring)(struct crypt_device *cd, int enable);
|
||||
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct crypt_device *, crypt_free, NULL);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct crypt_device *, sym_crypt_free, NULL);
|
||||
|
||||
Reference in New Issue
Block a user