On Wed, Mar 17, 2010, Mathieu Malaterre wrote:

> On Tue, Mar 16, 2010 at 6:25 PM, Dr. Stephen Henson <[email protected]> wrote:
> > On Tue, Mar 16, 2010, Mathieu Malaterre wrote:
> >
> >> Hi there,
> >>
> >>  I am looking at an old piece of code:
> >>
> >> http://cpansearch.perl.org/src/SAMPO/smime-0.7/smimeutil.c
> >>
> >> ...
> >> #ifdef WINDOWS
> >>   LOG_PRINT("RAND_screen...");
> >>   RAND_screen(); /* Loading video display memory into random state */
> >> #endif
> >> ...
> >>
> >>   And I was wondering why RAND_screen was being called only on windows ?
> >>
> >
> > It was used at one point for PRNG seeding. Now OpenSSL gathers entropy from 
> > a
> > number of OS specific sources and doesn't need the explicit call any more.
> 
> What do you mean 'doesn't anymore' ? I am looking at openssl 0.9.8m
> and it reveal:
> 
> cat ./apps/smime.c
> ...
>       else if (operation == SMIME_ENCRYPT)
>               {
> ...
>               need_rand = 1;
>               }
> ...
>       if (need_rand)
>               {
>               app_RAND_load_file(NULL, bio_err, (inrand != NULL));
> ...
> 
> which in turn:
> 
> cat apps/app_rand.c
> ...
> int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
>   {
>   int consider_randfile = (file == NULL);
>   char buffer[200];
> 
> #ifdef OPENSSL_SYS_WINDOWS
>   BIO_printf(bio_e,"Loading 'screen' into random state -");
>   BIO_flush(bio_e);
>   RAND_screen();
>   BIO_printf(bio_e," done\n");
> #endif
> ...
> 
> Did I misunderstood something ? This is still in use in 0.9.8m, right
> ? Should I use another function instead ?
> 

Well that call doesn't do any harm but it's just a legacy. It isn't needed any
more.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [email protected]

Reply via email to