mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 02:58:02 -06:00
Disable both RDRAND and RDSEED if a failure is detected
This commit is contained in:
@@ -397,6 +397,19 @@ void DetectX86Features()
|
||||
)
|
||||
{
|
||||
g_hasRDRAND = 0;
|
||||
g_hasRDSEED = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (g_hasRDSEED)
|
||||
{
|
||||
if ( RDSEED_getBytes ((unsigned char*) cpuid, sizeof (cpuid))
|
||||
&& (cpuid[0] == 0xFFFFFFFF) && (cpuid[1] == 0xFFFFFFFF)
|
||||
&& (cpuid[2] == 0xFFFFFFFF) && (cpuid[3] == 0xFFFFFFFF)
|
||||
)
|
||||
{
|
||||
g_hasRDRAND = 0;
|
||||
g_hasRDSEED = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user