Fix failing tests

This commit is contained in:
s3lph 2023-01-31 01:31:36 +01:00
parent 62fd2d52da
commit 082d7d93d4
3 changed files with 3 additions and 3 deletions

View file

@ -62,7 +62,7 @@ def advanced_hu(domain: str, userhash: str):
pubkey, revoked = read_hashed_public_key(domain, userhash) pubkey, revoked = read_hashed_public_key(domain, userhash)
response.add_header('Content-Type', 'application/octet-stream') response.add_header('Content-Type', 'application/octet-stream')
response.add_header(*CORS) 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: except FileNotFoundError:
abort(404, 'Not Found') abort(404, 'Not Found')

View file

@ -55,7 +55,7 @@ def _get_pgp_publickeys(parts: List[MIMEPart]) -> Tuple[PGPKey, List[PGPKey]]:
for (_, public), key in keys.items(): for (_, public), key in keys.items():
if not public: if not public:
continue continue
fpr = fingerprint(key.fingerprint) fpr = fingerprint(key)
if fpr in pubkeys: if fpr in pubkeys:
raise EasyWksError(f'Key with fingerprint {fpr} appears multiple times in submission request.') raise EasyWksError(f'Key with fingerprint {fpr} appears multiple times in submission request.')
pubkeys[fpr] = key pubkeys[fpr] = key

View file

@ -69,7 +69,7 @@ def armor_keys(keys: List[PGPKey]) -> str:
def split_revoked(keys: Iterable[PGPKey]) -> Tuple[List[PGPKey], List[PGPKey]]: def split_revoked(keys: Iterable[PGPKey]) -> Tuple[List[PGPKey], List[PGPKey]]:
revoked_keys = set() revoked_keys = set()
for key in keys: for key in keys:
if len(key.revocation_signatures) == 0: if len(list(key.revocation_signatures)) == 0:
continue continue
for rsig in key.revocation_signatures: for rsig in key.revocation_signatures:
if rsig.type == SignatureType.KeyRevocation: if rsig.type == SignatureType.KeyRevocation: