mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Add api exposing external token handlers support.
This commit is contained in:
@@ -2254,6 +2254,13 @@ typedef struct {
|
||||
*/
|
||||
int crypt_token_register(const crypt_token_handler *handler);
|
||||
|
||||
/**
|
||||
* Report external token handlers (plugins) support
|
||||
|
||||
* @return @e 0 when enabled or negative errno value otherwise.
|
||||
*/
|
||||
int crypt_token_external_support(void);
|
||||
|
||||
/** ABI version for external token in libcryptsetup-token-<name>.so */
|
||||
#define CRYPT_TOKEN_ABI_VERSION1 "CRYPTSETUP_TOKEN_1.0"
|
||||
|
||||
|
||||
@@ -142,4 +142,5 @@ CRYPTSETUP_2.4 {
|
||||
crypt_activate_by_token_pin;
|
||||
crypt_dump_json;
|
||||
crypt_format;
|
||||
crypt_token_external_support;
|
||||
} CRYPTSETUP_2.0;
|
||||
|
||||
@@ -38,6 +38,15 @@ static struct crypt_token_handler_internal token_handlers[LUKS2_TOKENS_MAX] = {
|
||||
}
|
||||
};
|
||||
|
||||
int crypt_token_external_support(void)
|
||||
{
|
||||
#if USE_EXTERNAL_TOKENS
|
||||
return 0;
|
||||
#else
|
||||
return -ENOTSUP;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if USE_EXTERNAL_TOKENS
|
||||
static void *token_dlvsym(struct crypt_device *cd,
|
||||
void *handle,
|
||||
|
||||
Reference in New Issue
Block a user