aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2016-10-20 09:58:55 +0100
committerMark Haines <mjark@negativecurvature.net>2016-10-20 09:58:55 +0100
commit653790eacbf7dcf94cbf181657cdb0c30c890c3f (patch)
tree6cf8ca49bff13c01d18c15cd8e1a5e53c1cf9167 /tests
parent6ea9fb450ec1ef10b32d65ceb00a6042b927a95c (diff)
Return the message index when decrypting group messages.
Applications can use the index to detect replays of the same message.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_group_session.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_group_session.cpp b/tests/test_group_session.cpp
index 9930927..b15875c 100644
--- a/tests/test_group_session.cpp
+++ b/tests/test_group_session.cpp
@@ -161,8 +161,9 @@ int main() {
memcpy(msgcopy, msg, msglen);
size = olm_group_decrypt_max_plaintext_length(inbound_session, msgcopy, msglen);
uint8_t plaintext_buf[size];
+ uint32_t message_index;
res = olm_group_decrypt(inbound_session, msg, msglen,
- plaintext_buf, size);
+ plaintext_buf, size, &message_index);
assert_equals(plaintext_length, res);
assert_equals(plaintext, plaintext_buf, res);
}
@@ -208,8 +209,9 @@ int main() {
memcpy(msgcopy, message, msglen);
uint8_t plaintext_buf[size];
+ uint32_t message_index;
res = olm_group_decrypt(
- inbound_session, msgcopy, msglen, plaintext_buf, size
+ inbound_session, msgcopy, msglen, plaintext_buf, size, &message_index
);
assert_equals(plaintext_length, res);
assert_equals(plaintext, plaintext_buf, res);
@@ -227,7 +229,7 @@ int main() {
memcpy(msgcopy, message, msglen);
res = olm_group_decrypt(
inbound_session, msgcopy, msglen,
- plaintext_buf, size
+ plaintext_buf, size, &message_index
);
assert_equals((size_t)-1, res);
assert_equals(