X-Git-Url: https://git.proxmox.com/?p=pve-access-control.git;a=blobdiff_plain;f=PVE%2FAuth%2FPlugin.pm;h=16ef046b4ecc69ccf0974ff13c1f0e0a17d7ac13;hp=13083406a1c66f66be22473f670e3e525178f570;hb=5654af83fa4f8ffc4e44176eea6229716eae2036;hpb=1abc2c0aeea26040cda69d40e43a7791f77e400c diff --git a/PVE/Auth/Plugin.pm b/PVE/Auth/Plugin.pm index 1308340..16ef046 100755 --- a/PVE/Auth/Plugin.pm +++ b/PVE/Auth/Plugin.pm @@ -9,8 +9,6 @@ use PVE::SectionConfig; use PVE::JSONSchema qw(get_standard_option); use PVE::Cluster qw(cfs_register_file cfs_read_file cfs_lock_file); -use Data::Dumper; - use base qw(PVE::SectionConfig); my $domainconfigfile = "domains.cfg"; @@ -116,6 +114,10 @@ sub parse_tfa_config { $res->{key} = $1; } elsif ($kvp =~ m/^url=(\S+)$/) { $res->{url} = $1; + } elsif ($kvp =~ m/^digits=([6|7|8])$/) { + $res->{digits} = $1; + } elsif ($kvp =~ m/^step=([1-9]\d+)$/) { + $res->{step} = $1; } else { return undef; } @@ -126,13 +128,6 @@ sub parse_tfa_config { return $res; } -sub encrypt_pw { - my ($pw) = @_; - - my $time = substr(Digest::SHA::sha1_base64 (time), 0, 8); - return crypt(encode("utf8", $pw), "\$5\$$time\$"); -} - my $defaultData = { propertyList => { type => { description => "Realm type." }, @@ -198,9 +193,6 @@ sub parse_config { sub write_config { my ($class, $filename, $cfg) = @_; - delete $cfg->{ids}->{pve}; - delete $cfg->{ids}->{pam}; - foreach my $realm (keys %{$cfg->{ids}}) { my $data = $cfg->{ids}->{$realm}; if ($data->{comment}) {