From 082d7d93d465b739a6e4d5e96266f45c5dc1990d Mon Sep 17 00:00:00 2001 From: s3lph <1375407-s3lph@users.noreply.gitlab.com> Date: Tue, 31 Jan 2023 01:31:36 +0100 Subject: [PATCH] Fix failing tests --- easywks/httpd.py | 2 +- easywks/process.py | 2 +- easywks/util.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/easywks/httpd.py b/easywks/httpd.py index 0d50feb..feb318c 100644 --- a/easywks/httpd.py +++ b/easywks/httpd.py @@ -62,7 +62,7 @@ def advanced_hu(domain: str, userhash: str): pubkey, revoked = read_hashed_public_key(domain, userhash) response.add_header('Content-Type', 'application/octet-stream') response.add_header(*CORS) - return bytes(pubkey) + b''.join([bytes(k) for k in revoked]) + return bytes(pubkey[0]) + b''.join([bytes(k) for k in revoked]) except FileNotFoundError: abort(404, 'Not Found') diff --git a/easywks/process.py b/easywks/process.py index fe3d9aa..7efdd8e 100644 --- a/easywks/process.py +++ b/easywks/process.py @@ -55,7 +55,7 @@ def _get_pgp_publickeys(parts: List[MIMEPart]) -> Tuple[PGPKey, List[PGPKey]]: for (_, public), key in keys.items(): if not public: continue - fpr = fingerprint(key.fingerprint) + fpr = fingerprint(key) if fpr in pubkeys: raise EasyWksError(f'Key with fingerprint {fpr} appears multiple times in submission request.') pubkeys[fpr] = key diff --git a/easywks/util.py b/easywks/util.py index 9292f58..4f8ee7b 100644 --- a/easywks/util.py +++ b/easywks/util.py @@ -69,7 +69,7 @@ def armor_keys(keys: List[PGPKey]) -> str: def split_revoked(keys: Iterable[PGPKey]) -> Tuple[List[PGPKey], List[PGPKey]]: revoked_keys = set() for key in keys: - if len(key.revocation_signatures) == 0: + if len(list(key.revocation_signatures)) == 0: continue for rsig in key.revocation_signatures: if rsig.type == SignatureType.KeyRevocation: