Expand description
This is a wrapper library for libcryptsetup. The intention is to provide as much safety as possible when crossing FFI boundaries to the cryptsetup C library.
Modules§
Macros§
- c_
confirm_ callback - Create a C-compatible callback to determine user confirmation which wraps safe Rust code
- c_
logging_ callback - Create a C-compatible logging callback which wraps safe Rust code
- c_
progress_ callback - Create a C-compatible progress callback for wiping a device which wraps safe Rust code
- c_str
- Create a C-compatible static string with a null byte
- c_
token_ handler_ dump - Create a C-compatible callback for compatible with
CryptTokenHandler
- c_
token_ handler_ free - Create a C-compatible callback for free compatible with
CryptTokenHandler
- c_
token_ handler_ open - Create a C-compatible open callback compatible with
CryptTokenHandler
- c_
token_ handler_ validate - Create a C-compatible callback for validate compatible with
CryptTokenHandler
- from_
str_ ptr - Convert a
*const c_char
into a&str
type
Structs§
- Active
Device - Record containing data on the given active device
- Crypt
Activation Handle - Handle for activation options
- Crypt
Backup Handle - Handle for backup operations on a device
- Crypt
Context Handle - Cryptographic context for device
- Crypt
Device - Data type that is a handle for a crypt device
- Crypt
Device Status Handle - Handle for crypt device status operations
- Crypt
Format Handle - Handle for format operations on a device
- Crypt
Init - Initialization handle for devices
- Crypt
Keyfile Contents - Contents of a keyfile that have been read
- Crypt
Keyfile Handle - Handle for keyfile operations
- Crypt
Keyslot Handle - Handle for keyslot operations
- Crypt
Luks2 Flags Handle - Handle for LUKS2 persistent flag operations
- Crypt
Luks2 Reencrypt Handle - Handle for reencryption operations
- Crypt
Luks2 Token Handle - Handle for LUKS2 token operations
- Crypt
Params Integrity - Parameters for integrity checking
- Crypt
Params Integrity Ref - A struct representing a reference with a lifetime to a
CryptParamsIntegrity
struct - Crypt
Params Loopaes - Parameters for formatting a loop AES device
- Crypt
Params Loopaes Ref - C-compatible reference to a
CryptParamsLoopaes
struct - Crypt
Params Luks1 - A struct representing LUKS1 specific parameters.
- Crypt
Params Luks2 - LUKS2-specific parameters
- Crypt
Params Luks1 Ref - A struct with a lifetime representing a reference to
CryptParamsLuks1
. - Crypt
Params Luks2 Ref - A struct representing a reference with a lifetime to a
CryptParamsLuks2
struct - Crypt
Params Plain - Struct representing plain cryptsetup format parameters
- Crypt
Params Plain Ref - Represents a reference to a
CryptParamsPlain
struct - Crypt
Params Reencrypt - Parameters for reencryption operations
- Crypt
Params Reencrypt Ref - A struct representing a reference with a lifetime to a
CryptParamsReencrypt
struct - Crypt
Params Tcrypt - Parameters for tcrypt operations
- Crypt
Params Tcrypt Ref - Reference to a
CryptParamsTcrypt
struct - Crypt
Params Verity - Parameters specific to Verity
- Crypt
Params Verity Ref - Reference to parameters specific to Verity
- Crypt
Pbkdf Type - Rust representation of
crypt_pbkdf_type
- Crypt
Pbkdf Type Ref - A type wrapping a PBKDF type with pointers derived from Rust data types and lifetimes to ensure pointer validity
- Crypt
Runtime Handle - Handle for runtime attribute options
- Crypt
Settings Handle - Handle to operate on cryptsetup device settings
- Crypt
Volume KeyHandle - Handle for volume key operations
- Crypt
Wipe Handle - Handle for volume key operations
- Safe
Borrowed MemZero - Handle for zeroing borrowed memory. “Borrowed” in this context refers to memory
that will be cleaned up by some other scope and is not required to be freed
by the caller. An example of this would be a
char *
pointer to kernel memory where the caller can access the memory but is not responsible for its allocation or deallocation. - Safe
MemHandle - Handle to allocated memory from libcryptsetup
- Safe
Owned MemZero - Handle for zeroing owned memory. “Owned” in this context refers to memory
that has been allocated and stored in some kind of
char **
argument in the context of C FFI. This means that the memory has been allocated by standard C allocators and needs to be cleaned up by the caller. In the context of Rust, we would consider this owned by the current scope.
Enums§
- Crypt
Token Info - Type representing the token status. This type wraps the
CRYPT_TOKEN_*
values and the optional corresponding token type as a string. - Either
- The enum
Either
with variantsLeft
andRight
is a general purpose sum type with two cases. - Libcrypt
Err - Error returned from any libcryptsetup-rs function
- Token
Input - Token input for
CryptLuks2Token::json_set
Traits§
- Safe
Memzero - A trait to be implemented for a segment of memory that can be explicitly zeroed in a way that will not be optimized away by the compiler.
Functions§
- get_
sector_ size - Get size of encryption sectors in bytes
- log
- Generate a log entry
- register
- Register token handler
- set_
debug_ level - Set library debug level
- set_
log_ callback - Set the callback to be executed on logging events
- status
- Get status info from device name