feature(keyringctl): skip user attribute packets as none relevant

This commit is contained in:
Levente Polyak 2021-11-10 21:08:45 +01:00
parent 3d8e88dfaf
commit 5a83a7b6c1
No known key found for this signature in database
GPG Key ID: FC1B547C8D8172C8

View File

@ -163,6 +163,10 @@ def convert_certificate( # noqa: ignore=C901
current_packet_uid = Uid(simplify_ascii(packet_dump_field(packet, "Value"))) current_packet_uid = Uid(simplify_ascii(packet_dump_field(packet, "Value")))
uids[current_packet_uid] = packet uids[current_packet_uid] = packet
elif packet.name.endswith("UserAttribute"):
current_packet_mode = "uattr"
current_packet_fingerprint = None
current_packet_uid = None
elif packet.name.endswith("--PublicSubkey"): elif packet.name.endswith("--PublicSubkey"):
current_packet_mode = "subkey" current_packet_mode = "subkey"
current_packet_fingerprint = Fingerprint(packet_dump_field(packet, "Fingerprint")) current_packet_fingerprint = Fingerprint(packet_dump_field(packet, "Fingerprint"))
@ -170,6 +174,11 @@ def convert_certificate( # noqa: ignore=C901
subkeys[current_packet_fingerprint] = packet subkeys[current_packet_fingerprint] = packet
elif packet.name.endswith("--Signature"): elif packet.name.endswith("--Signature"):
# ignore user attributes and related signatures
if current_packet_mode == "uattr":
debug("skipping user attribute signature packet")
continue
if not certificate_fingerprint: if not certificate_fingerprint:
raise Exception('missing certificate fingerprint for "{packet.name}"') raise Exception('missing certificate fingerprint for "{packet.name}"')