From: W. Trevor King Date: Sat, 21 Dec 2013 18:14:54 +0000 (-0800) Subject: Add hashlib hash names to PGPPacket._hashlib_name X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=463a45c1791201a8f99da62468f13532ff433d7f;p=gpg-migrate.git Add hashlib hash names to PGPPacket._hashlib_name The string-to-key algorithm is going to use hashlib for hashing, so map the OpenPGP-based names to hashlib names for easy lookup. --- diff --git a/gpg-migrate.py b/gpg-migrate.py index 844e21c..393d460 100755 --- a/gpg-migrate.py +++ b/gpg-migrate.py @@ -173,6 +173,16 @@ class PGPPacket (dict): 110: 'private', } + _hashlib_name = { # map OpenPGP-based names to hashlib names + 'md5': 'md5', + 'sha-1': 'sha1', + 'ripe-md/160': 'ripemd160', + 'sha256': 'sha256', + 'sha384': 'sha384', + 'sha512': 'sha512', + 'sha224': 'sha224', + } + _string_to_key_types = { 0: 'simple', 1: 'salted',