Commit f60475e2 authored by Milan Broz's avatar Milan Broz

Fix DEBUG output (thanks to Ivan Stankovic)



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@75 36d66b0a-2a48-0410-832c-cd162a569da5
parent e3e3027e
2009-07-30 Milan Broz <mbroz@redhat.com>
* Fix errors when compiled with LUKS_DEBUG.
2009-07-28 Milan Broz <mbroz@redhat.com>
* Pad luks header to 512 sector size.
* Rework read/write blockwise to not split operation to many pieces.
......
......@@ -457,9 +457,14 @@ static int __crypt_luks_format(int arg, struct setup_backend *backend, struct cr
if(NULL == mk) return -ENOMEM; // FIXME This may be misleading, since we don't know what went wrong
#ifdef LUKS_DEBUG
#define printoffset(entry) logger(options, CRYPT_LOG_ERROR, ("offset of " #entry " = %d\n", (char *)(&header.entry)-(char *)(&header))
#define printoffset(entry) \
logger(options, CRYPT_LOG_ERROR, \
"offset of " #entry " = %d\n", (char *)(&header.entry)-(char *)(&header))
logger(options, CRYPT_LOG_ERROR, "sizeof phdr %d, key slot %d\n",sizeof(struct luks_phdr),sizeof(header.keyblock[0]));
logger(options, CRYPT_LOG_ERROR,
"sizeof phdr %d, sizeof key slot %d\n",
sizeof(struct luks_phdr),
sizeof(header.keyblock[0]));
printoffset(magic);
printoffset(version);
......@@ -491,7 +496,7 @@ static int __crypt_luks_format(int arg, struct setup_backend *backend, struct cr
PBKDF2perSecond = LUKS_benchmarkt_iterations();
header.keyblock[keyIndex].passwordIterations = at_least_one(PBKDF2perSecond * ((float)options->iteration_time / 1000.0));
#ifdef LUKS_DEBUG
logger(options->icb->log,CRYPT_LOG_ERROR, "pitr %d\n", header.keyblock[0].passwordIterations);
logger(options, CRYPT_LOG_ERROR, "pitr %d\n", header.keyblock[0].passwordIterations);
#endif
get_key("Enter LUKS passphrase: ",&password,&passwordLen, 0, options->new_key_file, options->passphrase_fd, options->timeout, options->flags);
if(!password) {
......
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