Project

General

Profile

Bug #3028 » fn_get_passphrase.patch

tuxillo, 06/03/2022 05:12 PM

View differences:

usr.sbin/installer/dfuibe_installer/fn.h
void fn_select_disk(struct i_fn_args *);
void fn_select_slice(struct i_fn_args *);
void fn_get_passphrase(struct i_fn_args *);
void fn_get_passphrase(struct i_fn_args *, int);
/* Configure an Installed System (only) */
usr.sbin/installer/dfuibe_installer/fn_configure.c
}
void
fn_get_passphrase(struct i_fn_args *a)
fn_get_passphrase(struct i_fn_args *a, int configuring)
{
struct dfui_dataset *ds, *new_ds;
struct dfui_form *f;
......
int fd;
int done = 0;
f = dfui_form_create(
"crypt_passphrase",
_("Set Passphrase For Encryption"),
_("Please specify the passphrase to be used for the encrypted "
"filesystems.\n\n"
"Please note that in the LiveCD environment the keymap is set to "
"\"US ISO\". "
"If you prefer a different keymap for entering the passphrase "
"here, you will need to set it manually using kbdcontrol(1)."),
"",
"f", "passphrase_1", _("Passphrase"),
_("Enter the passphrase you would like to use for encryption"), "",
"p", "obscured", "true",
"f", "passphrase_2", _("Passphrase again"),
_("Enter the passphrase again to confirm"), "",
"p", "obscured", "true",
"a", "ok", _("Accept and Set Passphrase"), "", "",
"p", "accelerator", "ESC",
NULL
);
if (configuring) {
f = dfui_form_create(
"crypt_passphrase",
_("Specify Encryption Passphrase"),
_("Please, enter the passphrase to decrypt and mount the "
"filesystems.\n\n"
"Please note that in the LiveCD environment the keymap is set to "
"\"US ISO\". "
"If you prefer a different keymap for entering the passphrase "
"here, you will need to set it manually using kbdcontrol(1)."),
"",
"f", "passphrase_1", _("Passphrase"),
_("Enter the passphrase you would like to use for encryption"), "",
"p", "obscured", "true",
"a", "ok", _("Accept and Set Passphrase"), "", "",
"p", "accelerator", "ESC",
NULL
);
} else {
f = dfui_form_create(
"crypt_passphrase",
_("Set Passphrase For Encryption"),
_("Please specify the passphrase to be used for the encrypted "
"filesystems.\n\n"
"Please note that in the LiveCD environment the keymap is set to "
"\"US ISO\". "
"If you prefer a different keymap for entering the passphrase "
"here, you will need to set it manually using kbdcontrol(1)."),
"",
"f", "passphrase_1", _("Passphrase"),
_("Enter the passphrase you would like to use for encryption"), "",
"p", "obscured", "true",
"f", "passphrase_2", _("Passphrase again"),
_("Enter the passphrase again to confirm"), "",
"p", "obscured", "true",
"a", "ok", _("Accept and Set Passphrase"), "", "",
"p", "accelerator", "ESC",
NULL
);
}
ds = dfui_dataset_new();
dfui_dataset_celldata_add(ds, "passphrase_1", "");
dfui_dataset_celldata_add(ds, "passphrase_2", "");
if (!configuring)
dfui_dataset_celldata_add(ds, "passphrase_2", "");
dfui_form_dataset_add(f, ds);
while (!done) {
......
*/
passphrase_1 = dfui_dataset_get_value(new_ds, "passphrase_1");
passphrase_2 = dfui_dataset_get_value(new_ds, "passphrase_2");
if (configuring) {
passphrase_2 = passphrase_1;
} else {
passphrase_2 = dfui_dataset_get_value(new_ds, "passphrase_2");
}
if (strlen(passphrase_1) == 0 && strlen(passphrase_2) == 0) {
done = 0;
......
command_add(cmds, "%s%s %sboot",
a->os_root, cmd_name(a, "UMOUNT"),
a->os_root);
fn_get_passphrase(a);
fn_get_passphrase(a, 1);
command_add(cmds,
"%s%s -d /tmp/t1 luksOpen /dev/`%s%s \"^vfs\\.root\\.realroot=\" %st2 |"
"%s%s -F%s: '{print $2;}' |"
usr.sbin/installer/dfuibe_installer/fn_subpart_hammer.c
for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
sp != NULL; sp = subpartition_next(sp)) {
if (subpartition_is_encrypted(sp)) {
fn_get_passphrase(a);
fn_get_passphrase(a, 0);
break;
}
}
usr.sbin/installer/dfuibe_installer/fn_subpart_ufs.c
for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
sp != NULL; sp = subpartition_next(sp)) {
if (subpartition_is_encrypted(sp)) {
fn_get_passphrase(a);
fn_get_passphrase(a, 0);
break;
}
}
(2-2/2)