Linux: Disable Kernel crypto if volume encrypted using Kuznyechik or Magma

This commit is contained in:
Mounir IDRASSI 2016-08-17 08:19:43 +02:00
parent 7695b8ada0
commit d8a7de8ffb
No known key found for this signature in database
GPG Key ID: DD0C382D5FCFB8FC

View File

@ -303,9 +303,12 @@ namespace VeraCrypt
void CoreLinux::MountVolumeNative (shared_ptr <Volume> volume, MountOptions &options, const DirectoryPath &auxMountPoint) const void CoreLinux::MountVolumeNative (shared_ptr <Volume> volume, MountOptions &options, const DirectoryPath &auxMountPoint) const
{ {
bool xts = (typeid (*volume->GetEncryptionMode()) == typeid (EncryptionModeXTS)); bool xts = (typeid (*volume->GetEncryptionMode()) == typeid (EncryptionModeXTS));
bool algoNotSupported = (typeid (*volume->GetEncryptionAlgorithm()) == typeid (GOST89))
|| (typeid (*volume->GetEncryptionAlgorithm()) == typeid (Kuznyechik));
if (options.NoKernelCrypto if (options.NoKernelCrypto
|| !xts || !xts
|| algoNotSupported
|| volume->GetProtectionType() == VolumeProtection::HiddenVolumeReadOnly) || volume->GetProtectionType() == VolumeProtection::HiddenVolumeReadOnly)
{ {
throw NotApplicable (SRC_POS); throw NotApplicable (SRC_POS);