diff --git a/commonspace/object/accountdata/accountdata.go b/commonspace/object/accountdata/accountdata.go index 5cbd8ab3..b6816a2d 100644 --- a/commonspace/object/accountdata/accountdata.go +++ b/commonspace/object/accountdata/accountdata.go @@ -6,18 +6,16 @@ import ( ) type AccountKeys struct { - PeerKey crypto.PrivKey - SignKey crypto.PrivKey - MasterKey crypto.PrivKey - PeerId string + PeerKey crypto.PrivKey + SignKey crypto.PrivKey + PeerId string } -func New(peerKey, signKey, masterKey crypto.PrivKey) *AccountKeys { +func New(peerKey, signKey crypto.PrivKey) *AccountKeys { return &AccountKeys{ - PeerKey: peerKey, - SignKey: signKey, - MasterKey: masterKey, - PeerId: peerKey.GetPublic().PeerId(), + PeerKey: peerKey, + SignKey: signKey, + PeerId: peerKey.GetPublic().PeerId(), } } @@ -30,14 +28,9 @@ func NewRandom() (*AccountKeys, error) { if err != nil { return nil, err } - masterKey, _, err := crypto.GenerateEd25519Key(rand.Reader) - if err != nil { - return nil, err - } return &AccountKeys{ - PeerKey: peerKey, - SignKey: signKey, - MasterKey: masterKey, - PeerId: peerKey.GetPublic().PeerId(), + PeerKey: peerKey, + SignKey: signKey, + PeerId: peerKey.GetPublic().PeerId(), }, nil } diff --git a/commonspace/object/acl/list/listutils.go b/commonspace/object/acl/list/listutils.go index f2597ca2..342bddb1 100644 --- a/commonspace/object/acl/list/listutils.go +++ b/commonspace/object/acl/list/listutils.go @@ -9,10 +9,14 @@ import ( func NewTestDerivedAcl(spaceId string, keys *accountdata.AccountKeys) (AclList, error) { builder := NewAclRecordBuilder("", crypto.NewKeyStorage()) + masterKey, _, err := crypto.GenerateRandomEd25519KeyPair() + if err != nil { + return nil, err + } root, err := builder.BuildRoot(RootContent{ PrivKey: keys.SignKey, SpaceId: spaceId, - MasterKey: keys.MasterKey, + MasterKey: masterKey, }) if err != nil { return nil, err