1234567891011121314151617 |
- $OpenBSD: patch-encfs_openssl_cpp,v 1.1.1.1 2014/01/17 10:10:58 stsp Exp $
- --- encfs/openssl.cpp.orig Sun Nov 29 23:04:12 2009
- +++ encfs/openssl.cpp Thu Jan 16 14:13:07 2014
- @@ -78,8 +78,10 @@ void openssl_init(bool threaded)
- SSL_library_init();
-
- unsigned int randSeed = 0;
- - RAND_bytes( (unsigned char*)&randSeed, sizeof(randSeed) );
- - srand( randSeed );
- + if (RAND_bytes( (unsigned char*)&randSeed, sizeof(randSeed)) == 1)
- + srand( randSeed );
- + else
- + srand( arc4random() );
-
- #ifndef OPENSSL_NO_ENGINE
- /* Load all bundled ENGINEs into memory and make them visible */
|