projects
/
plack-middleware-auth-complex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
da36743
)
Prevent blocking when making reset key
author
Marius Gavrilescu
<marius@ieval.ro>
Wed, 22 Mar 2017 21:49:53 +0000
(23:49 +0200)
committer
Marius Gavrilescu
<marius@ieval.ro>
Wed, 22 Mar 2017 21:49:53 +0000
(23:49 +0200)
lib/Plack/Middleware/Auth/Complex.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Plack/Middleware/Auth/Complex.pm
b/lib/Plack/Middleware/Auth/Complex.pm
index 53ff827fafbe76ea5ce1a9d4c325ccbd3f9e099b..bc6a33b408f8bec8d37d1c6cb7726ff3577a7949 100644
(file)
--- a/
lib/Plack/Middleware/Auth/Complex.pm
+++ b/
lib/Plack/Middleware/Auth/Complex.pm
@@
-11,7
+11,7
@@
use re '/s';
use Authen::Passphrase;
use Authen::Passphrase::BlowfishCrypt;
use Authen::Passphrase;
use Authen::Passphrase::BlowfishCrypt;
-use Bytes::Random::Secure qw/
random_bytes
/;
+use Bytes::Random::Secure qw//;
use Carp qw/croak/;
use DBI;
use Digest::SHA qw/hmac_sha1_base64 sha256/;
use Carp qw/croak/;
use DBI;
use Digest::SHA qw/hmac_sha1_base64 sha256/;
@@
-100,7
+100,7
@@
sub set_passphrase {
sub make_reset_hmac {
my ($self, $username, @data) = @_;
sub make_reset_hmac {
my ($self, $username, @data) = @_;
- $self->{hmackey} //=
random_bytes 512
; # uncoverable condition false
+ $self->{hmackey} //=
Bytes::Random::Secure->new(NonBlocking => 1)->bytes(512)
; # uncoverable condition false
my $user = $self->get_user($username);
my $message = join ' ', $username, $user->{passphrase}, @data;
hmac_sha1_base64 $message, $self->{hmackey};
my $user = $self->get_user($username);
my $message = join ' ', $username, $user->{passphrase}, @data;
hmac_sha1_base64 $message, $self->{hmackey};
This page took
0.011618 seconds
and
4
git commands to generate.