@@ -1,5 +1,10 @@
Changes for Crypt::PBKDF2
+Version 0.140890: 2014-03-30
+ * Remove use of Method::Signatures::Simple. Devel::Declare was causing
+ problems for some users, and it's really not needed for such a simple
+ module.
+
Version 0.133330: 2013-11-29
* Replace Class::MOP::load_class with Module::Runtime for compatibility
with latest Moose
@@ -1,4 +1,4 @@
-This software is copyright (c) 2013 by Andrew Rodland.
+This software is copyright (c) 2014 by Andrew Rodland.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@ b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
-This software is Copyright (c) 2013 by Andrew Rodland.
+This software is Copyright (c) 2014 by Andrew Rodland.
This is free software, licensed under:
@@ -22,7 +22,7 @@ This is free software, licensed under:
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
- 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -272,7 +272,7 @@ That's all there is to it!
--- The Artistic License 1.0 ---
-This software is Copyright (c) 2013 by Andrew Rodland.
+This software is Copyright (c) 2014 by Andrew Rodland.
This is free software, licensed under:
@@ -1,3 +1,4 @@
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.014.
Changes
LICENSE
MANIFEST
@@ -3,40 +3,39 @@ abstract: 'The PBKDF2 password hash algorithm'
author:
- 'Andrew Rodland <arodland@cpan.org>'
build_requires:
- Encode: 0
- Test::More: 0
- constant: 0
- strict: 0
- warnings: 0
+ Encode: '0'
+ Test::More: '0'
+ constant: '0'
+ strict: '0'
+ warnings: '0'
configure_requires:
- ExtUtils::MakeMaker: 6.30
+ ExtUtils::MakeMaker: '6.30'
dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.300037, CPAN::Meta::Converter version 2.132140'
+generated_by: 'Dist::Zilla version 5.014, CPAN::Meta::Converter version 2.140640'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ version: '1.4'
name: Crypt-PBKDF2
no_index:
directory:
- t
requires:
- Carp: 0
- Digest: 1.16
- Digest::HMAC: 1.01
- Digest::SHA: 0
- MIME::Base64: 0
- Method::Signatures::Simple: 0
- Module::Runtime: 0
- Moose: 1
- Moose::Role: 0
- Moose::Util::TypeConstraints: 0
- Try::Tiny: 0.04
- namespace::autoclean: 0
+ Carp: '0'
+ Digest: '1.16'
+ Digest::HMAC: '1.01'
+ Digest::SHA: '0'
+ MIME::Base64: '0'
+ Module::Runtime: '0'
+ Moose: '1'
+ Moose::Role: '0'
+ Moose::Util::TypeConstraints: '0'
+ Try::Tiny: '0.04'
+ namespace::autoclean: '0'
resources:
bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Crypt-PBKDF2
homepage: http://metacpan.org/release/Crypt-PBKDF2
license: http://dev.perl.org/licenses/
repository: git://github.com/arodland/Crypt-PBKDF2.git
-version: 0.133330
+version: '0.140890'
x_authority: cpan:ARODLAND
@@ -1,4 +1,5 @@
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.014.
use strict;
use warnings;
@@ -25,7 +26,6 @@ my %WriteMakefileArgs = (
"Digest::HMAC" => "1.01",
"Digest::SHA" => 0,
"MIME::Base64" => 0,
- "Method::Signatures::Simple" => 0,
"Module::Runtime" => 0,
"Moose" => 1,
"Moose::Role" => 0,
@@ -40,37 +40,37 @@ my %WriteMakefileArgs = (
"strict" => 0,
"warnings" => 0
},
- "VERSION" => "0.133330",
+ "VERSION" => "0.140890",
"test" => {
"TESTS" => "t/*.t"
}
);
-unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
- my $tr = delete $WriteMakefileArgs{TEST_REQUIRES};
- my $br = $WriteMakefileArgs{BUILD_REQUIRES};
- for my $mod ( keys %$tr ) {
- if ( exists $br->{$mod} ) {
- $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod};
- }
- else {
- $br->{$mod} = $tr->{$mod};
- }
- }
-}
+my %FallbackPrereqs = (
+ "Carp" => 0,
+ "Digest" => "1.16",
+ "Digest::HMAC" => "1.01",
+ "Digest::SHA" => 0,
+ "Encode" => 0,
+ "MIME::Base64" => 0,
+ "Module::Runtime" => 0,
+ "Moose" => 1,
+ "Moose::Role" => 0,
+ "Moose::Util::TypeConstraints" => 0,
+ "Test::More" => 0,
+ "Try::Tiny" => "0.04",
+ "constant" => 0,
+ "namespace::autoclean" => 0,
+ "strict" => 0,
+ "warnings" => 0
+);
-unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
- my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
- my $pp = $WriteMakefileArgs{PREREQ_PM};
- for my $mod ( keys %$br ) {
- if ( exists $pp->{$mod} ) {
- $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
- }
- else {
- $pp->{$mod} = $br->{$mod};
- }
- }
+
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
+ delete $WriteMakefileArgs{TEST_REQUIRES};
+ delete $WriteMakefileArgs{BUILD_REQUIRES};
+ $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
@@ -1,13 +1,15 @@
This archive contains the distribution Crypt-PBKDF2,
-version 0.133330:
+version 0.140890:
The PBKDF2 password hash algorithm
-This software is copyright (c) 2013 by Andrew Rodland.
+This software is copyright (c) 2014 by Andrew Rodland.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
+This README file was generated by Dist::Zilla::Plugin::Readme v5.014.
+
@@ -1,6 +1,6 @@
package Crypt::PBKDF2::Hash::DigestHMAC;
# ABSTRACT: Digest::HMAC hash support for Crypt::PBKDF2.
-our $VERSION = '0.133330'; # VERSION
+our $VERSION = '0.140890'; # VERSION
our $AUTHORITY = 'cpan:ARODLAND'; # AUTHORITY
use Moose 1;
use namespace::autoclean;
@@ -72,13 +72,15 @@ __END__
=pod
+=encoding UTF-8
+
=head1 NAME
Crypt::PBKDF2::Hash::DigestHMAC - Digest::HMAC hash support for Crypt::PBKDF2.
=head1 VERSION
-version 0.133330
+version 0.140890
=head1 DESCRIPTION
@@ -98,7 +100,7 @@ Andrew Rodland <arodland@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2013 by Andrew Rodland.
+This software is copyright (c) 2014 by Andrew Rodland.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -1,6 +1,6 @@
package Crypt::PBKDF2::Hash::HMACSHA1;
# ABSTRACT: HMAC-SHA1 support for Crypt::PBKDF2 using Digest::SHA
-our $VERSION = '0.133330'; # VERSION
+our $VERSION = '0.140890'; # VERSION
our $AUTHORITY = 'cpan:ARODLAND'; # AUTHORITY
use Moose;
use namespace::autoclean;
@@ -33,13 +33,15 @@ __END__
=pod
+=encoding UTF-8
+
=head1 NAME
Crypt::PBKDF2::Hash::HMACSHA1 - HMAC-SHA1 support for Crypt::PBKDF2 using Digest::SHA
=head1 VERSION
-version 0.133330
+version 0.140890
=head1 DESCRIPTION
@@ -52,7 +54,7 @@ Andrew Rodland <arodland@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2013 by Andrew Rodland.
+This software is copyright (c) 2014 by Andrew Rodland.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -1,6 +1,6 @@
package Crypt::PBKDF2::Hash::HMACSHA2;
# ABSTRACT: HMAC-SHA2 support for Crypt::PBKDF2 using Digest::SHA
-our $VERSION = '0.133330'; # VERSION
+our $VERSION = '0.140890'; # VERSION
our $AUTHORITY = 'cpan:ARODLAND'; # AUTHORITY
use Moose 1;
use Moose::Util::TypeConstraints;
@@ -63,13 +63,15 @@ __END__
=pod
+=encoding UTF-8
+
=head1 NAME
Crypt::PBKDF2::Hash::HMACSHA2 - HMAC-SHA2 support for Crypt::PBKDF2 using Digest::SHA
=head1 VERSION
-version 0.133330
+version 0.140890
=head1 DESCRIPTION
@@ -82,7 +84,7 @@ Andrew Rodland <arodland@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2013 by Andrew Rodland.
+This software is copyright (c) 2014 by Andrew Rodland.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -1,6 +1,6 @@
package Crypt::PBKDF2::Hash;
# ABSTRACT: Abstract role for PBKDF2 hashing algorithms.
-our $VERSION = '0.133330'; # VERSION
+our $VERSION = '0.140890'; # VERSION
our $AUTHORITY = 'cpan:ARODLAND'; # AUTHORITY
use Moose::Role;
use namespace::autoclean;
@@ -19,13 +19,15 @@ __END__
=pod
+=encoding UTF-8
+
=head1 NAME
Crypt::PBKDF2::Hash - Abstract role for PBKDF2 hashing algorithms.
=head1 VERSION
-version 0.133330
+version 0.140890
=head1 METHODS
@@ -57,7 +59,7 @@ Andrew Rodland <arodland@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2013 by Andrew Rodland.
+This software is copyright (c) 2014 by Andrew Rodland.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -1,9 +1,8 @@
package Crypt::PBKDF2;
# ABSTRACT: The PBKDF2 password hashing algorithm.
-our $VERSION = '0.133330'; # VERSION
+our $VERSION = '0.140890'; # VERSION
our $AUTHORITY = 'cpan:ARODLAND'; # AUTHORITY
use Moose 1;
-use Method::Signatures::Simple;
use Moose::Util::TypeConstraints;
use namespace::autoclean;
use MIME::Base64 ();
@@ -11,7 +10,8 @@ use Carp qw(croak);
use Module::Runtime;
use Try::Tiny;
-method BUILD {
+sub BUILD {
+ my ($self) = @_;
$self->hasher; # Force instantiation, so we get errors ASAP
}
@@ -48,7 +48,8 @@ has _lazy_hasher => (
builder => '_build_hasher',
);
-method _build_hasher {
+sub _build_hasher {
+ my ($self) = @_;
my $class = $self->hash_class;
if ($class !~ s/^\+//) {
$class = "Crypt::PBKDF2::Hash::$class";
@@ -79,7 +80,8 @@ has salt_len => (
default => 4,
);
-method _random_salt {
+sub _random_salt {
+ my ($self) = @_;
my $ret = "";
for my $n (1 .. $self->salt_len) {
$ret .= chr(int rand 256);
@@ -95,7 +97,8 @@ has encoding => (
);
-method generate ($password, $salt) {
+sub generate {
+ my ($self, $password, $salt) = @_;
$salt = $self->_random_salt unless defined $salt;
my $hash = $self->PBKDF2($salt, $password);
@@ -103,7 +106,8 @@ method generate ($password, $salt) {
}
-method validate ($hashed, $password) {
+sub validate {
+ my ($self, $hashed, $password) = @_;
my $info = $self->decode_string($hashed);
my $hasher = try {
@@ -125,7 +129,8 @@ method validate ($hashed, $password) {
}
-method PBKDF2 ($salt, $password) {
+sub PBKDF2 {
+ my ($self, $salt, $password) = @_;
my $iterations = $self->iterations;
my $hasher = $self->hasher;
my $output_len = $self->output_len || $hasher->hash_len;
@@ -164,7 +169,8 @@ sub PBKDF2_hex {
return unpack "H*", unpack "A*", $self->PBKDF2(@_);
}
-method _PBKDF2_F ($hasher, $salt, $password, $iterations, $i) {
+sub _PBKDF2_F {
+ my ($self, $hasher, $salt, $password, $iterations, $i) = @_;
my $result =
my $hash =
$hasher->generate( $salt . pack("N", $i), $password );
@@ -178,7 +184,8 @@ method _PBKDF2_F ($hasher, $salt, $password, $iterations, $i) {
}
-method encode_string ($salt, $hash) {
+sub encode_string {
+ my ($self, $salt, $hash) = @_;
if ($self->encoding eq 'crypt') {
return $self->_encode_string_cryptlike($salt, $hash);
} elsif ($self->encoding eq 'ldap') {
@@ -188,7 +195,8 @@ method encode_string ($salt, $hash) {
}
}
-method _encode_string_cryptlike ($salt, $hash) {
+sub _encode_string_cryptlike {
+ my ($self, $salt, $hash) = @_;
my $hasher = $self->hasher;
my $hasher_class = Class::MOP::class_of($hasher)->name;
if (!defined $hasher_class || $hasher_class !~ s/^Crypt::PBKDF2::Hash:://) {
@@ -203,7 +211,8 @@ method _encode_string_cryptlike ($salt, $hash) {
. MIME::Base64::encode($hash, "");
}
-method _encode_string_ldaplike ($salt, $hash) {
+sub _encode_string_ldaplike {
+ my ($self, $salt, $hash) = @_;
my $hasher = $self->hasher;
my $hasher_class = Class::MOP::class_of($hasher)->name;
if (!defined $hasher_class || $hasher_class !~ s/^Crypt::PBKDF2::Hash:://) {
@@ -220,7 +229,8 @@ method _encode_string_ldaplike ($salt, $hash) {
}
-method decode_string ($hashed) {
+sub decode_string {
+ my ($self, $hashed) = @_;
if ($hashed =~ /^\$PBKDF2\$/) {
return $self->_decode_string_cryptlike($hashed);
} elsif ($hashed =~ /^\{X-PBKDF2}/i) {
@@ -230,7 +240,8 @@ method decode_string ($hashed) {
}
}
-method _decode_string_cryptlike ($hashed) {
+sub _decode_string_cryptlike {
+ my ($self, $hashed) = @_;
if ($hashed !~ /^\$PBKDF2\$/) {
croak "Unrecognized hash";
}
@@ -249,7 +260,8 @@ method _decode_string_cryptlike ($hashed) {
}
}
-method _decode_string_ldaplike ($hashed) {
+sub _decode_string_ldaplike {
+ my ($self, $hashed) = @_;
if ($hashed !~ /^\{X-PBKDF2}/i) {
croak "Unrecognized hash";
}
@@ -270,7 +282,8 @@ method _decode_string_ldaplike ($hashed) {
}
-method hasher_from_algorithm ($algorithm, $args) {
+sub hasher_from_algorithm {
+ my ($self, $algorithm, $args) = @_;
my $class = Module::Runtime::use_module("Crypt::PBKDF2::Hash::$algorithm");
if (defined $args) {
@@ -281,7 +294,8 @@ method hasher_from_algorithm ($algorithm, $args) {
}
-method clone (%params) {
+sub clone {
+ my ($self, %params) = @_;
my $class = ref $self;
# If the hasher was built from hash_class and hash_args, then omit it from
@@ -303,13 +317,15 @@ method clone (%params) {
return $class->new(%new_args);
}
-method _b64_encode_int32 ($value) {
+sub _b64_encode_int32 {
+ my ($self, $value) = @_;
my $b64 = MIME::Base64::encode(pack("N", $value), "");
$b64 =~ s/==$//;
return $b64;
}
-method _b64_decode_int32 ($b64) {
+sub _b64_decode_int32 {
+ my ($self, $b64) = @_;
$b64 .= "==";
return unpack "N", MIME::Base64::decode($b64);
}
@@ -321,13 +337,15 @@ __END__
=pod
+=encoding UTF-8
+
=head1 NAME
Crypt::PBKDF2 - The PBKDF2 password hashing algorithm.
=head1 VERSION
-version 0.133330
+version 0.140890
=head1 SYNOPSIS
@@ -522,7 +540,7 @@ Andrew Rodland <arodland@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2013 by Andrew Rodland.
+This software is copyright (c) 2014 by Andrew Rodland.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.