diff options
Diffstat (limited to 'xcode/OLMKit')
-rw-r--r-- | xcode/OLMKit/OLMInboundGroupSession.h | 2 | ||||
-rw-r--r-- | xcode/OLMKit/OLMInboundGroupSession.m | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/xcode/OLMKit/OLMInboundGroupSession.h b/xcode/OLMKit/OLMInboundGroupSession.h index a507490..46de3a0 100644 --- a/xcode/OLMKit/OLMInboundGroupSession.h +++ b/xcode/OLMKit/OLMInboundGroupSession.h @@ -24,6 +24,6 @@ - (NSString*)sessionIdentifier; /** base64 ciphertext -> UTF-8 plaintext */ -- (NSString*)decryptMessage:(NSString*)message; +- (NSString*)decryptMessage:(NSString*)message messageIndex:(NSUInteger*)messageIndex; @end diff --git a/xcode/OLMKit/OLMInboundGroupSession.m b/xcode/OLMKit/OLMInboundGroupSession.m index d95d1ab..ea79e14 100644 --- a/xcode/OLMKit/OLMInboundGroupSession.m +++ b/xcode/OLMKit/OLMInboundGroupSession.m @@ -79,7 +79,7 @@ return idString; } -- (NSString *)decryptMessage:(NSString *)message +- (NSString *)decryptMessage:(NSString *)message messageIndex:(NSUInteger*)messageIndex { NSParameterAssert(message != nil); NSData *messageData = [message dataUsingEncoding:NSUTF8StringEncoding]; @@ -96,7 +96,7 @@ // 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); + size_t plaintextLength = olm_group_decrypt(session, mutMessage.mutableBytes, mutMessage.length, plaintextData.mutableBytes, plaintextData.length, messageIndex); if (plaintextLength == olm_error()) { const char *error = olm_inbound_group_session_last_error(session); NSAssert(NO, @"olm_group_decrypt error: %s", error); |