From e5b9cee8681dc45340321f759079b344a3b2676c Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Thu, 7 Feb 2019 15:24:56 +0100 Subject: Windows: Add option to enable use of CPU RDRAND/RDSEED as source of entropy which is now disabled by default --- src/Common/Crypto.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/Common/Crypto.c') diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c index 299595bd..a6f3ffb7 100644 --- a/src/Common/Crypto.c +++ b/src/Common/Crypto.c @@ -1216,3 +1216,29 @@ BOOL IsHwEncryptionEnabled () } #endif // !TC_WINDOWS_BOOT + +#ifndef TC_WINDOWS_BOOT + +static BOOL CpuRngDisabled = FALSE; + +BOOL IsCpuRngSupport () +{ + if (HasRDSEED() || HasRDSEED()) + return TRUE; + else + return FALSE; +} + +void EnableCpuRng (BOOL enable) +{ + CpuRngDisabled = !enable; +} + +BOOL IsCpuRngEnabled () +{ + return !CpuRngDisabled; +} + + +#endif + -- cgit v1.2.3