In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/03c6205fee4d43c0a6607c90e46b4daffd749da3?hp=0987d6f3c0887ebe1a7db4d50e4827861bbb34e7>
- Log ----------------------------------------------------------------- commit 03c6205fee4d43c0a6607c90e46b4daffd749da3 Author: Chris 'BinGOs' Williams <[email protected]> Date: Mon Oct 27 10:05:32 2014 +0000 Update Digest-SHA to CPAN version 5.93 [DELTA] 5.93 Sun Oct 26 06:00:48 MST 2014 - corrected alignment problem in SHA struct (src/sha.h) -- thanks to H. Merijn Brand and J. Hietaniemi for analysis and suggested patch - provided workaround in t/methods.t for unreliable -T test -- Some Perl 5.8's mistake text for binary M Porting/Maintainers.pl M cpan/Digest-SHA/Makefile.PL M cpan/Digest-SHA/SHA.xs M cpan/Digest-SHA/lib/Digest/SHA.pm M cpan/Digest-SHA/shasum M cpan/Digest-SHA/src/sha.c M cpan/Digest-SHA/src/sha.h M cpan/Digest-SHA/src/sha64bit.c M cpan/Digest-SHA/src/sha64bit.h M cpan/Digest-SHA/t/methods.t M t/porting/customized.dat commit e87ace2e0b066fb8bfb29ebd3aa1437380046a57 Author: Chris 'BinGOs' Williams <[email protected]> Date: Mon Oct 27 09:59:24 2014 +0000 Update experimental to CPAN version 0.013 [DELTA] 0.013 2014-10-25 21:54:47+02:00 Europe/Amsterdam Rename lvalue_refs to refaliasing M Porting/Maintainers.pl M cpan/experimental/lib/experimental.pm M cpan/experimental/t/basic.t ----------------------------------------------------------------------- Summary of changes: Porting/Maintainers.pl | 7 ++--- cpan/Digest-SHA/Makefile.PL | 3 ++- cpan/Digest-SHA/SHA.xs | 12 ++++----- cpan/Digest-SHA/lib/Digest/SHA.pm | 4 ++- cpan/Digest-SHA/shasum | 6 ++--- cpan/Digest-SHA/src/sha.c | 49 +++++++++++++++++++---------------- cpan/Digest-SHA/src/sha.h | 17 ++++++------ cpan/Digest-SHA/src/sha64bit.c | 6 ++--- cpan/Digest-SHA/src/sha64bit.h | 6 ++--- cpan/Digest-SHA/t/methods.t | 13 +++++++--- cpan/experimental/lib/experimental.pm | 8 +++--- cpan/experimental/t/basic.t | 2 +- t/porting/customized.dat | 1 - 13 files changed, 72 insertions(+), 62 deletions(-) diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 3a30842..93c2b82 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -373,7 +373,7 @@ use File::Glob qw(:case); }, 'Digest::SHA' => { - 'DISTRIBUTION' => 'MSHELOR/Digest-SHA-5.92.tar.gz', + 'DISTRIBUTION' => 'MSHELOR/Digest-SHA-5.93.tar.gz', 'FILES' => q[cpan/Digest-SHA], 'EXCLUDED' => [ qw( t/pod.t @@ -381,9 +381,6 @@ use File::Glob qw(:case); examples/dups ), ], - # Was hoping to be merged upstream in CPAN RT#96498, - # but that has been rejected... - 'CUSTOMIZED' => ['hints/hpux.pl'], }, 'Dumpvalue' => { @@ -413,7 +410,7 @@ use File::Glob qw(:case); }, 'experimental' => { - 'DISTRIBUTION' => 'LEONT/experimental-0.012.tar.gz', + 'DISTRIBUTION' => 'LEONT/experimental-0.013.tar.gz', 'FILES' => q[cpan/experimental], 'EXCLUDED' => [ qr{^t/release-.*\.t}, diff --git a/cpan/Digest-SHA/Makefile.PL b/cpan/Digest-SHA/Makefile.PL index 8e882ca..af2c0c3 100644 --- a/cpan/Digest-SHA/Makefile.PL +++ b/cpan/Digest-SHA/Makefile.PL @@ -70,7 +70,8 @@ if ($Config{archname} =~ /^i[3456]86/ && $Config{ccname} eq 'gcc') { push(@extra, OPTIMIZE => '-O1 -fomit-frame-pointer'); } -push(@extra, CCFLAGS => '-W -Wall ' . $Config{ccflags}) if $opt_w; +my $fussy = '-Wall -Wextra -Wconversion -Wcast-align -Wpointer-arith '; +push(@extra, CCFLAGS => $fussy . $Config{ccflags}) if $opt_w; my %attr = ( 'NAME' => 'Digest::SHA', diff --git a/cpan/Digest-SHA/SHA.xs b/cpan/Digest-SHA/SHA.xs index c7a7f34..30fdb85 100644 --- a/cpan/Digest-SHA/SHA.xs +++ b/cpan/Digest-SHA/SHA.xs @@ -233,7 +233,7 @@ PREINIT: CODE: if ((state = getSHA(self)) == NULL) XSRETURN_UNDEF; - RETVAL = ix ? state->alg : state->digestlen << 3; + RETVAL = ix ? state->alg : (int) (state->digestlen << 3); OUTPUT: RETVAL @@ -307,7 +307,7 @@ CODE: ptr = w32mem(ptr, state->lenhl); ptr = w32mem(ptr, state->lenlh); ptr = w32mem(ptr, state->lenll); - RETVAL = newSVpv((char *) buf, ptr - buf); + RETVAL = newSVpv((char *) buf, (STRLEN) (ptr - buf)); OUTPUT: RETVAL @@ -324,7 +324,7 @@ PPCODE: if ((state = getSHA(self)) == NULL) XSRETURN_UNDEF; data = (UCHR *) SvPV(packed_state, len); - if (len != (state->alg <= SHA256 ? 116 : 212)) + if (len != (state->alg <= SHA256 ? 116U : 212U)) XSRETURN_UNDEF; data = statecpy(state, data); Copy(data, state->block, state->blocksize >> 3, UCHR); @@ -351,7 +351,7 @@ PPCODE: if (!f || (state = getSHA(self)) == NULL) XSRETURN_UNDEF; while ((n = PerlIO_read(f, in, sizeof(in))) > 0) - shawrite(in, n << 3, state); + shawrite(in, (ULNG) n << 3, state); XSRETURN(1); void @@ -359,7 +359,7 @@ _addfileuniv(self, f) SV * self PerlIO * f PREINIT: - char c; + UCHR c; int n; int cr = 0; UCHR *src, *dst; @@ -391,7 +391,7 @@ PPCODE: } } } - shawrite(in, (dst - in) << 3, state); + shawrite(in, (ULNG) (dst - in) << 3, state); } if (cr) { in[0] = '\012'; diff --git a/cpan/Digest-SHA/lib/Digest/SHA.pm b/cpan/Digest-SHA/lib/Digest/SHA.pm index 755ec0b..83906df 100644 --- a/cpan/Digest-SHA/lib/Digest/SHA.pm +++ b/cpan/Digest-SHA/lib/Digest/SHA.pm @@ -8,7 +8,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); use Fcntl; use integer; -$VERSION = '5.92'; +$VERSION = '5.93'; require Exporter; require DynaLoader; @@ -777,6 +777,7 @@ L<http://csrc.nist.gov/publications/fips/fips198/fips-198a.pdf> The author is particularly grateful to Gisle Aas + H. Merijn Brand Sean Burke Chris Carey Alexandr Ciornii @@ -786,6 +787,7 @@ The author is particularly grateful to Jeffrey Friedl Robert Gilmour Brian Gladman + Jarkko Hietaniemi Adam Kennedy Mark Lawrence Andy Lester diff --git a/cpan/Digest-SHA/shasum b/cpan/Digest-SHA/shasum index 79f5874..c28d70d 100644 --- a/cpan/Digest-SHA/shasum +++ b/cpan/Digest-SHA/shasum @@ -4,8 +4,8 @@ ## ## Copyright (C) 2003-2014 Mark Shelor, All Rights Reserved ## - ## Version: 5.92 - ## Sun Jun 1 00:15:44 MST 2014 + ## Version: 5.93 + ## Sun Oct 26 06:00:48 MST 2014 ## shasum SYNOPSIS adapted from GNU Coreutils sha1sum. Add ## "-a" option for algorithm selection, @@ -101,7 +101,7 @@ L<Digest::SHA::PurePerl>. END_OF_POD -my $VERSION = "5.92"; +my $VERSION = "5.93"; sub usage { my($err, $msg) = @_; diff --git a/cpan/Digest-SHA/src/sha.c b/cpan/Digest-SHA/src/sha.c index 8a638ce..3756969 100644 --- a/cpan/Digest-SHA/src/sha.c +++ b/cpan/Digest-SHA/src/sha.c @@ -5,8 +5,8 @@ * * Copyright (C) 2003-2014 Mark Shelor, All Rights Reserved * - * Version: 5.92 - * Sun Jun 1 00:15:44 MST 2014 + * Version: 5.93 + * Sun Oct 26 06:00:48 MST 2014 * */ @@ -65,10 +65,10 @@ static W32 K256[64] = /* SHA-224/256 constants */ C32(0x90befffa), C32(0xa4506ceb), C32(0xbef9a3f7), C32(0xc67178f2) }; -static W32 H01[5] = /* SHA-1 initial hash value */ +static W32 H01[8] = /* SHA-1 initial hash value */ { - C32(0x67452301), C32(0xefcdab89), C32(0x98badcfe), - C32(0x10325476), C32(0xc3d2e1f0) + C32(0x67452301), C32(0xefcdab89), C32(0x98badcfe), C32(0x10325476), + C32(0xc3d2e1f0), C32(0x00000000), C32(0x00000000), C32(0x00000000) }; static W32 H0224[8] = /* SHA-224 initial hash value */ @@ -88,7 +88,7 @@ static void sha1(SHA *s, UCHR *block) /* SHA-1 transform */ W32 a, b, c, d, e; W32 W[16]; W32 *wp = W; - W32 *H = (W32 *) s->H; + W32 *H = s->H32; SHA32_SCHED(W, block); @@ -156,7 +156,7 @@ static void sha256(SHA *s, UCHR *block) /* SHA-224/256 transform */ W32 W[16]; W32 *kp = K256; W32 *wp = W; - W32 *H = (W32 *) s->H; + W32 *H = s->H32; SHA32_SCHED(W, block); @@ -214,8 +214,8 @@ static void sha256(SHA *s, UCHR *block) /* SHA-224/256 transform */ #include "sha64bit.c" -#define SETBIT(s, pos) s[(pos) >> 3] |= (0x01 << (7 - (pos) % 8)) -#define CLRBIT(s, pos) s[(pos) >> 3] &= ~(0x01 << (7 - (pos) % 8)) +#define SETBIT(s, pos) s[(pos) >> 3] |= (UCHR) (0x01 << (7 - (pos) % 8)) +#define CLRBIT(s, pos) s[(pos) >> 3] &= (UCHR) ~(0x01 << (7 - (pos) % 8)) #define NBYTES(nbits) (((nbits) + 7) >> 3) #define HEXLEN(nbytes) ((nbytes) << 1) #define B64LEN(nbytes) (((nbytes) % 3 == 0) ? ((nbytes) / 3) * 4 \ @@ -247,8 +247,8 @@ static UCHR *digcpy(SHA *s) { int i; UCHR *d = s->digest; - W32 *p32 = (W32 *) s->H; - W64 *p64 = (W64 *) s->H; + W32 *p32 = s->H32; + W64 *p64 = s->H64; if (s->alg <= SHA256) for (i = 0; i < 8; i++, d += 4) @@ -265,8 +265,8 @@ static UCHR *digcpy(SHA *s) static UCHR *statecpy(SHA *s, UCHR *buf) { int i; - W32 *p32 = (W32 *) s->H; - W64 *p64 = (W64 *) s->H; + W32 *p32 = s->H32; + W64 *p64 = s->H64; if (s->alg <= SHA256) for (i = 0; i < 8; i++, buf += 4) @@ -282,7 +282,10 @@ static UCHR *statecpy(SHA *s, UCHR *buf) do { \ Zero(s, 1, SHA); \ s->alg = algo; s->sha = sha ## transform; \ - Copy(H0 ## algo, s->H, sizeof(H0 ## algo), char); \ + if (s->alg <= SHA256) \ + Copy(H0 ## algo, s->H32, 8, SHA32); \ + else \ + Copy(H0 ## algo, s->H64, 8, SHA64); \ s->blocksize = SHA ## algo ## _BLOCK_BITS; \ s->digestlen = SHA ## algo ## _DIGEST_BITS >> 3; \ } while (0) @@ -366,8 +369,8 @@ static ULNG shabits(UCHR *bitstr, ULNG bitcnt, SHA *s) ULNG savecnt = bitcnt; gap = 8 - s->blockcnt % 8; - s->block[s->blockcnt>>3] &= ~0 << gap; - s->block[s->blockcnt>>3] |= *bitstr >> (8 - gap); + s->block[s->blockcnt>>3] &= (UCHR) (~0 << gap); + s->block[s->blockcnt>>3] |= (UCHR) (*bitstr >> (8 - gap)); s->blockcnt += bitcnt < gap ? bitcnt : gap; if (bitcnt < gap) return(savecnt); @@ -377,14 +380,16 @@ static ULNG shabits(UCHR *bitstr, ULNG bitcnt, SHA *s) return(savecnt); while (nbytes > bufsize) { for (i = 0; i < bufsize; i++) - buf[i] = bitstr[i] << gap | bitstr[i+1] >> (8-gap); + buf[i] = (UCHR) (bitstr[i] << gap) | + (UCHR) (bitstr[i+1] >> (8-gap)); nbits = bitcnt < bufbits ? bitcnt : bufbits; shabytes(buf, nbits, s); bitcnt -= nbits, bitstr += bufsize, nbytes -= bufsize; } for (i = 0; i < nbytes - 1; i++) - buf[i] = bitstr[i] << gap | bitstr[i+1] >> (8-gap); - buf[nbytes-1] = bitstr[nbytes-1] << gap; + buf[i] = (UCHR) (bitstr[i] << gap) | + (UCHR) (bitstr[i+1] >> (8-gap)); + buf[nbytes-1] = (UCHR) (bitstr[nbytes-1] << gap); shabytes(buf, bitcnt, s); return(savecnt); } @@ -440,7 +445,7 @@ static char xmap[] = /* shahex: returns pointer to current digest (hexadecimal) */ static char *shahex(SHA *s) { - int i; + UINT i; char *h; UCHR *d; @@ -461,7 +466,7 @@ static char bmap[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /* encbase64: encodes input (0 to 3 bytes) into Base 64 */ -static void encbase64(UCHR *in, int n, char *out) +static void encbase64(UCHR *in, UINT n, char *out) { UCHR byte[3] = {0, 0, 0}; @@ -479,7 +484,7 @@ static void encbase64(UCHR *in, int n, char *out) /* shabase64: returns pointer to current digest (Base 64) */ static char *shabase64(SHA *s) { - int n; + UINT n; UCHR *q; char out[5]; diff --git a/cpan/Digest-SHA/src/sha.h b/cpan/Digest-SHA/src/sha.h index f1ed54e..61f365e 100644 --- a/cpan/Digest-SHA/src/sha.h +++ b/cpan/Digest-SHA/src/sha.h @@ -5,8 +5,8 @@ * * Copyright (C) 2003-2014 Mark Shelor, All Rights Reserved * - * Version: 5.92 - * Sun Jun 1 00:15:44 MST 2014 + * Version: 5.93 + * Sun Oct 26 06:00:48 MST 2014 * */ @@ -131,22 +131,21 @@ #define SHA_MAX_HEX_LEN (SHA_MAX_DIGEST_BITS / 4) #define SHA_MAX_BASE64_LEN (1 + (SHA_MAX_DIGEST_BITS / 6)) -#if defined(SHA64) - #define SHA_H_SIZE sizeof(SHA64) * 8 -#else - #define SHA_H_SIZE sizeof(SHA32) * 8 +#if !defined(SHA64) + #define SHA64 SHA32 #endif typedef struct SHA { int alg; void (*sha)(struct SHA *, unsigned char *); - unsigned char H[SHA_H_SIZE]; + SHA32 H32[8]; + SHA64 H64[8]; unsigned char block[SHA_MAX_BLOCK_BITS/8]; unsigned int blockcnt; unsigned int blocksize; SHA32 lenhh, lenhl, lenlh, lenll; unsigned char digest[SHA_MAX_DIGEST_BITS/8]; - int digestlen; + unsigned int digestlen; char hex[SHA_MAX_HEX_LEN+1]; char base64[SHA_MAX_BASE64_LEN+1]; } SHA; @@ -154,7 +153,7 @@ typedef struct SHA { typedef struct { SHA isha; SHA osha; - int digestlen; + unsigned int digestlen; unsigned char key[SHA_MAX_BLOCK_BITS/8]; } HMAC; diff --git a/cpan/Digest-SHA/src/sha64bit.c b/cpan/Digest-SHA/src/sha64bit.c index 169b912..add57e0 100644 --- a/cpan/Digest-SHA/src/sha64bit.c +++ b/cpan/Digest-SHA/src/sha64bit.c @@ -5,8 +5,8 @@ * * Copyright (C) 2003-2014 Mark Shelor, All Rights Reserved * - * Version: 5.92 - * Sun Jun 1 00:15:44 MST 2014 + * Version: 5.93 + * Sun Oct 26 06:00:48 MST 2014 * */ @@ -96,7 +96,7 @@ static void sha512(SHA *s, unsigned char *block) /* SHA-384/512 transform */ { W64 a, b, c, d, e, f, g, h, T1, T2; W64 W[80]; - W64 *H = (W64 *) s->H; + W64 *H = s->H64; int t; SHA64_SCHED(W, block); diff --git a/cpan/Digest-SHA/src/sha64bit.h b/cpan/Digest-SHA/src/sha64bit.h index 0eb8a3d..01dadc5 100644 --- a/cpan/Digest-SHA/src/sha64bit.h +++ b/cpan/Digest-SHA/src/sha64bit.h @@ -5,8 +5,8 @@ * * Copyright (C) 2003-2014 Mark Shelor, All Rights Reserved * - * Version: 5.92 - * Sun Jun 1 00:15:44 MST 2014 + * Version: 5.93 + * Sun Oct 26 06:00:48 MST 2014 * * The following macros supply placeholder values that enable the * sha.c module to successfully compile when 64-bit integer types @@ -18,7 +18,7 @@ */ #define sha_384_512 0 -#define W64 unsigned long +#define W64 SHA32 #define sha512 NULL #define H0384 H01 #define H0512 H01 diff --git a/cpan/Digest-SHA/t/methods.t b/cpan/Digest-SHA/t/methods.t index 7bbc706..223bc53 100644 --- a/cpan/Digest-SHA/t/methods.t +++ b/cpan/Digest-SHA/t/methods.t @@ -108,9 +108,16 @@ binmode($fh); print $fh "MacOS\r" . "MSDOS\r\n" . "UNIX\n" . "Quirky\r\r\n"; $fh->close; -print "not " unless $sha->new(1)->addfile($tempfile, "U")->hexdigest eq - "f4c6855783c737c7e224873c90e80a9df5c2bc97"; # per Python 3 -print "ok ", $testnum++, "\n"; +my $d = $sha->new(1)->addfile($tempfile, "U")->hexdigest; +if ($d eq "f4c6855783c737c7e224873c90e80a9df5c2bc97") { + print "ok ", $testnum++, "\n"; +} +elsif ($d eq "42335d4a517a5e31399e948e9d842bafd9194d8f") { + print "ok ", $testnum++, " # skip: flaky -T\n"; +} +else { + print "not ok ", $testnum++, "\n"; +} # test addfile BITS mode diff --git a/cpan/experimental/lib/experimental.pm b/cpan/experimental/lib/experimental.pm index efb853e..befa409 100644 --- a/cpan/experimental/lib/experimental.pm +++ b/cpan/experimental/lib/experimental.pm @@ -1,5 +1,5 @@ package experimental; -$experimental::VERSION = '0.012'; +$experimental::VERSION = '0.013'; use strict; use warnings; use version (); @@ -25,9 +25,9 @@ my %min_version = ( fc => '5.16.0', lexical_topic => '5.10.0', lexical_subs => '5.18.0', - lvalue_refs => '5.21.5', postderef => '5.20.0', postderef_qq => '5.20.0', + refaliasing => '5.21.5', regex_sets => '5.18.0', say => '5.10.0', smartmatch => '5.10.0', @@ -119,7 +119,7 @@ experimental - Experimental features made easy =head1 VERSION -version 0.012 +version 0.013 =head1 SYNOPSIS @@ -153,9 +153,9 @@ The supported features, documented further below, are: array_base - allow the use of $[ to change the starting index of @array autoderef - allow push, each, keys, and other built-ins on references lexical_topic - allow the use of lexical $_ via "my $_" - lvalue_refs - allow aliasing via \$x = \$y postderef - allow the use of postfix dereferencing expressions, including in interpolating strings + refaliasing - allow aliasing via \$x = \$y regex_sets - allow extended bracketed character classes in regexps signatures - allow subroutine signatures (for named arguments) smartmatch - allow the use of ~~ diff --git a/cpan/experimental/t/basic.t b/cpan/experimental/t/basic.t index df3ce2c..ee03a02 100644 --- a/cpan/experimental/t/basic.t +++ b/cpan/experimental/t/basic.t @@ -51,7 +51,7 @@ END } if ($] >= 5.021005) { - is (eval <<'END', 1, 'lvalue ref compiles') or diag $@; + is (eval <<'END', 1, 'ref aliasing compiles') or diag $@; use experimental 'refaliasing'; \@a = \@b; is(\@a, \@b, '@a and @b are the same after \@a=\@b'); diff --git a/t/porting/customized.dat b/t/porting/customized.dat index a42d799..fb431f8 100644 --- a/t/porting/customized.dat +++ b/t/porting/customized.dat @@ -1,6 +1,5 @@ DB_File cpan/DB_File/DB_File.xs f364b661bbb0df075b0c425b104577e7176fe82b Digest::MD5 cpan/Digest-MD5/t/files.t bdbe05b705d9da305fedce7a9f4b6ba63250c7cf -Digest::SHA cpan/Digest-SHA/hints/hpux.pl 8cf51e816894ee03826eac737bd6843300d6e64c ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm f738b4b8d6dfdb2bae5f3e43106370867aa88f01 ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/pm_to_blib.t 2cd28c8279d7900e28962712763eaa4768117414 IO::Socket::IP cpan/IO-Socket-IP/t/22timeout.t 0a65d4ca44663f70eea3c7f1ccb5faed2940611f -- Perl5 Master Repository
