improve return code check on RAND_bytes call

git-svn-id: http://encfs.googlecode.com/svn/trunk@25 db9cf616-1c43-0410-9cb8-a902689de0d6
This commit is contained in:
Valient Gough 2008-05-15 17:03:09 +00:00
parent 475658a255
commit e1d997fb9e

View File

@ -404,7 +404,7 @@ CipherKey SSL_Cipher::newRandomKey()
unsigned char tmpBuf[ bufLen ];
// to avoid warnings of uninitialized data from valgrind
memset(tmpBuf, 0, sizeof(tmpBuf));
if(RAND_bytes( tmpBuf, bufLen ) == 0)
if(RAND_bytes( tmpBuf, bufLen ) != 1)
{
char errStr[120]; // specs require string at least 120 bytes long..
unsigned long errVal = 0;