aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2016-09-13 17:54:07 +0100
committerGitHub <noreply@github.com>2016-09-13 17:54:07 +0100
commit1a50a4b3a0bd38326a7f2327df5513072763ba65 (patch)
treefdb86b76d1a1e4a0c92dc2875dd463aac3e75310 /tests
parente0b51971b7bc4cf3bb56b080f5f54296b58b3f0c (diff)
parent71bcaa5d45f63fc9b217937010199030d410f305 (diff)
Merge pull request #22 from matrix-org/markjh/inbound_group_session_id
Add a olm_inbound_group_session_id method
Diffstat (limited to 'tests')
-rw-r--r--tests/test_group_session.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_group_session.cpp b/tests/test_group_session.cpp
index ce889ad..094c744 100644
--- a/tests/test_group_session.cpp
+++ b/tests/test_group_session.cpp
@@ -133,6 +133,26 @@ int main() {
inbound_session, 0U, session_key, session_key_len);
assert_equals((size_t)0, res);
+
+ /* Check the session ids */
+
+ size_t out_session_id_len = olm_outbound_group_session_id_length(session);
+ uint8_t out_session_id[out_session_id_len];
+ assert_equals(out_session_id_len, olm_outbound_group_session_id(
+ session, out_session_id, out_session_id_len
+ ));
+
+ size_t in_session_id_len = olm_inbound_group_session_id_length(
+ inbound_session
+ );
+ uint8_t in_session_id[in_session_id_len];
+ assert_equals(in_session_id_len, olm_inbound_group_session_id(
+ inbound_session, in_session_id, in_session_id_len
+ ));
+
+ assert_equals(in_session_id_len, out_session_id_len);
+ assert_equals(out_session_id, in_session_id, in_session_id_len);
+
/* decode the message */
/* olm_group_decrypt_max_plaintext_length destroys the input so we have to