aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/inbound_group_session.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/inbound_group_session.c b/src/inbound_group_session.c
index bf00008..ed313a0 100644
--- a/src/inbound_group_session.c
+++ b/src/inbound_group_session.c
@@ -263,7 +263,8 @@ size_t olm_group_decrypt_max_plaintext_length(
static size_t _decrypt(
OlmInboundGroupSession *session,
uint8_t * message, size_t message_length,
- uint8_t * plaintext, size_t max_plaintext_length
+ uint8_t * plaintext, size_t max_plaintext_length,
+ uint32_t * message_index
) {
struct _OlmDecodeGroupMessageResults decoded_results;
size_t max_length, r;
@@ -286,6 +287,8 @@ static size_t _decrypt(
return (size_t)-1;
}
+ *message_index = decoded_results.message_index;
+
/* verify the signature. We could do this before decoding the message, but
* we allow for the possibility of future protocol versions which use a
* different signing mechanism; we would rather throw "BAD_MESSAGE_VERSION"
@@ -349,7 +352,8 @@ static size_t _decrypt(
size_t olm_group_decrypt(
OlmInboundGroupSession *session,
uint8_t * message, size_t message_length,
- uint8_t * plaintext, size_t max_plaintext_length
+ uint8_t * plaintext, size_t max_plaintext_length,
+ uint32_t * message_index
) {
size_t raw_message_length;
@@ -361,7 +365,8 @@ size_t olm_group_decrypt(
return _decrypt(
session, message, raw_message_length,
- plaintext, max_plaintext_length
+ plaintext, max_plaintext_length,
+ message_index
);
}