summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xPorting/Maintainers.pl2
-rw-r--r--cpan/Digest-MD5/Changes32
-rw-r--r--cpan/Digest-MD5/MD5.pm28
-rw-r--r--cpan/Digest-MD5/MD5.xs53
-rw-r--r--cpan/Digest-MD5/Makefile.PL2
-rw-r--r--cpan/Digest-MD5/README2
-rw-r--r--cpan/Digest-MD5/t/files.t8
7 files changed, 97 insertions, 30 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index 684b70428e..80aac89c0a 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -582,7 +582,7 @@ use File::Glob qw(:case);
'Digest::MD5' => {
'MAINTAINER' => 'gaas',
- 'DISTRIBUTION' => 'GAAS/Digest-MD5-2.51.tar.gz',
+ 'DISTRIBUTION' => 'GAAS/Digest-MD5-2.52.tar.gz',
'FILES' => q[cpan/Digest-MD5],
'EXCLUDED' => ['rfc1321.txt'],
'UPSTREAM' => "cpan",
diff --git a/cpan/Digest-MD5/Changes b/cpan/Digest-MD5/Changes
index de43f07aa8..97e1931c33 100644
--- a/cpan/Digest-MD5/Changes
+++ b/cpan/Digest-MD5/Changes
@@ -1,6 +1,30 @@
+2012-06-08 Gisle Aas <gisle@ActiveState.com>
+
+ Gisle Aas (3):
+ Wrong version number in the changelog
+ The t/threads.t was missing from the MANIFEST
+ Update expected digests for files
+
+ Andrew Fresh (1):
+ Remove double the
+
+ Lyle Hopkins (1):
+ Digest::Perl::MD5 OO fallback didn't work [RT#66634]
+
+ Peter J. Acklam (1):
+ Fix typos (spelling errors) in cpan/Digest-MD5/*
+
+ Shlomi Fish (1):
+ Modernize the code in the POD.
+
+ Zefram (1):
+ Makes Digest::MD5 work on Perl 5.6 [RT#75032]
+
+
+
2010-09-30 Gisle Aas <gisle@ActiveState.com>
- Release 2.50
+ Release 2.51
Florian Ragwitz (1):
Fix compilation with c++ compilers
@@ -68,7 +92,7 @@
Applied warning fix from Geoff Richards [RT#19643]
- Applied compatiblity fix from Alexandr Ciornii [RT#30348]
+ Applied compatibility fix from Alexandr Ciornii [RT#30348]
@@ -412,7 +436,7 @@
Avoid LONG and BYTE types in SHA.xs as they was in conflict
with similar definitions in <winnt.h>.
- Patch by Marko Asplund <aspa@hip.fi> to make the the alignment
+ Patch by Marko Asplund <aspa@hip.fi> to make the alignment
test program link successfully with sfio-perl.
Fixed a typo in MD5.xs that might have affected 64-bit systems.
@@ -594,7 +618,7 @@
Release 1.99_55
- Grahams HMAC_MD5.pm splitted into two modules. Digest::HMAC and
+ Grahams HMAC_MD5.pm split into two modules. Digest::HMAC and
Digest::HMAC_MD5. Also provide functional interface. Documentation
is still lacking.
diff --git a/cpan/Digest-MD5/MD5.pm b/cpan/Digest-MD5/MD5.pm
index 1ccba4e75d..8ea2705264 100644
--- a/cpan/Digest-MD5/MD5.pm
+++ b/cpan/Digest-MD5/MD5.pm
@@ -3,7 +3,7 @@ package Digest::MD5;
use strict;
use vars qw($VERSION @ISA @EXPORT_OK);
-$VERSION = '2.51';
+$VERSION = '2.52';
require Exporter;
*import = \&Exporter::import;
@@ -30,7 +30,7 @@ if ($@) {
require Digest::Perl::MD5;
Digest::Perl::MD5->import(qw(md5 md5_hex md5_base64));
- push(@ISA, "Digest::Perl::MD5"); # make OO interface work
+ unshift(@ISA, "Digest::Perl::MD5"); # make OO interface work
};
if ($@) {
# restore the original error
@@ -63,7 +63,7 @@ Digest::MD5 - Perl interface to the MD5 Algorithm
$ctx = Digest::MD5->new;
$ctx->add($data);
- $ctx->addfile(*FILE);
+ $ctx->addfile($file_handle);
$digest = $ctx->digest;
$digest = $ctx->hexdigest;
@@ -253,7 +253,7 @@ The same checksum can also be calculated in OO style:
print "Digest is $digest\n";
-With OO style you can break the message arbitrary. This means that we
+With OO style, you can break the message arbitrarily. This means that we
are no longer limited to have space for the whole message in memory, i.e.
we can handle messages of any size.
@@ -261,27 +261,27 @@ This is useful when calculating checksum for files:
use Digest::MD5;
- my $file = shift || "/etc/passwd";
- open(FILE, $file) or die "Can't open '$file': $!";
- binmode(FILE);
+ my $filename = shift || "/etc/passwd";
+ open (my $fh, '<', $filename) or die "Can't open '$filename': $!";
+ binmode($fh);
$md5 = Digest::MD5->new;
- while (<FILE>) {
+ while (<$fh>) {
$md5->add($_);
}
- close(FILE);
- print $md5->b64digest, " $file\n";
+ close($fh);
+ print $md5->b64digest, " $filename\n";
Or we can use the addfile method for more efficient reading of
the file:
use Digest::MD5;
- my $file = shift || "/etc/passwd";
- open(FILE, $file) or die "Can't open '$file': $!";
- binmode(FILE);
+ my $filename = shift || "/etc/passwd";
+ open (my $fh, '<', $filename) or die "Can't open '$filename': $!";
+ binmode ($fh);
- print Digest::MD5->new->addfile(*FILE)->hexdigest, " $file\n";
+ print Digest::MD5->new->addfile($fh)->hexdigest, " $filename\n";
Perl 5.8 support Unicode characters in strings. Since the MD5
algorithm is only defined for strings of bytes, it can not be used on
diff --git a/cpan/Digest-MD5/MD5.xs b/cpan/Digest-MD5/MD5.xs
index e8b950452c..f3b58f7eee 100644
--- a/cpan/Digest-MD5/MD5.xs
+++ b/cpan/Digest-MD5/MD5.xs
@@ -43,6 +43,51 @@ extern "C" {
}
#endif
+#ifndef PERL_UNUSED_VAR
+# define PERL_UNUSED_VAR(x) ((void)x)
+#endif
+
+#ifndef PERL_MAGIC_ext
+# define PERL_MAGIC_ext '~'
+#endif
+
+#ifndef Newxz
+# define Newxz(v,n,t) Newz(0,v,n,t)
+#endif
+
+#ifndef SvMAGIC_set
+# define SvMAGIC_set(sv, mg) (SvMAGIC(sv) = (mg))
+#endif
+
+#ifndef sv_magicext
+# define sv_magicext(sv, obj, type, vtbl, name, namlen) \
+ THX_sv_magicext(aTHX_ sv, obj, type, vtbl, name, namlen)
+static MAGIC *THX_sv_magicext(pTHX_ SV *sv, SV *obj, int type,
+ MGVTBL const *vtbl, char const *name, I32 namlen)
+{
+ MAGIC *mg;
+ if (obj || namlen)
+ /* exceeded intended usage of this reserve implementation */
+ return NULL;
+ Newxz(mg, 1, MAGIC);
+ mg->mg_virtual = (MGVTBL*)vtbl;
+ mg->mg_type = type;
+ mg->mg_ptr = (char *)name;
+ mg->mg_len = -1;
+ (void) SvUPGRADE(sv, SVt_PVMG);
+ mg->mg_moremagic = SvMAGIC(sv);
+ SvMAGIC_set(sv, mg);
+ SvMAGICAL_off(sv);
+ mg_magical(sv);
+ return mg;
+}
+#endif
+
+#if PERL_VERSION < 8
+# undef SvPVbyte
+# define SvPVbyte(sv, lp) (sv_utf8_downgrade((sv), 0), SvPV((sv), (lp)))
+#endif
+
/* Perl does not guarantee that U32 is exactly 32 bits. Some system
* has no integral type with exactly 32 bits. For instance, A Cray has
* short, int and long all at 64 bits so we need to apply this macro
@@ -89,7 +134,7 @@ static void u2s(U32 u, U8* s)
((U32)(*(s+3)) << 24))
#endif
-/* This stucture keeps the current state of algorithm.
+/* This structure keeps the current state of algorithm.
*/
typedef struct {
U32 A, B, C, D; /* current digest */
@@ -98,7 +143,7 @@ typedef struct {
U8 buffer[128]; /* collect complete 64 byte blocks */
} MD5_CTX;
-#ifdef USE_ITHREADS
+#if defined(USE_ITHREADS) && defined(MGf_DUP)
STATIC int dup_md5_ctx(pTHX_ MAGIC *mg, CLONE_PARAMS *params)
{
MD5_CTX *new_ctx;
@@ -482,7 +527,7 @@ static SV * new_md5_ctx(pTHX_ MD5_CTX *context, const char *klass)
#endif
sv_magicext(sv, NULL, PERL_MAGIC_ext, &vtbl_md5, (const char *)context, 0);
-#ifdef USE_ITHREADS
+#if defined(USE_ITHREADS) && defined(MGf_DUP)
mg->mg_flags |= MGf_DUP;
#endif
@@ -555,7 +600,7 @@ static SV* make_mortal_sv(pTHX_ const unsigned char *src, int type)
len = 22;
break;
default:
- croak("Bad convertion type (%d)", type);
+ croak("Bad conversion type (%d)", type);
break;
}
return sv_2mortal(newSVpv(ret,len));
diff --git a/cpan/Digest-MD5/Makefile.PL b/cpan/Digest-MD5/Makefile.PL
index 5f90338804..a56fe13595 100644
--- a/cpan/Digest-MD5/Makefile.PL
+++ b/cpan/Digest-MD5/Makefile.PL
@@ -23,7 +23,7 @@ WriteMakefile(
'ABSTRACT' => 'Perl interface to the MD-5 algorithm',
'AUTHOR' => 'Gisle Aas <gisle@activestate.com>',
'LICENSE' => 'perl',
- 'MIN_PERL_VERSION' => 5.008,
+ 'MIN_PERL_VERSION' => 5.006,
'PREREQ_PM' => { 'File::Spec' => 0,
'Digest::base' => '1.00',
'XSLoader' => 0,
diff --git a/cpan/Digest-MD5/README b/cpan/Digest-MD5/README
index 45c3658b62..031c8f10f1 100644
--- a/cpan/Digest-MD5/README
+++ b/cpan/Digest-MD5/README
@@ -4,8 +4,6 @@ algorithm takes as input a message of arbitrary length and produces as
output a 128-bit "fingerprint" or "message digest" of the input.
MD5 is described in RFC 1321.
-You will need perl version 5.8 or better to install this module.
-
Copyright 1998-2003 Gisle Aas.
Copyright 1995-1996 Neil Winton.
Copyright 1990-1992 RSA Data Security, Inc.
diff --git a/cpan/Digest-MD5/t/files.t b/cpan/Digest-MD5/t/files.t
index 11f625a52f..dc39aac118 100644
--- a/cpan/Digest-MD5/t/files.t
+++ b/cpan/Digest-MD5/t/files.t
@@ -13,15 +13,15 @@ use Digest::MD5 qw(md5 md5_hex md5_base64);
my $EXPECT;
if (ord "A" == 193) { # EBCDIC
$EXPECT = <<EOT;
-4f932585bed0cc942186fb51daff4839 README
-b0f7cb93ec1b43f9417f089bb7b87bb0 MD5.xs
+0956ffb4f6416082b27d6680b4cf73fc README
+b349234bb1005785bb6e377990209dc7 MD5.xs
276da0aa4e9a08b7fe09430c9c5690aa rfc1321.txt
EOT
} else {
# This is the output of: 'md5sum README MD5.xs rfc1321.txt'
$EXPECT = <<EOT;
-c8d3f8457a2d6983253d771ffddb9f4c README
-14b929c388c5a9bd8eca3d37160e1b8a MD5.xs
+2f93400875dbb56f36691d5f69f3eba5 README
+f908acbcf6bd32042f282b0deed61264 MD5.xs
754b9db19f79dbc4992f7166eb0f37ce rfc1321.txt
EOT
}