Crate libcryptsetup_rs
source ·Expand description
This is a wrapper library for libcryptsetup. The intension is to provide as much safety as possible when crossing FFI boundaries to the cryptsetup C library.
Modules
Macros
Create a C-compatible callback to determine user confirmation which wraps safe Rust code
Create a C-compatible logging callback which wraps safe Rust code
Create a C-compatible progress callback for wiping a device which wraps safe Rust code
Create a C-compatible static string with a null byte
Create a C-compatible callback for compatible with
CryptTokenHandlerCreate a C-compatible callback for free compatible with
CryptTokenHandlerCreate a C-compatible open callback compatible with
CryptTokenHandlerCreate a C-compatible callback for validate compatible with
CryptTokenHandlerConvert a
*const c_char into a &str typeStructs
Record containing data on the given active device
Handle for activation options
Handle for backup operations on a device
Cryptographic context for device
Data type that is a handle for a crypt device
Handle for crypt device status operations
Handle for format operations on a device
Initialization handle for devices
Contents of a keyfile that have been read
Handle for keyfile operations
Handle for keyslot operations
Handle for LUKS2 persistent flag operations
Handle for reencryption operations
Handle for LUKS2 token operations
Parameters for integrity checking
A struct representing a reference with a lifetime to a
CryptParamsIntegrity
structParameters for formatting a loop AES device
C-compatible reference to a
CryptParamsLoopaes structA struct representing LUKS1 specific parameters.
A struct with a lifetime representing a reference to
CryptParamsLuks1.LUKS2-specific parameters
A struct representing a reference with a lifetime to a
CryptParamsLuks2
structStruct representing plain cryptsetup format parameters
Represents a reference to a
CryptParamsPlain structParameters for reencryption operations
A struct representing a reference with a lifetime to a
CryptParamsReencrypt
structParameters for tcrypt operations
Reference to a
CryptParamsTcrypt structParameters specific to Verity
Reference to parameters specific to Verity
Rust representation of
crypt_pbkdf_typeA type wrapping a PBKDF type with pointers derived from Rust data types and lifetimes to ensure
pointer validity
Handle for runtime attribute options
Handle to operate on cryptsetup device settings
Handle for volume key operations
Handle for volume key operations
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.Handle to allocated memory from libcryptsetup
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
Type representing the token status. This type wraps the
CRYPT_TOKEN_* values and the optional corresponding token type as a string.The enum
Either with variants Left and Right is a general purpose
sum type with two cases.Error returned from any libcryptsetup-rs function
Token input for
CryptLuks2Token::json_setTraits
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 size of encryption sectors in bytes
Generate a log entry
Set library debug level
Set the callback to be executed on logging events
Get status info from device name