diff --git a/client.py b/client.py index f1e8042..eb26d47 100755 --- a/client.py +++ b/client.py @@ -540,8 +540,8 @@ def _gpg_get_uid_fp(address: str): elif line.startswith('fpr:'): fpr = line.split(':')[9] fprs.append(fpr) - valid = {fprs[i]: pub for i, pub in enumerate(pubs) if not revoked[i]} - revoked = {fprs[i]: pub for i, pub in enumerate(pubs) if revoked[i]} + valid = {next((f for f in fprs if f.endswith(pub))): pub for i, pub in enumerate(pubs) if not revoked[i]} + revoked = {next((f for f in fprs if f.endswith(pub))): pub for i, pub in enumerate(pubs) if revoked[i]} if len(valid) == 0: raise ValueError(f'No valid key found for {address}.') elif len(valid) > 1: