Remove password callback interface.

This was a design mistake and should not be handled inside libcryptsetup code.
This commit is contained in:
Milan Broz
2015-08-20 10:38:28 +02:00
parent 5293f5aae1
commit 4aea3b81ee
8 changed files with 14 additions and 251 deletions

View File

@@ -151,9 +151,6 @@ static int action_open_plain(void)
if ((r = crypt_init(&cd, action_argv[0])))
goto out;
crypt_set_timeout(cd, opt_timeout);
crypt_set_password_retry(cd, opt_tries);
r = crypt_format(cd, CRYPT_PLAIN,
cipher, cipher_mode,
NULL, NULL,
@@ -720,7 +717,6 @@ static int action_luksFormat(void)
keysize = (opt_key_size ?: DEFAULT_LUKS1_KEYBITS) / 8;
crypt_set_timeout(cd, opt_timeout);
if (opt_iteration_time)
crypt_set_iteration_time(cd, opt_iteration_time);
@@ -786,10 +782,6 @@ static int action_open_luks(void)
goto out;
}
crypt_set_timeout(cd, opt_timeout);
crypt_set_password_retry(cd, opt_tries);
crypt_set_password_verify(cd, _verify_passphrase(0));
if (opt_iteration_time)
crypt_set_iteration_time(cd, opt_iteration_time);
@@ -803,7 +795,6 @@ static int action_open_luks(void)
r = crypt_activate_by_volume_key(cd, activated_name,
key, keysize, activate_flags);
} else if (opt_key_file) {
crypt_set_password_retry(cd, 1);
r = crypt_activate_by_keyfile_offset(cd, activated_name,
opt_key_slot, opt_key_file, opt_keyfile_size,
opt_keyfile_offset, activate_flags);
@@ -870,7 +861,6 @@ static int action_luksKillSlot(void)
goto out;
crypt_set_confirm_callback(cd, yesDialog, NULL);
crypt_set_timeout(cd, opt_timeout);
if ((r = crypt_load(cd, CRYPT_LUKS1, NULL)))
goto out;
@@ -913,7 +903,6 @@ static int action_luksRemoveKey(void)
goto out;
crypt_set_confirm_callback(cd, yesDialog, NULL);
crypt_set_timeout(cd, opt_timeout);
if ((r = crypt_load(cd, CRYPT_LUKS1, NULL)))
goto out;
@@ -973,9 +962,6 @@ static int action_luksAddKey(void)
opt_force_password = 1;
keysize = crypt_get_volume_key_size(cd);
/* FIXME: lib cannot properly set verification for new/old passphrase */
crypt_set_password_verify(cd, _verify_passphrase(0));
crypt_set_timeout(cd, opt_timeout);
if (opt_iteration_time)
crypt_set_iteration_time(cd, opt_iteration_time);
@@ -1233,10 +1219,6 @@ static int action_luksResume(void)
if ((r = crypt_init_by_name_and_header(&cd, action_argv[0], uuid_or_device(opt_header_device))))
goto out;
crypt_set_timeout(cd, opt_timeout);
crypt_set_password_retry(cd, opt_tries);
crypt_set_password_verify(cd, _verify_passphrase(0));
if (opt_key_file)
r = crypt_resume_by_keyfile_offset(cd, action_argv[0], CRYPT_ANY_SLOT,
opt_key_file, opt_keyfile_size, opt_keyfile_offset);