nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 36 lines 1.0 kB view raw
1diff --git a/lib/LANraragi/Controller/Config.pm b/lib/LANraragi/Controller/Config.pm 2index 2cd2c999..0bd8ab6e 100644 3--- a/lib/LANraragi/Controller/Config.pm 4+++ b/lib/LANraragi/Controller/Config.pm 5@@ -50,6 +50,15 @@ sub index { 6 ); 7 } 8 9+sub make_password_hash { 10+ my $ppr = Authen::Passphrase::BlowfishCrypt->new( 11+ cost => 8, 12+ salt_random => 1, 13+ passphrase => shift, 14+ ); 15+ return $ppr->as_rfc2307; 16+} 17+ 18 # Save the given parameters to the Redis config 19 sub save_config { 20 21@@ -95,14 +104,7 @@ sub save_config { 22 my $password = $self->req->param('newpassword'); 23 24 if ( $password ne "" ) { 25- my $ppr = Authen::Passphrase::BlowfishCrypt->new( 26- cost => 8, 27- salt_random => 1, 28- passphrase => $password, 29- ); 30- 31- my $pass_hashed = $ppr->as_rfc2307; 32- $confhash{password} = $pass_hashed; 33+ $confhash{password} = make_password_hash($password); 34 } 35 } 36