patch-encfs_openssl_cpp 608 B

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