From: W. Trevor King Date: Fri, 20 Dec 2013 18:58:13 +0000 (-0800) Subject: Stub out PGPPacket._parse_signature_packet X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6fdae81be28e2b49a7207f003629db190abc11dd;p=gpg-migrate.git Stub out PGPPacket._parse_signature_packet The first octet of each signature packet is it's version number. That means we can parse the first octet of the signature packet and use its value to determine which version we're parsing. From RFC 4880 [1]: The body of a version 3 Signature Packet contains: - One-octet version number (3). - ... And in the next section [2]: The body of a version 4 Signature Packet contains: - One-octet version number (4). - ... [1]: http://tools.ietf.org/search/rfc4880#section-5.2.2 [2]: http://tools.ietf.org/search/rfc4880#section-5.2.3 --- diff --git a/gpg-migrate.py b/gpg-migrate.py index 7b51b72..48429b4 100755 --- a/gpg-migrate.py +++ b/gpg-migrate.py @@ -351,6 +351,13 @@ class PGPPacket (dict): if key_end: self['secret-key-checksum'] = data[key_end:] + def _parse_signature_packet(self, data): + self['signature-version'] = data[0] + offset = 1 + raise NotImplementedError( + 'signature packet version {}'.format( + self['signature-version'])) + def to_bytes(self): pass