Bug 1085026 - Use sha512 hashes for mar files; r=glandium a=NPOTB
authorMike Shal <mshal@mozilla.com>
Thu, 23 Oct 2014 11:32:25 -0400
changeset 225993 72d8ba95b2db
parent 225992 5591e0a83c4d
child 225994 ee2c3cfb4a7b
push id4099
push usermshal@mozilla.com
push date2014-11-07 15:57 +0000
treeherdermozilla-beta@dc18ad2b4816 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, NPOTB
bugs1085026
milestone34.0
Bug 1085026 - Use sha512 hashes for mar files; r=glandium a=NPOTB
build/gen_mach_buildprops.py
--- a/build/gen_mach_buildprops.py
+++ b/build/gen_mach_buildprops.py
@@ -1,38 +1,38 @@
 #!/usr/bin/python
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import sys
 import os
-import sha
+import hashlib
 import json
 import re
 import errno
 from argparse import ArgumentParser
 
 def getFileHashAndSize(filename):
-    sha1Hash = 'UNKNOWN'
+    sha512Hash = 'UNKNOWN'
     size = 'UNKNOWN'
 
     try:
         # open in binary mode to make sure we get consistent results
         # across all platforms
         f = open(filename, "rb")
-        shaObj = sha.new(f.read())
-        sha1Hash = shaObj.hexdigest()
+        shaObj = hashlib.sha512(f.read())
+        sha512Hash = shaObj.hexdigest()
 
         size = os.path.getsize(filename)
     except:
         pass
 
-    return (sha1Hash, size)
+    return (sha512Hash, size)
 
 def getMarProperties(filename):
     if not os.path.exists(filename):
         return {}
     (complete_mar_hash, complete_mar_size) = getFileHashAndSize(filename)
     return {
         'completeMarFilename': os.path.basename(filename),
         'completeMarSize': complete_mar_size,