Export memory safe functions.

Make crypt_safe_alloc/realloc/free and memzero part of API.
This commit is contained in:
Milan Broz
2019-11-08 16:19:24 +01:00
parent e08401a2ec
commit b03cb3f3d8
18 changed files with 196 additions and 132 deletions

View File

@@ -448,7 +448,7 @@ static int tcrypt_load(struct crypt_device *cd, struct crypt_params_tcrypt *para
continue;
params->veracrypt_pim = (uint32_t)tmp_pim_ull;
crypt_memzero(&tmp_pim_ull, sizeof(tmp_pim_ull));
crypt_safe_memzero(&tmp_pim_ull, sizeof(tmp_pim_ull));
}
if (opt_tcrypt_hidden)
@@ -512,7 +512,7 @@ static int action_open_tcrypt(void)
out:
crypt_free(cd);
crypt_safe_free(CONST_CAST(char*)params.passphrase);
crypt_memzero(&params.veracrypt_pim, sizeof(params.veracrypt_pim));
crypt_safe_memzero(&params.veracrypt_pim, sizeof(params.veracrypt_pim));
return r;
}