Fix up documentation
This commit is contained in:
parent
511a737c5d
commit
967c04f9cf
|
@ -88,13 +88,15 @@ func (g *Group) CheckGroup() bool {
|
||||||
return g.GroupID == deriveGroupID(g.GroupKey[:], g.GroupServer)
|
return g.GroupID == deriveGroupID(g.GroupKey[:], g.GroupServer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// deriveGroupID hashes together the key and the hostname to create a bound identifier that can later
|
||||||
|
// be referenced and checked by profiles when they receive invites and messages.
|
||||||
func deriveGroupID(groupKey []byte, serverHostname string) string {
|
func deriveGroupID(groupKey []byte, serverHostname string) string {
|
||||||
data, _ := base32.StdEncoding.DecodeString(strings.ToUpper(serverHostname))
|
data, _ := base32.StdEncoding.DecodeString(strings.ToUpper(serverHostname))
|
||||||
pubkey := data[0:ed25519.PublicKeySize]
|
pubkey := data[0:ed25519.PublicKeySize]
|
||||||
return hex.EncodeToString(pbkdf2.Key(groupKey, pubkey, 4096, 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
|
// Compromised should be called if we detect a groupkey leak
|
||||||
func (g *Group) Compromised() {
|
func (g *Group) Compromised() {
|
||||||
g.IsCompromised = true
|
g.IsCompromised = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue