summaryrefslogtreecommitdiff
path: root/paramiko/common.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-03-29 19:22:36 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2014-03-29 19:22:36 -0700
commit6f211115f49edcea7d23b764d7cf3a84ff12f5f0 (patch)
tree093859d4a75d3ccb361974439f61a01e7dc2b2b4 /paramiko/common.py
parent5a430def22aa5cbd755f347c8714e4140d6cdcab (diff)
downloadparamiko-6f211115f49edcea7d23b764d7cf3a84ff12f5f0.tar.gz
Switch from using PyCrypto's Random to using os.urandom.
There's several reasons for this change: 1) It's faster for reads up to 1024 bytes (nearly 10x faster for 16 byte reads) 2) It receives considerably more security review since it's in the kernel. 3) It's yet another step towards running on PyPy. 4) Using userspace CSPRNGs is considered something of an anti-pattern. See: http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/ http://webcache.googleusercontent.com/search?q=cache:2nTvpCgKZXIJ:www.2uo.de/myths-about-urandom/+&cd=3&hl=en&ct=clnk&gl=us
Diffstat (limited to 'paramiko/common.py')
-rw-r--r--paramiko/common.py5
1 files changed, 0 insertions, 5 deletions
diff --git a/paramiko/common.py b/paramiko/common.py
index 9a5e2ee1..18298922 100644
--- a/paramiko/common.py
+++ b/paramiko/common.py
@@ -126,11 +126,6 @@ CONNECTION_FAILED_CODE = {
DISCONNECT_SERVICE_NOT_AVAILABLE, DISCONNECT_AUTH_CANCELLED_BY_USER, \
DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE = 7, 13, 14
-from Crypto import Random
-
-# keep a crypto-strong PRNG nearby
-rng = Random.new()
-
zero_byte = byte_chr(0)
one_byte = byte_chr(1)
four_byte = byte_chr(4)