Decode public key algorithm in _parse_generic_public_key_packet
authorW. Trevor King <wking@tremily.us>
Fri, 20 Dec 2013 05:27:27 +0000 (21:27 -0800)
committerW. Trevor King <wking@tremily.us>
Fri, 20 Dec 2013 19:46:30 +0000 (11:46 -0800)
It's easier for humans to parse the text representation ;).

gpg-migrate.py

index e75cab84803dfd9c8866871246c16ea5e33d6531..d2049c256815f8b977317bcc6c47effe517a5646 100755 (executable)
@@ -201,9 +201,10 @@ class PGPPacket (dict):
                 'public (sub)key packet version {}'.format(
                     self['key-version']))
         length = 5
-        self['creation_time'], self['public-key-algorithm'] = _struct.unpack(
+        self['creation-time'], algorithm = _struct.unpack(
             '>IB', data[offset: offset + length])
         offset += length
+        self['public-key-algorithm'] = self._public_key_algorithms[algorithm]
         self['key'] = data[offset:]
 
     def to_bytes(self):