VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-13 02:40:45 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-15 01:09:16 +0200
commitc4d4ade9d00e65112b93640bd3a0eeb50279a202 (patch)
tree908ad47df55c646fd4e6fe751891b4d7438a1140 /src/Common
parentd12739389796a1b903665983a7b5be845ab2bb89 (diff)
downloadVeraCrypt-c4d4ade9d00e65112b93640bd3a0eeb50279a202.tar.gz
VeraCrypt-c4d4ade9d00e65112b93640bd3a0eeb50279a202.zip
Windows: Show only supported encryption algorithm in the system encryption wizard for MBR
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Crypto.c32
-rw-r--r--src/Common/Crypto.h6
2 files changed, 25 insertions, 13 deletions
diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c
index e9a3da68..f3045d0c 100644
--- a/src/Common/Crypto.c
+++ b/src/Common/Crypto.c
@@ -73,21 +73,21 @@ static EncryptionAlgorithm EncryptionAlgorithms[] =
#ifndef TC_WINDOWS_BOOT
- { { 0, 0 }, { 0, 0}, 0 }, // Must be all-zero
- { { AES, 0 }, { XTS, 0 }, 1 },
- { { SERPENT, 0 }, { XTS, 0 }, 1 },
- { { TWOFISH, 0 }, { XTS, 0 }, 1 },
- { { CAMELLIA, 0 }, { XTS, 0 }, 1 },
+ { { 0, 0 }, { 0, 0}, 0, 0 }, // Must be all-zero
+ { { AES, 0 }, { XTS, 0 }, 1, 1 },
+ { { SERPENT, 0 }, { XTS, 0 }, 1, 1 },
+ { { TWOFISH, 0 }, { XTS, 0 }, 1, 1 },
+ { { CAMELLIA, 0 }, { XTS, 0 }, 1, 1 },
#if defined(CIPHER_GOST89)
- { { GOST89, 0 }, { XTS, 0 }, 1 },
+ { { GOST89, 0 }, { XTS, 0 }, 0, 1 },
#endif // defined(CIPHER_GOST89)
- { { KUZNYECHIK, 0 }, { XTS, 0 }, 1 },
- { { TWOFISH, AES, 0 }, { XTS, 0 }, 1 },
- { { SERPENT, TWOFISH, AES, 0 }, { XTS, 0 }, 1 },
- { { AES, SERPENT, 0 }, { XTS, 0 }, 1 },
- { { AES, TWOFISH, SERPENT, 0 }, { XTS, 0 }, 1 },
- { { SERPENT, TWOFISH, 0 }, { XTS, 0 }, 1 },
- { { 0, 0 }, { 0, 0}, 0 } // Must be all-zero
+ { { KUZNYECHIK, 0 }, { XTS, 0 }, 0, 1 },
+ { { TWOFISH, AES, 0 }, { XTS, 0 }, 1, 1 },
+ { { SERPENT, TWOFISH, AES, 0 }, { XTS, 0 }, 1, 1 },
+ { { AES, SERPENT, 0 }, { XTS, 0 }, 1, 1 },
+ { { AES, TWOFISH, SERPENT, 0 }, { XTS, 0 }, 1, 1 },
+ { { SERPENT, TWOFISH, 0 }, { XTS, 0 }, 1, 1 },
+ { { 0, 0 }, { 0, 0}, 0, 0 } // Must be all-zero
#else // TC_WINDOWS_BOOT
@@ -684,6 +684,12 @@ int EAIsFormatEnabled (int ea)
return EncryptionAlgorithms[ea].FormatEnabled;
}
+#ifndef TC_WINDOWS_BOOT
+int EAIsMbrSysEncEnabled (int ea)
+{
+ return EncryptionAlgorithms[ea].MbrSysEncEnabled;
+}
+#endif
// Returns TRUE if the mode of operation is supported for the encryption algorithm
BOOL EAIsModeSupported (int ea, int testedMode)
diff --git a/src/Common/Crypto.h b/src/Common/Crypto.h
index c4bc4fa9..7d99f233 100644
--- a/src/Common/Crypto.h
+++ b/src/Common/Crypto.h
@@ -133,6 +133,9 @@ typedef struct
{
int Ciphers[4]; // Null terminated array of ciphers used by encryption algorithm
int Modes[LAST_MODE_OF_OPERATION + 1]; // Null terminated array of modes of operation
+#ifndef TC_WINDOWS_BOOT
+ BOOL MbrSysEncEnabled;
+#endif
int FormatEnabled;
} EncryptionAlgorithm;
@@ -348,6 +351,9 @@ int EAGetLastCipher (int ea);
int EAGetNextCipher (int ea, int previousCipherId);
int EAGetPreviousCipher (int ea, int previousCipherId);
int EAIsFormatEnabled (int ea);
+#ifndef TC_WINDOWS_BOOT
+int EAIsMbrSysEncEnabled (int ea);
+#endif
BOOL EAIsModeSupported (int ea, int testedMode);