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)  

internal.h File Reference
#include <stdint.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <fcntl.h>
#include "nls.h"
#include "bitops.h"
#include "utils_blkid.h"
#include "utils_crypt.h"
#include "utils_loop.h"
#include "utils_dm.h"
#include "utils_fips.h"
#include "utils_keyring.h"
#include "utils_io.h"
#include "crypto_backend/crypto_backend.h"
#include "utils_storage_wrappers.h"
#include "libcryptsetup.h"
#include "libcryptsetup_macros.h"
#include "libcryptsetup_symver.h"
Include dependency graph for internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  volume_key


#define LOG_MAX_LEN   4096
#define MAX_DM_DEPS   32
#define CRYPT_SUBDEV   "SUBDEV" /* prefix for sublayered devices underneath public crypt types */
#define O_CLOEXEC   0
#define log_dbg(c, x...)   crypt_logf(c, CRYPT_LOG_DEBUG, x)
#define log_std(c, x...)   crypt_logf(c, CRYPT_LOG_NORMAL, x)
#define log_verbose(c, x...)   crypt_logf(c, CRYPT_LOG_VERBOSE, x)
#define log_err(c, x...)   crypt_logf(c, CRYPT_LOG_ERROR, x)


enum  devcheck { DEV_OK = 0 , DEV_EXCL = 1 }


