things are bytes

This commit is contained in:
meejah 2019-06-24 16:56:50 -06:00
parent f52a6ce9bb
commit 249abbdd1f

View File

@ -51,13 +51,14 @@ def unsign_from_foolscap(ann_t):
if not claimed_key_vs.startswith("v0-"): if not claimed_key_vs.startswith("v0-"):
raise UnknownKeyError("only v0- keys recognized") raise UnknownKeyError("only v0- keys recognized")
claimed_key = ed25519.verifying_key_from_string("pub-" + claimed_key_vs) claimed_key = ed25519.verifying_key_from_string(b"pub-" + claimed_key_vs)
sig_bytes = base32.a2b(remove_prefix(sig_vs, "v0-")) sig_bytes = base32.a2b(remove_prefix(sig_vs, b"v0-"))
ed25519.verify_signature(claimed_key, sig_bytes, msg) ed25519.verify_signature(claimed_key, sig_bytes, msg)
key_vs = claimed_key_vs key_vs = claimed_key_vs
ann = json.loads(msg.decode("utf-8")) ann = json.loads(msg.decode("utf-8"))
return (ann, key_vs) return (ann, key_vs)
class SubscriberDescriptor(object): class SubscriberDescriptor(object):
"""This describes a subscriber, for status display purposes. It contains """This describes a subscriber, for status display purposes. It contains
the following attributes: the following attributes: