Skip to content

Commit

Permalink
Typo
Browse files Browse the repository at this point in the history
  • Loading branch information
vqhuy committed Sep 3, 2017
1 parent 7f3f14f commit 76ae044
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
23 changes: 11 additions & 12 deletions protocol/auditlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ type directoryHistory struct {
snapshots map[uint64]*DirSTR
}

// 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.
type ConiksAuditLog map[[crypto.HashSizeByte]byte]*directoryHistory

// caller validates that initSTR is for epoch 0.
func newDirectoryHistory(addr string, signKey sign.PublicKey, initSTR *DirSTR) *directoryHistory {
a := NewAuditor(signKey, initSTR)
Expand All @@ -28,16 +38,6 @@ func newDirectoryHistory(addr string, signKey sign.PublicKey, initSTR *DirSTR) *
return h
}

// 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.
type ConiksAuditLog map[[crypto.HashSizeByte]byte]*directoryHistory

// updateVerifiedSTR inserts the latest verified STR into a directory history;
// assumes the STRs have been validated by the caller.
func (h *directoryHistory) updateVerifiedSTR(newVerified *DirSTR) {
Expand Down Expand Up @@ -65,7 +65,7 @@ func (h *directoryHistory) insertRange(snaps []*DirSTR) {
// from a specific directory.
func (h *directoryHistory) Audit(msg *Response) error {
if err := msg.validate(); err != nil {
return err.(ErrorCode)
return err
}

strs := msg.DirectoryResponse.(*STRHistoryRange)
Expand Down Expand Up @@ -121,7 +121,6 @@ func (l ConiksAuditLog) get(dirInitHash [crypto.HashSizeByte]byte) (*directoryHi
// from disk (either first-time startup, or after reboot).
func (l ConiksAuditLog) InitHistory(addr string, signKey sign.PublicKey,
snaps []*DirSTR) error {

// make sure we're getting an initial STR at the very least
if len(snaps) < 1 || snaps[0].Epoch != 0 {
// FIXME: This should be a more generic "malformed error"
Expand Down
1 change: 0 additions & 1 deletion protocol/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ func (d *ConiksDirectory) Monitor(req *MonitoringRequest) (
// omitted in req, the end of the range will be set to d.LatestSTR().Epoch.
func (d *ConiksDirectory) GetSTRHistory(req *STRHistoryRequest) (*Response,
ErrorCode) {

// make sure the request is well-formed
if req.StartEpoch > d.LatestSTR().Epoch ||
(req.EndEpoch != 0 && req.EndEpoch < req.StartEpoch) {
Expand Down
2 changes: 1 addition & 1 deletion protocol/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ type DirectoryProof struct {
// STR representing a range of the STR hash chain. If the range only
// covers the latest epoch, the list only contains a single STR.
// A CONIKS auditor returns this DirectoryResponse type upon an
// AudutingRequest from a client, and a CONIKS directory returns
// AuditingRequest from a client, and a CONIKS directory returns
// this message upon an STRHistoryRequest from an auditor.
type STRHistoryRange struct {
STR []*DirSTR
Expand Down

0 comments on commit 76ae044

Please sign in to comment.