From 6fdae81be28e2b49a7207f003629db190abc11dd Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 20 Dec 2013 10:58:13 -0800 Subject: [PATCH] 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 --- gpg-migrate.py | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.26.2