From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjRzj-0005ZW-7c for qemu-devel@nongnu.org; Mon, 12 Sep 2016 10:14:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjRze-0005Rs-ET for qemu-devel@nongnu.org; Mon, 12 Sep 2016 10:13:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjRze-0005Rl-9J for qemu-devel@nongnu.org; Mon, 12 Sep 2016 10:13:54 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EF7FA89C28 for ; Mon, 12 Sep 2016 14:13:53 +0000 (UTC) From: "Daniel P. Berrange" Date: Mon, 12 Sep 2016 15:13:41 +0100 Message-Id: <1473689623-28870-6-git-send-email-berrange@redhat.com> In-Reply-To: <1473689623-28870-1-git-send-email-berrange@redhat.com> References: <1473689623-28870-1-git-send-email-berrange@redhat.com> Subject: [Qemu-devel] [PATCH v2 5/7] crypto: remove bogus /= 2 for pbkdf iterations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Signed-off-by: Daniel P. Berrange --- 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