Nmap Development mailing list archives

Re: [PATCH] No need to seed the RNG with srand() in nbase/nbase_rnd.c


From: Fyodor <fyodor () insecure org>
Date: Mon, 21 Aug 2006 18:51:13 -0700

On Mon, Aug 21, 2006 at 01:41:00PM -0500, Kris Katterjohn wrote:
OpenSSL isn't used for the random numbers anymore, so this comment will
only be confusing later on.

Thanks, removed.

The "normal" random number generator is seeded with srand() in main() in
main.cc so it doesn't need to be done again in nbase/nbase_rnd.c (unless
I'm missing something?). They both seed it the same way.

Good point, though I actually don't mind this duplication.  We need it
in nbase because other users of the library (nmapfe, etc.) might not
do their own srand().  And I don't mind having it in Nmap just to be
on the safe side in case someone was to add a rand() or similar call
before the first Nbase get_random_* call.  Nmap does have some rand()
calls (though I should probably get rid of them).

Cheers,
-F

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: