From 57d57860a81e620db083d6a45ecc32dc3e69da55 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 1 Mar 2005 15:09:09 +0000 Subject: allow to choose encryption algorithm (#13472) --- perl-install/diskdrake/interactive.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'perl-install/diskdrake') diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index d48379ed9..5ed05a39e 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -948,8 +948,8 @@ sub Options { if (!check($in, $hd, $part, $all_hds)) { $options->{encrypted} = 0; } elsif (!$part->{encrypt_key} && !isSwap($part)) { - if (my $encrypt_key = choose_encrypt_key($in)) { - $options->{'encryption='} = 'AES128'; + if (my ($encrypt_key, $encrypt_algo) = choose_encrypt_key($in)) { + $options->{'encryption='} = $encrypt_algo; $part->{encrypt_key} = $encrypt_key; } else { $options->{encrypted} = 0; @@ -1260,6 +1260,9 @@ sub choose_encrypt_key { my ($in) = @_; my ($encrypt_key, $encrypt_key2); + my @algorithms = map { "AES$_" } 128, 196, 256, 512, 1024, 2048; + my $encrypt_algo = "AES128"; + $in->ask_from_( { title => N("Filesystem encryption key"), @@ -1272,7 +1275,8 @@ sub choose_encrypt_key { } } }, [ { label => N("Encryption key"), val => \$encrypt_key, hidden => 1 }, { label => N("Encryption key (again)"), val => \$encrypt_key2, hidden => 1 }, - ]) && $encrypt_key; +{ label => N("Encryption algorithm"), type => 'list', val => \$encrypt_algo, list => \@algorithms } + ]) && ($encrypt_key, $encrypt_algo); } -- cgit v1.2.1