From 001dc1edaa4c5306fbb7c625202788458dadeafa Mon Sep 17 00:00:00 2001 From: J08nY Date: Sun, 2 Apr 2017 00:35:55 +0200 Subject: Python: Switch to a more general os.urandom for randomness source Signed-off-by: Jan Jancar --- python/olm/account.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'python/olm/account.py') 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 -- cgit v1.2.3