struct volume_keycrypt_alloc_volume_key (size_t keylength, const char *key)
struct volume_keycrypt_generate_volume_key (struct crypt_device *cd, size_t keylength)
void crypt_free_volume_key (struct volume_key *vk)
int crypt_volume_key_set_description (struct volume_key *key, const char *key_description)
void crypt_volume_key_set_id (struct volume_key *vk, int id)
int crypt_volume_key_get_id (const struct volume_key *vk)
void crypt_volume_key_add_next (struct volume_key **vks, struct volume_key *vk)
struct volume_keycrypt_volume_key_next (struct volume_key *vk)
struct volume_keycrypt_volume_key_by_id (struct volume_key *vk, int id)
struct crypt_pbkdf_typecrypt_get_pbkdf (struct crypt_device *cd)
int init_pbkdf_type (struct crypt_device *cd, const struct crypt_pbkdf_type *pbkdf, const char *dev_type)
int verify_pbkdf_params (struct crypt_device *cd, const struct crypt_pbkdf_type *pbkdf)
int crypt_benchmark_pbkdf_internal (struct crypt_device *cd, struct crypt_pbkdf_type *pbkdf, size_t volume_key_size)
const char * crypt_get_cipher_spec (struct crypt_device *cd)
int device_alloc (struct crypt_device *cd, struct device **device, const char *path)
int device_alloc_no_check (struct device **device, const char *path)
void device_close (struct crypt_device *cd, struct device *device)
void device_free (struct crypt_device *cd, struct device *device)
const char * device_path (const struct device *device)
const char * device_dm_name (const struct device *device)
const char * device_block_path (const struct device *device)
void device_topology_alignment (struct crypt_device *cd, struct device *device, unsigned long *required_alignment, unsigned long *alignment_offset, unsigned long default_alignment)
size_t device_block_size (struct crypt_device *cd, struct device *device)
int device_read_ahead (struct device *device, uint32_t *read_ahead)
int device_size (struct device *device, uint64_t *size)
int device_open (struct crypt_device *cd, struct device *device, int flags)
int device_open_excl (struct crypt_device *cd, struct device *device, int flags)
void device_release_excl (struct crypt_device *cd, struct device *device)
void device_disable_direct_io (struct device *device)
int device_is_identical (struct device *device1, struct device *device2)
int device_is_rotational (struct device *device)
size_t device_alignment (struct device *device)
int device_direct_io (const struct device *device)
int device_fallocate (struct device *device, uint64_t size)
void device_sync (struct crypt_device *cd, struct device *device)
int device_check_size (struct crypt_device *cd, struct device *device, uint64_t req_offset, int falloc)
void device_set_block_size (struct device *device, size_t size)
size_t device_optimal_encryption_sector_size (struct crypt_device *cd, struct device *device)
int device_open_locked (struct crypt_device *cd, struct device *device, int flags)
int device_read_lock (struct crypt_device *cd, struct device *device)
int device_write_lock (struct crypt_device *cd, struct device *device)
void device_read_unlock (struct crypt_device *cd, struct device *device)
void device_write_unlock (struct crypt_device *cd, struct device *device)
bool device_is_locked (struct device *device)
int device_check_access (struct crypt_device *cd, struct device *device, enum devcheck device_check)
int device_block_adjust (struct crypt_device *cd, struct device *device, enum devcheck device_check, uint64_t device_offset, uint64_t *size, uint32_t *flags)
size_t size_round_up (size_t size, size_t block)
int create_or_reload_device (struct crypt_device *cd, const char *name, const char *type, struct crypt_dm_active_device *dmd)
int create_or_reload_device_with_integrity (struct crypt_device *cd, const char *name, const char *type, struct crypt_dm_active_device *dmd, struct crypt_dm_active_device *dmdi)
struct devicecrypt_metadata_device (struct crypt_device *cd)
struct devicecrypt_data_device (struct crypt_device *cd)
int crypt_confirm (struct crypt_device *cd, const char *msg)
char * crypt_lookup_dev (const char *dev_id)
int crypt_dev_is_rotational (int major, int minor)
int crypt_dev_is_partition (const char *dev_path)
char * crypt_get_partition_device (const char *dev_path, uint64_t offset, uint64_t size)
char * crypt_get_base_device (const char *dev_path)
uint64_t crypt_dev_partition_offset (const char *dev_path)
int lookup_by_disk_id (const char *dm_uuid)
int lookup_by_sysfs_uuid_field (const char *dm_uuid)
int crypt_uuid_cmp (const char *dm_uuid, const char *hdr_uuid)
size_t crypt_getpagesize (void)
unsigned crypt_cpusonline (void)
uint64_t crypt_getphysmemory_kb (void)
int init_crypto (struct crypt_device *ctx)
int crypt_get_debug_level (void)
int crypt_memlock_inc (struct crypt_device *ctx)
int crypt_memlock_dec (struct crypt_device *ctx)
int crypt_metadata_locking_enabled (void)
int crypt_random_init (struct crypt_device *ctx)
int crypt_random_get (struct crypt_device *ctx, char *buf, size_t len, int quality)
void crypt_random_exit (void)
int crypt_random_default_key_rng (void)
int crypt_plain_hash (struct crypt_device *cd, const char *hash_name, char *key, size_t key_size, const char *passphrase, size_t passphrase_size)
int PLAIN_activate (struct crypt_device *cd, const char *name, struct volume_key *vk, uint64_t size, uint32_t flags)
void * crypt_get_hdr (struct crypt_device *cd, const char *type)
void crypt_set_luks2_reencrypt (struct crypt_device *cd, struct luks2_reencrypt *rh)
struct luks2_reencryptcrypt_get_luks2_reencrypt (struct crypt_device *cd)
int onlyLUKS2 (struct crypt_device *cd)
int onlyLUKS2mask (struct crypt_device *cd, uint32_t mask)
int crypt_wipe_device (struct crypt_device *cd, struct device *device, crypt_wipe_pattern pattern, uint64_t offset, uint64_t length, size_t wipe_block_size, int(*progress)(uint64_t size, uint64_t offset, void *usrptr), void *usrptr)
const char * crypt_get_integrity (struct crypt_device *cd)
int crypt_get_integrity_key_size (struct crypt_device *cd)
int crypt_get_integrity_tag_size (struct crypt_device *cd)
int crypt_key_in_keyring (struct crypt_device *cd)
void crypt_set_key_in_keyring (struct crypt_device *cd, unsigned key_in_keyring)
int crypt_volume_key_load_in_keyring (struct crypt_device *cd, struct volume_key *vk)
int crypt_use_keyring_for_vk (struct crypt_device *cd)
void crypt_drop_keyring_key_by_description (struct crypt_device *cd, const char *key_description, key_type_t ktype)
void crypt_drop_keyring_key (struct crypt_device *cd, struct volume_key *vks)
static uint64_t compact_version (uint16_t major, uint16_t minor, uint16_t patch, uint16_t release)
int kernel_version (uint64_t *kversion)
int crypt_serialize_lock (struct crypt_device *cd)
void crypt_serialize_unlock (struct crypt_device *cd)
bool crypt_string_in (const char *str, char **list, size_t list_size)
int crypt_strcmp (const char *a, const char *b)
int crypt_compare_dm_devices (struct crypt_device *cd, const struct crypt_dm_active_device *src, const struct crypt_dm_active_device *tgt)
static void * crypt_zalloc (size_t size)
static bool uint64_mult_overflow (uint64_t *u, uint64_t b, size_t size)

