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)  

bitlk.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
Include dependency graph for bitlk.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bitlk_vmk
 
struct  bitlk_fvek
 
struct  bitlk_metadata
 

Macros

#define BITLK_NONCE_SIZE   12
 
#define BITLK_SALT_SIZE   16
 
#define BITLK_VMK_MAC_TAG_SIZE   16
 
#define BITLK_STATE_NORMAL   0x0004
 

Enumerations

enum  BITLKEncryptionType { BITLK_ENCRYPTION_TYPE_NORMAL = 0 , BITLK_ENCRYPTION_TYPE_EOW , BITLK_ENCRYPTION_TYPE_UNKNOWN }
 
enum  BITLKVMKProtection {
  BITLK_PROTECTION_CLEAR_KEY = 0 , BITLK_PROTECTION_TPM , BITLK_PROTECTION_STARTUP_KEY , BITLK_PROTECTION_TPM_PIN ,
  BITLK_PROTECTION_RECOVERY_PASSPHRASE , BITLK_PROTECTION_PASSPHRASE , BITLK_PROTECTION_SMART_CARD , BITLK_PROTECTION_UNKNOWN
}
 
enum  BITLKFVEEntryType {
  BITLK_ENTRY_TYPE_PROPERTY = 0x0000 , BITLK_ENTRY_TYPE_VMK = 0x0002 , BITLK_ENTRY_TYPE_FVEK = 0x0003 , BITLK_ENTRY_TYPE_STARTUP_KEY = 0x0006 ,
  BITLK_ENTRY_TYPE_DESCRIPTION = 0x0007 , BITLK_ENTRY_TYPE_VOLUME_HEADER = 0x000f , BITLK_ENTRY_TYPE_VOLUME_GUID = 0x0019
}
 
enum  BITLKFVEEntryValue {
  BITLK_ENTRY_VALUE_ERASED = 0x0000 , BITLK_ENTRY_VALUE_KEY = 0x0001 , BITLK_ENTRY_VALUE_STRING = 0x0002 , BITLK_ENTRY_VALUE_STRETCH_KEY = 0x0003 ,
  BITLK_ENTRY_VALUE_USE_KEY = 0x0004 , BITLK_ENTRY_VALUE_ENCRYPTED_KEY = 0x0005 , BITLK_ENTRY_VALUE_TPM_KEY = 0x0006 , BITLK_ENTRY_VALUE_VALIDATION = 0x0007 ,
  BITLK_ENTRY_VALUE_VMK = 0x0008 , BITLK_ENTRY_VALUE_EXTERNAL_KEY = 0x0009 , BITLK_ENTRY_VALUE_OFFSET_SIZE = 0x000f , BITLK_ENTRY_VALUE_RECOVERY_TIME = 0x015 ,
  BITLK_ENTRY_VALUE_GUID = 0x0017
}
 

Functions

int BITLK_read_sb (struct crypt_device *cd, struct bitlk_metadata *params)
 
int BITLK_dump (struct crypt_device *cd, struct device *device, struct bitlk_metadata *params)
 
int BITLK_get_volume_key (struct crypt_device *cd, const char *password, size_t passwordLen, const struct bitlk_metadata *params, struct volume_key **open_fvek_key)
 
int BITLK_activate_by_passphrase (struct crypt_device *cd, const char *name, const char *password, size_t passwordLen, const struct bitlk_metadata *params, uint32_t flags)
 
int BITLK_activate_by_volume_key (struct crypt_device *cd, const char *name, const char *volume_key, size_t volume_key_size, const struct bitlk_metadata *params, uint32_t flags)
 
void BITLK_bitlk_fvek_free (struct bitlk_fvek *fvek)
 
void BITLK_bitlk_vmk_free (struct bitlk_vmk *vmk)
 
void BITLK_bitlk_metadata_free (struct bitlk_metadata *params)
 

Macro Definition Documentation

◆ BITLK_NONCE_SIZE

#define BITLK_NONCE_SIZE   12

Definition at line 34 of file bitlk.h.

◆ BITLK_SALT_SIZE

#define BITLK_SALT_SIZE   16

Definition at line 35 of file bitlk.h.

◆ BITLK_STATE_NORMAL

#define BITLK_STATE_NORMAL   0x0004

Definition at line 38 of file bitlk.h.

◆ BITLK_VMK_MAC_TAG_SIZE

#define BITLK_VMK_MAC_TAG_SIZE   16

Definition at line 36 of file bitlk.h.

Enumeration Type Documentation

◆ BITLKEncryptionType

Enumerator
BITLK_ENCRYPTION_TYPE_NORMAL 
BITLK_ENCRYPTION_TYPE_EOW 
BITLK_ENCRYPTION_TYPE_UNKNOWN 

Definition at line 40 of file bitlk.h.

◆ BITLKFVEEntryType

Enumerator
BITLK_ENTRY_TYPE_PROPERTY 
BITLK_ENTRY_TYPE_VMK 
BITLK_ENTRY_TYPE_FVEK 
BITLK_ENTRY_TYPE_STARTUP_KEY 
BITLK_ENTRY_TYPE_DESCRIPTION 
BITLK_ENTRY_TYPE_VOLUME_HEADER 
BITLK_ENTRY_TYPE_VOLUME_GUID 

Definition at line 57 of file bitlk.h.

◆ BITLKFVEEntryValue

