diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-07-04 11:19:53 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-07-04 12:28:17 +0200 |
commit | 88cc8a00f4a7fc34003b961c572d5a78462dd682 (patch) | |
tree | c34058cc9b899791f5b26a0c01955198cd0953d4 /src/Common/Crypto.c | |
parent | 0358eb6c717cfe132bcec7fddeac14213ed8937c (diff) | |
download | VeraCrypt-88cc8a00f4a7fc34003b961c572d5a78462dd682.tar.gz VeraCrypt-88cc8a00f4a7fc34003b961c572d5a78462dd682.zip |
Windows: correctly handle SEH exceptions during self-tests in order to disable CPU extended features in such case.
Diffstat (limited to 'src/Common/Crypto.c')
-rw-r--r-- | src/Common/Crypto.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c index 2035b7e3..c0e77922 100644 --- a/src/Common/Crypto.c +++ b/src/Common/Crypto.c @@ -1156,20 +1156,20 @@ static BOOL HwEncryptionDisabled = FALSE; BOOL IsAesHwCpuSupported () { +#ifdef TC_WINDOWS_BOOT_AES static BOOL state = FALSE; static BOOL stateValid = FALSE; if (!stateValid) { -#ifdef TC_WINDOWS_BOOT_AES state = is_aes_hw_cpu_supported() ? TRUE : FALSE; -#else - state = g_hasAESNI ? TRUE : FALSE; -#endif stateValid = TRUE; } return state && !HwEncryptionDisabled; +#else + return (HasAESNI() && !HwEncryptionDisabled)? TRUE : FALSE; +#endif } void EnableHwEncryption (BOOL enable) |