aboutsummaryrefslogtreecommitdiff
path: root/xcode/OLMKit/OLMInboundGroupSession.m
diff options
context:
space:
mode:
authormanuroe <manu@matrix.org>2016-11-14 17:02:56 +0100
committermanuroe <manu@matrix.org>2016-11-14 17:02:56 +0100
commitbc697bf5e2ddbad947aec65533d41514592ca093 (patch)
treea27946a24bbb675bdce510e11617171adf83f754 /xcode/OLMKit/OLMInboundGroupSession.m
parentcf66af6f2e7c69a3e0712317f8473ab09711d426 (diff)
OLMKit: Fixed type-cast of messageIndex of [OLMInboundGroupSession decryptMessage] for 32 and 64bits platforms
Diffstat (limited to 'xcode/OLMKit/OLMInboundGroupSession.m')
-rw-r--r--xcode/OLMKit/OLMInboundGroupSession.m10
1 files changed, 9 insertions, 1 deletions
diff --git a/xcode/OLMKit/OLMInboundGroupSession.m b/xcode/OLMKit/OLMInboundGroupSession.m
index 5e108a1..32e1376 100644
--- a/xcode/OLMKit/OLMInboundGroupSession.m
+++ b/xcode/OLMKit/OLMInboundGroupSession.m
@@ -118,7 +118,9 @@
// message buffer is destroyed by olm_group_decrypt_max_plaintext_length
mutMessage = messageData.mutableCopy;
NSMutableData *plaintextData = [NSMutableData dataWithLength:maxPlaintextLength];
- size_t plaintextLength = olm_group_decrypt(session, mutMessage.mutableBytes, mutMessage.length, plaintextData.mutableBytes, plaintextData.length, messageIndex);
+
+ uint32_t message_index;
+ size_t plaintextLength = olm_group_decrypt(session, mutMessage.mutableBytes, mutMessage.length, plaintextData.mutableBytes, plaintextData.length, &message_index);
if (plaintextLength == olm_error()) {
const char *olm_error = olm_inbound_group_session_last_error(session);
@@ -137,6 +139,12 @@
}
plaintextData.length = plaintextLength;
NSString *plaintext = [[NSString alloc] initWithData:plaintextData encoding:NSUTF8StringEncoding];
+
+ if (messageIndex)
+ {
+ *messageIndex = message_index;
+ }
+
return plaintext;
}