diff options
author | J08nY <johny@neuromancer.sk> | 2017-04-02 00:35:55 +0200 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2017-04-04 10:45:11 +0100 |
commit | 001dc1edaa4c5306fbb7c625202788458dadeafa (patch) | |
tree | ef9201b107d717c34b19f3fb9d4dca56d0fa32fe /python/olm/account.py | |
parent | bb05b5687f12782cc2e87ffdf2dc0dfe0f6dcfb6 (diff) |
Python: Switch to a more general os.urandom for randomness source
Signed-off-by: Jan Jancar <johny@neuromancer.sk>
Diffstat (limited to 'python/olm/account.py')
-rw-r--r-- | python/olm/account.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/python/olm/account.py b/python/olm/account.py index 3fa1049..e2dcca2 100644 --- a/python/olm/account.py +++ b/python/olm/account.py @@ -1,4 +1,5 @@ import json +from os import urandom from ._base import * @@ -58,7 +59,7 @@ class Account(object): def create(self): random_length = lib.olm_create_account_random_length(self.ptr) - random = read_random(random_length) + random = urandom(random_length) random_buffer = create_string_buffer(random) lib.olm_create_account(self.ptr, random_buffer, random_length) @@ -112,7 +113,7 @@ class Account(object): random_length = lib.olm_account_generate_one_time_keys_random_length( self.ptr, count ) - random = read_random(random_length) + random = urandom(random_length) random_buffer = create_string_buffer(random) lib.olm_account_generate_one_time_keys( self.ptr, count, random_buffer, random_length |