fix OpenSSL usage for py3. Fixes #7915

This commit is contained in:
Yann Leboulanger 2015-01-05 21:45:42 +01:00
parent a5f50372c8
commit e694a9ad9b
1 changed files with 4 additions and 1 deletions

View File

@ -339,7 +339,10 @@ try:
except TypeError: except TypeError:
OpenSSL.rand.load_file(RNG_SEED.encode('utf-8')) OpenSSL.rand.load_file(RNG_SEED.encode('utf-8'))
crypto.add_entropy_sources_OpenSSL() crypto.add_entropy_sources_OpenSSL()
OpenSSL.rand.write_file(str(RNG_SEED)) try:
OpenSSL.rand.write_file(RNG_SEED)
except TypeError:
OpenSSL.rand.write_file(RNG_SEED.encode('utf-8'))
except ImportError: except ImportError:
log.info("PyOpenSSL PRNG not available") log.info("PyOpenSSL PRNG not available")