diff options
author | pedroGitt <pedro.contreiras@amdocs.com> | 2016-11-07 11:40:23 +0100 |
---|---|---|
committer | pedroGitt <pedro.contreiras@amdocs.com> | 2016-11-07 11:40:23 +0100 |
commit | c144d3fec5f135319a6b46bc5645f7e70eecc1da (patch) | |
tree | 81db09d0a64fb339ee2035e5385a155b344b98de /java/android | |
parent | 59bb145ceb0b703e8124fb44b75e85a48a2caed3 (diff) |
Update test02AliceToBobBackAndForth() with a last sequence where Alice encrypts and Bob decrypts
Diffstat (limited to 'java/android')
-rw-r--r-- | java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmSessionTest.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmSessionTest.java b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmSessionTest.java index 99127e1..2494c80 100644 --- a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmSessionTest.java +++ b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmSessionTest.java @@ -159,6 +159,8 @@ public class OlmSessionTest { * - bob decrypts the encrypted message with its own session * - bob encrypts messages with its own session * - alice decrypts bob's messages with its own message + * - alice encrypts a message + * - bob decrypts the encrypted message */ @Test public void test02AliceToBobBackAndForth() { @@ -245,14 +247,22 @@ public class OlmSessionTest { String decryptedMsg3 = aliceSession.decryptMessage(encryptedMsg3); assertNotNull(decryptedMsg3); - // and one more form alice.. - encryptedMsg1 = aliceSession.encryptMessage(clearMsg1); - // comparison tests assertTrue(clearMsg1.equals(decryptedMsg1)); assertTrue(clearMsg2.equals(decryptedMsg2)); assertTrue(clearMsg3.equals(decryptedMsg3)); + // and one more from alice to bob + clearMsg1 = "another message from Alice to Bob!!"; + encryptedMsg1 = aliceSession.encryptMessage(clearMsg1); + assertNotNull(encryptedMsg1); + decryptedMsg1 = bobSession.decryptMessage(encryptedMsg1); + assertNotNull(decryptedMsg1); + assertTrue(clearMsg1.equals(decryptedMsg1)); + + // comparison test + assertTrue(clearMsg1.equals(decryptedMsg1)); + // clean objects.. assertTrue(0==bobAccount.removeOneTimeKeysForSession(bobSession)); bobAccount.releaseAccount(); |