diff options
author | manuroe <manu@matrix.org> | 2016-12-19 18:10:37 +0100 |
---|---|---|
committer | manuroe <manu@matrix.org> | 2016-12-19 18:10:37 +0100 |
commit | 3540926b98813e5e5daed709f820f06f6f9ac2ae (patch) | |
tree | ebdbbee5946d166159c12546bea3f233233c2412 /xcode/OLMKit/OLMOutboundGroupSession.m | |
parent | aa12cbcac2d9f380847644febdf1f13f102cebb1 (diff) |
OLMKit: Reset intermediate buffers to zeroes
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 d838ebc..a3421fd 100644 --- a/xcode/OLMKit/OLMOutboundGroupSession.m +++ b/xcode/OLMKit/OLMOutboundGroupSession.m @@ -55,6 +55,7 @@ NSMutableData *random = [OLMUtility randomBytesOfLength:olm_init_outbound_group_session_random_length(session)]; size_t result = olm_init_outbound_group_session(session, random.mutableBytes, random.length); + [random resetBytesInRange:NSMakeRange(0, random.length)]; if (result == olm_error()) { const char *error = olm_outbound_group_session_last_error(session); NSLog(@"olm_init_outbound_group_session error: %s", error); @@ -97,6 +98,7 @@ return nil; } NSString *sessionKey = [[NSString alloc] initWithData:sessionKeyData encoding:NSUTF8StringEncoding]; + [sessionKeyData resetBytesInRange:NSMakeRange(0, sessionKeyData.length)]; return sessionKey; } |