Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConiksAuditLog ¶
type ConiksAuditLog map[[crypto.HashSizeByte]byte]*directoryHistory
A ConiksAuditLog maintains the histories of all CONIKS directories known to a CONIKS auditor, indexing the histories by the hash of a directory's initial STR (specifically, the hash of the STR's signature). Each history includes the directory's domain addr as a string, its public signing key enabling the auditor to verify the corresponding signed tree roots, and a list with all observed snapshots in chronological order.
func New ¶
func New() ConiksAuditLog
New constructs a new ConiksAuditLog. It creates an empty log; the auditor will add an entry for each CONIKS directory the first time it observes an STR for that directory.
func NewTestAuditLog ¶
func NewTestAuditLog(t *testing.T, numEpochs int) ( *directory.ConiksDirectory, ConiksAuditLog, []*protocol.DirSTR)
NewTestAuditLog creates a ConiksAuditLog and corresponding ConiksDirectory used for testing auditor-side CONIKS operations. The new audit log can be initialized with the number of epochs indicating the length of the directory history with which to initialize the log; if numEpochs > 0, the history contains numEpochs+1 STRs as it always includes the STR after the last directory update
func (ConiksAuditLog) GetObservedSTRs ¶
func (l ConiksAuditLog) GetObservedSTRs(req *protocol.AuditingRequest) *protocol.Response
GetObservedSTRs gets a range of observed STRs for the CONIKS directory address indicated in the AuditingRequest req received from a CONIKS client, and returns a protocol.Response. The response (which also includes the error code) is sent back to the client.
A request without a directory address, with a StartEpoch or EndEpoch greater than the latest observed epoch of this directory, or with at StartEpoch > EndEpoch is considered malformed and causes GetObservedSTRs() to return a message.NewErrorResponse(ErrMalformedMessage). GetObservedSTRs() returns a message.NewSTRHistoryRange(strs). strs is a list of STRs for the epoch range [StartEpoch, EndEpoch]; if StartEpoch == EndEpoch, the list returned is of length 1. If the auditor doesn't have any history entries for the requested CONIKS directory, GetObservedSTRs() returns a message.NewErrorResponse(ReqUnknownDirectory).
func (ConiksAuditLog) InitHistory ¶
func (l ConiksAuditLog) InitHistory(addr string, signKey sign.PublicKey, snaps []*protocol.DirSTR) error
InitHistory creates a new directory history for the key directory addr and inserts it into the audit log l. InitHistory() is called by an auditor when it initializes its state from disk (either first-time startup, or after reboot). The directory history is initialized with the key directory's signing key signKey, and a list of one or more snapshots snaps containing the pinned initial STR as well as the saved directory's STR history so far, in chronological order. InitHistory() returns an ErrAuditLog if the auditor attempts to create a new history for a known directory, and nil otherwise.