feat: Allow calculating fingerprints

This commit is contained in:
2022-08-08 14:26:25 +02:00
parent 70ab74b8dc
commit dd96e840d4
7 changed files with 86 additions and 8 deletions

View File

@@ -79,11 +79,13 @@ void main() {
// Build a session
final alicesRatchet = await OmemoDoubleRatchet.initiateNewSession(
spkBob.pk,
ikBob.pk,
resultAlice.sk,
resultAlice.ad,
);
final bobsRatchet = await OmemoDoubleRatchet.acceptNewSession(
spkBob,
ikAlice.pk,
resultBob.sk,
resultBob.ad,
);

View File

@@ -132,5 +132,15 @@ void main() {
bobResponseMessage.encryptedKeys,
);
expect(bobResponseText, aliceReceivedMessage);
// Alice checks the fingerprints
final fingerprints = await aliceSession.getHexFingerprintsForJid(bobJid);
// Check that they the fingerprints are correct
expect(fingerprints.length, 2);
expect(fingerprints[0] != fingerprints[1], true);
// Check that those two calls do not throw an exception
aliceSession
..getRatchet(bobJid, fingerprints[0].deviceId)
..getRatchet(bobJid, fingerprints[1].deviceId);
});
}