Make passphrase prompts more consistent.

Also see http://code.google.com/p/cryptsetup/issues/detail?id=145
This commit is contained in:
Milan Broz
2013-02-11 14:53:49 +01:00
parent 433758e4cb
commit fd5b88449a
2 changed files with 10 additions and 10 deletions

View File

@@ -657,7 +657,7 @@ static int action_luksFormat(void)
else if (opt_urandom) else if (opt_urandom)
crypt_set_rng_type(cd, CRYPT_RNG_URANDOM); crypt_set_rng_type(cd, CRYPT_RNG_URANDOM);
r = tools_get_key(_("Enter LUKS passphrase: "), &password, &passwordLen, r = tools_get_key(_("Enter passphrase: "), &password, &passwordLen,
opt_keyfile_offset, opt_keyfile_size, opt_key_file, opt_keyfile_offset, opt_keyfile_size, opt_key_file,
opt_timeout, _verify_passphrase(1), 1, cd); opt_timeout, _verify_passphrase(1), 1, cd);
if (r < 0) if (r < 0)
@@ -828,7 +828,7 @@ static int action_luksKillSlot(void)
if (!opt_batch_mode) { if (!opt_batch_mode) {
r = verify_keyslot(cd, opt_key_slot, r = verify_keyslot(cd, opt_key_slot,
_("This is the last keyslot. Device will become unusable after purging this key."), _("This is the last keyslot. Device will become unusable after purging this key."),
_("Enter any remaining LUKS passphrase: "), _("Enter any remaining passphrase: "),
opt_key_file, opt_keyfile_offset, opt_keyfile_size); opt_key_file, opt_keyfile_offset, opt_keyfile_size);
if (r < 0) if (r < 0)
goto out; goto out;
@@ -856,7 +856,7 @@ static int action_luksRemoveKey(void)
if ((r = crypt_load(cd, CRYPT_LUKS1, NULL))) if ((r = crypt_load(cd, CRYPT_LUKS1, NULL)))
goto out; goto out;
r = tools_get_key(_("Enter LUKS passphrase to be deleted: "), r = tools_get_key(_("Enter passphrase to be deleted: "),
&password, &passwordLen, &password, &passwordLen,
opt_keyfile_offset, opt_keyfile_size, opt_key_file, opt_keyfile_offset, opt_keyfile_size, opt_key_file,
opt_timeout, opt_timeout,
@@ -925,7 +925,7 @@ static int action_luksAddKey(void)
opt_key_file, opt_keyfile_size, opt_keyfile_offset, opt_key_file, opt_keyfile_size, opt_keyfile_offset,
opt_new_key_file, opt_new_keyfile_size, opt_new_keyfile_offset); opt_new_key_file, opt_new_keyfile_size, opt_new_keyfile_offset);
} else { } else {
r = tools_get_key(_("Enter any passphrase: "), r = tools_get_key(_("Enter any existing passphrase: "),
&password, &password_size, 0, 0, NULL, &password, &password_size, 0, 0, NULL,
opt_timeout, _verify_passphrase(0), 0, cd); opt_timeout, _verify_passphrase(0), 0, cd);
@@ -974,7 +974,7 @@ static int action_luksChangeKey(void)
if (opt_iteration_time) if (opt_iteration_time)
crypt_set_iteration_time(cd, opt_iteration_time); crypt_set_iteration_time(cd, opt_iteration_time);
r = tools_get_key(_("Enter LUKS passphrase to be changed: "), r = tools_get_key(_("Enter passphrase to be changed: "),
&password, &password_size, &password, &password_size,
opt_keyfile_offset, opt_keyfile_size, opt_key_file, opt_keyfile_offset, opt_keyfile_size, opt_key_file,
opt_timeout, _verify_passphrase(0), 0, cd); opt_timeout, _verify_passphrase(0), 0, cd);
@@ -988,7 +988,7 @@ static int action_luksChangeKey(void)
if (r < 0) if (r < 0)
goto out; goto out;
r = tools_get_key(_("Enter new LUKS passphrase: "), r = tools_get_key(_("Enter new passphrase: "),
&password_new, &password_new_size, &password_new, &password_new_size,
opt_new_keyfile_offset, opt_new_keyfile_size, opt_new_keyfile_offset, opt_new_keyfile_size,
opt_new_key_file, opt_new_key_file,
@@ -1067,7 +1067,7 @@ static int luksDump_with_volume_key(struct crypt_device *cd)
if (!vk) if (!vk)
return -ENOMEM; return -ENOMEM;
r = tools_get_key(_("Enter LUKS passphrase: "), &password, &passwordLen, r = tools_get_key(_("Enter passphrase: "), &password, &passwordLen,
opt_keyfile_offset, opt_keyfile_size, opt_key_file, opt_keyfile_offset, opt_keyfile_size, opt_key_file,
opt_timeout, 0, 0, cd); opt_timeout, 0, 0, cd);
if (r < 0) if (r < 0)

View File

@@ -931,7 +931,7 @@ static int initialize_passphrase(struct reenc_ctx *rc, const char *device)
log_dbg("Passhrases initialization."); log_dbg("Passhrases initialization.");
if (opt_new && !rc->in_progress) { if (opt_new && !rc->in_progress) {
r = init_passphrase1(rc, cd, _("Enter new LUKS passphrase: "), 0, 0); r = init_passphrase1(rc, cd, _("Enter new passphrase: "), 0, 0);
return r > 0 ? 0 : r; return r > 0 ? 0 : r;
} }
@@ -945,14 +945,14 @@ static int initialize_passphrase(struct reenc_ctx *rc, const char *device)
if (opt_key_file) { if (opt_key_file) {
r = init_keyfile(rc, cd, opt_key_slot); r = init_keyfile(rc, cd, opt_key_slot);
} else if (rc->in_progress) { } else if (rc->in_progress) {
r = init_passphrase1(rc, cd, _("Enter any LUKS passphrase: "), r = init_passphrase1(rc, cd, _("Enter any existing passphrase: "),
CRYPT_ANY_SLOT, 1); CRYPT_ANY_SLOT, 1);
} else for (i = 0; i < MAX_SLOT; i++) { } else for (i = 0; i < MAX_SLOT; i++) {
ki = crypt_keyslot_status(cd, i); ki = crypt_keyslot_status(cd, i);
if (ki != CRYPT_SLOT_ACTIVE && ki != CRYPT_SLOT_ACTIVE_LAST) if (ki != CRYPT_SLOT_ACTIVE && ki != CRYPT_SLOT_ACTIVE_LAST)
continue; continue;
snprintf(msg, sizeof(msg), _("Enter LUKS passphrase for key slot %u: "), i); snprintf(msg, sizeof(msg), _("Enter passphrase for key slot %u: "), i);
r = init_passphrase1(rc, cd, msg, i, 1); r = init_passphrase1(rc, cd, msg, i, 1);
if (r < 0) if (r < 0)
break; break;