mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-12 11:20:10 +01:00
Properly initialise crypto backend in header backup/restore commands. (fixes issue #49)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@190 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
2010-02-25 Milan Broz <mbroz@redhat.com>
|
2010-02-25 Milan Broz <mbroz@redhat.com>
|
||||||
* Do not verify unlocking passphrase in luksAddKey command.
|
* Do not verify unlocking passphrase in luksAddKey command.
|
||||||
|
* Properly initialise crypto backend in header backup/restore commands.
|
||||||
|
|
||||||
2010-01-17 Milan Broz <mbroz@redhat.com>
|
2010-01-17 Milan Broz <mbroz@redhat.com>
|
||||||
* If gcrypt compiled with capabilities, document workaround for cryptsetup (see lib/gcrypt.c).
|
* If gcrypt compiled with capabilities, document workaround for cryptsetup (see lib/gcrypt.c).
|
||||||
|
|||||||
@@ -23,8 +23,10 @@ int init_crypto(void)
|
|||||||
* and it locks its memory space anyway.
|
* and it locks its memory space anyway.
|
||||||
*/
|
*/
|
||||||
#if 0
|
#if 0
|
||||||
|
log_dbg("Initializing crypto backend (secure memory disabled).");
|
||||||
gcry_control (GCRYCTL_DISABLE_SECMEM);
|
gcry_control (GCRYCTL_DISABLE_SECMEM);
|
||||||
#else
|
#else
|
||||||
|
log_dbg("Initializing crypto backend (using secure memory).");
|
||||||
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
|
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
|
||||||
gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0);
|
gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0);
|
||||||
gcry_control (GCRYCTL_RESUME_SECMEM_WARN);
|
gcry_control (GCRYCTL_RESUME_SECMEM_WARN);
|
||||||
|
|||||||
12
lib/setup.c
12
lib/setup.c
@@ -1213,6 +1213,12 @@ int crypt_header_backup(struct crypt_device *cd,
|
|||||||
if ((requested_type && !isLUKS(requested_type)) || !backup_file)
|
if ((requested_type && !isLUKS(requested_type)) || !backup_file)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
/* Some hash functions need initialized gcrypt library */
|
||||||
|
if (init_crypto()) {
|
||||||
|
log_err(cd, _("Cannot initialize crypto backend.\n"));
|
||||||
|
return -ENOSYS;
|
||||||
|
}
|
||||||
|
|
||||||
log_dbg("Requested header backup of device %s (%s) to "
|
log_dbg("Requested header backup of device %s (%s) to "
|
||||||
"file %s.", cd->device, requested_type, backup_file);
|
"file %s.", cd->device, requested_type, backup_file);
|
||||||
|
|
||||||
@@ -1226,6 +1232,12 @@ int crypt_header_restore(struct crypt_device *cd,
|
|||||||
if (requested_type && !isLUKS(requested_type))
|
if (requested_type && !isLUKS(requested_type))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
/* Some hash functions need initialized gcrypt library */
|
||||||
|
if (init_crypto()) {
|
||||||
|
log_err(cd, _("Cannot initialize crypto backend.\n"));
|
||||||
|
return -ENOSYS;
|
||||||
|
}
|
||||||
|
|
||||||
log_dbg("Requested header restore to device %s (%s) from "
|
log_dbg("Requested header restore to device %s (%s) from "
|
||||||
"file %s.", cd->device, requested_type, backup_file);
|
"file %s.", cd->device, requested_type, backup_file);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user