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 225919 14de6cbff9c2fdfbf8eb6859f167b07f77dc454e
parent 225918 43dcdc7f4626e253134525dc95506ff9b66598dd
child 225920 f81cf71ec0cd996629b35c3eec2e7b3a8f27b72d
push id7234
push usermshal@mozilla.com
push dateFri, 07 Nov 2014 15:32:04 +0000
treeherdermozilla-aurora@0ebb0de0bb58 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, NPOTB
bugs1085026
milestone35.0a2
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,