gossip

package
v1.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package gossip holds code for spreading CT log information via a gossip protocol.

Index

Constants

View Source
const (
	STHVersion0 = 0
	STHVersion1 = 1
)

STHVersion constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler for the gossip HTTP requests.

func NewHandler

func NewHandler(s *Storage, v SignatureVerifierMap) Handler

NewHandler creates a new Handler object, taking a pointer a Storage object to use for storing and retrieving feedback and pollination data, and a SignatureVerifierMap for verifying signatures from known logs.

func (*Handler) HandleSCTFeedback

func (h *Handler) HandleSCTFeedback(rw http.ResponseWriter, req *http.Request)

HandleSCTFeedback handles requests POSTed to .../sct-feedback. It attempts to store the provided SCT Feedback

func (*Handler) HandleSTHPollination

func (h *Handler) HandleSTHPollination(rw http.ResponseWriter, req *http.Request)

HandleSTHPollination handles requests POSTed to .../sth-pollination. It attempts to store the provided pollination info, and returns a random set of pollination data from the last 14 days (i.e. "fresh" by the definition of the gossip RFC.)

type SCTFeedback

type SCTFeedback struct {
	Feedback []SCTFeedbackEntry `json:"sct_feedback"`
}

SCTFeedback represents a collection of SCTFeedback which a client might send together.

type SCTFeedbackEntry

type SCTFeedbackEntry struct {
	X509Chain []string `json:"x509_chain"`
	SCTData   []string `json:"sct_data"`
}

SCTFeedbackEntry represents a single piece of SCT feedback.

type STHPollination

type STHPollination struct {
	STHs []ct.SignedTreeHead `json:"sths"`
}

STHPollination represents a collection of STH pollination entries which a client might send together.

type STHVersion

type STHVersion int

STHVersion reflects the STH Version field in RFC6862[-bis]

type SignatureVerifierMap

type SignatureVerifierMap map[ct.SHA256Hash]ct.SignatureVerifier

SignatureVerifierMap is a map of SignatureVerifier by LogID

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage provides an SQLite3-backed method for persisting gossip data

func (*Storage) AddSCTFeedback

func (s *Storage) AddSCTFeedback(feedback SCTFeedback) (err error)

AddSCTFeedback stores the passed in feedback object.

func (*Storage) AddSTHPollination

func (s *Storage) AddSTHPollination(pollination STHPollination) error

AddSTHPollination stores the passed in pollination object.

func (*Storage) Close

func (s *Storage) Close() error

Close closes the underlying DB storage.

func (*Storage) GetRandomSTHPollination

func (s *Storage) GetRandomSTHPollination(newerThan time.Time, limit int) (*STHPollination, error)

GetRandomSTHPollination returns a random selection of "fresh" (i.e. at most 14 days old) STHs from the pool.

func (*Storage) Open

func (s *Storage) Open(dbPath string) error

Open opens the underlying persistent data store. Should be called before attempting to use any of the store or search methods.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL