From: Steve Peters Date: Fri, 2 May 2008 14:26:59 +0000 (+0000) Subject: Upgrade to Digest-SHA-5.47 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4eb6bdb8125acdfea8b9f73540d56355754b5da8;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Digest-SHA-5.47 p4raw-id: //depot/perl@33779 --- diff --git a/MANIFEST b/MANIFEST index 414dac6..3be3a7a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -385,9 +385,9 @@ ext/Digest/MD5/t/utf8.t See if Digest::MD5 extension works ext/Digest/MD5/typemap Digest::MD5 extension ext/Digest/SHA/bin/shasum shasum script ext/Digest/SHA/Changes Digest::SHA changes +ext/Digest/SHA/lib/Digest/SHA.pm Digest::SHA extension ext/Digest/SHA/Makefile.PL Digest::SHA Makefile.PL ext/Digest/SHA/README Digest::SHA README -ext/Digest/SHA/SHA.pm Digest::SHA extension ext/Digest/SHA/SHA.xs Digest::SHA extension ext/Digest/SHA/src/hmac.c Digest::SHA extension ext/Digest/SHA/src/hmac.h Digest::SHA extension diff --git a/ext/Digest/SHA/Changes b/ext/Digest/SHA/Changes index a183e9f..ad5bd06 100644 --- a/ext/Digest/SHA/Changes +++ b/ext/Digest/SHA/Changes @@ -1,5 +1,14 @@ Revision history for Perl extension Digest::SHA. +5.47 Wed Apr 30 04:00:54 MST 2008 + - modified Makefile.PL to install in core for Perls >= 5.10 + -- thanks to Jerry Hedden for patch + - changed from #include <> to #include "" in SHA.xs + -- some platforms not able to find SHA source files + -- thanks to Alexandr Ciornii for testing + - moved .pm file to appropriate lib directory + - minor addition to META.yml + 5.46 Wed Apr 9 05:04:00 MST 2008 - modified Addfile to recognize leading and trailing whitespace in filenames (ref. rt.cpan.org #34690) diff --git a/ext/Digest/SHA/Makefile.PL b/ext/Digest/SHA/Makefile.PL index d688087..ce9e402 100644 --- a/ext/Digest/SHA/Makefile.PL +++ b/ext/Digest/SHA/Makefile.PL @@ -1,14 +1,16 @@ -require 5.006000; +require 5.003000; use ExtUtils::MakeMaker; use Getopt::Std; use Config; +my $PM = 'lib/Digest/SHA.pm'; + my %opts; getopts('tx', \%opts); -my @defines = ('-DSHA_PERL_MODULE'); - +my @defines; +push(@defines, '-DSHA_PERL_MODULE') if $] >= 5.004; push(@defines, '-DSHA_THREAD_SAFE') if $opts{'t'}; push(@defines, '-DNO_SHA_384_512') if $opts{'x'}; @@ -23,14 +25,17 @@ if ($Config{archname} =~ /^i[3456]86/) { my $define = join(' ', @defines); -WriteMakefile( +my %att = ( 'NAME' => 'Digest::SHA', - 'VERSION_FROM' => 'SHA.pm', - 'PREREQ_PM' => {}, - 'AUTHOR' => 'Mark Shelor ', + 'VERSION_FROM' => $PM, 'LIBS' => [''], - MAN3PODS => {}, # Pods will be built by installman. 'DEFINE' => $define, 'INC' => '-I.', - 'NO_META' => 1, + 'EXE_FILES' => [ 'shasum' ], + 'INSTALLDIRS' => ($] >= 5.010) ? 'perl' : 'site', ); + +my $MMversion = $ExtUtils::MakeMaker::VERSION || 0; +$att{NO_META} = 1 unless $MMversion < 6.10_03; + +WriteMakefile(%att); diff --git a/ext/Digest/SHA/README b/ext/Digest/SHA/README index 847a9dd..8cd68bd 100644 --- a/ext/Digest/SHA/README +++ b/ext/Digest/SHA/README @@ -1,4 +1,4 @@ -Digest::SHA version 5.46 +Digest::SHA version 5.47 ======================== Digest::SHA is a complete implementation of the NIST Secure Hash diff --git a/ext/Digest/SHA/SHA.xs b/ext/Digest/SHA/SHA.xs index af0d666..7c394e9 100644 --- a/ext/Digest/SHA/SHA.xs +++ b/ext/Digest/SHA/SHA.xs @@ -2,8 +2,8 @@ #include "perl.h" #include "XSUB.h" -#include -#include +#include "src/sha.c" +#include "src/hmac.c" static int ix2alg[] = {1,1,1,224,224,224,256,256,256,384,384,384,512,512,512}; @@ -12,8 +12,8 @@ MODULE = Digest::SHA PACKAGE = Digest::SHA PROTOTYPES: ENABLE -#include -#include +#include "src/sha.h" +#include "src/hmac.h" #ifndef INT2PTR #define INT2PTR(p, i) (p) (i) diff --git a/ext/Digest/SHA/bin/shasum b/ext/Digest/SHA/bin/shasum index bdf93d8..a349ed7 100755 --- a/ext/Digest/SHA/bin/shasum +++ b/ext/Digest/SHA/bin/shasum @@ -4,8 +4,8 @@ # # Copyright (C) 2003-2008 Mark Shelor, All Rights Reserved # - # Version: 5.46 - # Wed Apr 9 05:04:00 MST 2008 + # Version: 5.47 + # Wed Apr 30 04:00:54 MST 2008 =head1 NAME @@ -74,7 +74,7 @@ use strict; use FileHandle; use Getopt::Long; -my $VERSION = "5.46"; +my $VERSION = "5.47"; # Try to use Digest::SHA, since it's faster. If not installed, diff --git a/ext/Digest/SHA/SHA.pm b/ext/Digest/SHA/lib/Digest/SHA.pm similarity index 100% rename from ext/Digest/SHA/SHA.pm rename to ext/Digest/SHA/lib/Digest/SHA.pm diff --git a/ext/Digest/SHA/src/hmac.c b/ext/Digest/SHA/src/hmac.c index 9c108f9..ca5536e 100644 --- a/ext/Digest/SHA/src/hmac.c +++ b/ext/Digest/SHA/src/hmac.c @@ -3,10 +3,10 @@ * * Ref: FIPS PUB 198 The Keyed-Hash Message Authentication Code * - * Copyright (C) 2003-2007 Mark Shelor, All Rights Reserved + * Copyright (C) 2003-2008 Mark Shelor, All Rights Reserved * - * Version: 5.46 - * Wed Apr 9 05:04:00 MST 2008 + * Version: 5.47 + * Wed Apr 30 04:00:54 MST 2008 * */ diff --git a/ext/Digest/SHA/src/hmac.h b/ext/Digest/SHA/src/hmac.h index b2ea575..b2f5795 100644 --- a/ext/Digest/SHA/src/hmac.h +++ b/ext/Digest/SHA/src/hmac.h @@ -3,10 +3,10 @@ * * Ref: FIPS PUB 198 The Keyed-Hash Message Authentication Code * - * Copyright (C) 2003-2007 Mark Shelor, All Rights Reserved + * Copyright (C) 2003-2008 Mark Shelor, All Rights Reserved * - * Version: 5.46 - * Wed Apr 9 05:04:00 MST 2008 + * Version: 5.47 + * Wed Apr 30 04:00:54 MST 2008 * */ diff --git a/ext/Digest/SHA/src/sha.c b/ext/Digest/SHA/src/sha.c index b97fa07..eec969b 100644 --- a/ext/Digest/SHA/src/sha.c +++ b/ext/Digest/SHA/src/sha.c @@ -3,10 +3,10 @@ * * Ref: NIST FIPS PUB 180-2 Secure Hash Standard * - * Copyright (C) 2003-2007 Mark Shelor, All Rights Reserved + * Copyright (C) 2003-2008 Mark Shelor, All Rights Reserved * - * Version: 5.46 - * Wed Apr 9 05:04:00 MST 2008 + * Version: 5.47 + * Wed Apr 30 04:00:54 MST 2008 * */ diff --git a/ext/Digest/SHA/src/sha.h b/ext/Digest/SHA/src/sha.h index 547347b..6f18834 100644 --- a/ext/Digest/SHA/src/sha.h +++ b/ext/Digest/SHA/src/sha.h @@ -3,10 +3,10 @@ * * Ref: NIST FIPS PUB 180-2 Secure Hash Standard * - * Copyright (C) 2003-2007 Mark Shelor, All Rights Reserved + * Copyright (C) 2003-2008 Mark Shelor, All Rights Reserved * - * Version: 5.46 - * Wed Apr 9 05:04:00 MST 2008 + * Version: 5.47 + * Wed Apr 30 04:00:54 MST 2008 * */ diff --git a/ext/Digest/SHA/t/allfcns.t b/ext/Digest/SHA/t/allfcns.t index 0c4fccb..34cc803 100644 --- a/ext/Digest/SHA/t/allfcns.t +++ b/ext/Digest/SHA/t/allfcns.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw( hmac_sha1 hmac_sha1_base64 hmac_sha1_hex diff --git a/ext/Digest/SHA/t/base64.t b/ext/Digest/SHA/t/base64.t index 35e784f..1675e9a 100644 --- a/ext/Digest/SHA/t/base64.t +++ b/ext/Digest/SHA/t/base64.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha1_base64 sha224_base64 sha256_base64 sha384_base64 sha512_base64)); diff --git a/ext/Digest/SHA/t/bitbuf.t b/ext/Digest/SHA/t/bitbuf.t index 30b45b3..8159735 100644 --- a/ext/Digest/SHA/t/bitbuf.t +++ b/ext/Digest/SHA/t/bitbuf.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/dumpload.t b/ext/Digest/SHA/t/dumpload.t index af23807..92b9286 100644 --- a/ext/Digest/SHA/t/dumpload.t +++ b/ext/Digest/SHA/t/dumpload.t @@ -4,7 +4,7 @@ use FileHandle; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha384_hex sha512_hex)); } diff --git a/ext/Digest/SHA/t/fips198.t b/ext/Digest/SHA/t/fips198.t index 26ce363..0447aa6 100644 --- a/ext/Digest/SHA/t/fips198.t +++ b/ext/Digest/SHA/t/fips198.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(hmac_sha1_hex)); } diff --git a/ext/Digest/SHA/t/gg.t b/ext/Digest/SHA/t/gg.t index dc2bddf..b43ec48 100644 --- a/ext/Digest/SHA/t/gg.t +++ b/ext/Digest/SHA/t/gg.t @@ -7,7 +7,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/gglong.t b/ext/Digest/SHA/t/gglong.t index 8abc7e6..4d8c53d 100644 --- a/ext/Digest/SHA/t/gglong.t +++ b/ext/Digest/SHA/t/gglong.t @@ -8,7 +8,7 @@ use FileHandle; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/hmacsha.t b/ext/Digest/SHA/t/hmacsha.t index fe68374..a265a76 100644 --- a/ext/Digest/SHA/t/hmacsha.t +++ b/ext/Digest/SHA/t/hmacsha.t @@ -5,7 +5,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(hmac_sha256_hex)); } diff --git a/ext/Digest/SHA/t/ireland.t b/ext/Digest/SHA/t/ireland.t index c11968f..97bad44 100644 --- a/ext/Digest/SHA/t/ireland.t +++ b/ext/Digest/SHA/t/ireland.t @@ -4,7 +4,7 @@ use FileHandle; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/methods.t b/ext/Digest/SHA/t/methods.t index 637fc28..2a4a7c4 100644 --- a/ext/Digest/SHA/t/methods.t +++ b/ext/Digest/SHA/t/methods.t @@ -4,7 +4,7 @@ use FileHandle; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/nistbit.t b/ext/Digest/SHA/t/nistbit.t index e9325e0..8516195 100644 --- a/ext/Digest/SHA/t/nistbit.t +++ b/ext/Digest/SHA/t/nistbit.t @@ -7,7 +7,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/nistbyte.t b/ext/Digest/SHA/t/nistbyte.t index 3265bfa..9c4a89d 100644 --- a/ext/Digest/SHA/t/nistbyte.t +++ b/ext/Digest/SHA/t/nistbyte.t @@ -7,7 +7,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/rfc2202.t b/ext/Digest/SHA/t/rfc2202.t index adbd26f..8e21bbd 100644 --- a/ext/Digest/SHA/t/rfc2202.t +++ b/ext/Digest/SHA/t/rfc2202.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(hmac_sha1_hex)); } diff --git a/ext/Digest/SHA/t/sha1.t b/ext/Digest/SHA/t/sha1.t index a9cb603..e7de6f2 100644 --- a/ext/Digest/SHA/t/sha1.t +++ b/ext/Digest/SHA/t/sha1.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha1_hex)); } diff --git a/ext/Digest/SHA/t/sha224.t b/ext/Digest/SHA/t/sha224.t index ca327be..6c2b45f 100644 --- a/ext/Digest/SHA/t/sha224.t +++ b/ext/Digest/SHA/t/sha224.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha224_hex)); } diff --git a/ext/Digest/SHA/t/sha256.t b/ext/Digest/SHA/t/sha256.t index 3651f0c..591f432 100644 --- a/ext/Digest/SHA/t/sha256.t +++ b/ext/Digest/SHA/t/sha256.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha256_hex)); } diff --git a/ext/Digest/SHA/t/sha384.t b/ext/Digest/SHA/t/sha384.t index 7cf328f..a6fbd36 100644 --- a/ext/Digest/SHA/t/sha384.t +++ b/ext/Digest/SHA/t/sha384.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha384_hex)); } diff --git a/ext/Digest/SHA/t/sha512.t b/ext/Digest/SHA/t/sha512.t index 33e585d..7228554 100644 --- a/ext/Digest/SHA/t/sha512.t +++ b/ext/Digest/SHA/t/sha512.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha512_hex)); } diff --git a/ext/Digest/SHA/t/woodbury.t b/ext/Digest/SHA/t/woodbury.t index fab98b4..d56e810 100644 --- a/ext/Digest/SHA/t/woodbury.t +++ b/ext/Digest/SHA/t/woodbury.t @@ -7,7 +7,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(hmac_sha256_hex hmac_sha384_hex hmac_sha512_hex)); }