aboutsummaryrefslogtreecommitdiff
path: root/xcode/OLMKit/OLMAccount.m
diff options
context:
space:
mode:
authorChris Ballinger <chrisballinger@gmail.com>2016-04-09 14:00:30 -0700
committerChris Ballinger <chrisballinger@gmail.com>2016-04-09 14:00:30 -0700
commitf505113fb7a6d61015ad8050b3fb4e26df029150 (patch)
tree0bdaba8f07189f3adc828c2895ce7429d9b3cb3e /xcode/OLMKit/OLMAccount.m
parent719eb543a8d08c4f536ea7933ffb3af0a8553e87 (diff)
Initial test passing
Diffstat (limited to 'xcode/OLMKit/OLMAccount.m')
-rw-r--r--xcode/OLMKit/OLMAccount.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/xcode/OLMKit/OLMAccount.m b/xcode/OLMKit/OLMAccount.m
index 58dd4ad..d56b6b4 100644
--- a/xcode/OLMKit/OLMAccount.m
+++ b/xcode/OLMKit/OLMAccount.m
@@ -44,7 +44,8 @@
return nil;
}
size_t randomLength = olm_create_account_random_length(_account);
- size_t accountResult = olm_create_account(_account, (void*)[OLMUtility randomBytesOfLength:randomLength].bytes, randomLength);
+ NSMutableData *random = [OLMUtility randomBytesOfLength:randomLength];
+ size_t accountResult = olm_create_account(_account, random.mutableBytes, random.length);
if (accountResult == olm_error()) {
const char *error = olm_account_last_error(_account);
NSLog(@"error creating account: %s", error);
@@ -105,7 +106,8 @@
- (void) generateOneTimeKeys:(NSUInteger)numberOfKeys {
size_t randomLength = olm_account_generate_one_time_keys_random_length(_account, numberOfKeys);
- size_t result = olm_account_generate_one_time_keys(_account, numberOfKeys, (void*)[OLMUtility randomBytesOfLength:randomLength].bytes, randomLength);
+ NSMutableData *random = [OLMUtility randomBytesOfLength:randomLength];
+ size_t result = olm_account_generate_one_time_keys(_account, numberOfKeys, random.mutableBytes, random.length);
if (result == olm_error()) {
const char *error = olm_account_last_error(_account);
NSLog(@"error generating keys: %s", error);