reject group invites without a corresponding key bundle
This commit is contained in:
parent
957558165d
commit
aa6f2499b9
|
@ -8,6 +8,7 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"git.openprivacy.ca/openprivacy/connectivity/tor"
|
"git.openprivacy.ca/openprivacy/connectivity/tor"
|
||||||
"golang.org/x/crypto/ed25519"
|
"golang.org/x/crypto/ed25519"
|
||||||
"io"
|
"io"
|
||||||
|
@ -390,6 +391,9 @@ func (p *Profile) GetGroup(groupID string) (g *Group) {
|
||||||
func (p *Profile) ProcessInvite(invite string) (string, error) {
|
func (p *Profile) ProcessInvite(invite string) (string, error) {
|
||||||
gci, err := ValidateInvite(invite)
|
gci, err := ValidateInvite(invite)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
if _, exists := p.GetContact(gci.ServerHost); !exists {
|
||||||
|
return "", fmt.Errorf("unknown server. a server key bundle needs to be imported before this group can be verified")
|
||||||
|
}
|
||||||
group := new(Group)
|
group := new(Group)
|
||||||
group.Version = CurrentGroupVersion
|
group.Version = CurrentGroupVersion
|
||||||
group.GroupID = gci.GroupID
|
group.GroupID = gci.GroupID
|
||||||
|
|
Loading…
Reference in New Issue