r3363 - in /packages/libdigest-sha-perl/trunk: ./ debian/ src/ t/

gwolf at users.alioth.debian.org gwolf at users.alioth.debian.org
Mon Jul 31 18:10:10 UTC 2006


Author: gwolf
Date: Mon Jul 31 18:10:09 2006
New Revision: 3363

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=3363
Log:
New upstream version 5.42

Modified:
    packages/libdigest-sha-perl/trunk/Changes
    packages/libdigest-sha-perl/trunk/META.yml
    packages/libdigest-sha-perl/trunk/README
    packages/libdigest-sha-perl/trunk/SHA.pm
    packages/libdigest-sha-perl/trunk/SIGNATURE
    packages/libdigest-sha-perl/trunk/debian/changelog
    packages/libdigest-sha-perl/trunk/shasum
    packages/libdigest-sha-perl/trunk/src/hmac.c
    packages/libdigest-sha-perl/trunk/src/hmac.h
    packages/libdigest-sha-perl/trunk/src/sha.c
    packages/libdigest-sha-perl/trunk/src/sha.h
    packages/libdigest-sha-perl/trunk/t/1-exist.t
    packages/libdigest-sha-perl/trunk/t/2-nist-sha-oo.t
    packages/libdigest-sha-perl/trunk/t/2-nist-vectors-bit.t
    packages/libdigest-sha-perl/trunk/t/2-nist-vectors-byte.t
    packages/libdigest-sha-perl/trunk/t/3-gillogly-hard.t
    packages/libdigest-sha-perl/trunk/t/6-dump-load.t
    packages/libdigest-sha-perl/trunk/t/7-ireland.t

Modified: packages/libdigest-sha-perl/trunk/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/Changes?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/Changes (original)
+++ packages/libdigest-sha-perl/trunk/Changes Mon Jul 31 18:10:09 2006
@@ -1,4 +1,13 @@
 Revision history for Perl extension Digest::SHA.
+
+5.42  Mon Jul 24 04:04:40 MST 2006
+	- minor code changes suggested by Perl::Critic
+		-- e.g. no bareword filehandles, no 2-argument open's
+	- updated public key (ref. B538C51C)
+		-- previous one (0AF563FE) expired July 2, 2006
+	- added documentation to warn that Base64 digests are NOT padded
+		-- padding must be done by user if interoperability
+			with other software is required
 
 5.41  Sat Jun  3 01:50:46 MST 2006
 	- corrected addfile

Modified: packages/libdigest-sha-perl/trunk/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/META.yml?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/META.yml (original)
+++ packages/libdigest-sha-perl/trunk/META.yml Mon Jul 31 18:10:09 2006
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name: Digest-SHA
-version: 5.41
+version: 5.42
 author:
   - Mark Shelor, mshelor at cpan.org
 abstract: Perl extension for SHA-1/224/256/384/512
@@ -12,5 +12,5 @@
 provides:
   Digest::SHA:
     file: SHA.pm
-    version: 5.41
+    version: 5.42
 generated_by: Module::Build version 0.22

Modified: packages/libdigest-sha-perl/trunk/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/README?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/README (original)
+++ packages/libdigest-sha-perl/trunk/README Mon Jul 31 18:10:09 2006
@@ -1,4 +1,4 @@
-Digest::SHA version 5.41
+Digest::SHA version 5.42
 ========================
 
 Digest::SHA is a complete implementation of the NIST Secure Hash

Modified: packages/libdigest-sha-perl/trunk/SHA.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/SHA.pm?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/SHA.pm (original)
+++ packages/libdigest-sha-perl/trunk/SHA.pm Mon Jul 31 18:10:09 2006
@@ -6,7 +6,7 @@
 use warnings;
 use integer;
 
-our $VERSION = '5.41';
+our $VERSION = '5.42';
 
 require Exporter;
 our @ISA = qw(Exporter);
@@ -118,22 +118,21 @@
 	my ($binary, $portable) = map { $_ eq $mode } ("b", "p");
 	my $text = -T $file;
 
-	local *F;
-	_bail("Open failed") unless open(F, "<$file");
-	binmode(F) if $binary || $portable;
+	open(my $fh, q{<}, $file) or _bail("Open failed");
+	binmode($fh) if $binary || $portable;
 
 	unless ($portable && $text) {
-		$self->_addfile(*F);
-		close(F);
+		$self->_addfile($fh);
+		close($fh);
 		return($self);
 	}
 
 	my ($n1, $n2);
 	my ($buf1, $buf2) = ("", "");
 
