From efa2fed7cb33d67680caac22fe7830f445c105b6 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Tue, 11 Jul 2023 17:43:33 -0400 Subject: [PATCH] PGPKey.from_file,from_blob: Drop failed filtering of keyid mapping This appears to have been introduced in 38a4f9f8b17fd40a2be942f58db2ecd8e67a32ee nearly 9 years ago, but it doesn't look like it ever worked. It's not clear to me why this index of keys by key ID is returned at all in these functions, but since September 2014 (v0.3.0) the index has always returned the key ID of the primary key anyway. There are a few things broken in this particular line: - the use of `~` if `fingerprint.keyid` doesn't work for some reason: that won't match anything. - and, None gets passed as the second object in the tuple, but the second object should be either True or False. Rather than try to salvage something that i don't understand in the first place, i figure it's better to drop it and acknowledge the status quo. --- pgpy/pgp.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pgpy/pgp.py b/pgpy/pgp.py index f34a25fb..46a8f9bb 100644 --- a/pgpy/pgp.py +++ b/pgpy/pgp.py @@ -2670,9 +2670,6 @@ def __call__(self, pkt): for pkt in group: # pragma: no cover orphaned.append(pkt) - # remove the reference to self from keys - [ keys.pop((getattr(self, 'fingerprint.keyid', '~'), None), t) for t in (True, False) ] - # return {'keys': keys, 'orphaned': orphaned} return keys