auditor

package
v0.0.0-...-11acf48 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2018 License: BSD-3-Clause Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeDirectoryIdentity

func ComputeDirectoryIdentity(str *protocol.DirSTR) [crypto.HashSizeByte]byte

ComputeDirectoryIdentity returns the hash of the directory's initial STR as a byte array. It panics if the STR isn't an initial STR (i.e. str.Epoch != 0).

Types

type AudState

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

AudState verifies the hash chain of a specific directory.

func New

func New(signKey sign.PublicKey, verified *protocol.DirSTR) *AudState

New instantiates a new auditor state from a persistance storage.

func (*AudState) AuditDirectory

func (a *AudState) AuditDirectory(strs []*protocol.DirSTR) error

AuditDirectory validates a range of STRs received from a CONIKS directory. AuditDirectory() checks the consistency of the oldest STR in the range against the verifiedSTR, and verifies the remaining range if the message contains more than one STR. AuditDirectory() returns the appropriate consistency check error if any of the checks fail, or nil if the checks pass.

func (*AudState) CheckSTRAgainstVerified

func (a *AudState) CheckSTRAgainstVerified(str *protocol.DirSTR) error

CheckSTRAgainstVerified checks an STR str against the a.verifiedSTR. If str's Epoch is the same as the verified, CheckSTRAgainstVerified() compares the two STRs directly. If str is one epoch ahead of the a.verifiedSTR, CheckSTRAgainstVerified() checks the consistency between the two STRs. CheckSTRAgainstVerified() returns nil if the check passes, or the appropriate consistency check error if any of the checks fail, or str's epoch is anything other than the same or one ahead of a.verifiedSTR.

func (*AudState) Update

func (a *AudState) Update(newSTR *protocol.DirSTR)

Update updates the auditor's verifiedSTR to newSTR

func (*AudState) VerifiedSTR

func (a *AudState) VerifiedSTR() *protocol.DirSTR

VerifiedSTR returns the newly verified STR.

func (*AudState) Verify

func (a *AudState) Verify(message, sig []byte) bool

Verify verifies a signature sig on message using the underlying public-key of the AudState.

func (*AudState) VerifySTRRange

func (a *AudState) VerifySTRRange(prevSTR *protocol.DirSTR, strs []*protocol.DirSTR) error

VerifySTRRange checks the consistency of a range of a directory's STRs. It begins by verifying the STR consistency between the given prevSTR and the first STR in the given range, and then verifies the consistency between each subsequent STR pair.

type Auditor

type Auditor interface {
	AuditDirectory([]*protocol.DirSTR) error
}

Auditor provides a generic interface allowing different auditor types to implement specific auditing functionality.

Jump to

Keyboard shortcuts

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