The following patch syncs up Digest::MD5 in bleadperl with the latest on CPAN. Regards, Gisle #### Patch data follows #### diff -u 'current/ext/Digest/MD5/Changes' 'hack1/ext/Digest/MD5/Changes' Index: ./ext/Digest/MD5/Changes --- ./ext/Digest/MD5/Changes Fri Mar 23 05:23:20 2001 +++ ./ext/Digest/MD5/Changes Thu Sep 6 23:00:32 2001 @@ -1,3 +1,38 @@ +2001-09-07 Gisle Aas <[EMAIL PROTECTED]> + + Release 2.16 + + Sync up with the bleadperl version: + - use SvPVbyte() if avaiable + - fixes to make the code 'gcc -Wall'-clean + + + +2001-08-27 Gisle Aas <[EMAIL PROTECTED]> + + Release 2.15 + + Avoid exit() in Makefile.PL and bleedperls redefinition of printf + in the alignment test program. + Patch by Doug MacEachern <[EMAIL PROTECTED]>. + + + +2001-07-18 Gisle Aas <[EMAIL PROTECTED]> + + Release 2.14 + + Try to warn if the functional interface is used as methods, + i.e. Digest::MD5->md5_hex("foo") will make noise if -w is + enabled. + + Document the missing padding for the base64 digests. + + If both XS bootstrap and locating Digest::Perl::MD5 fails + reraise the original XS bootstrap exception. + + + 2001-03-13 Gisle Aas <[EMAIL PROTECTED]> Release 2.13 diff -u 'current/ext/Digest/MD5/MD5.pm' 'hack1/ext/Digest/MD5/MD5.pm' Index: ./ext/Digest/MD5/MD5.pm --- ./ext/Digest/MD5/MD5.pm Sun Mar 25 08:25:37 2001 +++ ./ext/Digest/MD5/MD5.pm Thu Sep 6 23:00:32 2001 @@ -3,7 +3,7 @@ use strict; use vars qw($VERSION @ISA @EXPORT_OK); -$VERSION = '2.13'; +$VERSION = '2.16'; # $Date: 2001/09/07 05:45:14 $ require Exporter; *import = \&Exporter::import; @@ -16,11 +16,18 @@ Digest::MD5->bootstrap($VERSION); }; if ($@) { - # Try to load the pure perl version - require Digest::Perl::MD5; - - Digest::Perl::MD5->import(qw(md5 md5_hex md5_base64)); - push(@ISA, "Digest::Perl::MD5"); # make OO interface work + my $olderr = $@; + eval { + # Try to load the pure perl version + require Digest::Perl::MD5; + + Digest::Perl::MD5->import(qw(md5 md5_hex md5_base64)); + push(@ISA, "Digest::Perl::MD5"); # make OO interface work + }; + if ($@) { + # restore the original error + die $olderr; + } } else { *reset = \&new; @@ -88,6 +95,10 @@ Same as md5(), but will return the digest as a base64 encoded string. +The base64 encoded string returned is not padded to be a multiple of 4 +bytes long. If you want interoperability with other base64 encoded +md5 digests you might want to append the string "==" to the result. + =back =head1 METHODS @@ -142,6 +153,10 @@ Same as $md5->digest, but will return the digest as a base64 encoded string. +The base64 encoded string returned is not padded to be a multiple of 4 +bytes long. If you want interoperability with other base64 encoded +md5 digests you might want to append the string "==" to the result. + =back @@ -215,7 +230,7 @@ This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. - Copyright 1998-2000 Gisle Aas. + Copyright 1998-2001 Gisle Aas. Copyright 1995-1996 Neil Winton. Copyright 1991-1992 RSA Data Security, Inc. diff -u 'current/ext/Digest/MD5/MD5.xs' 'hack1/ext/Digest/MD5/MD5.xs' Index: ./ext/Digest/MD5/MD5.xs --- ./ext/Digest/MD5/MD5.xs Wed May 30 08:06:56 2001 +++ ./ext/Digest/MD5/MD5.xs Thu Sep 6 23:02:24 2001 @@ -42,8 +42,9 @@ } #endif -/* Define this to turn on verbose debugging prints */ -#undef MD5_DEBUG +#ifndef SvPVbyte + #define SvPVbyte SvPV +#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 @@ -618,6 +619,14 @@ unsigned char digeststr[16]; PPCODE: MD5Init(&ctx); + if (PL_dowarn && items > 1) { + data = (unsigned char *)SvPVbyte(ST(0), len); + if (len == 11 && memEQ("Digest::MD5", data, 11)) { + char *f = (ix == F_BIN) ? "md5" : + (ix == F_HEX) ? "md5_hex" : "md5_base64"; + warn("&Digest::MD5::%s function probably called as method", f); + } + } for (i = 0; i < items; i++) { data = (unsigned char *)(SvPVbyte(ST(i), len)); MD5Update(&ctx, data, len); diff -u 'current/ext/Digest/MD5/t/files.t' 'hack1/ext/Digest/MD5/t/files.t' Index: ./ext/Digest/MD5/t/files.t --- ./ext/Digest/MD5/t/files.t Sun Jun 17 22:21:15 2001 +++ ./ext/Digest/MD5/t/files.t Thu Sep 6 23:27:05 2001 @@ -15,13 +15,13 @@ if (ord('A') == 193) { # EBCDIC $EXPECT = <<EOT; -95a81f17a8e6c2273aecac12d8c4cb90 ext/Digest/MD5/MD5.pm -9cecc5dbb27bd64b98f61f558b4db378 ext/Digest/MD5/MD5.xs +???????????????????????????????? ext/Digest/MD5/MD5.pm +???????????????????????????????? ext/Digest/MD5/MD5.xs EOT } else { # ASCII $EXPECT = <<EOT; -3d0146bf194e4fe68733d00fba02a49e ext/Digest/MD5/MD5.pm -5526659171a63f532d990dd73791b60e ext/Digest/MD5/MD5.xs +bf8c3c72d071d1c0303fc9e311820708 ext/Digest/MD5/MD5.pm +dc50ae0aea3182f4d5f1ec368b67918b ext/Digest/MD5/MD5.xs EOT } @@ -126,7 +126,7 @@ #print "$file $method\n"; open(FILE, $file) or die "Can't open $file: $!"; -# Digests avove are generated on UNIX without CRLF +# Digests above are generated on UNIX without CRLF # so leave handles in text mode # binmode(FILE); my $digest = Digest::MD5->new->addfile(*FILE)->$method(); @@ -140,7 +140,7 @@ my($file) = @_; local $/; # slurp open(FILE, $file) or die "Can't open $file: $!"; -# Digests avove are generated on UNIX without CRLF +# Digests above are generated on UNIX without CRLF # so leave handles in text mode # binmode(FILE); my $tmp = <FILE>; #### End of Patch data #### #### ApplyPatch data follows #### # Data version : 1.0 # Date generated : Thu Sep 6 23:27:15 2001 # Generated by : makepatch 2.00_02 # Recurse directories : Yes # v 'patchlevel.h' 3047 999790658 33060 # p 'ext/Digest/MD5/Changes' 11787 999842432 0100644 # p 'ext/Digest/MD5/MD5.pm' 6526 999842432 0100644 # p 'ext/Digest/MD5/MD5.xs' 16733 999842544 0100644 # p 'ext/Digest/MD5/t/files.t' 3383 999844025 0100755 #### End of ApplyPatch data #### #### End of Patch kit [created: Thu Sep 6 23:27:15 2001] #### #### Patch checksum: 198 6132 62297 #### #### Checksum: 216 6806 52794 ####