changeset 028705b6a08f in /home/hg/repos/gajim
author: Fedor Brunner fedor.brunner@azet.sk branches: gajim_0.16 details:http://hg.gajim.org/gajim?cmd=changeset;node=028705b6a08f description: Update entropy gathering for interface changes of pyOpenSSL. Fixes: #7642
diffstat:
src/common/crypto.py | 20 ++++++++++---------- src/gajim.py | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-)
diffs (42 lines):
diff -r e7666c925c22 -r 028705b6a08f src/common/crypto.py --- a/src/common/crypto.py Thu Jan 30 14:19:37 2014 +0100 +++ b/src/common/crypto.py Thu Jan 30 17:17:25 2014 +0100 @@ -98,16 +98,16 @@ dirs = ['/proc', '/proc/net', '/proc/self'] for d in dirs: if os.access(d, os.R_OK): - for filename in os.listdir(d): - OpenSSL.rand.add(filename, 0) - try: - with open(d + os.sep + filename, "r") as fp: - # Limit the ammount of read bytes, in case a memory - # file was opened - OpenSSL.rand.add(str(fp.read(5000)), 0.01) - except: - # Ignore all read and access errors - pass + for filename in os.listdir(d): + OpenSSL.rand.add(filename, 0) + try: + with open(d + os.sep + filename, "r") as fp: + # Limit the ammount of read bytes, in case a memory + # file was opened + OpenSSL.rand.add(str(fp.read(5000)), 1) + except IOError: + # Ignore all read and access errors + pass
PYOPENSSL_PRNG_PRESENT = False try: diff -r e7666c925c22 -r 028705b6a08f src/gajim.py --- a/src/gajim.py Thu Jan 30 14:19:37 2014 +0100 +++ b/src/gajim.py Thu Jan 30 17:17:25 2014 +0100 @@ -463,7 +463,7 @@ def on_exit(): # Save the entropy from OpenSSL PRNG if PYOPENSSL_PRNG_PRESENT: - OpenSSL.rand.write_file(RNG_SEED) + OpenSSL.rand.write_file(str(RNG_SEED)) # delete pid file on normal exit if os.path.exists(pid_filename): os.remove(pid_filename)