Skip to content

Commit

Permalink
fix proof checker when left side is latest team link
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsteele committed Sep 18, 2017
1 parent bf4e010 commit f50e334
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go/teams/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func NewProofError(p proof, s string) ProofError {
}

func (p ProofError) Error() string {
return fmt.Sprintf("proof error for proof %+v: %s", p.p, p.msg)
return fmt.Sprintf("proof error for proof '%s': %s", p.p.reason, p.msg)
}

type PermissionError struct {
Expand Down
9 changes: 7 additions & 2 deletions go/teams/loader2.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,15 @@ func (l *TeamLoader) verifyLink(ctx context.Context,
return nil, proofSet, libkb.NewWrongKidError(kid, key.Base.Kid)
}

var teamLinkMap map[keybase1.Seqno]keybase1.LinkID
teamLinkMap := make(map[keybase1.Seqno]keybase1.LinkID)
if state != nil {
teamLinkMap = state.Chain.LinkIDs
// copy over the stored links
for k, v := range state.Chain.LinkIDs {
teamLinkMap[k] = v
}
}
// add on the link that is being checked
teamLinkMap[link.Seqno()] = link.LinkID().Export()

proofSet = addProofsForKeyInUserSigchain(ctx, teamID, teamLinkMap, link, signerUV.Uid, key, linkMap, proofSet)

Expand Down

0 comments on commit f50e334

Please sign in to comment.