feature(keyringctl): derive username from short key id fingerprints

Allow short key id fingerprints to be used with the username derive
function by adding a glob in front of the fingerprint component.
This commit is contained in:
Levente Polyak 2021-10-19 19:12:48 +02:00
parent 60ee3d6d94
commit 147287959f
No known key found for this signature in database
GPG Key ID: FC1B547C8D8172C8

View File

@ -718,7 +718,7 @@ def derive_username_from_fingerprint(keyring_dir: Path, certificate_fingerprint:
A string representing the username a public key certificate belongs to, None otherwise
"""
matches = list(keyring_dir.glob(f"*/{certificate_fingerprint}"))
matches = list(keyring_dir.glob(f"*/*{certificate_fingerprint}"))
if len(matches) > 1:
raise Exception(