* autoload.cc (CryptAcquireContextW): Remove.
(CryptGenRandom): Remove. (CryptReleaseContext): Remove. (SystemFunction036): Define. Add comment to explain that this is actually the RtlGenRandom function. * fhandler.h (class fhandler_dev_random): Drop crypt_prov member. (fhandler_dev_random::fhandler_dev_random): Define inline. (fhandler_dev_random::dup): Drop declaration. * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Remove here. (fhandler_dev_random::crypt_gen_random): Use RtlGenRandom to drop dependency to old Crypto API. (fhandler_dev_random::read): Implement an enhanced version of reading random bytes from RtlGenRandom for the sake of a better /dev/random emulation. (fhandler_dev_random::close): Just return 0 since crypt_prov doesn't exisyt anymore. (fhandler_dev_random::dup): Drop entirely for the same reason.
This commit is contained in:
@ -1652,7 +1652,6 @@ class fhandler_dev_zero: public fhandler_base
|
||||
class fhandler_dev_random: public fhandler_base
|
||||
{
|
||||
protected:
|
||||
HCRYPTPROV crypt_prov;
|
||||
uint32_t pseudo;
|
||||
off_t dummy_offset;
|
||||
|
||||
@ -1661,14 +1660,13 @@ class fhandler_dev_random: public fhandler_base
|
||||
int pseudo_read (void *ptr, size_t len);
|
||||
|
||||
public:
|
||||
fhandler_dev_random ();
|
||||
int open (int flags, mode_t mode = 0);
|
||||
ssize_t __stdcall write (const void *ptr, size_t len);
|
||||
void __reg3 read (void *ptr, size_t& len);
|
||||
off_t lseek (off_t offset, int whence);
|
||||
int close ();
|
||||
int dup (fhandler_base *child, int);
|
||||
|
||||
fhandler_dev_random () : fhandler_base () {}
|
||||
fhandler_dev_random (void *) {}
|
||||
|
||||
void copyto (fhandler_base *x)
|
||||
|
Reference in New Issue
Block a user