forked from mozilla/amo-validator
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 563522; Hashes for files from the Jetpack SDK's packages are whit…
…elisted for validation.
- Loading branch information
Showing
4 changed files
with
307 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import sys | ||
import os | ||
import os.path as pth | ||
import hashlib | ||
|
||
output = open("whitelist_hashes.txt", mode="w") | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
for root, dirs, files in os.walk(sys.argv[1]): | ||
for filename in files: | ||
path = pth.join(pth.dirname(pth.abspath(sys.argv[0])), | ||
root, filename) | ||
hash = hashlib.sha1(open(path).read()).hexdigest() | ||
print path, hash | ||
output.write(hash + "\n") | ||
|
||
output.close() | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
clouserw
Contributor
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Let's accept a filename when we run the command so we can support multiple versions