Bug 472790, default to sha512 hashes for release updates, r=bhearsum

git-svn-id: svn://10.0.0.236/trunk@257279 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nrthomas%gmail.com 2009-05-25 04:57:36 +00:00
parent 86e69d8c3a
commit 516e9e3790
2 changed files with 4 additions and 5 deletions

View File

@ -81,7 +81,7 @@ use vars qw($PID_FILE
$ST_SIZE );
$PID_FILE = 'patcher2.pid';
$DEFAULT_HASH_TYPE = 'SHA1';
$DEFAULT_HASH_TYPE = 'SHA512';
$DEFAULT_CVSROOT = ':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot';
$DEFAULT_HGROOT = 'http://hg.mozilla.org/mozilla-central';

View File

@ -359,13 +359,12 @@ sub HashFile {
die "ASSERT: HashFile(): null file\n" if (not defined($args{'file'}));
my $fileToHash = $args{'file'};
my $hashFunction = lc($args{'type'}) || 'md5';
my $hashFunction = lc($args{'type'}) || 'sha512';
my $dumpOutput = $args{'output'} || 0;
my $ignoreErrors = $args{'ignoreErrors'} || 0;
die 'ASSERT: HashFile(): invalid hashFunction; use md5/sha1: ' .
"$hashFunction\n" if
($hashFunction ne 'md5' && $hashFunction ne 'sha1');
die 'ASSERT: HashFile(): invalid hashFunction; use md5/sha1/sha256/sha384/sha512: ' .
"$hashFunction\n" if ($hashFunction !~ '^(md5|sha1|sha256|sha384|sha512)$');
if (not(-f $fileToHash) || not(-r $fileToHash)) {
if ($ignoreErrors) {