Commit 28c6ea4a authored by fedor.brunner's avatar fedor.brunner

Fix changes in interface of pyOpenSSL.

Fixes: #7642
parent e80b9786
......@@ -87,7 +87,7 @@ def add_entropy_sources_OpenSSL():
os.environ, os.getcwd(), os.getpid()]
for s in sources:
OpenSSL.rand.add(str(s), 0.01)
OpenSSL.rand.add(str(s), 1)
# On Windows add the current contents of the screen to the PRNG state.
if os.name == 'nt':
......
......@@ -119,7 +119,7 @@ def get_context(fingerprint, verify_cb=None, remote_jid=None):
dh_params_name = os.path.join(gajim.MY_CERT_DIR, DH_PARAMS)
try:
with open(dh_params_name, "r") as dh_params_file:
ctx.load_tmp_dh(dh_params_name)
ctx.load_tmp_dh(str(dh_params_name))
except IOError as err:
log.warn('Unable to load DH parameter file: %s. You should generate it '
'by using this command : "openssl dhparam 4096 -out '
......@@ -129,7 +129,7 @@ def get_context(fingerprint, verify_cb=None, remote_jid=None):
'other', DEFAULT_DH_PARAMS)
try:
with open(default_dh_params_name, "r") as default_dh_params_file:
ctx.load_tmp_dh(default_dh_params_name)
ctx.load_tmp_dh(str(default_dh_params_name))
except IOError as err:
log.error('Unable to load default DH parameter file: %s , %s'
% (default_dh_params_name, err))
......
......@@ -310,7 +310,7 @@ try:
from common import crypto
PYOPENSSL_PRNG_PRESENT = True
# Seed from file
OpenSSL.rand.load_file(RNG_SEED)
OpenSSL.rand.load_file(str(RNG_SEED))
crypto.add_entropy_sources_OpenSSL()
except ImportError:
log.info("PyOpenSSL PRNG not available")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment