cryptsetup API
Public cryptsetup API
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
LUKS2 Device persistent flags and requirements

Macros

#define CRYPT_REQUIREMENT_OFFLINE_REENCRYPT   (UINT32_C(1) << 0)
 
#define CRYPT_REQUIREMENT_ONLINE_REENCRYPT   (UINT32_C(1) << 1)
 
#define CRYPT_REQUIREMENT_OPAL   (UINT32_C(1) << 2)
 
#define CRYPT_REQUIREMENT_UNKNOWN   (UINT32_C(1) << 31)
 

Enumerations

enum  crypt_flags_type { CRYPT_FLAGS_ACTIVATION , CRYPT_FLAGS_REQUIREMENTS }
 

Functions

int crypt_persistent_flags_set (struct crypt_device *cd, crypt_flags_type type, uint32_t flags)
 
int crypt_persistent_flags_get (struct crypt_device *cd, crypt_flags_type type, uint32_t *flags)
 

Detailed Description

Macro Definition Documentation

◆ CRYPT_REQUIREMENT_OFFLINE_REENCRYPT

#define CRYPT_REQUIREMENT_OFFLINE_REENCRYPT   (UINT32_C(1) << 0)

LUKS2 header requirements Unfinished offline reencryption

◆ CRYPT_REQUIREMENT_ONLINE_REENCRYPT

#define CRYPT_REQUIREMENT_ONLINE_REENCRYPT   (UINT32_C(1) << 1)

Online reencryption in-progress

◆ CRYPT_REQUIREMENT_OPAL

#define CRYPT_REQUIREMENT_OPAL   (UINT32_C(1) << 2)

Device configured with OPAL support

◆ CRYPT_REQUIREMENT_UNKNOWN

#define CRYPT_REQUIREMENT_UNKNOWN   (UINT32_C(1) << 31)

unknown requirement in header (output only)

Enumeration Type Documentation

◆ crypt_flags_type

Persistent flags type

Enumerator
CRYPT_FLAGS_ACTIVATION 

activation flags,

See also
aflags
CRYPT_FLAGS_REQUIREMENTS 

requirements flags

Function Documentation

◆ crypt_persistent_flags_get()

int crypt_persistent_flags_get ( struct crypt_device *  cd,
crypt_flags_type  type,
uint32_t *  flags 
)

Get persistent flags stored in header.

Parameters
cdcrypt device handle (can be NULL)
typeflags type to retrieve (CRYPT_FLAGS_ACTIVATION or CRYPT_FLAGS_REQUIREMENTS)
flagsreference to output variable
Returns
0 on success or negative errno value otherwise

◆ crypt_persistent_flags_set()

int crypt_persistent_flags_set ( struct crypt_device *  cd,
crypt_flags_type  type,
uint32_t  flags 
)

Set persistent flags.

Parameters
cdcrypt device handle (can be NULL)
typetype to set (CRYPT_FLAGS_ACTIVATION or CRYPT_FLAGS_REQUIREMENTS)
flagsflags to set
Returns
0 on success or negative errno value otherwise
Note
Valid only for LUKS2.
Not all activation flags can be stored. Only ALLOW_DISCARD, SAME_CPU_CRYPT, SUBMIT_FROM_CRYPT_CPU and NO_JOURNAL can be stored persistently.
Only requirements flags recognised by current library may be set. CRYPT_REQUIREMENT_UNKNOWN is illegal (output only) in set operation.