From 3540926b98813e5e5daed709f820f06f6f9ac2ae Mon Sep 17 00:00:00 2001 From: manuroe Date: Mon, 19 Dec 2016 18:10:37 +0100 Subject: OLMKit: Reset intermediate buffers to zeroes --- xcode/OLMKit/OLMOutboundGroupSession.m | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xcode/OLMKit/OLMOutboundGroupSession.m') 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; } -- cgit v1.2.3