The use of the PURIFY macro in ssleay_rand_bytes() is sufficient to

resolve the Valgrind issue with random numbers. Undo the changes to
RAND_bytes() and RAND_pseudo_bytes() that are redundant in this
respect.
Update documentation and FAQ accordingly, as the PURIFY macro is
available at least since 0.9.7.
This commit is contained in:
Lutz Jänicke
2007-09-21 10:10:47 +00:00
parent 48ca0c99b2
commit 29f4b05954
3 changed files with 1 additions and 9 deletions

View File

@@ -154,9 +154,6 @@ void RAND_add(const void *buf, int num, double entropy)
int RAND_bytes(unsigned char *buf, int num)
{
const RAND_METHOD *meth = RAND_get_rand_method();
#ifdef PURIFY
memset(buf, 0, num);
#endif
if (meth && meth->bytes)
return meth->bytes(buf,num);
return(-1);
@@ -165,9 +162,6 @@ int RAND_bytes(unsigned char *buf, int num)
int RAND_pseudo_bytes(unsigned char *buf, int num)
{
const RAND_METHOD *meth = RAND_get_rand_method();
#ifdef PURIFY
memset(buf, 0, num);
#endif
if (meth && meth->pseudorand)
return meth->pseudorand(buf,num);
return(-1);