Update iteration counter
This commit is contained in:
parent
08bb2f907f
commit
511a737c5d
|
@ -83,10 +83,15 @@ func NewGroup(server string) (*Group, error) {
|
|||
return group, nil
|
||||
}
|
||||
|
||||
// CheckGroup returns true only if the ID of the group is cryptographically valid.
|
||||
func (g *Group) CheckGroup() bool {
|
||||
return g.GroupID == deriveGroupID(g.GroupKey[:], g.GroupServer)
|
||||
}
|
||||
|
||||
func deriveGroupID(groupKey []byte, serverHostname string) string {
|
||||
data, _ := base32.StdEncoding.DecodeString(strings.ToUpper(serverHostname))
|
||||
pubkey := data[0:ed25519.PublicKeySize]
|
||||
return hex.EncodeToString(pbkdf2.Key(groupKey, pubkey, 4, 16, sha512.New))
|
||||
return hex.EncodeToString(pbkdf2.Key(groupKey, pubkey, 4096, 16, sha512.New))
|
||||
}
|
||||
|
||||
// Compromised should be called if we detect a a groupkey leak
|
||||
|
|
Loading…
Reference in New Issue