Macro Definition Documentation


#define CRYPT_SUBDEV   "SUBDEV" /* prefix for sublayered devices underneath public crypt types */

Definition at line 55 of file internal.h.

◆ log_dbg

#define log_dbg (   c,
)    crypt_logf(c, CRYPT_LOG_DEBUG, x)

Definition at line 174 of file internal.h.

◆ log_err

#define log_err (   c,
)    crypt_logf(c, CRYPT_LOG_ERROR, x)

Definition at line 177 of file internal.h.


#define LOG_MAX_LEN   4096

Definition at line 52 of file internal.h.

◆ log_std

#define log_std (   c,
)    crypt_logf(c, CRYPT_LOG_NORMAL, x)

Definition at line 175 of file internal.h.

◆ log_verbose

#define log_verbose (   c,
)    crypt_logf(c, CRYPT_LOG_VERBOSE, x)

Definition at line 176 of file internal.h.


#define MAX_DM_DEPS   32

Definition at line 53 of file internal.h.


#define O_CLOEXEC   0

Definition at line 58 of file internal.h.

Enumeration Type Documentation

◆ devcheck

enum devcheck

Definition at line 133 of file internal.h.

Function Documentation

◆ compact_version()

static uint64_t compact_version ( uint16_t  major,
uint16_t  minor,
uint16_t  patch,
uint16_t  release 

Definition at line 229 of file internal.h.

Referenced by dmcrypt_keyring_bug(), and kernel_version().

◆ create_or_reload_device()

◆ create_or_reload_device_with_integrity()

int create_or_reload_device_with_integrity ( struct crypt_device cd,
const char *  name,
const char *  type,
struct crypt_dm_active_device dmd,
struct crypt_dm_active_device dmdi 

◆ crypt_alloc_volume_key()

◆ crypt_benchmark_pbkdf_internal()

◆ crypt_compare_dm_devices()

◆ crypt_confirm()

int crypt_confirm ( struct crypt_device cd,
const char *  msg 

◆ crypt_cpusonline()

unsigned crypt_cpusonline ( void  )

Definition at line 39 of file utils.c.

Referenced by init_pbkdf_type().

◆ crypt_data_device()

◆ crypt_dev_is_partition()

int crypt_dev_is_partition ( const char *  dev_path)

◆ crypt_dev_is_rotational()

int crypt_dev_is_rotational ( int  major,
int  minor 

Definition at line 213 of file utils_devpath.c.

References _sysfs_get_uint64().

Referenced by device_is_rotational().

◆ crypt_dev_partition_offset()

uint64_t crypt_dev_partition_offset ( const char *  dev_path)

Definition at line 241 of file utils_devpath.c.

References _sysfs_get_uint64(), and crypt_dev_is_partition().

Referenced by TCRYPT_get_iv_offset().

◆ crypt_drop_keyring_key()

◆ crypt_drop_keyring_key_by_description()

void crypt_drop_keyring_key_by_description ( struct crypt_device cd,
const char *  key_description,
key_type_t  ktype 

◆ crypt_free_volume_key()

void crypt_free_volume_key ( struct volume_key vk)

Definition at line 118 of file volumekey.c.

References CONST_CAST, crypt_safe_memzero(), volume_key::key, volume_key::key_description, volume_key::keylength, and volume_key::next.

Referenced by _activate_by_passphrase(), _activate_loopaes(), _crypt_format(), _crypt_format_integrity(), _dm_target_free_query_path(), _dm_target_query_crypt(), _dm_target_query_integrity(), _keyslot_repair(), _open_and_activate(), _open_and_verify(), _reload_device(), _reload_device_with_integrity(), BITLK_activate_by_passphrase(), BITLK_activate_by_volume_key(), BITLK_bitlk_fvek_free(), BITLK_bitlk_vmk_free(), BITLK_get_volume_key(), crypt_activate_by_volume_key(), crypt_free(), crypt_free_type(), crypt_generate_volume_key(), crypt_keyslot_add_by_key(), crypt_keyslot_add_by_keyfile_device_offset(), crypt_keyslot_add_by_passphrase(), crypt_keyslot_add_by_volume_key(), crypt_keyslot_change_by_passphrase(), crypt_resume_by_keyfile_device_offset(), crypt_resume_by_passphrase(), crypt_resume_by_volume_key(), crypt_volume_key_get(), crypt_volume_key_verify(), hash_keys(), INTEGRITY_format(), luks2_keyslot_get_key(), LUKS2_keyslot_open_all_segments(), LUKS2_keyslot_reencrypt_digest_create(), luks2_keyslot_set_key(), LUKS2_reencrypt_digest_verify(), LUKS2_reencrypt_free(), LUKS2_token_open_and_activate(), LUKS_check_cipher(), LUKS_open_key(), LUKS_set_key(), process_key(), reencrypt_assembly_verification_data(), reencrypt_init_by_passphrase(), resume_by_volume_key(), TCRYPT_activate(), and verify_and_update_segment_digest().

◆ crypt_generate_volume_key()

struct volume_key * crypt_generate_volume_key ( struct crypt_device cd,
size_t  keylength 

◆ crypt_get_base_device()

char * crypt_get_base_device ( const char *  dev_path)

Definition at line 336 of file utils_devpath.c.

References crypt_dev_is_partition(), dm_is_dm_kernel_name(), and NULL.

Referenced by TCRYPT_read_phdr().

◆ crypt_get_cipher_spec()

◆ crypt_get_debug_level()

int crypt_get_debug_level ( void  )

Definition at line 154 of file setup.c.

References _debug_level.

◆ crypt_get_hdr()

◆ crypt_get_integrity()

◆ crypt_get_integrity_key_size()

int crypt_get_integrity_key_size ( struct crypt_device cd)

◆ crypt_get_integrity_tag_size()

◆ crypt_get_luks2_reencrypt()

struct luks2_reencrypt * crypt_get_luks2_reencrypt ( struct crypt_device cd)

◆ crypt_get_partition_device()

char * crypt_get_partition_device ( const char *  dev_path,
uint64_t  offset,
uint64_t  size 

Definition at line 260 of file utils_devpath.c.

References _path_get_uint64(), dm_is_dm_kernel_name(), and NULL.

Referenced by TCRYPT_activate().

◆ crypt_get_pbkdf()

◆ crypt_getpagesize()

◆ crypt_getphysmemory_kb()

uint64_t crypt_getphysmemory_kb ( void  )

Definition at line 45 of file utils.c.

References pagesize().

Referenced by adjusted_phys_memory().

◆ crypt_key_in_keyring()

int crypt_key_in_keyring ( struct crypt_device cd)

Definition at line 6130 of file setup.c.

References crypt_device::key_in_keyring.

Referenced by crypt_resize().

◆ crypt_lookup_dev()

char * crypt_lookup_dev ( const char *  dev_id)

◆ crypt_memlock_dec()

int crypt_memlock_dec ( struct crypt_device ctx)

Definition at line 89 of file utils.c.

References _, _memlock_count, _priority, log_dbg, and log_err.

Referenced by crypt_memory_lock().

◆ crypt_memlock_inc()

int crypt_memlock_inc ( struct crypt_device ctx)

Definition at line 69 of file utils.c.

References _, _memlock_count, _priority, DEFAULT_PROCESS_PRIORITY, log_dbg, and log_err.

Referenced by crypt_memory_lock().

◆ crypt_metadata_device()

◆ crypt_metadata_locking_enabled()

◆ crypt_plain_hash()

int crypt_plain_hash ( struct crypt_device cd,
const char *  hash_name,
char *  key,
size_t  key_size,
const char *  passphrase,
size_t  passphrase_size 

Definition at line 67 of file crypt_plain.c.

References hash(), log_dbg, and PLAIN_HASH_LEN_MAX.

Referenced by process_key().

◆ crypt_random_default_key_rng()

int crypt_random_default_key_rng ( void  )

Definition at line 233 of file random.c.


Referenced by crypt_init(), and crypt_random_get().

◆ crypt_random_exit()

void crypt_random_exit ( void  )

Definition at line 218 of file random.c.

References random_fd, random_initialised, and urandom_fd.

Referenced by crypt_random_init(), and libcryptsetup_exit().

◆ crypt_random_get()

◆ crypt_random_init()

int crypt_random_init ( struct crypt_device ctx)

◆ crypt_serialize_lock()

int crypt_serialize_lock ( struct crypt_device cd)

◆ crypt_serialize_unlock()

void crypt_serialize_unlock ( struct crypt_device cd)

◆ crypt_set_key_in_keyring()

void crypt_set_key_in_keyring ( struct crypt_device cd,
unsigned  key_in_keyring 

◆ crypt_set_luks2_reencrypt()

void crypt_set_luks2_reencrypt ( struct crypt_device cd,
struct luks2_reencrypt rh 

Definition at line 5704 of file setup.c.

References crypt_device::luks2, crypt_device::rh, and crypt_device::u.

◆ crypt_strcmp()

int crypt_strcmp ( const char *  a,
const char *  b 

Definition at line 337 of file utils.c.

Referenced by _compare_crypt_devices(), and _compare_integrity_devices().

◆ crypt_string_in()

bool crypt_string_in ( const char *  str,
char **  list,
size_t  list_size 

Definition at line 325 of file utils.c.

Referenced by _init_by_name_crypt(), and _process_deps().

◆ crypt_use_keyring_for_vk()

◆ crypt_uuid_cmp()

int crypt_uuid_cmp ( const char *  dm_uuid,
const char *  hdr_uuid 

◆ crypt_volume_key_add_next()

void crypt_volume_key_add_next ( struct volume_key **  vks,
struct volume_key vk 

Definition at line 93 of file volumekey.c.

References volume_key::next.

Referenced by LUKS2_keyslot_open_all_segments(), and parse_vmk_entry().

◆ crypt_volume_key_by_id()

struct volume_key * crypt_volume_key_by_id ( struct volume_key vk,
int  id 

◆ crypt_volume_key_get_id()

int crypt_volume_key_get_id ( const struct volume_key vk)

Definition at line 75 of file volumekey.c.

References volume_key::id.

◆ crypt_volume_key_load_in_keyring()

◆ crypt_volume_key_next()

struct volume_key * crypt_volume_key_next ( struct volume_key vk)

Definition at line 113 of file volumekey.c.

References volume_key::next, and NULL.

Referenced by crypt_drop_keyring_key().

◆ crypt_volume_key_set_description()

int crypt_volume_key_set_description ( struct volume_key key,
const char *  key_description 

◆ crypt_volume_key_set_id()

void crypt_volume_key_set_id ( struct volume_key vk,
int  id 

Definition at line 69 of file volumekey.c.

References volume_key::id.

Referenced by _open_and_verify().

◆ crypt_wipe_device()

int crypt_wipe_device ( struct crypt_device cd,
struct device device,
crypt_wipe_pattern  pattern,
uint64_t  offset,
uint64_t  length,
size_t  wipe_block_size,
int(*)(uint64_t size, uint64_t offset, void *usrptr)  progress,
void *  usrptr 

◆ crypt_zalloc()

static void * crypt_zalloc ( size_t  size)

Definition at line 244 of file internal.h.

Referenced by _dm_target_query_verity(), dm_targets_allocate(), and LUKS2_disk_hdr_write().

◆ device_alignment()

◆ device_alloc()

◆ device_alloc_no_check()

int device_alloc_no_check ( struct device **  device,
const char *  path 

◆ device_block_adjust()

◆ device_block_path()

const char * device_block_path ( const struct device device)

◆ device_block_size()

◆ device_check_access()

int device_check_access ( struct crypt_device cd,
struct device device,
enum devcheck  device_check 

◆ device_check_size()

int device_check_size ( struct crypt_device cd,
struct device device,
uint64_t  req_offset,
int  falloc 

◆ device_close()

void device_close ( struct crypt_device cd,
struct device device 

Definition at line 1061 of file utils_device.c.

References device::dev_fd, device_path(), log_dbg, and device::ro_dev_fd.

Referenced by _init_by_name_crypt(), and device_free().

◆ device_direct_io()

int device_direct_io ( const struct device device)

Definition at line 934 of file utils_device.c.

References device::o_direct.

Referenced by LUKS2_hdr_version_unlocked().

◆ device_disable_direct_io()

void device_disable_direct_io ( struct device device)

Definition at line 928 of file utils_device.c.

References device::o_direct.

Referenced by crypt_wipe(), LUKS_read_phdr(), and VERITY_write_sb().

◆ device_dm_name()

const char * device_dm_name ( const struct device device)

◆ device_fallocate()

int device_fallocate ( struct device device,
uint64_t  size 

◆ device_free()

◆ device_is_identical()

int device_is_identical ( struct device device1,
struct device device2 

◆ device_is_locked()

bool device_is_locked ( struct device device)

◆ device_is_rotational()

int device_is_rotational ( struct device device)

Definition at line 970 of file utils_device.c.

References crypt_dev_is_rotational(), and device_path().

Referenced by crypt_wipe_device().

◆ device_open()

◆ device_open_excl()

int device_open_excl ( struct crypt_device cd,
struct device device,
int  flags 

◆ device_open_locked()

◆ device_optimal_encryption_sector_size()

size_t device_optimal_encryption_sector_size ( struct crypt_device cd,
struct device device 

◆ device_path()

const char * device_path ( const struct device device)

Definition at line 496 of file utils_device.c.

References device::file_path, NULL, and device::path.

Referenced by _activate(), _crypt_format_luks2(), _init_by_name_crypt(), _open_locked(), acquire_and_verify(), acquire_lock_handle(), BITLK_dump(), BITLK_read_sb(), crypt_check_data_device_size(), crypt_get_device_name(), crypt_get_metadata_device_name(), crypt_get_verity_info(), crypt_init_by_name_and_header(), crypt_storage_dmcrypt_init(), crypt_wipe(), data_device_path(), device_alignment(), device_block_adjust(), device_block_size(), device_check_size(), device_close(), device_fallocate(), device_free(), device_info(), device_is_identical(), device_is_rotational(), device_open_excl(), device_open_internal(), device_optimal_encryption_sector_size(), device_read_lock_internal(), device_ready(), device_release_excl(), device_sync(), device_unlock_internal(), device_write_lock_internal(), FEC_process_inputs(), INTEGRITY_activate_dmd_device(), INTEGRITY_dump(), INTEGRITY_format(), INTEGRITY_read_superblock(), luks2_decrypt_from_storage(), LUKS2_device_write_lock(), LUKS2_disk_hdr_read(), LUKS2_hdr_backup(), LUKS2_hdr_read(), LUKS2_hdr_restore(), LUKS2_hdr_version_unlocked(), LUKS2_keyslot_wipe(), LUKS2_reencrypt_check_device_size(), LUKS_check_device_size(), LUKS_decrypt_from_storage(), LUKS_del_key(), LUKS_encrypt_to_storage(), LUKS_endec_template(), LUKS_hdr_backup(), LUKS_hdr_restore(), LUKS_read_phdr(), LUKS_write_phdr(), mdata_device_path(), TCRYPT_activate(), TCRYPT_dump(), TCRYPT_get_data_offset(), TCRYPT_get_iv_offset(), TCRYPT_read_phdr(), VERITY_create_or_verify_hash(), VERITY_FEC_blocks(), VERITY_FEC_process(), VERITY_read_sb(), and VERITY_write_sb().

◆ device_read_ahead()

int device_read_ahead ( struct device device,
uint32_t *  read_ahead 

Definition at line 632 of file utils_device.c.

References device::path.

Referenced by _dm_create_device(), and _dm_reload_device().

◆ device_read_lock()

int device_read_lock ( struct crypt_device cd,
struct device device 

◆ device_read_unlock()

void device_read_unlock ( struct crypt_device cd,
struct device device 

◆ device_release_excl()

void device_release_excl ( struct crypt_device cd,
struct device device 

Definition at line 370 of file utils_device.c.

References device::dev_fd_excl, device_path(), and log_dbg.

Referenced by LUKS2_reencrypt_free().

◆ device_set_block_size()

void device_set_block_size ( struct device device,
size_t  size 

◆ device_size()

◆ device_sync()

◆ device_topology_alignment()

void device_topology_alignment ( struct crypt_device cd,
struct device device,
unsigned long *  required_alignment,
unsigned long *  alignment_offset,
unsigned long  default_alignment 

Definition at line 514 of file utils_device.c.

References _, BLKALIGNOFF, BLKIOMIN, BLKIOOPT, log_dbg, log_err, MISALIGNED_4K, and device::path.

Referenced by _crypt_format_luks1(), and _crypt_format_luks2().

◆ device_write_lock()

◆ device_write_unlock()

◆ init_crypto()

◆ init_pbkdf_type()

◆ kernel_version()

int kernel_version ( uint64_t *  kversion)

Definition at line 301 of file utils.c.

References compact_version().

Referenced by dmcrypt_keyring_bug().

◆ lookup_by_disk_id()

int lookup_by_disk_id ( const char *  dm_uuid)

Definition at line 376 of file utils_devpath.c.

Referenced by lookup_dm_dev_by_uuid().

◆ lookup_by_sysfs_uuid_field()

int lookup_by_sysfs_uuid_field ( const char *  dm_uuid)

Definition at line 411 of file utils_devpath.c.

References DM_UUID_LEN, O_CLOEXEC, and read_buffer().

Referenced by lookup_dm_dev_by_uuid().

◆ onlyLUKS2()

◆ onlyLUKS2mask()

int onlyLUKS2mask ( struct crypt_device cd,
uint32_t  mask 

◆ PLAIN_activate()

◆ size_round_up()

◆ uint64_mult_overflow()

static bool uint64_mult_overflow ( uint64_t *  u,
uint64_t  b,
size_t  size 

Definition at line 246 of file internal.h.

Referenced by create_or_verify(), and VERITY_create_or_verify_hash().

◆ verify_pbkdf_params()