summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/Digest-SHA
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2019-02-13 21:15:00 +0000
committerafresh1 <afresh1@openbsd.org>2019-02-13 21:15:00 +0000
commit9f11ffb7133c203312a01e4b986886bc88c7d74b (patch)
tree6618511204c614b20256e4ef9dea39a7b311d638 /gnu/usr.bin/perl/cpan/Digest-SHA
parentImport perl-5.28.1 (diff)
downloadwireguard-openbsd-9f11ffb7133c203312a01e4b986886bc88c7d74b.tar.xz
wireguard-openbsd-9f11ffb7133c203312a01e4b986886bc88c7d74b.zip
Fix merge issues, remove excess files - match perl-5.28.1 dist
looking good sthen@, Great! bluhm@
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Digest-SHA')
-rw-r--r--gnu/usr.bin/perl/cpan/Digest-SHA/SHA.xs2
-rw-r--r--gnu/usr.bin/perl/cpan/Digest-SHA/lib/Digest/SHA.pm47
-rw-r--r--gnu/usr.bin/perl/cpan/Digest-SHA/shasum181
-rw-r--r--gnu/usr.bin/perl/cpan/Digest-SHA/src/sha.c12
-rw-r--r--gnu/usr.bin/perl/cpan/Digest-SHA/src/sha.h6
-rw-r--r--gnu/usr.bin/perl/cpan/Digest-SHA/src/sha64bit.c6
-rw-r--r--gnu/usr.bin/perl/cpan/Digest-SHA/src/sha64bit.h6
-rwxr-xr-xgnu/usr.bin/perl/cpan/Digest-SHA/t/methods.t53
-rwxr-xr-xgnu/usr.bin/perl/cpan/Digest-SHA/t/woodbury.t16
9 files changed, 137 insertions, 192 deletions
diff --git a/gnu/usr.bin/perl/cpan/Digest-SHA/SHA.xs b/gnu/usr.bin/perl/cpan/Digest-SHA/SHA.xs
index 0a0c89d4e36..62eaad8d53a 100644
--- a/gnu/usr.bin/perl/cpan/Digest-SHA/SHA.xs
+++ b/gnu/usr.bin/perl/cpan/Digest-SHA/SHA.xs
@@ -401,6 +401,6 @@ PPCODE:
}
if (cr) {
in[0] = '\012';
- shawrite(in, 1 << 3, state);
+ shawrite(in, 1UL << 3, state);
}
XSRETURN(1);
diff --git a/gnu/usr.bin/perl/cpan/Digest-SHA/lib/Digest/SHA.pm b/gnu/usr.bin/perl/cpan/Digest-SHA/lib/Digest/SHA.pm
index e696decea45..2e86d4eea16 100644
--- a/gnu/usr.bin/perl/cpan/Digest-SHA/lib/Digest/SHA.pm
+++ b/gnu/usr.bin/perl/cpan/Digest-SHA/lib/Digest/SHA.pm
@@ -4,16 +4,16 @@ require 5.003000;
use strict;
use warnings;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
-use Fcntl;
+use vars qw($VERSION @ISA @EXPORT_OK $errmsg);
+use Fcntl qw(O_RDONLY);
use integer;
-$VERSION = '5.95_01';
+$VERSION = '6.01';
require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
+@ISA = qw(Exporter);
@EXPORT_OK = qw(
+ $errmsg
hmac_sha1 hmac_sha1_base64 hmac_sha1_hex
hmac_sha224 hmac_sha224_base64 hmac_sha224_hex
hmac_sha256 hmac_sha256_base64 hmac_sha256_hex
@@ -68,6 +68,7 @@ sub add_bits {
sub _bail {
my $msg = shift;
+ $errmsg = $!;
$msg .= ": $!";
require Carp;
Carp::croak($msg);
@@ -110,8 +111,8 @@ sub addfile {
return(_addfile($self, $file)) unless ref(\$file) eq 'SCALAR';
$mode = defined($mode) ? $mode : "";
- my ($binary, $UNIVERSAL, $BITS, $portable) =
- map { $_ eq $mode } ("b", "U", "0", "p");
+ my ($binary, $UNIVERSAL, $BITS) =
+ map { $_ eq $mode } ("b", "U", "0");
## Always interpret "-" to mean STDIN; otherwise use
## sysopen to handle full range of POSIX file names
@@ -124,7 +125,7 @@ sub addfile {
if ($BITS) {
my ($n, $buf) = (0, "");
while (($n = read(FH, $buf, 4096))) {
- $buf =~ s/[^01]//g;
+ $buf =~ tr/01//cd;
$self->add_bits($buf);
}
_bail("Read failed") unless defined $n;
@@ -132,17 +133,10 @@ sub addfile {
return($self);
}
- binmode(FH) if $binary || $portable || $UNIVERSAL;
+ binmode(FH) if $binary || $UNIVERSAL;
if ($UNIVERSAL && _istext(*FH, $file)) {
$self->_addfileuniv(*FH);
}
- elsif ($portable && _istext(*FH, $file)) {
- while (<FH>) {
- s/\015?\015\012/\012/g;
- s/\015/\012/g;
- $self->add($_);
- }
- }
else { $self->_addfilebin(*FH) }
close(FH);
@@ -243,7 +237,15 @@ sub load {
$class->putstate($str);
}
-Digest::SHA->bootstrap($VERSION);
+eval {
+ require XSLoader;
+ XSLoader::load('Digest::SHA', $VERSION);
+ 1;
+} or do {
+ require DynaLoader;
+ push @ISA, 'DynaLoader';
+ Digest::SHA->bootstrap($VERSION);
+};
1;
__END__
@@ -617,8 +619,6 @@ argument to one of the following values:
"0" use BITS mode
- "p" use portable mode (to be deprecated)
-
The "U" mode is modeled on Python's "Universal Newlines" concept, whereby
DOS and Mac OS line terminators are converted internally to UNIX newlines
before processing. This ensures consistent digest values when working
@@ -626,12 +626,6 @@ simultaneously across multiple file systems. B<The "U" mode influences
only text files>, namely those passing Perl's I<-T> test; binary files
are processed with no translation whatsoever.
-The "p" mode differs from "U" only in that it treats "\r\r\n" as a single
-newline, a quirky feature designed to accommodate legacy applications that
-occasionally added an extra carriage return before DOS line terminators.
-The "p" mode will be phased out eventually in favor of the cleaner and
-more well-established Universal Newlines concept.
-
The BITS mode ("0") interprets the contents of I<$filename> as a logical
stream of bits, where each ASCII '0' or '1' character represents a 0 or
1 bit, respectively. All other characters are ignored. This provides
@@ -790,6 +784,7 @@ The author is particularly grateful to
Sean Burke
Chris Carey
Alexandr Ciornii
+ Chris David
Jim Doble
Thomas Drugeon
Julius Duque
@@ -813,7 +808,7 @@ darkness and moored it in so perfect a calm and in so brilliant a light"
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2003-2015 Mark Shelor
+Copyright (C) 2003-2017 Mark Shelor
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
diff --git a/gnu/usr.bin/perl/cpan/Digest-SHA/shasum b/gnu/usr.bin/perl/cpan/Digest-SHA/shasum
index 62a2b0ec3c3..f8bc02098d6 100644
--- a/gnu/usr.bin/perl/cpan/Digest-SHA/shasum
+++ b/gnu/usr.bin/perl/cpan/Digest-SHA/shasum
@@ -2,22 +2,23 @@
## shasum: filter for computing SHA digests (ref. sha1sum/md5sum)
##
- ## Copyright (C) 2003-2015 Mark Shelor, All Rights Reserved
+ ## Copyright (C) 2003-2017 Mark Shelor, All Rights Reserved
##
- ## Version: 5.95
- ## Sat Jan 10 12:15:36 MST 2015
+ ## Version: 6.01
+ ## Mon Dec 25 00:08:08 MST 2017
## shasum SYNOPSIS adapted from GNU Coreutils sha1sum. Add
## "-a" option for algorithm selection,
- ## "-U" option for Universal Newlines support,
- ## "-0" option for reading bit strings, and
- ## "-p" option for portable digests (to be deprecated).
+ ## "-U" option for Universal Newlines support, and
+ ## "-0" option for reading bit strings.
BEGIN { pop @INC if $INC[-1] eq '.' }
+
use strict;
use warnings;
use Fcntl;
use Getopt::Long;
+use Digest::SHA qw($errmsg);
my $POD = <<'END_OF_POD';
@@ -34,6 +35,7 @@ shasum - Print or Check SHA Checksums
-a, --algorithm 1 (default), 224, 256, 384, 512, 512224, 512256
-b, --binary read in binary mode
-c, --check read SHA sums from the FILEs and check them
+ --tag create a BSD-style checksum
-t, --text read in text mode (default)
-U, --UNIVERSAL read in Universal Newlines mode
produces same digest on Windows/Unix/Mac
@@ -41,11 +43,13 @@ shasum - Print or Check SHA Checksums
ASCII '0' interpreted as 0-bit,
ASCII '1' interpreted as 1-bit,
all other characters ignored
- -p, --portable read in portable mode (to be deprecated)
- The following two options are useful only when verifying checksums:
- -s, --status don't output anything, status code shows success
- -w, --warn warn about improperly formatted checksum lines
+ The following five options are useful only when verifying checksums:
+ --ignore-missing don't fail or report status for missing files
+ -q, --quiet don't print OK for each successfully verified file
+ -s, --status don't output anything, status code shows success
+ --strict exit non-zero for improperly formatted checksum lines
+ -w, --warn warn about improperly formatted checksum lines
-h, --help display this help and exit
-v, --version output version information and exit
@@ -58,8 +62,10 @@ shasum - Print or Check SHA Checksums
The sums are computed as described in FIPS PUB 180-4. When checking,
the input should be a former output of this program. The default
mode is to print a line with checksum, a character indicating type
- (`*' for binary, ` ' for text, `U' for UNIVERSAL, `^' for BITS, `?'
- for portable), and name for each FILE.
+ (`*' for binary, ` ' for text, `U' for UNIVERSAL, `^' for BITS),
+ and name for each FILE. The line starts with a `\' character if the
+ FILE name contains either newlines or backslashes, which are then
+ replaced by the two-character sequences `\n' and `\\' respectively.
Report shasum bugs to mshelor@cpan.org
@@ -91,18 +97,17 @@ the 7-bit message I<0001100>:
=head1 AUTHOR
-Copyright (c) 2003-2015 Mark Shelor <mshelor@cpan.org>.
+Copyright (c) 2003-2017 Mark Shelor <mshelor@cpan.org>.
=head1 SEE ALSO
-I<shasum> is implemented using the Perl module L<Digest::SHA> or
-L<Digest::SHA::PurePerl>.
+I<shasum> is implemented using the Perl module L<Digest::SHA>.
=cut
END_OF_POD
-my $VERSION = "5.95";
+my $VERSION = "6.01";
sub usage {
my($err, $msg) = @_;
@@ -129,20 +134,21 @@ select((select(STDERR), $| = 1)[0]);
## Collect options from command line
-my ($alg, $binary, $check, $text, $status, $warn, $help, $version);
-my ($portable, $BITS, $reverse, $UNIVERSAL, $versions);
+my ($alg, $binary, $check, $text, $status, $quiet, $warn, $help);
+my ($version, $BITS, $UNIVERSAL, $tag, $strict, $ignore_missing);
eval { Getopt::Long::Configure ("bundling") };
GetOptions(
'b|binary' => \$binary, 'c|check' => \$check,
't|text' => \$text, 'a|algorithm=i' => \$alg,
's|status' => \$status, 'w|warn' => \$warn,
+ 'q|quiet' => \$quiet,
'h|help' => \$help, 'v|version' => \$version,
- 'p|portable' => \$portable,
'0|01' => \$BITS,
- 'R|REVERSE' => \$reverse,
'U|UNIVERSAL' => \$UNIVERSAL,
- 'V|VERSIONS' => \$versions,
+ 'tag' => \$tag,
+ 'strict' => \$strict,
+ 'ignore-missing' => \$ignore_missing,
) or usage(1, "");
@@ -152,39 +158,34 @@ usage(0)
if $help;
usage(1, "shasum: Ambiguous file mode\n")
if scalar(grep {defined $_}
- ($binary, $portable, $text, $BITS, $UNIVERSAL)) > 1;
+ ($binary, $text, $BITS, $UNIVERSAL)) > 1;
usage(1, "shasum: --warn option used only when verifying checksums\n")
if $warn && !$check;
usage(1, "shasum: --status option used only when verifying checksums\n")
if $status && !$check;
-
-
- ## Try to use Digest::SHA. If not installed, use the slower
- ## but functionally equivalent Digest::SHA::PurePerl instead.
-
- ## If option -R is invoked, reverse the module preference,
- ## i.e. try Digest::SHA::PurePerl first, then Digest::SHA.
-
-my @MODS = qw(Digest::SHA Digest::SHA::PurePerl);
-@MODS[0, 1] = @MODS[1, 0] if $reverse;
-
-my $module;
-for (@MODS) {
- my $mod = $_;
- if (eval "require $mod") {
- $module = $mod;
- last;
- }
-}
-die "shasum: Unable to find " . join(" or ", @MODS) . "\n"
- unless defined $module;
+usage(1, "shasum: --quiet option used only when verifying checksums\n")
+ if $quiet && !$check;
+usage(1, "shasum: --ignore-missing option used only when verifying checksums\n")
+ if $ignore_missing && !$check;
+usage(1, "shasum: --strict option used only when verifying checksums\n")
+ if $strict && !$check;
+usage(1, "shasum: --tag does not support --text mode\n")
+ if $tag && $text;
+usage(1, "shasum: --tag does not support Universal Newlines mode\n")
+ if $tag && $UNIVERSAL;
+usage(1, "shasum: --tag does not support BITS mode\n")
+ if $tag && $BITS;
## Default to SHA-1 unless overridden by command line option
+my %isAlg = map { $_ => 1 } (1, 224, 256, 384, 512, 512224, 512256);
$alg = 1 unless defined $alg;
-grep { $_ == $alg } (1, 224, 256, 384, 512, 512224, 512256)
- or usage(1, "shasum: Unrecognized algorithm\n");
+usage(1, "shasum: Unrecognized algorithm\n") unless $isAlg{$alg};
+
+my %Tag = map { $_ => "SHA$_" } (1, 224, 256, 384, 512);
+$Tag{512224} = "SHA512/224";
+$Tag{512256} = "SHA512/256";
## Display version information if requested
@@ -194,24 +195,16 @@ if ($version) {
exit(0);
}
-if ($versions) {
- print "shasum $VERSION\n";
- print "$module ", eval "\$${module}::VERSION", "\n";
- print "perl ", defined $^V ? sprintf("%vd", $^V) : $], "\n";
- exit(0);
-}
-
## Try to figure out if the OS is DOS-like. If it is,
## default to binary mode when reading files, unless
## explicitly overridden by command line "--text" or
- ## "--UNIVERSAL" or "--portable" options.
+ ## "--UNIVERSAL" options.
my $isDOSish = ($^O =~ /^(MSWin\d\d|os2|dos|mint|cygwin)$/);
-if ($isDOSish) { $binary = 1 unless $text || $UNIVERSAL || $portable }
+if ($isDOSish) { $binary = 1 unless $text || $UNIVERSAL }
-my $modesym = $binary ? '*' : ($UNIVERSAL ? 'U' :
- ($BITS ? '^' : ($portable ? '?' : ' ')));
+my $modesym = $binary ? '*' : ($UNIVERSAL ? 'U' : ($BITS ? '^' : ' '));
## Read from STDIN (-) if no files listed on command line
@@ -224,10 +217,9 @@ my $modesym = $binary ? '*' : ($UNIVERSAL ? 'U' :
sub sumfile {
my $file = shift;
- my $mode = $binary ? 'b' : ($UNIVERSAL ? 'U' :
- ($BITS ? '0' : ($portable ? 'p' : '')));
- my $digest = eval { $module->new($alg)->addfile($file, $mode) };
- if ($@) { warn "shasum: $file: $!\n"; return }
+ my $mode = $binary ? 'b' : ($UNIVERSAL ? 'U' : ($BITS ? '0' : ''));
+ my $digest = eval { Digest::SHA->new($alg)->addfile($file, $mode) };
+ if ($@) { warn "shasum: $file: $errmsg\n"; return }
$digest->hexdigest;
}
@@ -245,7 +237,6 @@ sub unescape {
$_ = shift;
s/\\\\/\0/g;
s/\\n/\n/g;
- return if /\\/;
s/\0/\\/g;
return $_;
}
@@ -256,8 +247,8 @@ sub unescape {
sub verify {
my $checkfile = shift;
my ($err, $fmt_errs, $read_errs, $match_errs) = (0, 0, 0, 0);
- my ($num_lines, $num_files) = (0, 0);
- my ($bslash, $sum, $fname, $rsp, $digest);
+ my ($num_fmt_OK, $num_OK) = (0, 0);
+ my ($bslash, $sum, $fname, $rsp, $digest, $isOK);
local *FH;
$checkfile eq '-' and open(FH, '< -')
@@ -265,38 +256,49 @@ sub verify {
or sysopen(FH, $checkfile, O_RDONLY)
or die "shasum: $checkfile: $!\n";
while (<FH>) {
- next if /^#/; s/\n$//; s/^[ \t]+//; $num_lines++;
- $bslash = s/^\\//;
- ($sum, $modesym, $fname) =
- /^([\da-fA-F]+)[ \t]([ *?^U])([^\0]*)/;
- $alg = defined $sum ? $len2alg{length($sum)} : undef;
- $fname = unescape($fname) if defined $fname && $bslash;
- if (grep { ! defined $_ } ($alg, $sum, $modesym, $fname)) {
- $alg = 1 unless defined $alg;
+ next if /^#/;
+ if (/^[ \t]*\\?SHA/) {
+ $modesym = '*';
+ ($bslash, $alg, $fname, $sum) =
+ /^[ \t]*(\\?)SHA(\S+) \((.+)\) = ([\da-fA-F]+)/;
+ $alg =~ tr{/}{}d if defined $alg;
+ }
+ else {
+ ($bslash, $sum, $modesym, $fname) =
+ /^[ \t]*(\\?)([\da-fA-F]+)[ \t]([ *^U])(.+)/;
+ $alg = defined $sum ? $len2alg{length($sum)} : undef;
+ }
+ if (grep { ! defined $_ } ($alg, $sum, $modesym, $fname) or
+ ! $isAlg{$alg}) {
warn("shasum: $checkfile: $.: improperly " .
- "formatted SHA$alg checksum line\n") if $warn;
+ "formatted SHA checksum line\n") if $warn;
$fmt_errs++;
+ $err = 1 if $strict;
next;
}
- $fname =~ s/\r$// unless -e $fname;
- $rsp = "$fname: "; $num_files++;
- ($binary, $text, $UNIVERSAL, $BITS, $portable) =
- map { $_ eq $modesym } ('*', ' ', 'U', '^', 'p');
+ $num_fmt_OK++;
+ $fname = unescape($fname) if $bslash;
+ next if $ignore_missing && ! -e $fname;
+ $rsp = "$fname: ";
+ ($binary, $text, $UNIVERSAL, $BITS) =
+ map { $_ eq $modesym } ('*', ' ', 'U', '^');
+ $isOK = 0;
unless ($digest = sumfile($fname)) {
$rsp .= "FAILED open or read\n";
$err = 1; $read_errs++;
}
- else {
- if (lc($sum) eq $digest) { $rsp .= "OK\n" }
- else { $rsp .= "FAILED\n"; $err = 1; $match_errs++ }
+ elsif (lc($sum) eq $digest) {
+ $rsp .= "OK\n";
+ $isOK = 1;
+ $num_OK++;
}
- print $rsp unless $status;
+ else { $rsp .= "FAILED\n"; $err = 1; $match_errs++ }
+ print $rsp unless ($status || ($quiet && $isOK));
}
close(FH);
- unless ($num_files) {
- $alg = 1 unless defined $alg;
+ if (! $num_fmt_OK) {
warn("shasum: $checkfile: no properly formatted " .
- "SHA$alg checksum lines found\n");
+ "SHA checksum lines found\n");
$err = 1;
}
elsif (! $status) {
@@ -307,6 +309,11 @@ sub verify {
warn("shasum: WARNING: $match_errs computed checksum" .
($match_errs>1?'s':'') . " did NOT match\n") if $match_errs;
}
+ if ($ignore_missing && ! $num_OK && $num_fmt_OK) {
+ warn("shasum: $checkfile: no file was verified\n")
+ unless $status;
+ $err = 1;
+ }
return($err == 0);
}
@@ -314,17 +321,17 @@ sub verify {
## Verify or compute SHA checksums of requested files
my($file, $digest);
-
my $STATUS = 0;
for $file (@ARGV) {
if ($check) { $STATUS = 1 unless verify($file) }
elsif ($digest = sumfile($file)) {
if ($file =~ /[\n\\]/) {
$file =~ s/\\/\\\\/g; $file =~ s/\n/\\n/g;
- $digest = "\\$digest";
+ print "\\";
}
- print "$digest $modesym", "$file\n";
+ unless ($tag) { print "$digest $modesym$file\n" }
+ else { print "$Tag{$alg} ($file) = $digest\n" }
}
else { $STATUS = 1 }
}
-exit($STATUS)
+exit($STATUS);
diff --git a/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha.c b/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha.c
index ea0d41ba077..79557fff8fc 100644
--- a/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha.c
+++ b/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha.c
@@ -3,10 +3,10 @@
*
* Ref: NIST FIPS PUB 180-4 Secure Hash Standard
*
- * Copyright (C) 2003-2015 Mark Shelor, All Rights Reserved
+ * Copyright (C) 2003-2017 Mark Shelor, All Rights Reserved
*
- * Version: 5.95
- * Sat Jan 10 12:15:36 MST 2015
+ * Version: 6.01
+ * Mon Dec 25 00:08:08 MST 2017
*
*/
@@ -364,10 +364,10 @@ static ULNG shabits(UCHR *bitstr, ULNG bitcnt, SHA *s)
for (i = 0UL; i < bitcnt; i++) {
if (BITSET(bitstr, i))
- SETBIT(s->block, s->blockcnt), s->blockcnt++;
+ SETBIT(s->block, s->blockcnt);
else
- CLRBIT(s->block, s->blockcnt), s->blockcnt++;
- if (s->blockcnt == s->blocksize)
+ CLRBIT(s->block, s->blockcnt);
+ if (++s->blockcnt == s->blocksize)
s->sha(s, s->block), s->blockcnt = 0;
}
return(bitcnt);
diff --git a/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha.h b/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha.h
index e63d4b743b3..91f181b0be0 100644
--- a/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha.h
+++ b/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha.h
@@ -3,10 +3,10 @@
*
* Ref: NIST FIPS PUB 180-4 Secure Hash Standard
*
- * Copyright (C) 2003-2015 Mark Shelor, All Rights Reserved
+ * Copyright (C) 2003-2017 Mark Shelor, All Rights Reserved
*
- * Version: 5.95
- * Sat Jan 10 12:15:36 MST 2015
+ * Version: 6.01
+ * Mon Dec 25 00:08:08 MST 2017
*
*/
diff --git a/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha64bit.c b/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha64bit.c
index 2fa0ddaf445..4d6e9dd4040 100644
--- a/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha64bit.c
+++ b/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha64bit.c
@@ -3,10 +3,10 @@
*
* Ref: NIST FIPS PUB 180-4 Secure Hash Standard
*
- * Copyright (C) 2003-2015 Mark Shelor, All Rights Reserved
+ * Copyright (C) 2003-2017 Mark Shelor, All Rights Reserved
*
- * Version: 5.95
- * Sat Jan 10 12:15:36 MST 2015
+ * Version: 6.01
+ * Mon Dec 25 00:08:08 MST 2017
*
*/
diff --git a/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha64bit.h b/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha64bit.h
index ce89548cf38..2b8dc55a9b6 100644
--- a/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha64bit.h
+++ b/gnu/usr.bin/perl/cpan/Digest-SHA/src/sha64bit.h
@@ -3,10 +3,10 @@
*
* Ref: NIST FIPS PUB 180-4 Secure Hash Standard
*
- * Copyright (C) 2003-2015 Mark Shelor, All Rights Reserved
+ * Copyright (C) 2003-2017 Mark Shelor, All Rights Reserved
*
- * Version: 5.95
- * Sat Jan 10 12:15:36 MST 2015
+ * Version: 6.01
+ * Mon Dec 25 00:08:08 MST 2017
*
* The following macros supply placeholder values that enable the
* sha.c module to successfully compile when 64-bit integer types
diff --git a/gnu/usr.bin/perl/cpan/Digest-SHA/t/methods.t b/gnu/usr.bin/perl/cpan/Digest-SHA/t/methods.t
index 223bc5399a0..1522f99bc3a 100755
--- a/gnu/usr.bin/perl/cpan/Digest-SHA/t/methods.t
+++ b/gnu/usr.bin/perl/cpan/Digest-SHA/t/methods.t
@@ -1,38 +1,24 @@
use strict;
use FileHandle;
-
-my $MODULE;
-
-BEGIN {
- $MODULE = (-d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl";
- eval "require $MODULE" || die $@;
- $MODULE->import(qw());
-}
-
-BEGIN {
- if ($ENV{PERL_CORE}) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
-}
+use Digest::SHA;
my @out = (
"ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0",
"248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1",
);
-my $numtests = 9 + scalar @out;
+my $numtests = 6 + scalar @out;
print "1..$numtests\n";
# attempt to use an invalid algorithm, and check for failure
my $testnum = 1;
my $NSA = "SHA-42"; # No Such Algorithm
-print "not " if $MODULE->new($NSA);
+print "not " if Digest::SHA->new($NSA);
print "ok ", $testnum++, "\n";
my $tempfile = "methods.tmp";
-END { 1 while unlink $tempfile }
+END { unlink $tempfile if $tempfile }
# test OO methods using first two SHA-256 vectors from NIST
@@ -41,7 +27,7 @@ binmode($fh);
print $fh "bcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
$fh->close;
-my $sha = $MODULE->new()->reset("SHA-256")->new();
+my $sha = Digest::SHA->new()->reset("SHA-256")->new();
$sha->add_bits("a", 5)->add_bits("001");
my $rsp = shift(@out);
@@ -72,35 +58,6 @@ $fh->close;
print "not " unless $sha->addfile($tempfile, "b")->hexdigest eq $rsp;
print "ok ", $testnum++, "\n";
- # test addfile portable mode
-
-$fh = FileHandle->new($tempfile, "w");
-binmode($fh);
-print $fh "abc\012" x 2048; # using UNIX newline
-$fh->close;
-
-print "not " unless $sha->new(1)->addfile($tempfile, "p")->hexdigest eq
- "d449e19c1b0b0c191294c8dc9fa2e4a6ff77fc51";
-print "ok ", $testnum++, "\n";
-
-$fh = FileHandle->new($tempfile, "w");
-binmode($fh);
-print $fh "abc\015\012" x 2048; # using DOS/Windows newline
-$fh->close;
-
-print "not " unless $sha->new(1)->addfile($tempfile, "p")->hexdigest eq
- "d449e19c1b0b0c191294c8dc9fa2e4a6ff77fc51";
-print "ok ", $testnum++, "\n";
-
-$fh = FileHandle->new($tempfile, "w");
-binmode($fh);
-print $fh "abc\015" x 2048; # using early-Mac newline
-$fh->close;
-
-print "not " unless $sha->new(1)->addfile($tempfile, "p")->hexdigest eq
- "d449e19c1b0b0c191294c8dc9fa2e4a6ff77fc51";
-print "ok ", $testnum++, "\n";
-
# test addfile "universal newlines" mode
$fh = FileHandle->new($tempfile, "w");
diff --git a/gnu/usr.bin/perl/cpan/Digest-SHA/t/woodbury.t b/gnu/usr.bin/perl/cpan/Digest-SHA/t/woodbury.t
index afcb731962a..95527006cdb 100755
--- a/gnu/usr.bin/perl/cpan/Digest-SHA/t/woodbury.t
+++ b/gnu/usr.bin/perl/cpan/Digest-SHA/t/woodbury.t
@@ -3,21 +3,7 @@
# Vectors and initial script courtesy of Adam Woodbury, The MITRE Corporation
use strict;
-
-my $MODULE;
-
-BEGIN {
- $MODULE = (-d "src") ? "Digest::SHA" : "Digest::SHA::PurePerl";
- eval "require $MODULE" || die $@;
- $MODULE->import(qw(hmac_sha256 hmac_sha384 hmac_sha512));
-}
-
-BEGIN {
- if ($ENV{PERL_CORE}) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
-}
+use Digest::SHA qw(hmac_sha256 hmac_sha384 hmac_sha512);
my @plex = map { eval } <DATA>;