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.
  Fossies Dox: cryptsetup-2.4.3.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

luks2_json_format.c File Reference
#include "luks2_internal.h"
#include <uuid/uuid.h>
#include <assert.h>
Include dependency graph for luks2_json_format.c:

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)
 

Function Documentation

◆ get_area_size()

static size_t get_area_size ( size_t  keylength)
static

Definition at line 31 of file luks2_json_format.c.

References size_round_up().

Referenced by LUKS2_find_area_gap().

◆ get_max_offset()

static size_t get_max_offset ( struct luks2_hdr hdr)
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().

◆ get_min_offset()

static size_t get_min_offset ( struct luks2_hdr hdr)
static

◆ LUKS2_check_keyslots_area_size()

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().

◆ LUKS2_check_metadata_area_size()

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().

◆ LUKS2_find_area_gap()

int LUKS2_find_area_gap ( struct crypt_device cd,
struct luks2_hdr hdr,
size_t  keylength,
uint64_t *  area_offset,
uint64_t *  area_length 
)

◆ LUKS2_find_area_max_gap()

int LUKS2_find_area_max_gap ( struct crypt_device cd,
struct luks2_hdr hdr,
uint64_t *  area_offset,
uint64_t *  area_length 
)

◆ LUKS2_generate_hdr()

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 
)

◆ LUKS2_set_keyslots_size()

int LUKS2_set_keyslots_size ( struct crypt_device cd,
struct luks2_hdr hdr,
uint64_t  data_offset 
)

◆ LUKS2_wipe_header_areas()