-	while (($n1 = read(F, $buf1, 4096))) {
+	while (($n1 = read($fh, $buf1, 4096))) {
 		while (substr($buf1, -1) eq "\015") {
-			$n2 = read(F, $buf2, 4096);
+			$n2 = read($fh, $buf2, 4096);
 			_bail("Read failed") unless defined $n2;
 			last unless $n2;
 			$buf1 .= $buf2;
@@ -143,7 +142,7 @@
 		$self->add($buf1);
 	}
 	_bail("Read failed") unless defined $n1;
-	close(F);
+	close($fh);
 
 	$self;
 }
@@ -323,6 +322,30 @@
 
 ref. L<http://www.csrc.nist.gov/pki/HashWorkshop/NIST%20Statement/Burr_Mar2005.html>
 
+=head1 BASE64 DIGESTS
+
+By convention, CPAN Digest modules do not pad their Base64 output.
+This means that Base64 digests contain no trailing "=" characters.
+Unfortunately, problems can occur when feeding such digests to other
+software that expects properly padded Base64 encodings.
+
+For the time being, any necessary padding must be done by the user.
+Fortunately, the rule for accomplishing it is straightforward: if the
+length of a Base64-encoded digest isn't a multiple of 4, simply append
+1 or more "=" characters to the end of the digest until it is:
+
+	while (length($b64_digest) % 4) {
+		$b64_digest .= '=';
+	}
+
+To illustrate, I<sha256_base64("abc")> is computed to be
+
+	ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0
+
+which has a length of 43.  So, the properly padded version is
+
+	ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=
+
 =head1 EXPORT
 
 None by default.
@@ -377,6 +400,11 @@
 
 Logically joins the arguments into a single string, and returns
 its SHA-1/224/256/384/512 digest encoded as a Base64 string.
+
+It's important to note that the resulting string does B<not> contain
+the padding characters typical of Base64 encodings.  This omission is
+deliberate, and is done to maintain compatibility with the family of
+CPAN Digest modules.  See L</"BASE64 DIGESTS"> for details.
 
 =back
 
@@ -527,6 +555,11 @@
 This method is inherited if L<Digest::base> is installed on your
 system.  Otherwise, a functionally equivalent substitute is used.
 
+It's important to note that the resulting string does B<not> contain
+the padding characters typical of Base64 encodings.  This omission is
+deliberate, and is done to maintain compatibility with the family of
+CPAN Digest modules.  See L</"BASE64 DIGESTS"> for details.
+
 =back
 
 I<HMAC-SHA-1/224/256/384/512>
@@ -577,6 +610,11 @@
 with the result encoded as a Base64 string.  Multiple I<$data>
 arguments are allowed, provided that I<$key> is the last argument
 in the list.
+
+It's important to note that the resulting string does B<not> contain
+the padding characters typical of Base64 encodings.  This omission is
+deliberate, and is done to maintain compatibility with the family of
+CPAN Digest modules.  See L</"BASE64 DIGESTS"> for details.
 
 =back
 

Modified: packages/libdigest-sha-perl/trunk/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/SIGNATURE?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/SIGNATURE (original)
+++ packages/libdigest-sha-perl/trunk/SIGNATURE Mon Jul 31 18:10:09 2006
@@ -14,26 +14,26 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-SHA1 cabbf055a6baf5e44a0077acc3893fadd4152dd3 Changes
+SHA1 ad8fa1bc0f14e56778aec3a89c0c7a09c80eb81a Changes
 SHA1 952a17b73eeb605287d1aa08d2e8bf4837106b43 MANIFEST
-SHA1 714bff592bcd28df6c7d0cee672eb2c090744aa3 META.yml
+SHA1 8d49a31de153d1e5606f0f5e6f438cc7ddbca17f META.yml
 SHA1 def31e4ea732857338ca9858b091a7b9b4c35fd7 Makefile.PL
-SHA1 702a09721bbe399223a92b53e18b43ef1091d436 README
-SHA1 85733b9681cf91c14fe5aeba2800f07e7045a93e SHA.pm
+SHA1 875c1a5f12cde0c3b957927f3712b5df2ca650de README
+SHA1 7be8a1f1af914154bea121e282cfb9914c04beb2 SHA.pm
 SHA1 51d3d1db41241cdf960bb3d5c81efa9eac13b197 SHA.xs
 SHA1 48517b1bf0ddf48ae4bc24910d3b9af625bc2325 ppport.h
-SHA1 81edf31a7454f1c6684f3eea3765ccbbc1714fb3 shasum
-SHA1 d3613dc31e6d07b448559a6aeb6bc352c794b546 src/hmac.c
-SHA1 c3039558777c06c626d18827d3f8114b4a9b1bf5 src/hmac.h
+SHA1 13198e4cd149d2fac3c4b8ff6936cad0d72d47fc shasum
+SHA1 ed60ca4dd1e4160972809db753e0e1341276a59a src/hmac.c
+SHA1 b5b0165a2182a7b0fc6f9a5ccb9bd24955314e2a src/hmac.h
 SHA1 7589c6ce33e74a58ded932d69756659e91723fdb src/hmacxtra.c
-SHA1 8ba775a2803e4492acd152efc0e5821a7c6b72f3 src/sha.c
-SHA1 075e3e772e74a3cbd439dab6e5194c468d873931 src/sha.h
+SHA1 1389b810490272e22502901e2d79d031ee136e8a src/sha.c
+SHA1 dc0f942a8bc33b44b487888ec6233ff20d3f25a0 src/sha.h
 SHA1 c1bba35de65c8d81362472b76075dba8cf1e542b src/sha64bit.c
 SHA1 48d806b05a15dfd8211d5f7158b3294d86fa24d2 src/sha64bit.h
 SHA1 329ac17325437c725331fbf84ae0c9484f50041a src/shaxtra.c
 SHA1 18aa2e2abf4f8b3a5dd2cd6ba74ea242ddfe4071 t/0-pod-coverage.t
 SHA1 38ccb5f60fe9f45d127602067f072458fc1797d5 t/0-pod.t
-SHA1 aa619fcc19f260e520fc7ca4a95e74ae53b52c82 t/1-exist.t
+SHA1 2a15e161bad79f2c7eb7817fe252ae54176ded09 t/1-exist.t
 SHA1 8a3fec711fbc48a150d28ac5a88efc9a101eb86c t/1-hello-world.t
 SHA1 3e57a15a837469e18f02b1d1f7a022e754f5852a t/2-nist-sha-1.t
 SHA1 7415c29834500690925912fc4c1fc7a0cdbdf0c2 t/2-nist-sha-224.t
@@ -41,11 +41,11 @@
 SHA1 5ff47d34427af615dd5222486a3460e2a75535aa t/2-nist-sha-384.t
 SHA1 4d5dfce16efb801b27dcd5cfcd904d91175e97f1 t/2-nist-sha-512.t
 SHA1 902f263f29354655886cc5e5361bf8ff6fc6dc68 t/2-nist-sha-base64.t
-SHA1 721ca107b263b128f128a65a4f660581e3344e1d t/2-nist-sha-oo.t
-SHA1 62b21ae81d5e57c0b064f7ba0c6bc81952ea2808 t/2-nist-vectors-bit.t
-SHA1 f8f550ff0161091803e163f56ecc043a9ae2387c t/2-nist-vectors-byte.t
+SHA1 0c83f41cb9530b4521782d0bd4b440025a31fcce t/2-nist-sha-oo.t
+SHA1 880c45e1d211cce65efae9ece173c2baaf3672f4 t/2-nist-vectors-bit.t
+SHA1 f97235288f1f9159a3b0d95a63964a5e14461448 t/2-nist-vectors-byte.t
 SHA1 3e9a29e58dfc4a6c40b5f92982d7ba26f175cf9c t/3-gillogly-easy.t
-SHA1 67e6c5001d6b9e6f0d0305592f64b0d2e52bdc58 t/3-gillogly-hard.t
+SHA1 39dfc02dac776d7527a712b5e2968dd88d363270 t/3-gillogly-hard.t
 SHA1 b3189cbf12b15bf461bdf7dae878f8f05a8136f8 t/4-bitstr-increasing.t
 SHA1 6b62754c9a89239d379d12dc38aaa1c9465ccbe3 t/4-bitstr-large.t
 SHA1 359ff1266547a7da0f43ce5776007d548efa15e5 t/4-bitstr-random.t
@@ -53,8 +53,8 @@
 SHA1 4235dc4336d072894170323e430abf9c02288659 t/5-hmac-rfc2202.t
 SHA1 d0a13027299b4f3a7749612f1964dcdc50ba49c2 t/5-hmac-sha-256.t
 SHA1 c34e883b47f7da8097fe655bf56884cd0b0058a1 t/5-hmac-woodbury.t
-SHA1 9d7892b2beefd2d456993db667e78e80bae71c69 t/6-dump-load.t
-SHA1 21c02922ef7908fd6d6ed3d1cc99df57b700274c t/7-ireland.t
+SHA1 594068594eb806e48aa5caff03fd6283456259aa t/6-dump-load.t
+SHA1 7c7699ee971c0fa0afb7bab9a94a1fe29fc4ce8e t/7-ireland.t
 SHA1 636d5e987243f6634fdc1dff1fe1d11d07778347 t/gillogly/state.011
 SHA1 b1e86af6b46e066555bbcd749982ccba816cf744 t/gillogly/state.110
 SHA1 427874bceb58bc3a36b5808a204023334614930b t/nist/COPYRIGHT
@@ -69,9 +69,9 @@
 SHA1 69cd49d84cb11c83ef8e6eb36f6a472edb37079d t/state/state.512
 SHA1 e93dd71c67ba56e170516c16eeeb7659a41f91fd typemap
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.1 (GNU/Linux)
+Version: GnuPG v1.4.2.2 (GNU/Linux)
 
-iD8DBQFEgU6EBwNg/wr1Y/4RApdOAJ46GmuAdxR8+FQIuGZUXlEAPJlqxwCg1E9g
-TydSX2oMr+7Y+MnrA+mfC4U=
-=nZJs
+iD8DBQFExKmvD1RhyLU4xRwRAtcBAJ92pl1M3eGlIxJYV+4S0pSM5XtHYgCeIVIE
+QZo6fH6EuRpB5z3HfEZR1Gc=
+=b3Nh
 -----END PGP SIGNATURE-----

Modified: packages/libdigest-sha-perl/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/debian/changelog?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/debian/changelog (original)
+++ packages/libdigest-sha-perl/trunk/debian/changelog Mon Jul 31 18:10:09 2006
@@ -1,3 +1,9 @@
+libdigest-sha-perl (5.42-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Gunnar Wolf <gwolf at debian.org>  Mon, 31 Jul 2006 12:50:41 -0500
+
 libdigest-sha-perl (5.41-1) unstable; urgency=low
 
   * New upstream release.

Modified: packages/libdigest-sha-perl/trunk/shasum
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/shasum?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/shasum (original)
+++ packages/libdigest-sha-perl/trunk/shasum Mon Jul 31 18:10:09 2006
@@ -4,8 +4,8 @@
 	#
 	# Copyright (C) 2003-2006 Mark Shelor, All Rights Reserved
 	#
-	# Version: 5.41
-	# Sat Jun  3 01:50:46 MST 2006
+	# Version: 5.42
+	# Mon Jul 24 04:04:40 MST 2006
 
 =head1 NAME
 
@@ -22,7 +22,7 @@
   -b, --binary       read files in binary mode (default on DOS/Windows)
   -c, --check        check SHA sums against given list
   -p, --portable     read files in portable mode
-                         produces same digest on Windows/Unix/MacOS 9
+                         produces same digest on Windows/Unix/Mac
   -t, --text         read files in text mode (default)
 
  The following two options are useful only when verifying checksums:
@@ -52,7 +52,7 @@
 use strict;
 use Getopt::Long;
 
-my $VERSION = "5.41";
+my $VERSION = "5.42";
 
 
 	# Try to use Digest::SHA, since it's faster.  If not installed,
@@ -62,10 +62,10 @@
 my $MOD_SECOND = "Digest::SHA::PurePerl";
 
 my $module = $MOD_PREFER;
-eval "require $module";
+eval "require $module";			## no critic
 if ($@) {
 	$module = $MOD_SECOND;
-	eval "require $module";
+	eval "require $module";		## no critic
 	die "Unable to find $MOD_PREFER or $MOD_SECOND\n" if $@;
 }
 
@@ -92,7 +92,7 @@
   -b, --binary       read files in binary mode (default on DOS/Windows)
   -c, --check        check SHA sums against given list
   -p, --portable     read files in portable mode
-                         produces same digest on Windows/Unix/MacOS 9
+                         produces same digest on Windows/Unix/Mac
   -t, --text         read files in text mode (default)
 
 The following two options are useful only when verifying checksums:
@@ -201,7 +201,7 @@
 	my ($fh, $sum, $fname, $rsp);
 
 	die "shasum: $checkfile: $!\n"
-		unless open($fh, "<$checkfile");
+		unless open($fh, q{<}, $checkfile);
 	while (<$fh>) {
 		s/\s+$//;
 		($sum, $modesym, $fname) = /^(\S+) (.)(.*)$/;

Modified: packages/libdigest-sha-perl/trunk/src/hmac.c
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/src/hmac.c?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/src/hmac.c (original)
+++ packages/libdigest-sha-perl/trunk/src/hmac.c Mon Jul 31 18:10:09 2006
@@ -5,8 +5,8 @@
  *
  * Copyright (C) 2003-2006 Mark Shelor, All Rights Reserved
  *
- * Version: 5.41
- * Sat Jun  3 01:50:46 MST 2006
+ * Version: 5.42
+ * Mon Jul 24 04:04:40 MST 2006
  *
  */
 

Modified: packages/libdigest-sha-perl/trunk/src/hmac.h
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/src/hmac.h?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/src/hmac.h (original)
+++ packages/libdigest-sha-perl/trunk/src/hmac.h Mon Jul 31 18:10:09 2006
@@ -5,8 +5,8 @@
  *
  * Copyright (C) 2003-2006 Mark Shelor, All Rights Reserved
  *
- * Version: 5.41
- * Sat Jun  3 01:50:46 MST 2006
+ * Version: 5.42
+ * Mon Jul 24 04:04:40 MST 2006
  *
  */
 

Modified: packages/libdigest-sha-perl/trunk/src/sha.c
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/src/sha.c?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/src/sha.c (original)
+++ packages/libdigest-sha-perl/trunk/src/sha.c Mon Jul 31 18:10:09 2006
@@ -5,8 +5,8 @@
  *
  * Copyright (C) 2003-2006 Mark Shelor, All Rights Reserved
  *
- * Version: 5.41
- * Sat Jun  3 01:50:46 MST 2006
+ * Version: 5.42
+ * Mon Jul 24 04:04:40 MST 2006
  *
  */
 

Modified: packages/libdigest-sha-perl/trunk/src/sha.h
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/src/sha.h?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/src/sha.h (original)
+++ packages/libdigest-sha-perl/trunk/src/sha.h Mon Jul 31 18:10:09 2006
@@ -5,8 +5,8 @@
  *
  * Copyright (C) 2003-2006 Mark Shelor, All Rights Reserved
  *
- * Version: 5.41
- * Sat Jun  3 01:50:46 MST 2006
+ * Version: 5.42
+ * Mon Jul 24 04:04:40 MST 2006
  *
  */
 

Modified: packages/libdigest-sha-perl/trunk/t/1-exist.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/t/1-exist.t?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/t/1-exist.t (original)
+++ packages/libdigest-sha-perl/trunk/t/1-exist.t Mon Jul 31 18:10:09 2006
@@ -1,4 +1,5 @@
 use Test;
+use strict;
 
 BEGIN {
 	if ($ENV{PERL_CORE}) {

Modified: packages/libdigest-sha-perl/trunk/t/2-nist-sha-oo.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/t/2-nist-sha-oo.t?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/t/2-nist-sha-oo.t (original)
+++ packages/libdigest-sha-perl/trunk/t/2-nist-sha-oo.t Mon Jul 31 18:10:09 2006
@@ -30,12 +30,11 @@
 
 	# test OO methods using first two SHA-256 vectors from NIST
 
-my $temp = File::Spec->catfile(dirname($0), "oo.tmp");
-my $file = File::Spec->canonpath($temp);
-open(FILE, ">$file");
-binmode(FILE);
-print FILE "bcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
-close(FILE);
+my $file = File::Spec->catfile(dirname($0), "oo.tmp");
+open(my $fh, q{>}, $file);
+binmode($fh);
+print $fh "bcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
+close($fh);
 
 my $ctx = Digest::SHA->new()->reset("SHA-256")->new();
 $ctx->add_bits("a", 5)->add_bits("001");
@@ -44,14 +43,17 @@
 ok($ctx->clone->add("b", "c")->b64digest, $rsp);
 
 $rsp = shift(@vec);
-open(FILE, "<$file");
-binmode(FILE);
-ok($ctx->clone->addfile(*FILE)->hexdigest, $rsp);
-close(FILE);
 
-	# use indirect filehandle
+	# test addfile with bareword filehandle
 
-open(my $fh, "<$file");
+open(FILE, "<$file");					## no critic
+binmode(FILE);						## no critic
+ok($ctx->clone->addfile(*FILE)->hexdigest, $rsp);	## no critic
+close(FILE);						## no critic
+
+	# test addfile with indirect filehandle
+
+undef($fh); open($fh, q{<}, $file);
 binmode($fh);
 ok($ctx->clone->addfile($fh)->hexdigest, $rsp);
 close($fh);
@@ -62,26 +64,26 @@
 
 	# test addfile portable mode
 
-open(FILE, ">$file");
-binmode(FILE);
-print FILE "abc\012" x 2048;		# using UNIX newline
-close(FILE);
+undef($fh); open($fh, q{>}, $file);
+binmode($fh);
+print $fh "abc\012" x 2048;		# using UNIX newline
+close($fh);
 
 ok($ctx->new(1)->addfile($file, "p")->hexdigest,
 	"d449e19c1b0b0c191294c8dc9fa2e4a6ff77fc51");
 
-open(FILE, ">$file");
-binmode(FILE);
-print FILE "abc\015\012" x 2048;	# using DOS/Windows newline
-close(FILE);
+undef($fh); open($fh, q{>}, $file);
+binmode($fh);
+print $fh "abc\015\012" x 2048;		# using DOS/Windows newline
+close($fh);
 
 ok($ctx->new(1)->addfile($file, "p")->hexdigest,
 	"d449e19c1b0b0c191294c8dc9fa2e4a6ff77fc51");
 
-open(FILE, ">$file");
-binmode(FILE);
-print FILE "abc\015" x 2048;		# using Apple/Mac newline
-close(FILE);
+undef($fh); open($fh, q{>}, $file);
+binmode($fh);
+print $fh "abc\015" x 2048;		# using Apple/Mac newline
+close($fh);
 
 ok($ctx->new(1)->addfile($file, "p")->hexdigest,
 	"d449e19c1b0b0c191294c8dc9fa2e4a6ff77fc51");

Modified: packages/libdigest-sha-perl/trunk/t/2-nist-vectors-bit.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/t/2-nist-vectors-bit.t?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/t/2-nist-vectors-bit.t (original)
+++ packages/libdigest-sha-perl/trunk/t/2-nist-vectors-bit.t Mon Jul 31 18:10:09 2006
@@ -23,9 +23,8 @@
 
 BEGIN {
 	my $file = File::Spec->catfile(dirname($0), "nist", "bit-hashes.sha1");
-	my $datafile = File::Spec->canonpath($file);
-	open(F, $datafile);
-	while (<F>) {
+	open(my $fh, q{<}, $file);
+	while (<$fh>) {
 		next unless (/^[0-9A-F]/);
 		s/[\r\n]+$//;
 		if (/\^$/) {
@@ -33,7 +32,7 @@
 			push(@hashes, $_);
 		}
 	}
-	close(F);
+	close($fh);
 	plan tests => scalar(@hashes);
 }
 
@@ -61,9 +60,8 @@
 my $ctx = Digest::SHA->new(1);
 
 my $file = File::Spec->catfile(dirname($0), "nist", "bit-messages.sha1");
-my $datafile = File::Spec->canonpath($file);
-open(F, $datafile);
-while (<F>) {
+open(my $fh, q{<}, $file);
+while (<$fh>) {
 	$type3 = 1 if (/Type 3/);
 	$type3 = 0 if (/^<D/);
 	next unless (/^[0-9^ ]/);
@@ -86,4 +84,4 @@
 		$line = "";
 	}
 }
-close(F);
+close($fh);

Modified: packages/libdigest-sha-perl/trunk/t/2-nist-vectors-byte.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/t/2-nist-vectors-byte.t?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/t/2-nist-vectors-byte.t (original)
+++ packages/libdigest-sha-perl/trunk/t/2-nist-vectors-byte.t Mon Jul 31 18:10:09 2006
@@ -23,9 +23,8 @@
 
 BEGIN {
 	my $file = File::Spec->catfile(dirname($0), "nist", "byte-hashes.sha1");
-	my $datafile = File::Spec->canonpath($file);
-	open(F, $datafile);
-	while (<F>) {
+	open(my $fh, q{<}, $file);
+	while (<$fh>) {
 		next unless (/^[0-9A-F]/);
 		s/[\r\n]+$//;
 		if (/\^$/) {
@@ -33,7 +32,7 @@
 			push(@hashes, $_);
 		}
 	}
-	close(F);
+	close($fh);
 	plan tests => scalar(@hashes);
 }
 
@@ -61,9 +60,8 @@
 my $ctx = Digest::SHA->new(1);
 
 my $file = File::Spec->catfile(dirname($0), "nist", "byte-messages.sha1");
-my $datafile = File::Spec->canonpath($file);
-open(F, $datafile);
-while (<F>) {
+open(my $fh, q{<}, $file);
+while (<$fh>) {
 	$type3 = 1 if (/Type 3/);
 	$type3 = 0 if (/^<D/);
 	next unless (/^[0-9^ ]/);
@@ -86,4 +84,4 @@
 		$line = "";
 	}
 }
-close(F);
+close($fh);

Modified: packages/libdigest-sha-perl/trunk/t/3-gillogly-hard.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/t/3-gillogly-hard.t?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/t/3-gillogly-hard.t (original)
+++ packages/libdigest-sha-perl/trunk/t/3-gillogly-hard.t Mon Jul 31 18:10:09 2006
@@ -54,11 +54,8 @@
 	plan tests => scalar(@vec110) / 2 + scalar(@vec011) / 2;
 }
 
-my $fileSTATE110 = File::Spec->catfile(dirname($0), "gillogly", "state.110");
-my $fileSTATE011 = File::Spec->catfile(dirname($0), "gillogly", "state.011");
-
-my $STATE110 = File::Spec->canonpath($fileSTATE110);
-my $STATE011 = File::Spec->canonpath($fileSTATE011);
+my $STATE110 = File::Spec->catfile(dirname($0), "gillogly", "state.110");
+my $STATE011 = File::Spec->catfile(dirname($0), "gillogly", "state.011");
 
 my $reps = 1 << 14;
 my $loops = int(1431655764 / $reps);

Modified: packages/libdigest-sha-perl/trunk/t/6-dump-load.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/t/6-dump-load.t?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/t/6-dump-load.t (original)
+++ packages/libdigest-sha-perl/trunk/t/6-dump-load.t Mon Jul 31 18:10:09 2006
@@ -27,8 +27,7 @@
 my @ext = (1, 256, 384, 512);
 my $data = "a" x 990000;
 my $skip;
-my $tmpname = File::Spec->catfile(dirname($0), "dumpload.tmp");
-my $tmpfile = File::Spec->canonpath($tmpname);
+my $tmpfile = File::Spec->catfile(dirname($0), "dumpload.tmp");
 
 for (my $i = 0; $i < @sharsp; $i++) {
 	$skip = 0;
@@ -41,11 +40,8 @@
 	my $digest;
 	unless ($skip) {
 		my $state;
-		my $file;
-		my $filename;
-		$filename = File::Spec->catfile(dirname($0),
+		my $file = File::Spec->catfile(dirname($0),
 			"state", "state.$ext[$i]");
-		$file = File::Spec->canonpath($filename);
 		unless ($state = Digest::SHA->load($file)) {
 			$state = Digest::SHA->new($ext[$i]);
 			$state->add($data);

Modified: packages/libdigest-sha-perl/trunk/t/7-ireland.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdigest-sha-perl/trunk/t/7-ireland.t?rev=3363&op=diff
==============================================================================
--- packages/libdigest-sha-perl/trunk/t/7-ireland.t (original)
+++ packages/libdigest-sha-perl/trunk/t/7-ireland.t Mon Jul 31 18:10:09 2006
@@ -18,9 +18,8 @@
 
 BEGIN { plan tests => 1 }
 
-my $filename = File::Spec->catfile(dirname($0), "ireland.tmp");
-my $file = File::Spec->canonpath($filename);
-open(F, ">$file"); while (<DATA>) { print F $_ }  close(F);
+my $file = File::Spec->catfile(dirname($0), "ireland.tmp");
+open(my $fh, q{>}, $file); while (<DATA>) { print $fh $_ }  close($fh);
 
 my $data = "a" x 1000000;
 my $vec = "b9045a713caed5dff3d3b783e98d1ce5778d8bc331ee4119d707072312af06a7";




More information about the Pkg-perl-cvs-commits mailing list