From: W. Trevor King Date: Fri, 20 Dec 2013 05:18:01 +0000 (-0800) Subject: Add PGPPacket._hash_algorithms X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ceb0156543e16d00a07e0242eac23a077ef4a0b7;p=gpg-migrate.git Add PGPPacket._hash_algorithms From RFC 4880 [1]: ID Algorithm Text Name -- --------- --------- 1 - MD5 [HAC] "MD5" 2 - SHA-1 [FIPS180] "SHA1" 3 - RIPE-MD/160 [HAC] "RIPEMD160" 4 - Reserved 5 - Reserved 6 - Reserved 7 - Reserved 8 - SHA256 [FIPS180] "SHA256" 9 - SHA384 [FIPS180] "SHA384" 10 - SHA512 [FIPS180] "SHA512" 11 - SHA224 [FIPS180] "SHA224" 100 to 110 - Private/Experimental algorithm [1]: http://tools.ietf.org/search/rfc4880#section-9.4 --- diff --git a/gpg-migrate.py b/gpg-migrate.py index 401b696..e75cab8 100755 --- a/gpg-migrate.py +++ b/gpg-migrate.py @@ -117,6 +117,31 @@ class PGPPacket (dict): 110: 'private', } + _hash_algorithms = { + 1: 'md5', + 2: 'sha-1', + 3: 'ripe-md/160', + 4: 'reserved', + 5: 'reserved', + 6: 'reserved', + 7: 'reserved', + 8: 'sha256', + 9: 'sha384', + 10: 'sha512', + 11: 'sha224', + 100: 'private', + 101: 'private', + 102: 'private', + 103: 'private', + 104: 'private', + 105: 'private', + 106: 'private', + 107: 'private', + 108: 'private', + 109: 'private', + 110: 'private', + } + _clean_type_regex = _re.compile('\W+') def _clean_type(self):