* fhandler.h (class fhandler_dev_random): Add members for managing

pseudo randomness.
        * fhandler_random.cc: Rearrange. Use pseudo random number generator
        as entropy source if system entropy isn't available and if device is
        used as /dev/urandom. Allow initializing device by calling write().
This commit is contained in:
Corinna Vinschen
2000-07-24 11:33:02 +00:00
parent 5b7d5241fe
commit 9602ffc30b
3 changed files with 100 additions and 16 deletions

View File

@ -743,6 +743,11 @@ class fhandler_dev_random: public fhandler_base
protected:
int unit;
HCRYPTPROV crypt_prov;
long pseudo;
BOOL crypt_gen_random (void *ptr, size_t len);
int pseudo_write (const void *ptr, size_t len);
int pseudo_read (void *ptr, size_t len);
public:
fhandler_dev_random (const char *name, int unit);