| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
LibP2P.Protocol.GossipSub.Validation
Description
Inbound pubsub message validation (specspubsubREADME.md).
Under StrictSign the consuming side must enforce that from, seqno and
signature are present, that the signature verifies against the author's
public key, and that the key matches the from peer ID. Messages that fail
are dropped without propagation. Under StrictNoSign the signing fields must
be absent.
The signed bytes are "libp2p-pubsub:" <> protobuf(msg without signature and
key), symmetric with the signing path in LibP2P.Protocol.GossipSub.Router.
Synopsis
Documentation
data ValidationError Source #
Why an inbound message was rejected.
Constructors
| MissingField String | A field required by StrictSign is absent |
| UnexpectedField String | A signing field is present under StrictNoSign |
| MalformedKey String | The key field (or inlined key) failed to decode |
| KeyPeerIdMismatch | The public key does not derive the |
| BadSignature | Signature verification failed |
Instances
| Show ValidationError Source # | |
Defined in LibP2P.Protocol.GossipSub.Validation Methods showsPrec :: Int -> ValidationError -> ShowS # show :: ValidationError -> String # showList :: [ValidationError] -> ShowS # | |
| Eq ValidationError Source # | |
Defined in LibP2P.Protocol.GossipSub.Validation Methods (==) :: ValidationError -> ValidationError -> Bool # (/=) :: ValidationError -> ValidationError -> Bool # | |
validateMessage :: SignaturePolicy -> PubSubMessage -> Either ValidationError () Source #
Validate an inbound message against the configured signature policy.
signaturePrefix :: ByteString Source #
Domain separation prefix for pubsub message signatures.
marshalForSigning :: PubSubMessage -> ByteString Source #
Marshal a message for signature computation. Per the libp2p spec, the signed data excludes both signature and key fields.
signingBytes :: PubSubMessage -> ByteString Source #
The exact bytes covered by a message signature.