refactor: key rotation (#2383)
This commit is contained in:
@@ -189,12 +189,7 @@ describe('asymmetric messages', function () {
|
||||
|
||||
contactContext.lockSyncing()
|
||||
|
||||
const promise = context.resolveWhenAsyncFunctionCompletes(
|
||||
context.sharedVaults._notifyVaultUsersOfKeyRotation,
|
||||
'execute',
|
||||
)
|
||||
await context.vaults.rotateVaultRootKey(sharedVault)
|
||||
await promise
|
||||
|
||||
const firstPartySpy = sinon.spy(context.asymmetric, 'handleTrustedSharedVaultRootKeyChangedMessage')
|
||||
const secondPartySpy = sinon.spy(contactContext.asymmetric, 'handleTrustedSharedVaultRootKeyChangedMessage')
|
||||
@@ -333,8 +328,8 @@ describe('asymmetric messages', function () {
|
||||
it('sender keypair changed message should be signed using old key pair', async () => {
|
||||
const { contactContext, deinitContactContext } = await Collaboration.createSharedVaultWithAcceptedInvite(context)
|
||||
|
||||
const oldKeyPair = context.encryption.getKeyPair()
|
||||
const oldSigningKeyPair = context.encryption.getSigningKeyPair()
|
||||
const oldKeyPair = context.keyPair
|
||||
const oldSigningKeyPair = context.signingKeyPair
|
||||
|
||||
await context.changePassword('new password')
|
||||
|
||||
@@ -360,8 +355,8 @@ describe('asymmetric messages', function () {
|
||||
|
||||
await context.changePassword('new password')
|
||||
|
||||
const newKeyPair = context.encryption.getKeyPair()
|
||||
const newSigningKeyPair = context.encryption.getSigningKeyPair()
|
||||
const newKeyPair = context.keyPair
|
||||
const newSigningKeyPair = context.signingKeyPair
|
||||
|
||||
await contactContext.syncAndAwaitMessageProcessing()
|
||||
|
||||
@@ -413,12 +408,12 @@ describe('asymmetric messages', function () {
|
||||
const usecase = context.application.dependencies.get(TYPES.ResendAllMessages)
|
||||
const result = await usecase.execute({
|
||||
keys: {
|
||||
encryption: context.encryption.getKeyPair(),
|
||||
signing: context.encryption.getSigningKeyPair(),
|
||||
encryption: context.keyPair,
|
||||
signing: context.signingKeyPair,
|
||||
},
|
||||
previousKeys: {
|
||||
encryption: context.encryption.getKeyPair(),
|
||||
signing: context.encryption.getSigningKeyPair(),
|
||||
encryption: context.keyPair,
|
||||
signing: context.signingKeyPair,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user