[tor-commits] [bridgedb/develop] Remove deprecated OpenSSL.rand.bytes()

phw at torproject.org phw at torproject.org
Tue May 21 00:46:35 UTC 2019


commit c10eb79832f64659978eb948ff5e52ca6d95380b
Author: David Goulet <dgoulet at torproject.org>
Date:   Tue Feb 26 13:41:48 2019 -0500

    Remove deprecated OpenSSL.rand.bytes()
    
    "OpenSSL.rand is deprecated - you should use os.urandom instead"
    
    Signed-off-by: David Goulet <dgoulet at torproject.org>
---
 bridgedb/crypto.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bridgedb/crypto.py b/bridgedb/crypto.py
index 13af305..ac2e3ec 100644
--- a/bridgedb/crypto.py
+++ b/bridgedb/crypto.py
@@ -200,7 +200,7 @@ def getKey(filename):
         fh = open(filename, 'rb')
     except IOError:
         logging.debug("getKey(): Creating new secret key.")
-        key = OpenSSL.rand.bytes(32)
+        key = os.urandom(32)
         writeKeyToFile(key, filename)
     else:
         logging.debug("getKey(): Secret key file found. Loading...")





More information about the tor-commits mailing list