Enumerator
BITLK_ENTRY_VALUE_ERASED 
BITLK_ENTRY_VALUE_KEY 
BITLK_ENTRY_VALUE_STRING 
BITLK_ENTRY_VALUE_STRETCH_KEY 
BITLK_ENTRY_VALUE_USE_KEY 
BITLK_ENTRY_VALUE_ENCRYPTED_KEY 
BITLK_ENTRY_VALUE_TPM_KEY 
BITLK_ENTRY_VALUE_VALIDATION 
BITLK_ENTRY_VALUE_VMK 
BITLK_ENTRY_VALUE_EXTERNAL_KEY 
BITLK_ENTRY_VALUE_OFFSET_SIZE 
BITLK_ENTRY_VALUE_RECOVERY_TIME 
BITLK_ENTRY_VALUE_GUID 

Definition at line 67 of file bitlk.h.

◆ BITLKVMKProtection

Enumerator
BITLK_PROTECTION_CLEAR_KEY 
BITLK_PROTECTION_TPM 
BITLK_PROTECTION_STARTUP_KEY 
BITLK_PROTECTION_TPM_PIN 
BITLK_PROTECTION_RECOVERY_PASSPHRASE 
BITLK_PROTECTION_PASSPHRASE 
BITLK_PROTECTION_SMART_CARD 
BITLK_PROTECTION_UNKNOWN 

Definition at line 46 of file bitlk.h.

Function Documentation

◆ BITLK_activate_by_passphrase()

int BITLK_activate_by_passphrase ( struct crypt_device cd,
const char *  name,
const char *  password,
size_t  passwordLen,
const struct bitlk_metadata params,
uint32_t  flags 
)

◆ BITLK_activate_by_volume_key()

int BITLK_activate_by_volume_key ( struct crypt_device cd,
const char *  name,
const char *  volume_key,
size_t  volume_key_size,
const struct bitlk_metadata params,
uint32_t  flags 
)

◆ BITLK_bitlk_fvek_free()

void BITLK_bitlk_fvek_free ( struct bitlk_fvek fvek)

Definition at line 432 of file bitlk.c.

References crypt_free_volume_key(), and bitlk_fvek::vk.

Referenced by BITLK_bitlk_metadata_free().

◆ BITLK_bitlk_metadata_free()

void BITLK_bitlk_metadata_free ( struct bitlk_metadata params)

◆ BITLK_bitlk_vmk_free()

void BITLK_bitlk_vmk_free ( struct bitlk_vmk vmk)

◆ BITLK_dump()

◆ BITLK_get_volume_key()

◆ BITLK_read_sb()

int BITLK_read_sb ( struct crypt_device cd,
struct bitlk_metadata params 
)

Definition at line 469 of file bitlk.c.

References _, BITLK_bitlk_vmk_free(), BITLK_BOOTCODE_V1, BITLK_BOOTCODE_V2, BITLK_ENCRYPTION_TYPE_EOW, BITLK_ENCRYPTION_TYPE_NORMAL, BITLK_ENCRYPTION_TYPE_UNKNOWN, BITLK_ENTRY_HEADER_LEN, BITLK_ENTRY_TYPE_DESCRIPTION, BITLK_ENTRY_TYPE_FVEK, BITLK_ENTRY_TYPE_VMK, BITLK_ENTRY_TYPE_VOLUME_HEADER, BITLK_FVE_METADATA_HEADER_LEN, BITLK_FVE_METADATA_HEADERS_LEN, BITLK_GUID_EOW, BITLK_GUID_NORMAL, BITLK_HEADER_METADATA_OFFSET, BITLK_HEADER_METADATA_OFFSET_TOGO, BITLK_NONCE_SIZE, BITLK_SIGNATURE, BITLK_SIGNATURE_TOGO, BITLK_STATE_NORMAL, BITLK_VMK_HEADER_LEN, BITLK_VMK_MAC_TAG_SIZE, bitlk_signature::boot_code, bitlk_metadata::cipher, bitlk_metadata::cipher_mode, convert_to_utf8(), bitlk_fve_metadata::creation_time, bitlk_metadata::creation_time, crypt_alloc_volume_key(), crypt_data_device(), crypt_metadata_device(), bitlk_fve_metadata::curr_state, bitlk_metadata::description, device_alignment(), device_block_size(), device_open(), device_path(), bitlk_fve_metadata::encryption, filetime_to_unixtime(), bitlk_superblock::fve_offset, bitlk_fve_metadata::fve_version, bitlk_metadata::fvek, get_bitlk_type_string(), get_vmk_protection(), bitlk_superblock::guid, bitlk_fve_metadata::guid, bitlk_entry_vmk::guid, bitlk_vmk::guid, bitlk_metadata::guid, guid_to_string(), bitlk_metadata::key_size, le16_to_cpu, le32_to_cpu, le64_to_cpu, log_dbg, log_err, bitlk_fvek::mac_tag, bitlk_metadata::metadata_offset, bitlk_fve_metadata::metadata_size, bitlk_metadata::metadata_version, bitlk_vmk::name, bitlk_vmk::next, bitlk_fve_metadata::next_state, bitlk_fvek::nonce, NULL, bitlk_entry_header_block::offset, parse_vmk_entry(), bitlk_entry_vmk::protection, bitlk_vmk::protection, read_lseek_blockwise(), bitlk_signature::sector_size, bitlk_metadata::sector_size, SECTOR_SIZE, bitlk_signature::signature, bitlk_fve_metadata::signature, bitlk_entry_header_block::size, bitlk_metadata::state, bitlk_metadata::togo, bitlk_metadata::type, UUID_STR_LEN, bitlk_fvek::vk, bitlk_metadata::vmks, bitlk_metadata::volume_header_offset, and bitlk_metadata::volume_header_size.

Referenced by _crypt_load_bitlk().