Commit 828e6f20 authored by Milan Broz's avatar Milan Broz

Skip legacy TrueCrypt algoritms if PIM is specified.

parent 982b7373
......@@ -31,7 +31,7 @@
#include "internal.h"
/* TCRYPT PBKDF variants */
static struct {
static const struct {
unsigned int legacy:1;
unsigned int veracrypt:1;
const char *name;
......@@ -538,8 +538,10 @@ static int TCRYPT_init_hdr(struct crypt_device *cd,
continue;
if (!(params->flags & CRYPT_TCRYPT_VERA_MODES) && tcrypt_kdf[i].veracrypt)
continue;
if ((params->flags & CRYPT_TCRYPT_VERA_MODES) && tcrypt_kdf[i].veracrypt &&
params->veracrypt_pim) {
if ((params->flags & CRYPT_TCRYPT_VERA_MODES) && params->veracrypt_pim) {
/* Do not try TrueCrypt modes if we have PIM value */
if (!tcrypt_kdf[i].veracrypt)
continue;
/* adjust iterations to given PIM cmdline parameter */
if (params->flags & CRYPT_TCRYPT_SYSTEM_HEADER)
iterations = params->veracrypt_pim * 2048;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment