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/session.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'python/olm/session.py') diff --git a/python/olm/session.py b/python/olm/session.py index 19d43d3..ff733b3 100644 --- a/python/olm/session.py +++ b/python/olm/session.py @@ -1,3 +1,5 @@ +from os import urandom + from ._base import * @@ -103,7 +105,7 @@ class Session(object): def create_outbound(self, account, identity_key, one_time_key): r_length = lib.olm_create_outbound_session_random_length(self.ptr) - random = read_random(r_length) + random = urandom(r_length) random_buffer = create_string_buffer(random) identity_key_buffer = create_string_buffer(identity_key) one_time_key_buffer = create_string_buffer(one_time_key) @@ -157,7 +159,7 @@ class Session(object): def encrypt(self, plaintext): r_length = lib.olm_encrypt_random_length(self.ptr) - random = read_random(r_length) + random = urandom(r_length) random_buffer = create_string_buffer(random) message_type = lib.olm_encrypt_message_type(self.ptr) -- cgit v1.2.3