2010-02-25 Milan Broz <mbroz@redhat.com>
* 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>
* If gcrypt compiled with capabilities, document workaround for cryptsetup (see lib/gcrypt.c).
* and it locks its memory space anyway.
*/
#if 0
+ log_dbg("Initializing crypto backend (secure memory disabled).");
gcry_control (GCRYCTL_DISABLE_SECMEM);
#else
+ log_dbg("Initializing crypto backend (using secure memory).");
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0);
gcry_control (GCRYCTL_RESUME_SECMEM_WARN);
if ((requested_type && !isLUKS(requested_type)) || !backup_file)
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 "
"file %s.", cd->device, requested_type, backup_file);
if (requested_type && !isLUKS(requested_type))
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 "
"file %s.", cd->device, requested_type, backup_file);