Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matrix-org
Olm
Commits
c144d3fe
Commit
c144d3fe
authored
Nov 07, 2016
by
pedroGitt
Browse files
Update test02AliceToBobBackAndForth() with a last sequence where Alice encrypts and Bob decrypts
parent
59bb145c
Changes
1
Hide whitespace changes
Inline
Side-by-side
java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmSessionTest.java
View file @
c144d3fe
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment