Message was not enforced to carry signature yet
This commit is contained in:
parent
1cea1264a4
commit
d4febea469
|
@ -409,7 +409,7 @@ class Pubsub:
|
||||||
# TODO: - Validate the message. If failed, reject it.
|
# TODO: - Validate the message. If failed, reject it.
|
||||||
# Validate the signature of the message
|
# Validate the signature of the message
|
||||||
# FIXME: `signature_validator` is currently a stub.
|
# FIXME: `signature_validator` is currently a stub.
|
||||||
if not signature_validator(msg.key, msg.SerializeToString(), msg.singature):
|
if not signature_validator(msg.key, msg.SerializeToString()):
|
||||||
log.debug(f"Signature validation failed for msg={msg}")
|
log.debug(f"Signature validation failed for msg={msg}")
|
||||||
return
|
return
|
||||||
# Validate the message with registered topic validators.
|
# Validate the message with registered topic validators.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# FIXME: Replace the type of `pubkey` with a custom type `Pubkey`
|
# FIXME: Replace the type of `pubkey` with a custom type `Pubkey`
|
||||||
def signature_validator(pubkey: bytes, msg: bytes, sig: bytes) -> bool:
|
def signature_validator(pubkey: bytes, msg: bytes) -> bool:
|
||||||
"""
|
"""
|
||||||
Verify the message against the given public key.
|
Verify the message against the given public key.
|
||||||
:param pubkey: the public key which signs the message.
|
:param pubkey: the public key which signs the message.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user