Skip to content

Commit

Permalink
v0.5.1 update - fixed packet parser bug that ignored legacy keys
Browse files Browse the repository at this point in the history
  • Loading branch information
rmlibre committed Dec 19, 2019
1 parent 1b069c8 commit 3791e35
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tiny_gnupg/tiny_gnupg.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,17 @@ def packet_fingerprint(self, target=""):
gpg message, key or signature.
"""
try:
size = slice(-41, -1)
sentinel = "(issuer fpr v4"
packets = self.raw_packets(target).split("\n\t")
packets = self.raw_packets(target).replace(")", "")
except KeyError as exception:
packets = exception.output.replace(")", "")
packets = packets.replace("key ID", "keyid")
if "issuer fpr" in packets:
size = slice(-40, None)
sentinel = "(issuer fpr "
else:
sentinel = "keyid "
size = slice(-16, None)
packets = exception.output.split("\n\t")
for packet in packets:
for packet in packets.split("\n\t"):
if sentinel in packet:
return packet[size]

Expand Down

0 comments on commit 3791e35

Please sign in to comment.