Revert "Better password generation (#1803)"

This reverts commit b4ec8eaeeb.
This commit is contained in:
Xavier 2019-06-26 06:19:07 +02:00
parent b4ec8eaeeb
commit 400b9eaab9
4 changed files with 4 additions and 15 deletions

View File

@ -3,7 +3,6 @@ package Lemonldap::NG::Portal::2F::Ext2F;
use strict; use strict;
use Mouse; use Mouse;
use String::Random; use String::Random;
use Crypt::URandom;
use Lemonldap::NG::Portal::Main::Constants qw( use Lemonldap::NG::Portal::Main::Constants qw(
PE_BADCREDENTIALS PE_BADCREDENTIALS
PE_ERROR PE_ERROR
@ -39,13 +38,7 @@ sub init {
$self->error("Missing 'ext2FSendCommand' parameter, aborting"); $self->error("Missing 'ext2FSendCommand' parameter, aborting");
return 0; return 0;
} }
$self->random( $self->random( String::Random->new );
String::Random->new(
rand_gen => sub {
return unpack( "Q", Crypt::URandom::urandom(8) ) % $_[0];
}
)
);
$self->logo( $self->conf->{ext2fLogo} ) $self->logo( $self->conf->{ext2fLogo} )
if ( $self->conf->{ext2fLogo} ); if ( $self->conf->{ext2fLogo} );
return $self->SUPER::init(); return $self->SUPER::init();

View File

@ -3,7 +3,6 @@ package Lemonldap::NG::Portal::2F::Mail2F;
use strict; use strict;
use Mouse; use Mouse;
use String::Random; use String::Random;
use Crypt::URandom;
use Lemonldap::NG::Portal::Main::Constants qw( use Lemonldap::NG::Portal::Main::Constants qw(
PE_BADCREDENTIALS PE_BADCREDENTIALS
PE_ERROR PE_ERROR
@ -24,9 +23,7 @@ has prefix => ( is => 'ro', default => 'mail' );
has random => ( has random => (
is => 'rw', is => 'rw',
default => sub { default => sub {
return String::Random->new( rand_gen => return String::Random->new;
sub { return unpack( "Q", Crypt::URandom::urandom(8) ) % $_[0] }
);
} }
); );

View File

@ -8,6 +8,7 @@ use Lemonldap::NG::Common::UserAgent;
use Lemonldap::NG::Common::FormEncode; use Lemonldap::NG::Common::FormEncode;
use XML::Simple; use XML::Simple;
use MIME::Base64; use MIME::Base64;
use String::Random;
use HTTP::Request; # SOAP call use HTTP::Request; # SOAP call
use POSIX qw(strftime); # Convert SAML2 date into timestamp use POSIX qw(strftime); # Convert SAML2 date into timestamp
use Time::Local; # Convert SAML2 date into timestamp use Time::Local; # Convert SAML2 date into timestamp

View File

@ -24,9 +24,7 @@ our $transport;
has random => ( has random => (
is => 'rw', is => 'rw',
default => sub { default => sub {
return String::Random->new( rand_gen => return String::Random->new;
sub { return unpack( "Q", Crypt::URandom::urandom(8) ) % $_[0]; }
);
} }
); );
has charset => ( has charset => (