Don't use buffered fread() to read from DEVRANDOM,
[openssl.git] / crypto / rand / md_rand.c
index 7943861..ce90175 100644 (file)
@@ -327,6 +327,7 @@ static void ssleay_rand_initialize(void)
                unsigned char tmpbuf[ENTROPY_NEEDED];
                int n;
                
+               setvbuf(fh, NULL, _IONBF, 0);
                n=fread((unsigned char *)tmpbuf,1,ENTROPY_NEEDED,fh);
                fclose(fh);
                RAND_add(tmpbuf,sizeof tmpbuf,n);