diff options
author | manuroe <manuroe@users.noreply.github.com> | 2018-10-22 08:25:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-22 08:25:41 +0200 |
commit | 2784e495957ee96c7ce2e44eea77e02085868680 (patch) | |
tree | 7f6195575045bb25d7cae37baa3154d95023bbd2 /xcode/OLMKit/OLMOutboundGroupSession.m | |
parent | 2cace25fba3d0606540f0c187f77f3b979af195b (diff) | |
parent | cc9a97f0cb14009409ad66c189402b6b50f873e2 (diff) |
Merge pull request #70 from matrix-org/manuroe/objc_pk
OLMKit: Add objc wrappers for pk encryption/decryption
Diffstat (limited to 'xcode/OLMKit/OLMOutboundGroupSession.m')
-rw-r--r-- | xcode/OLMKit/OLMOutboundGroupSession.m | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xcode/OLMKit/OLMOutboundGroupSession.m b/xcode/OLMKit/OLMOutboundGroupSession.m index a3421fd..a0a7cc6 100644 --- a/xcode/OLMKit/OLMOutboundGroupSession.m +++ b/xcode/OLMKit/OLMOutboundGroupSession.m @@ -148,6 +148,7 @@ } NSMutableData *pickle = [serializedData dataUsingEncoding:NSUTF8StringEncoding].mutableCopy; size_t result = olm_unpickle_outbound_group_session(session, key.bytes, key.length, pickle.mutableBytes, pickle.length); + [pickle resetBytesInRange:NSMakeRange(0, pickle.length)]; if (result == olm_error()) { const char *olm_error = olm_outbound_group_session_last_error(session); NSString *errorString = [NSString stringWithUTF8String:olm_error]; @@ -174,6 +175,7 @@ return nil; } NSString *pickleString = [[NSString alloc] initWithData:pickled encoding:NSUTF8StringEncoding]; + [pickled resetBytesInRange:NSMakeRange(0, pickled.length)]; return pickleString; } |