From e1d997fb9e580d5f444364cb3031b585803ebf12 Mon Sep 17 00:00:00 2001 From: Valient Gough Date: Thu, 15 May 2008 17:03:09 +0000 Subject: [PATCH] improve return code check on RAND_bytes call git-svn-id: http://encfs.googlecode.com/svn/trunk@25 db9cf616-1c43-0410-9cb8-a902689de0d6 --- encfs/SSL_Cipher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encfs/SSL_Cipher.cpp b/encfs/SSL_Cipher.cpp index f65e468..100f11d 100644 --- a/encfs/SSL_Cipher.cpp +++ b/encfs/SSL_Cipher.cpp @@ -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;