From: Crispin F. <cr...@th...> - 2003-05-23 15:37:00
|
On Fri, 2003-05-23 at 15:22, Steve G wrote: > Hello, > > I've been doing some testing of daemon's using valgrind. > I've run across a problem with valgrind and have created a > simple test program. I've tried several different versions > of valgrind including cvs. > > I've attached a program that can be compiled as: > > gcc -o ssltest ssltest.c -lcrypto This is a known problem in openssl. It uses uninitialzed data to generate random numbers. The dodgy code is in md_rand.c (search for PURIFY). See: http://www.mail-archive.com/ope...@op.../msg15497.html (just for reference, your test program can be shortened as follows (making use of the very useful VALGRIND_* macros) #include <openssl/rand.h> #include <openssl/err.h> #include <valgrind/memcheck.h> int main(void) { unsigned char rand_buf[20]; if (!RAND_bytes(rand_buf, sizeof(rand_buf))) printf("Couldn't obtain random bytes" ); VALGRIND_CHECK_READABLE( rand_buf, sizeof( rand_buf ) ); return 0; } Crispin |