cryptsetup
2.4.3
About: cryptsetup is a utility used to conveniently setup disk encryption based on the dm-crypt kernel module. These include plain dm-crypt volumes, LUKS volumes, loop-AES and TrueCrypt compatible format.
![]() ![]() |
Go to the source code of this file.
Data Structures | |
struct | area |
Functions | |
static size_t | get_area_size (size_t keylength) |
static size_t | get_min_offset (struct luks2_hdr *hdr) |
static size_t | get_max_offset (struct luks2_hdr *hdr) |
int | LUKS2_find_area_max_gap (struct crypt_device *cd, struct luks2_hdr *hdr, uint64_t *area_offset, uint64_t *area_length) |
int | LUKS2_find_area_gap (struct crypt_device *cd, struct luks2_hdr *hdr, size_t keylength, uint64_t *area_offset, uint64_t *area_length) |
int | LUKS2_check_metadata_area_size (uint64_t metadata_size) |
int | LUKS2_check_keyslots_area_size (uint64_t keyslots_size) |
int | LUKS2_generate_hdr (struct crypt_device *cd, struct luks2_hdr *hdr, const struct volume_key *vk, const char *cipherName, const char *cipherMode, const char *integrity, const char *uuid, unsigned int sector_size, uint64_t data_offset, uint64_t align_offset, uint64_t required_alignment, uint64_t metadata_size, uint64_t keyslots_size) |
int | LUKS2_wipe_header_areas (struct crypt_device *cd, struct luks2_hdr *hdr, bool detached_header) |
int | LUKS2_set_keyslots_size (struct crypt_device *cd, struct luks2_hdr *hdr, uint64_t data_offset) |
|
static |
Definition at line 31 of file luks2_json_format.c.
References size_round_up().
Referenced by LUKS2_find_area_gap().
|
static |
Definition at line 42 of file luks2_json_format.c.
References LUKS2_hdr_and_areas_size().
Referenced by LUKS2_find_area_gap(), and LUKS2_find_area_max_gap().
|
static |
Definition at line 37 of file luks2_json_format.c.
References luks2_hdr::hdr_size.
Referenced by LUKS2_find_area_gap(), LUKS2_find_area_max_gap(), LUKS2_generate_hdr(), LUKS2_set_keyslots_size(), and LUKS2_wipe_header_areas().
int LUKS2_check_keyslots_area_size | ( | uint64_t | keyslots_size | ) |
Definition at line 198 of file luks2_json_format.c.
References LUKS2_MAX_KEYSLOTS_SIZE, and MISALIGNED_4K.
Referenced by crypt_set_metadata_size(), and hdr_validate_config().
int LUKS2_check_metadata_area_size | ( | uint64_t | metadata_size | ) |
Definition at line 188 of file luks2_json_format.c.
Referenced by crypt_set_metadata_size(), and hdr_validate_config().
int LUKS2_find_area_gap | ( | struct crypt_device * | cd, |
struct luks2_hdr * | hdr, | ||
size_t | keylength, | ||
uint64_t * | area_offset, | ||
uint64_t * | area_length | ||
) |
Definition at line 121 of file luks2_json_format.c.
References get_area_size(), get_max_offset(), get_min_offset(), area::length, log_dbg, LUKS2_keyslot_area(), LUKS2_KEYSLOTS_MAX, and area::offset.
Referenced by luks2_keyslot_alloc(), LUKS2_keyslot_find_empty(), LUKS2_luks2_to_luks1(), and reenc_keyslot_alloc().
int LUKS2_find_area_max_gap | ( | struct crypt_device * | cd, |
struct luks2_hdr * | hdr, | ||
uint64_t * | area_offset, | ||
uint64_t * | area_length | ||
) |
Definition at line 47 of file luks2_json_format.c.
References get_max_offset(), get_min_offset(), area::length, log_dbg, LUKS2_keyslot_area(), LUKS2_KEYSLOTS_MAX, area::offset, and size_round_up().
Referenced by reenc_keyslot_alloc().
int LUKS2_generate_hdr | ( | struct crypt_device * | cd, |
struct luks2_hdr * | hdr, | ||
const struct volume_key * | vk, | ||
const char * | cipherName, | ||
const char * | cipherMode, | ||
const char * | integrity, | ||
const char * | uuid, | ||
unsigned int | sector_size, | ||
uint64_t | data_offset, | ||
uint64_t | align_offset, | ||
uint64_t | required_alignment, | ||
uint64_t | metadata_size, | ||
uint64_t | keyslots_size | ||
) |
Definition at line 204 of file luks2_json_format.c.
References _, luks2_hdr::checksum_alg, crypt_jobj_new_uint64(), crypt_metadata_device(), crypt_random_get(), CRYPT_RND_SALT, device_fallocate(), device_size(), get_min_offset(), luks2_hdr::hdr_size, luks2_hdr::jobj, JSON_DBG(), json_object_object_add_by_uint(), json_segment_create_crypt(), luks2_hdr::label, log_dbg, log_err, log_std, LUKS2_DEFAULT_HDR_SIZE, LUKS2_digest_create(), LUKS2_digest_segment_assign(), LUKS2_HDR_16K_LEN, LUKS2_HDR_BIN_LEN, LUKS2_HDR_OFFSET_MAX, LUKS2_LABEL_L, LUKS2_MAX_KEYSLOTS_SIZE, LUKS2_SALT_L, NULL, luks2_hdr::salt1, luks2_hdr::salt2, sector_size, luks2_hdr::seqid, size_round_up(), luks2_hdr::uuid, and luks2_hdr::version.
Referenced by _crypt_format_luks2().
int LUKS2_set_keyslots_size | ( | struct crypt_device * | cd, |
struct luks2_hdr * | hdr, | ||
uint64_t | data_offset | ||
) |
Definition at line 386 of file luks2_json_format.c.
References crypt_jobj_new_uint64(), get_min_offset(), luks2_hdr::jobj, and LUKS2_MAX_KEYSLOTS_SIZE.
int LUKS2_wipe_header_areas | ( | struct crypt_device * | cd, |
struct luks2_hdr * | hdr, | ||
bool | detached_header | ||
) |
Definition at line 345 of file luks2_json_format.c.
References crypt_metadata_device(), crypt_wipe_device(), CRYPT_WIPE_RANDOM, CRYPT_WIPE_ZERO, get_min_offset(), luks2_hdr::hdr_size, luks2_hdr::jobj, log_dbg, LUKS2_get_data_offset(), LUKS2_HDR_BIN_LEN, LUKS2_hdr_validate(), LUKS2_keyslots_size(), NULL, SECTOR_SIZE, and wipe_block().
Referenced by _crypt_format_luks2().