From: Michael Vrable Date: Thu, 27 Sep 2012 04:24:58 +0000 (-0700) Subject: Add sha224/sha256 as supported hash algorithms. X-Git-Url: http://git.vrable.net/?p=cumulus.git;a=commitdiff_plain;h=76ce8210bee6f9c2dbefab56873a9b2847d92a13 Add sha224/sha256 as supported hash algorithms. Document new hash algorithms in the format description, and include all supported algorithms in the Python code. The cumulus binary does not yet support the new algorithms. --- diff --git a/doc/format.txt b/doc/format.txt index c273e21..582ef59 100644 --- a/doc/format.txt +++ b/doc/format.txt @@ -32,8 +32,10 @@ format. The general format used is = identifies the checksum algorithm used, and allows new -algorithms to be added later. At the moment, the only permissible value -is "sha1", indicating a SHA-1 checksum. +algorithms to be added later. Permissible values are: + "sha1": SHA-1 + "sha224": SHA-224 (added in version 0.11) + "sha256": SHA-256 (added in version 0.11) is a sequence of hexadecimal digits which encode the checksum value. For sha1, should be precisely 40 digits diff --git a/python/cumulus/__init__.py b/python/cumulus/__init__.py index 3f6b6f7..2ac9be4 100644 --- a/python/cumulus/__init__.py +++ b/python/cumulus/__init__.py @@ -57,6 +57,7 @@ class Struct: CHECKSUM_ALGORITHMS = { 'sha1': hashlib.sha1, + 'sha224': hashlib.sha224, 'sha256': hashlib.sha256, }