Return-Path: Received: from mail.saout.de ([127.0.0.1]) by localhost (mail.saout.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i1QELnDfElRY for ; Tue, 20 Nov 2012 20:10:01 +0100 (CET) Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108]) by mail.saout.de (Postfix) with ESMTP for ; Tue, 20 Nov 2012 20:10:01 +0100 (CET) Received: from pip.fifthhorseman.net (lair.fifthhorseman.net [108.58.6.98]) by che.mayfirst.org (Postfix) with ESMTPSA id 538C7F970 for ; Tue, 20 Nov 2012 14:02:16 -0500 (EST) From: Daniel Kahn Gillmor Date: Tue, 20 Nov 2012 14:02:06 -0500 Message-ID: <87r4no85e9.fsf@pip.fifthhorseman.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Subject: [dm-crypt] cryptsetup --iter-time default should be configurable (and reported in --help) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hi folks-- I just noticed that the default for cryptsetup --iter-time isn't visible in the output of cryptsetup --help. I went looking to change this, and saw that the default is neither configurable nor easily extracted. The attached patch should make the default for this parameter configurable (e.g. ./configure --with-luks1-iter-time=1000), as well as reporting the compiled-in default in the output of --help. I'm not currently subscribed to the dm-crypt mailing list; please Cc me on replies. Thanks very much for all your work on dm-crypt -- it's a valuable component in the operating systems i use! Regards, --dkg --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-make-default-LUKS-PBKDF2-iteration-time-configurable.patch Content-Transfer-Encoding: quoted-printable Content-Description: make --iter-time default configurable and documented From=20fe6a079e055dc7b4ba2e14531582d82411d3d7b8 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Tue, 20 Nov 2012 13:43:28 -0500 Subject: [PATCH] make default LUKS PBKDF2 iteration time configurable =2D-- configure.in | 1 + src/cryptsetup.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 6b7a79b..c937ab3 100644 =2D-- a/configure.in +++ b/configure.in @@ -346,6 +346,7 @@ CS_STR_WITH([luks1-hash], [hash function for LUKS1 he= ader], [sha1]) CS_STR_WITH([luks1-cipher], [cipher for LUKS1], [aes]) CS_STR_WITH([luks1-mode], [cipher mode for LUKS1], [cbc-essiv:sha256]) CS_NUM_WITH([luks1-keybits],[key length in bits for LUKS1], [256]) +CS_NUM_WITH([luks1-iter-time],[PBKDF2 iteration time for LUKS1 (in msec)],= [1000]) =20 CS_STR_WITH([loopaes-cipher], [cipher for loop-AES mode], [aes]) CS_NUM_WITH([loopaes-keybits],[key length in bits for loop-AES mode], [256= ]) diff --git a/src/cryptsetup.c b/src/cryptsetup.c index 0cc7f07..eae14ee 100644 =2D-- a/src/cryptsetup.c +++ b/src/cryptsetup.c @@ -44,7 +44,7 @@ static uint64_t opt_offset =3D 0; static uint64_t opt_skip =3D 0; static int opt_skip_valid =3D 0; static int opt_readonly =3D 0; =2Dstatic int opt_iteration_time =3D 1000; +static int opt_iteration_time =3D DEFAULT_LUKS1_ITER_TIME; static int opt_version_mode =3D 0; static int opt_timeout =3D 0; static int opt_tries =3D 3; @@ -1165,10 +1165,12 @@ static void help(poptContext popt_context, " optional key file for the new key for luksAddKey action\n"= ), crypt_get_dir()); =20 =2D log_std(_("\nDefault compiled-in keyfile parameters:\n" + log_std(_("\nDefault compiled-in key and passphrase parameters:\n" "\tMaximum keyfile size: %dkB, " =2D "Maximum interactive passphrase length %d (characters)\n"), =2D DEFAULT_KEYFILE_SIZE_MAXKB, DEFAULT_PASSPHRASE_SIZE_MAX); + "Maximum interactive passphrase length %d (characters)\n" + "Default PBKDF2 iteration time for LUKS: %d (msec)\n"), + DEFAULT_KEYFILE_SIZE_MAXKB, DEFAULT_PASSPHRASE_SIZE_MAX, + DEFAULT_LUKS1_ITER_TIME); =20 log_std(_("\nDefault compiled-in device cipher parameters:\n" "\tloop-AES: %s, Key %d bits\n" =2D-=20 1.7.10.4 --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQJ8BAEBCgBmBQJQq9OwXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwRUU1QkU5NzkyODJEODBCOUY3NTQwRjFD Q0QyRUQ5NEQyMTczOUU5AAoJEMzS7ZTSFznpdsYP/19iYqoRGEThMtQvKOynIxON 1b+bMaROL0+jIkabP5O3EVYukIsaMRSQn3+IeV+Ow26ex6u/scKJUYqWL7P6wtey M1gk/ZBkZpcROl0ZESIKOX4dnEdgtluWT4EVncrKiDEKjLksVuod1EvPyOsPHgmX Xd6qGH7pSUa/NZ7Ds6VuR4JdPa2tmNIDNQ7EhdRtmZRhVyWLPU0OYAzrp2PLUdm4 h4ZhO+3zHULTc76jN64iTysnbYwJhtioXttJpkKpGK5RC8EqyuvgYoBe4nIYb/3b Kh3PZeNzab32VwtPfCb/SOPVysulEDSw3p5nsDEY1NoOJBgi+nYJKIgQqjti8ic/ jsksDfQdBjeohG73kOZlyLGH42oyeVSDaWcfwlIbbVWn2ASq/F9K2vMe7lagzHX8 GL6OX2DI6xvdwG1+wH8jl6wQYXtZSuRGR1LyHZHfm5B+l7TrIWsjEoiVHiNsU2XJ dX91McTGNQMh6Ij7dosDocnEvo3+u+qd9PXykRlGQEPiB1vhV+RCXSHz2ddpiWLx KLiNjic7bhufsq1ExYs3h2t3kO8p5L2IcRAF/pppGEr2vG9tBc+wz7k2BTqSsOqC 7leO9k2ru9YM8GgjdsZuCZFoFoMPIPiOfDgFJ4MnIMNx7SNkdvt8pDlpHQRlNN/d Zy2yc1AIQvi2Ejb1gaDE =+M5D -----END PGP SIGNATURE----- --==-=-=--