VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount/Mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mount/Mount.c')
-rw-r--r--src/Mount/Mount.c80
1 files changed, 5 insertions, 75 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index 2c14010e..380cd04a 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -2808,9 +2808,6 @@ BOOL CALLBACK VolumePropertiesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP
2808 int size = EAGetKeySize (prop.ea); 2808 int size = EAGetKeySize (prop.ea);
2809 EAGetName (name, prop.ea); 2809 EAGetName (name, prop.ea);
2810 2810
2811 if (strcmp (name, "Triple DES") == 0) /* Deprecated/legacy */
2812 size -= 3; // Compensate for parity bytes
2813
2814 // Primary key 2811 // Primary key
2815 ListItemAddW (list, i, GetString ("KEY_SIZE")); 2812 ListItemAddW (list, i, GetString ("KEY_SIZE"));
2816 StringCbPrintfW (sw, sizeof(sw), L"%d %s", size * 8, GetString ("BITS")); 2813 StringCbPrintfW (sw, sizeof(sw), L"%d %s", size * 8, GetString ("BITS"));
@@ -2823,37 +2820,12 @@ BOOL CALLBACK VolumePropertiesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP
2823 ListItemAddW (list, i, GetString ("SECONDARY_KEY_SIZE_XTS")); 2820 ListItemAddW (list, i, GetString ("SECONDARY_KEY_SIZE_XTS"));
2824 ListSubItemSetW (list, i++, 1, sw); 2821 ListSubItemSetW (list, i++, 1, sw);
2825 } 2822 }
2826 else if (strcmp (EAGetModeName (prop.ea, prop.mode, TRUE), "LRW") == 0)
2827 {
2828 // Tweak key (LRW)
2829
2830 ListItemAddW (list, i, GetString ("SECONDARY_KEY_SIZE_LRW"));
2831 StringCbPrintfW (sw, sizeof(sw), L"%d %s", CipherGetBlockSize (EAGetFirstCipher(prop.ea))*8, GetString ("BITS"));
2832 ListSubItemSetW (list, i++, 1, sw);
2833 }
2834 } 2823 }
2835 2824
2836 // Block size 2825 // Block size
2837 ListItemAddW (list, i, GetString ("BLOCK_SIZE")); 2826 ListItemAddW (list, i, GetString ("BLOCK_SIZE"));
2838 if (EAGetFirstMode (prop.ea) == INNER_CBC) 2827
2839 { 2828 StringCbPrintfW (sw, sizeof(sw), L"%d ", CipherGetBlockSize (EAGetFirstCipher(prop.ea))*8);
2840 // Cascaded ciphers with non-equal block sizes (deprecated/legacy)
2841 wchar_t tmpstr[64];
2842 int i = EAGetLastCipher(prop.ea);
2843
2844 StringCbPrintfW (sw, sizeof(sw), L"%d", CipherGetBlockSize(i)*8);
2845
2846 while (i = EAGetPreviousCipher(prop.ea, i))
2847 {
2848 StringCbPrintfW (tmpstr, sizeof(tmpstr), L"/%d", CipherGetBlockSize(i)*8);
2849 StringCbCatW (sw, sizeof(sw), tmpstr);
2850 }
2851 StringCbCatW (sw, sizeof(sw), L" ");
2852 }
2853 else
2854 {
2855 StringCbPrintfW (sw, sizeof(sw), L"%d ", CipherGetBlockSize (EAGetFirstCipher(prop.ea))*8);
2856 }
2857 StringCbCatW (sw, sizeof(sw), GetString ("BITS")); 2829 StringCbCatW (sw, sizeof(sw), GetString ("BITS"));
2858 ListSubItemSetW (list, i++, 1, sw); 2830 ListSubItemSetW (list, i++, 1, sw);
2859 2831
@@ -3378,7 +3350,7 @@ static BOOL Mount (HWND hwndDlg, int nDosDriveNo, char *szFileName)
3378{ 3350{
3379 BOOL status = FALSE; 3351 BOOL status = FALSE;
3380 char fileName[MAX_PATH]; 3352 char fileName[MAX_PATH];
3381 int mounted = 0, modeOfOperation; 3353 int mounted = 0;
3382 3354
3383 bPrebootPasswordDlgMode = mountOptions.PartitionInInactiveSysEncScope; 3355 bPrebootPasswordDlgMode = mountOptions.PartitionInInactiveSysEncScope;
3384 3356
@@ -3443,14 +3415,6 @@ static BOOL Mount (HWND hwndDlg, int nDosDriveNo, char *szFileName)
3443 3415
3444 if (mounted) 3416 if (mounted)
3445 { 3417 {
3446 // Check for deprecated CBC mode
3447 modeOfOperation = GetModeOfOperationByDriveNo (nDosDriveNo);
3448 if (modeOfOperation == CBC || modeOfOperation == OUTER_CBC)
3449 Warning("WARN_CBC_MODE");
3450
3451 // Check for deprecated 64-bit-block ciphers
3452 if (GetCipherBlockSizeByDriveNo (nDosDriveNo) == 64)
3453 Warning("WARN_64_BIT_BLOCK_CIPHER");
3454 3418
3455 // Check for problematic file extensions (exe, dll, sys) 3419 // Check for problematic file extensions (exe, dll, sys)
3456 if (CheckFileExtension(szFileName)) 3420 if (CheckFileExtension(szFileName))
@@ -3479,15 +3443,6 @@ static BOOL Mount (HWND hwndDlg, int nDosDriveNo, char *szFileName)
3479 mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, &VolumePassword, bCacheInDriver, bForceMount, &mountOptions, Silent, !Silent); 3443 mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, &VolumePassword, bCacheInDriver, bForceMount, &mountOptions, Silent, !Silent);
3480 NormalCursor (); 3444 NormalCursor ();
3481 3445
3482 // Check for deprecated CBC mode
3483 modeOfOperation = GetModeOfOperationByDriveNo (nDosDriveNo);
3484 if (modeOfOperation == CBC || modeOfOperation == OUTER_CBC)
3485 Warning("WARN_CBC_MODE");
3486
3487 // Check for deprecated 64-bit-block ciphers
3488 if (GetCipherBlockSizeByDriveNo (nDosDriveNo) == 64)
3489 Warning("WARN_64_BIT_BLOCK_CIPHER");
3490
3491 // Check for legacy non-ASCII passwords 3446 // Check for legacy non-ASCII passwords
3492 if (mounted > 0 && !KeyFilesEnable && !CheckPasswordCharEncoding (NULL, &VolumePassword)) 3447 if (mounted > 0 && !KeyFilesEnable && !CheckPasswordCharEncoding (NULL, &VolumePassword))
3493 Warning ("UNSUPPORTED_CHARS_IN_PWD_RECOM"); 3448 Warning ("UNSUPPORTED_CHARS_IN_PWD_RECOM");
@@ -3701,8 +3656,8 @@ static BOOL MountAllDevices (HWND hwndDlg, BOOL bPasswordPrompt)
3701{ 3656{
3702 HWND driveList = GetDlgItem (hwndDlg, IDC_DRIVELIST); 3657 HWND driveList = GetDlgItem (hwndDlg, IDC_DRIVELIST);
3703 int selDrive = ListView_GetSelectionMark (driveList); 3658 int selDrive = ListView_GetSelectionMark (driveList);
3704 BOOL shared = FALSE, status = FALSE, b64BitBlockCipher = FALSE, bCBCMode = FALSE, bHeaderBakRetry = FALSE; 3659 BOOL shared = FALSE, status = FALSE, bHeaderBakRetry = FALSE;
3705 int mountedVolCount = 0, modeOfOperation; 3660 int mountedVolCount = 0;
3706 vector <HostDevice> devices; 3661 vector <HostDevice> devices;
3707 3662
3708 VolumePassword.Length = 0; 3663 VolumePassword.Length = 0;
@@ -3808,13 +3763,6 @@ static BOOL MountAllDevices (HWND hwndDlg, BOOL bPasswordPrompt)
3808 3763
3809 status = TRUE; 3764 status = TRUE;
3810 3765
3811 // Check for deprecated CBC mode
3812 modeOfOperation = GetModeOfOperationByDriveNo (nDosDriveNo);
3813 bCBCMode = (modeOfOperation == CBC || modeOfOperation == OUTER_CBC);
3814
3815 if (GetCipherBlockSizeByDriveNo(nDosDriveNo) == 64)
3816 b64BitBlockCipher = TRUE;
3817
3818 mountedVolCount++; 3766 mountedVolCount++;
3819 3767
3820 // Skip other partitions of the disk if partition0 (whole disk) has been mounted 3768 // Skip other partitions of the disk if partition0 (whole disk) has been mounted
@@ -3889,14 +3837,6 @@ static BOOL MountAllDevices (HWND hwndDlg, BOOL bPasswordPrompt)
3889 Info ("HIDVOL_PROT_WARN_AFTER_MOUNT"); 3837 Info ("HIDVOL_PROT_WARN_AFTER_MOUNT");
3890 } 3838 }
3891 3839
3892 // Check for deprecated CBC mode
3893 if (bCBCMode)
3894 Warning("WARN_CBC_MODE");
3895
3896 // Check for deprecated 64-bit-block ciphers
3897 if (b64BitBlockCipher)
3898 Warning("WARN_64_BIT_BLOCK_CIPHER");
3899
3900 // Check for legacy non-ASCII passwords 3840 // Check for legacy non-ASCII passwords
3901 if (!KeyFilesEnable 3841 if (!KeyFilesEnable
3902 && !FirstCmdKeyFile 3842 && !FirstCmdKeyFile
@@ -4664,7 +4604,6 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
4664 case WM_INITDIALOG: 4604 case WM_INITDIALOG:
4665 { 4605 {
4666 int exitCode = 0; 4606 int exitCode = 0;
4667 int modeOfOperation;
4668 4607
4669 MainDlg = hwndDlg; 4608 MainDlg = hwndDlg;
4670 4609
@@ -4833,15 +4772,6 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
4833 4772
4834 if(!Silent) 4773 if(!Silent)
4835 { 4774 {
4836 // Check for deprecated CBC mode
4837 modeOfOperation = GetModeOfOperationByDriveNo (szDriveLetter[0] - 'A');
4838 if (modeOfOperation == CBC || modeOfOperation == OUTER_CBC)
4839 Warning("WARN_CBC_MODE");
4840
4841 // Check for deprecated 64-bit-block ciphers
4842 if (GetCipherBlockSizeByDriveNo (szDriveLetter[0] - 'A') == 64)
4843 Warning("WARN_64_BIT_BLOCK_CIPHER");
4844
4845 // Check for problematic file extensions (exe, dll, sys) 4775 // Check for problematic file extensions (exe, dll, sys)
4846 if (CheckFileExtension (szFileName)) 4776 if (CheckFileExtension (szFileName))
4847 Warning ("EXE_FILE_EXTENSION_MOUNT_WARNING"); 4777 Warning ("EXE_FILE_EXTENSION_MOUNT_WARNING");