aboutsummaryrefslogtreecommitdiff
path: root/xcode/OLMKit/OLMAccount.m
diff options
context:
space:
mode:
authormanuroe <manu@matrix.org>2016-12-19 18:10:37 +0100
committermanuroe <manu@matrix.org>2016-12-19 18:10:37 +0100
commit3540926b98813e5e5daed709f820f06f6f9ac2ae (patch)
treeebdbbee5946d166159c12546bea3f233233c2412 /xcode/OLMKit/OLMAccount.m
parentaa12cbcac2d9f380847644febdf1f13f102cebb1 (diff)
OLMKit: Reset intermediate buffers to zeroes
Diffstat (limited to 'xcode/OLMKit/OLMAccount.m')
-rw-r--r--xcode/OLMKit/OLMAccount.m2
1 files changed, 2 insertions, 0 deletions
diff --git a/xcode/OLMKit/OLMAccount.m b/xcode/OLMKit/OLMAccount.m
index 2f30fb6..af1e308 100644
--- a/xcode/OLMKit/OLMAccount.m
+++ b/xcode/OLMKit/OLMAccount.m
@@ -66,6 +66,7 @@
size_t randomLength = olm_create_account_random_length(_account);
NSMutableData *random = [OLMUtility randomBytesOfLength:randomLength];
size_t accountResult = olm_create_account(_account, random.mutableBytes, random.length);
+ [random resetBytesInRange:NSMakeRange(0, random.length)];
if (accountResult == olm_error()) {
const char *error = olm_account_last_error(_account);
NSLog(@"error creating account: %s", error);
@@ -147,6 +148,7 @@
size_t randomLength = olm_account_generate_one_time_keys_random_length(_account, numberOfKeys);
NSMutableData *random = [OLMUtility randomBytesOfLength:randomLength];
size_t result = olm_account_generate_one_time_keys(_account, numberOfKeys, random.mutableBytes, random.length);
+ [random resetBytesInRange:NSMakeRange(0, random.length)];
if (result == olm_error()) {
const char *error = olm_account_last_error(_account);
NSLog(@"error generating keys: %s", error);