mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 11:50:10 +01:00
Initialize crypto library before LUKS header load.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@111 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
14
lib/gcrypt.c
14
lib/gcrypt.c
@@ -9,6 +9,20 @@
|
||||
#define MAX_DIGESTS 64
|
||||
#define GCRYPT_REQ_VERSION "1.1.42"
|
||||
|
||||
int init_crypto(void)
|
||||
{
|
||||
if (!gcry_control (GCRYCTL_INITIALIZATION_FINISHED_P)) {
|
||||
//if (!gcry_check_version (GCRYPT_VERSION))
|
||||
// return -ENOSYS;
|
||||
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
|
||||
gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0);
|
||||
gcry_control (GCRYCTL_RESUME_SECMEM_WARN);
|
||||
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gcrypt_hash(void *data, int size, char *key,
|
||||
int sizep, const char *passphrase)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user