feat: Track the old Signed Prekey after rotation
This commit is contained in:
@@ -244,5 +244,9 @@ void main() {
|
||||
|
||||
expect(await oldDevice.equals(newDevice!), false);
|
||||
expect(await newDevice!.equals(await aliceSession.getDevice()), true);
|
||||
|
||||
expect(await newDevice!.oldSpk!.equals(oldDevice.spk), true);
|
||||
expect(newDevice!.oldSpkId, oldDevice.spkId);
|
||||
expect(listsEqual(newDevice!.oldSpkSignature!, oldDevice.spkSignature), true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,6 +12,16 @@ void main() {
|
||||
expect(await oldDevice.equals(newDevice), true);
|
||||
});
|
||||
|
||||
test('Test serialising and deserialising the Device after rotating the SPK', () async {
|
||||
// Generate a random session
|
||||
final oldSession = await OmemoSessionManager.generateNewIdentity('user@test.server', opkAmount: 1);
|
||||
final oldDevice = await (await oldSession.getDevice()).replaceSignedPrekey();
|
||||
final serialised = await oldDevice.toJson();
|
||||
|
||||
final newDevice = Device.fromJson(serialised);
|
||||
expect(await oldDevice.equals(newDevice), true);
|
||||
});
|
||||
|
||||
test('Test serialising and deserialising the OmemoDoubleRatchet', () async {
|
||||
// Generate a random ratchet
|
||||
const aliceJid = 'alice@server.example';
|
||||
|
||||
Reference in New Issue
Block a user