mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-12 11:20:10 +01:00
Implement external tokens unload.
This commit is contained in:
committed by
Milan Broz
parent
05c997da1f
commit
c9ff83bfa3
@@ -273,6 +273,8 @@ int LUKS2_token_keyring_get(struct crypt_device *cd,
|
||||
int LUKS2_token_keyring_json(char *buffer, size_t buffer_size,
|
||||
const struct crypt_token_params_luks2_keyring *keyring_params);
|
||||
|
||||
void crypt_token_unload_external_all(struct crypt_device *cd);
|
||||
|
||||
/*
|
||||
* Generic LUKS2 digest
|
||||
*/
|
||||
|
||||
@@ -131,6 +131,21 @@ int crypt_token_load(const char *name)
|
||||
return crypt_token_load_external(name, &token_handlers[i]);
|
||||
}
|
||||
|
||||
void crypt_token_unload_external_all(struct crypt_device *cd)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = LUKS2_TOKENS_MAX - 1; i >= 0; i--) {
|
||||
if (!token_handlers[i].dlhandle)
|
||||
continue;
|
||||
|
||||
log_dbg(cd, "Unloading %s token handler.", token_handlers[i].h->name);
|
||||
|
||||
if (dlclose(CONST_CAST(void *)token_handlers[i].dlhandle))
|
||||
log_dbg(cd, "%s", dlerror());
|
||||
}
|
||||
}
|
||||
|
||||
static const crypt_token_handler
|
||||
*LUKS2_token_handler_type(struct crypt_device *cd, const char *type)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user