Documentation ¶
Overview ¶
Package monitor implements the monitor service. A monitor repeatedly polls a key-transparency server's Mutations API and signs Map Roots if it could reconstruct clients can query.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInconsistentProofs occurs when the server returned different hashes // for the same inclusion proof node in the tree. ErrInconsistentProofs = errors.New("inconsistent inclusion proofs") // ErrInvalidLogConsistencyProof occurs when the log consistency proof does // not verify. ErrInvalidLogConsistencyProof = errors.New("invalid log consistency proof") // ErrInvalidLogInclusion occurs if the inclusion proof for the signed map // root into the log does not verify. ErrInvalidLogInclusion = errors.New("invalid log inclusion proof") // ErrInvalidLogSignature occurs if the log roots signature does not verify. ErrInvalidLogSignature = errors.New("invalid signature on log root") // ErrInvalidMapSignature occurs if the map roots signature does not verify. ErrInvalidMapSignature = errors.New("invalid signature on map root") // ErrInvalidMutation occurs when verification failed because of an invalid // mutation. ErrInvalidMutation = errors.New("invalid mutation") // ErrNotMatchingMapRoot occurs when the reconstructed root differs from the // one we received from the server. ErrNotMatchingMapRoot = errors.New("recreated root does not match") )
Functions ¶
func RevisionPairs ¶
func RevisionPairs(ctx context.Context, revisions <-chan *types.MapRootV1, pairs chan<- RevisionPair) error
RevisionPairs consumes revisions (0, 1, 2) and produces pairs (0,1), (1,2).
Types ¶
type ErrList ¶
type ErrList []error
ErrList is a list of errors.
func (*ErrList) AppendStatus ¶
AppendStatus adds a status errord, or the error about adding the status if the latter is not nil.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor holds the internal state for a monitor accessing the mutations API and for verifying its responses.
func New ¶
func New(cli *client.Client, mapVerifier *tclient.MapVerifier, signer *tcrypto.Signer, store monitorstorage.Interface) (*Monitor, error)
New creates a new instance of the monitor.
func NewFromDirectory ¶
func NewFromDirectory(cli pb.KeyTransparencyClient, config *pb.Directory, signer *tcrypto.Signer, store monitorstorage.Interface) (*Monitor, error)
NewFromDirectory produces a new monitor from a Directory object.
type RevisionPair ¶
RevisionPair is two adjacent revisions.
Notes ¶
Bugs ¶
Proto serializations are not idempotent. - Upgrade the hasher to use ObjectHash. - Use deep compare between the tree and the computed value.