[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit c10eb79832f64659978eb948ff5e52ca6d95380b
Author: David Goulet <dgoulet@xxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxx>
---
 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...")



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits