aboutsummaryrefslogtreecommitdiff
path: root/src/inbound_group_session.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/inbound_group_session.c')
-rw-r--r--src/inbound_group_session.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/inbound_group_session.c b/src/inbound_group_session.c
index bf00008..a54e55f 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,10 @@ static size_t _decrypt(
return (size_t)-1;
}
+ if (message_index != NULL) {
+ *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 +354,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 +367,8 @@ size_t olm_group_decrypt(
return _decrypt(
session, message, raw_message_length,
- plaintext, max_plaintext_length
+ plaintext, max_plaintext_length,
+ message_index
);
}