From: W. Trevor King Date: Fri, 20 Dec 2013 22:05:22 +0000 (-0800) Subject: Add preferred compression algorithm signature subpacket parsing to PGPPacket X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7aece29657fdd37222c5a5e9bd09ba71dcaceac3;p=gpg-migrate.git Add preferred compression algorithm signature subpacket parsing to PGPPacket From RFC 4880 [1]: (array of one-octet values) Compression algorithm numbers that indicate which algorithms the key holder prefers to use. Like the preferred symmetric algorithms, the list is ordered. Algorithm numbers are in Section 9. If this subpacket is not included, ZIP is preferred. A zero denotes that uncompressed data is preferred; the key holder's software might have no compression software in that implementation. This is only found on a self-signature. [1]: http://tools.ietf.org/search/rfc4880#section-5.2.3.9 --- diff --git a/gpg-migrate.py b/gpg-migrate.py index 782fa4e..9fa4c02 100755 --- a/gpg-migrate.py +++ b/gpg-migrate.py @@ -302,6 +302,11 @@ class PGPPacket (dict): return ', '.join( algo for algo in subpacket['preferred-hash-algorithms']) + def _str_preferred_compression_algorithms_signature_subpacket( + self, subpacket): + return ', '.join( + algo for algo in subpacket['preferred-compression-algorithms']) + def _str_key_flags_signature_subpacket(self, subpacket): return ', '.join(x for x in sorted(subpacket['key-flags'])) @@ -571,6 +576,11 @@ class PGPPacket (dict): subpacket['preferred-hash-algorithms'] = [ self._hash_algorithms[d] for d in data] + def _parse_preferred_compression_algorithms_signature_subpacket( + self, data, subpacket): + subpacket['preferred-compression-algorithms'] = [ + self._compression_algorithms[d] for d in data] + def _parse_key_flags_signature_subpacket(self, data, subpacket): subpacket['key-flags'] = set() if data[0] & 0x1: