]> granicus.if.org Git - python/commit
Expose three OpenSSL API calls for dealing with the PRNG.
authorJeremy Hylton <jeremy@alum.mit.edu>
Thu, 18 Oct 2001 00:28:50 +0000 (00:28 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Thu, 18 Oct 2001 00:28:50 +0000 (00:28 +0000)
commitde80f2efb5c189a9e709651af99e495b2a578b5a
treedc0eb0291bbd137b96cbb58f589279b2988083f9
parent5449e08412a5abd83c21d59764ef6240c58872b0
Expose three OpenSSL API calls for dealing with the PRNG.

Quoth the OpenSSL RAND_add man page:

    OpenSSL makes sure that the PRNG state is unique for each
    thread. On systems that provide /dev/urandom, the
    randomness device is used to seed the PRNG transparently.
    However, on all other systems, the application is
    responsible for seeding the PRNG by calling RAND_add(),
    RAND_egd(3) or RAND_load_file(3).

I decided to expose RAND_add() because it's general and RAND_egd()
because it's a useful special case.  RAND_load_file() didn't seem to
offer much over RAND_add(), so I skipped it.  Also supplied
RAND_status() which returns true if the PRNG is seeded and false if
not.
Modules/socketmodule.c