qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL v1 5/8] crypto: remove bogus /= 2 for pbkdf iteration


From: Daniel P. Berrange
Subject: [Qemu-devel] [PULL v1 5/8] crypto: remove bogus /= 2 for pbkdf iterations
Date: Mon, 19 Sep 2016 12:44:09 +0100

When calculating iterations for pbkdf of the key slot
data, we had a /= 2, which was copied from identical
code in cryptsetup. It was always unclear & undocumented
why cryptsetup had this division and it was recently
removed there, too.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
---
 crypto/block-luks.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/crypto/block-luks.c b/crypto/block-luks.c
index 9269aaf..3ab3250 100644
--- a/crypto/block-luks.c
+++ b/crypto/block-luks.c
@@ -1170,10 +1170,6 @@ qcrypto_block_luks_create(QCryptoBlock *block,
     /* iter_time was in millis, but count_iters reported for secs */
     iters = iters * luks_opts.iter_time / 1000;
 
-    /* Why /= 2 ?  That matches cryptsetup, but there's no
-     * explanation why they chose /= 2... */
-    iters /= 2;
-
     if (iters > UINT32_MAX) {
         error_setg_errno(errp, ERANGE,
                          "PBKDF iterations %llu larger than %u",
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]