Rename without_activation to test_passphrase.

This commit is contained in:
Milan Broz
2012-06-19 17:37:31 +02:00
parent 0ec4d4c9cf
commit 527c0fe4f9
4 changed files with 11 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
2012-06-18 Milan Broz <gmazyland@gmail.com> 2012-06-18 Milan Broz <gmazyland@gmail.com>
* Introduce cryptsetup-reencrypt - experimental offline LUKS reencryption tool. * Introduce cryptsetup-reencrypt - experimental offline LUKS reencryption tool.
* Fix luks-header-from-active script (do not use LUKS header on-disk, add UUID). * Fix luks-header-from-active script (do not use LUKS header on-disk, add UUID).
* Add --without-activation option for luksOpen (check passphrase only). * Add --test-passphrase option for luksOpen (check passphrase only).
2012-06-11 Milan Broz <gmazyland@gmail.com> 2012-06-11 Milan Broz <gmazyland@gmail.com>
* Introduce veritysetup for dm-verity target management. * Introduce veritysetup for dm-verity target management.

View File

@@ -144,7 +144,7 @@ The <device> parameter can be also specified by LUKS UUID in the
format UUID=<uuid>, which uses the symlinks in /dev/disk/by-uuid. format UUID=<uuid>, which uses the symlinks in /dev/disk/by-uuid.
\fB<options>\fR can be [\-\-key-file, \-\-keyfile-offset, \fB<options>\fR can be [\-\-key-file, \-\-keyfile-offset,
\-\-keyfile-size, \-\-readonly, \-\-without-activation, \-\-keyfile-size, \-\-readonly, \-\-test-passphrase,
\-\-allow-discards, \-\-header, \-\-key-slot, \-\-master-key-file]. \-\-allow-discards, \-\-header, \-\-key-slot, \-\-master-key-file].
.PP .PP
\fIluksClose\fR <name> \fIluksClose\fR <name>
@@ -613,7 +613,7 @@ later. If in doubt, do no use it.
A kernel version of 3.1 or later is needed. For earlier kernels A kernel version of 3.1 or later is needed. For earlier kernels
this option is ignored. this option is ignored.
.TP .TP
.B "\-\-without-activation\fR" .B "\-\-test-passphrase\fR"
Do not activate device, just verify passphrase. Do not activate device, just verify passphrase.
This option is only relevant for \fIluksOpen\fR. This option is only relevant for \fIluksOpen\fR.
.TP .TP
@@ -807,7 +807,7 @@ Copyright \(co 2004 Christophe Saout
.br .br
Copyright \(co 2004-2006 Clemens Fruhwirth Copyright \(co 2004-2006 Clemens Fruhwirth
.br .br
Copyright \(co 2009-2011 Red Hat, Inc. Copyright \(co 2009-2012 Red Hat, Inc.
.br .br
Copyright \(co 2012 Arno Wagner Copyright \(co 2012 Arno Wagner

View File

@@ -68,7 +68,7 @@ static int opt_urandom = 0;
static int opt_dump_master_key = 0; static int opt_dump_master_key = 0;
static int opt_shared = 0; static int opt_shared = 0;
static int opt_allow_discards = 0; static int opt_allow_discards = 0;
static int opt_without_activation = 0; static int opt_test_passphrase = 0;
static const char **action_argv; static const char **action_argv;
static int action_argc; static int action_argc;
@@ -642,7 +642,7 @@ static int action_luksOpen(int arg __attribute__((unused)))
data_device = NULL; data_device = NULL;
} }
activated_name = opt_without_activation ? NULL : action_argv[1]; activated_name = opt_test_passphrase ? NULL : action_argv[1];
if ((r = crypt_init(&cd, header_device))) if ((r = crypt_init(&cd, header_device)))
goto out; goto out;
@@ -1307,7 +1307,7 @@ int main(int argc, const char **argv)
{ "uuid", '\0', POPT_ARG_STRING, &opt_uuid, 0, N_("UUID for device to use."), NULL }, { "uuid", '\0', POPT_ARG_STRING, &opt_uuid, 0, N_("UUID for device to use."), NULL },
{ "allow-discards", '\0', POPT_ARG_NONE, &opt_allow_discards, 0, N_("Allow discards (aka TRIM) requests for device."), NULL }, { "allow-discards", '\0', POPT_ARG_NONE, &opt_allow_discards, 0, N_("Allow discards (aka TRIM) requests for device."), NULL },
{ "header", '\0', POPT_ARG_STRING, &opt_header_device, 0, N_("Device or file with separated LUKS header."), NULL }, { "header", '\0', POPT_ARG_STRING, &opt_header_device, 0, N_("Device or file with separated LUKS header."), NULL },
{ "without-activation",'\0', POPT_ARG_NONE, &opt_without_activation, 0, N_("Do not activate device, just check passphrase."), NULL }, { "test-passphrase", '\0', POPT_ARG_NONE, &opt_test_passphrase, 0, N_("Do not activate device, just check passphrase."), NULL },
POPT_TABLEEND POPT_TABLEEND
}; };
poptContext popt_context; poptContext popt_context;
@@ -1416,10 +1416,10 @@ int main(int argc, const char **argv)
"To limit read from keyfile use --keyfile-size=(bytes)."), "To limit read from keyfile use --keyfile-size=(bytes)."),
poptGetInvocationName(popt_context)); poptGetInvocationName(popt_context));
if (opt_without_activation && if (opt_test_passphrase &&
strcmp(aname, "luksOpen")) strcmp(aname, "luksOpen"))
usage(popt_context, EXIT_FAILURE, usage(popt_context, EXIT_FAILURE,
_("Option --without-activation is allowed only for luksOpen.\n"), _("Option --test-passphrase is allowed only for luksOpen.\n"),
poptGetInvocationName(popt_context)); poptGetInvocationName(popt_context));
if (opt_key_size % 8) if (opt_key_size % 8)

View File

@@ -158,8 +158,8 @@ echo "key0" | $CRYPTSETUP -i 1000 -h sha512 -c aes-cbc-essiv:sha256 -s 128 luksF
check "$LUKS_HEADER $KEY_SLOT0 $KEY_MATERIAL0" check "$LUKS_HEADER $KEY_SLOT0 $KEY_MATERIAL0"
prepare "[5] open" prepare "[5] open"
echo "key0" | $CRYPTSETUP luksOpen $LOOPDEV $DEV_NAME --without-activation || fail echo "key0" | $CRYPTSETUP luksOpen $LOOPDEV $DEV_NAME --test-passphrase || fail
echo "blah" | $CRYPTSETUP luksOpen $LOOPDEV $DEV_NAME --without-activation 2>/dev/null && fail echo "blah" | $CRYPTSETUP luksOpen $LOOPDEV $DEV_NAME --test-passphrase 2>/dev/null && fail
echo "key0" | $CRYPTSETUP luksOpen $LOOPDEV $DEV_NAME || fail echo "key0" | $CRYPTSETUP luksOpen $LOOPDEV $DEV_NAME || fail
check_exists check_exists