From 400b9eaab95f85c59d3a3b11d3562ebdf379ba6f Mon Sep 17 00:00:00 2001 From: Xavier Date: Wed, 26 Jun 2019 06:19:07 +0200 Subject: [PATCH] Revert "Better password generation (#1803)" This reverts commit b4ec8eaeebc16a28bb015887877ba5743470deef. --- lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Ext2F.pm | 9 +-------- lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Mail2F.pm | 5 +---- lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SAML.pm | 1 + lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SMTP.pm | 4 +--- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Ext2F.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Ext2F.pm index 117d96a0e..0fdd372d5 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Ext2F.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Ext2F.pm @@ -3,7 +3,6 @@ package Lemonldap::NG::Portal::2F::Ext2F; use strict; use Mouse; use String::Random; -use Crypt::URandom; use Lemonldap::NG::Portal::Main::Constants qw( PE_BADCREDENTIALS PE_ERROR @@ -39,13 +38,7 @@ sub init { $self->error("Missing 'ext2FSendCommand' parameter, aborting"); return 0; } - $self->random( - String::Random->new( - rand_gen => sub { - return unpack( "Q", Crypt::URandom::urandom(8) ) % $_[0]; - } - ) - ); + $self->random( String::Random->new ); $self->logo( $self->conf->{ext2fLogo} ) if ( $self->conf->{ext2fLogo} ); return $self->SUPER::init(); diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Mail2F.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Mail2F.pm index d1daf105e..f2cea52e8 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Mail2F.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Mail2F.pm @@ -3,7 +3,6 @@ package Lemonldap::NG::Portal::2F::Mail2F; use strict; use Mouse; use String::Random; -use Crypt::URandom; use Lemonldap::NG::Portal::Main::Constants qw( PE_BADCREDENTIALS PE_ERROR @@ -24,9 +23,7 @@ has prefix => ( is => 'ro', default => 'mail' ); has random => ( is => 'rw', default => sub { - return String::Random->new( rand_gen => - sub { return unpack( "Q", Crypt::URandom::urandom(8) ) % $_[0] } - ); + return String::Random->new; } ); diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SAML.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SAML.pm index 9f7b6c923..ada284b3b 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SAML.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SAML.pm @@ -8,6 +8,7 @@ use Lemonldap::NG::Common::UserAgent; use Lemonldap::NG::Common::FormEncode; use XML::Simple; use MIME::Base64; +use String::Random; use HTTP::Request; # SOAP call use POSIX qw(strftime); # Convert SAML2 date into timestamp use Time::Local; # Convert SAML2 date into timestamp diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SMTP.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SMTP.pm index 2f322699c..0d9e829dc 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SMTP.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SMTP.pm @@ -24,9 +24,7 @@ our $transport; has random => ( is => 'rw', default => sub { - return String::Random->new( rand_gen => - sub { return unpack( "Q", Crypt::URandom::urandom(8) ) % $_[0]; } - ); + return String::Random->new; } ); has charset => (