diff --git a/pgpdump/packet.py b/pgpdump/packet.py index cf83e4e..f29c5cd 100644 --- a/pgpdump/packet.py +++ b/pgpdump/packet.py @@ -46,6 +46,7 @@ class AlgoLookup(object): 19: "ECDSA", 20: "Formerly ElGamal Encrypt or Sign", 21: "Diffie-Hellman", + 22: "EdDSA", } @classmethod @@ -143,6 +144,7 @@ def __init__(self, raw, hashed, data): 30: "Features", 31: "Signature Target", 32: "Embedded Signature", + 33: "Issuer Fingerprint", } @property @@ -172,6 +174,8 @@ def __init__(self, *args, **kwargs): self.raw_expiration_time = None self.expiration_time = None self.key_id = None + self.fingerprint = None + self.fingerprint_version = None self.hash2 = None self.subpackets = [] super(SignaturePacket, self).__init__(*args, **kwargs) @@ -275,6 +279,9 @@ def parse_subpackets(self, outer_offset, outer_length, hashed=False): self.raw_expiration_time = get_int4(subpacket.data, 0) elif subpacket.subtype == 16: self.key_id = get_key_id(subpacket.data, 0) + elif subpacket.subtype == 33: + self.fingerprint_version = int(subpacket.data[0]) + self.fingerprint = get_hex_data(subpacket.data, 1, len(subpacket.data)) offset += sub_len self.subpackets.append(subpacket) @@ -420,12 +427,9 @@ def parse_key_material(self, offset): self.prime, offset = get_mpi(self.data, offset) self.group_gen, offset = get_mpi(self.data, offset) self.key_value, offset = get_mpi(self.data, offset) - elif 100 <= self.raw_pub_algorithm <= 110: - # Private/Experimental algorithms, just move on - pass else: - raise PgpdumpException("Unsupported public key algorithm %d" % - self.raw_pub_algorithm) + # If we don't know how to handle the algorithm, just move on + pass return offset @@ -578,7 +582,7 @@ def parse(self): "Unsupported GnuPG S2K extension, encountered mode %d" % mode) else: raise PgpdumpException( - "Unsupported public key algorithm %d" % s2k_type_id) + "Unsupported S2K algorithm %d" % s2k_type_id) if s2k_length != (offset - offset_before_s2k): raise PgpdumpException( @@ -609,12 +613,9 @@ def parse_private_key_material(self, offset): self.pub_algorithm_type = "elg" # x self.exponent_x, offset = get_mpi(self.data, offset) - elif 100 <= self.raw_pub_algorithm <= 110: - # Private/Experimental algorithms, just move on - pass else: - raise PgpdumpException("Unsupported public key algorithm %d" % - self.raw_pub_algorithm) + # If we don't know how to handle the algorithm, just move on + pass return offset