diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2023-06-29 00:06:20 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2023-06-29 00:06:20 +0200 |
commit | 034b64f4153550cbe5849bcbfc27e187377cc512 (patch) | |
tree | d831496163c3891031765010bf1934406b0c4a3c /src/Mount | |
parent | 502ab9112a7624dbd7c1c90c2e12ed45512b8b3c (diff) | |
download | VeraCrypt-034b64f4153550cbe5849bcbfc27e187377cc512.tar.gz VeraCrypt-034b64f4153550cbe5849bcbfc27e187377cc512.zip |
EMV keyfile support: Overall code improvements and bug fixes
Diffstat (limited to 'src/Mount')
-rw-r--r-- | src/Mount/Mount.c | 8 | ||||
-rw-r--r-- | src/Mount/Mount.rc | 2 | ||||
-rw-r--r-- | src/Mount/Mount.vcxproj | 26 | ||||
-rw-r--r-- | src/Mount/Mount.vcxproj.filters | 50 | ||||
-rw-r--r-- | src/Mount/Mount_vs2019.vcxproj | 22 | ||||
-rw-r--r-- | src/Mount/Resource.h | 2 |
6 files changed, 94 insertions, 16 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index a7552411..713b239d 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -954,7 +954,7 @@ void LoadSettingsAndCheckModified (HWND hwndDlg, BOOL bOnlyCheckModified, BOOL* } ConfigReadCompareInt ("CloseSecurityTokenSessionsAfterMount", 0, &CloseSecurityTokenSessionsAfterMount, bOnlyCheckModified, pbSettingsModified); - ConfigReadCompareInt ("ActivateEMVOption", 0, &ActivateEMVOption, bOnlyCheckModified, pbSettingsModified); + ConfigReadCompareInt ("EMVSupportEnabled", 0, &EMVSupportEnabled, bOnlyCheckModified, pbSettingsModified); if (IsHiddenOSRunning()) ConfigReadCompareInt ("HiddenSystemLeakProtNotifStatus", TC_HIDDEN_OS_READ_ONLY_NOTIF_MODE_NONE, &HiddenSysLeakProtectionNotificationStatus, bOnlyCheckModified, pbSettingsModified); @@ -1127,7 +1127,7 @@ void SaveSettings (HWND hwndDlg) } ConfigWriteInt ("CloseSecurityTokenSessionsAfterMount", CloseSecurityTokenSessionsAfterMount); - ConfigWriteInt ("ActivateEMVOption", ActivateEMVOption); + ConfigWriteInt ("EMVSupportEnabled", EMVSupportEnabled); // Hotkeys ConfigWriteInt ("HotkeyModAutoMountDevices", Hotkeys[HK_AUTOMOUNT_DEVICES].vKeyModifiers); @@ -11881,7 +11881,7 @@ static BOOL CALLBACK SecurityTokenPreferencesDlgProc (HWND hwndDlg, UINT msg, WP LocalizeDialog (hwndDlg, "IDD_TOKEN_PREFERENCES"); SetDlgItemText (hwndDlg, IDC_PKCS11_MODULE, SecurityTokenLibraryPath); CheckDlgButton (hwndDlg, IDC_CLOSE_TOKEN_SESSION_AFTER_MOUNT, CloseSecurityTokenSessionsAfterMount ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton (hwndDlg, IDC_ACTIVATE_EMV_OPTION, ActivateEMVOption ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton (hwndDlg, IDC_ENABLE_EMV_SUPPORT, EMVSupportEnabled ? BST_CHECKED : BST_UNCHECKED); SetWindowTextW (GetDlgItem (hwndDlg, IDT_PKCS11_LIB_HELP), GetString("PKCS11_LIB_LOCATION_HELP")); @@ -11924,7 +11924,7 @@ static BOOL CALLBACK SecurityTokenPreferencesDlgProc (HWND hwndDlg, UINT msg, WP } CloseSecurityTokenSessionsAfterMount = (IsDlgButtonChecked (hwndDlg, IDC_CLOSE_TOKEN_SESSION_AFTER_MOUNT) == BST_CHECKED); - ActivateEMVOption = (IsDlgButtonChecked (hwndDlg, IDC_ACTIVATE_EMV_OPTION) == BST_CHECKED); + EMVSupportEnabled = (IsDlgButtonChecked (hwndDlg, IDC_ENABLE_EMV_SUPPORT) == BST_CHECKED); WaitCursor (); SaveSettings (hwndDlg); NormalCursor (); diff --git a/src/Mount/Mount.rc b/src/Mount/Mount.rc index d6d766c5..8d248f7b 100644 --- a/src/Mount/Mount.rc +++ b/src/Mount/Mount.rc @@ -280,7 +280,7 @@ BEGIN PUSHBUTTON "Auto-&Detect Library",IDC_AUTO_DETECT_PKCS11_MODULE,16,41,112,14 CONTROL "&Close token session (log out) after a volume is successfully mounted",IDC_CLOSE_TOKEN_SESSION_AFTER_MOUNT, "Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,16,154,284,9 - CONTROL "&Activate EMV Option",IDC_ACTIVATE_EMV_OPTION,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,16,185,284,9 + CONTROL "&Enable EMV Support",IDC_ENABLE_EMV_SUPPORT,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,16,185,284,9 DEFPUSHBUTTON "OK",IDOK,205,208,50,14 PUSHBUTTON "Cancel",IDCANCEL,259,208,50,14 GROUPBOX "PKCS #11 Library Path",IDT_PKCS11_LIB_PATH,7,7,302,129 diff --git a/src/Mount/Mount.vcxproj b/src/Mount/Mount.vcxproj index 5aeb6722..480ef694 100644 --- a/src/Mount/Mount.vcxproj +++ b/src/Mount/Mount.vcxproj @@ -236,7 +236,7 @@ copy Debug\VeraCrypt.exe "..\Debug\Setup Files" >NUL: <DisableSpecificWarnings>4057;4100;4127;4201;4701;4706;4131;%(DisableSpecificWarnings)</DisableSpecificWarnings> </ClCompile> <Link> - <AdditionalDependencies>..\Crypto\x64\Debug\crypto.lib;..\Common\x64\Debug\Zip.lib;..\Common\x64\Debug\lzma.lib;mpr.lib;winscard.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>..\Crypto\x64\Debug\crypto.lib;..\Common\x64\Debug\Zip.lib;..\Common\x64\Debug\lzma.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)VeraCrypt.exe</OutputFile> <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs> @@ -325,7 +325,7 @@ copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-x64.exe" >NUL: <DisableSpecificWarnings>4057;4100;4127;4201;4701;4706;4131;%(DisableSpecificWarnings)</DisableSpecificWarnings> </ClCompile> <Link> - <AdditionalDependencies>..\Crypto\Release\crypto.lib;..\Common\Release\Zip.lib;..\Common\Release\lzma.lib;mpr.lib;winscard.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>..\Crypto\Release\crypto.lib;..\Common\Release\Zip.lib;..\Common\Release\lzma.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)VeraCrypt.exe</OutputFile> <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs> @@ -415,7 +415,7 @@ copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-x64.exe" >NUL: <DisableSpecificWarnings>4057;4100;4127;4201;4701;4706;4131;%(DisableSpecificWarnings)</DisableSpecificWarnings> </ClCompile> <Link> - <AdditionalDependencies>..\Crypto\x64\Release\crypto.lib;..\Common\x64\Release\Zip.lib;..\Common\x64\Release\lzma.lib;mpr.lib;winscard.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>..\Crypto\x64\Release\crypto.lib;..\Common\x64\Release\Zip.lib;..\Common\x64\Release\lzma.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)VeraCrypt.exe</OutputFile> <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs> @@ -462,7 +462,7 @@ copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-x64.exe" >NUL: <DisableSpecificWarnings>4057;4100;4127;4201;4701;4706;4131;%(DisableSpecificWarnings)</DisableSpecificWarnings> </ClCompile> <Link> - <AdditionalDependencies>..\Crypto\x64\Release\crypto.lib;..\Common\x64\Release\Zip.lib;..\Common\x64\Release\lzma.lib;mpr.lib;winscard.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>..\Crypto\x64\Release\crypto.lib;..\Common\x64\Release\Zip.lib;..\Common\x64\Release\lzma.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)VeraCrypt.exe</OutputFile> <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs> @@ -533,8 +533,15 @@ copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-x64.exe" >NUL: </ResourceCompile> </ItemDefinitionGroup> <ItemGroup> + <ClCompile Include="..\Common\CommandAPDU.cpp" /> + <ClCompile Include="..\Common\EMVCard.cpp" /> <ClCompile Include="..\Common\EMVToken.cpp" /> - <ClCompile Include="..\Common\IccDataExtractor.cpp" /> + <ClCompile Include="..\Common\PCSCException.cpp" /> + <ClCompile Include="..\Common\ResponseAPDU.cpp" /> + <ClCompile Include="..\Common\SCard.cpp" /> + <ClCompile Include="..\Common\SCardLoader.cpp" /> + <ClCompile Include="..\Common\SCardManager.cpp" /> + <ClCompile Include="..\Common\SCardReader.cpp" /> <ClCompile Include="..\Common\TLVParser.cpp" /> <ClCompile Include="..\Common\Token.cpp" /> <ClCompile Include="..\Setup\SelfExtract.c" /> @@ -606,8 +613,15 @@ copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-x64.exe" >NUL: <Midl Include="MainCom.idl" /> </ItemGroup> <ItemGroup> + <ClInclude Include="..\Common\CommandAPDU.h" /> + <ClInclude Include="..\Common\EMVCard.h" /> <ClInclude Include="..\Common\EMVToken.h" /> - <ClInclude Include="..\Common\IccDataExtractor.h" /> + <ClInclude Include="..\Common\PCSCException.h" /> + <ClInclude Include="..\Common\ResponseAPDU.h" /> + <ClInclude Include="..\Common\SCard.h" /> + <ClInclude Include="..\Common\SCardLoader.h" /> + <ClInclude Include="..\Common\SCardManager.h" /> + <ClInclude Include="..\Common\SCardReader.h" /> <ClInclude Include="..\Common\TLVParser.h" /> <ClInclude Include="..\Common\Token.h" /> <ClInclude Include="..\Common\Wipe.h" /> diff --git a/src/Mount/Mount.vcxproj.filters b/src/Mount/Mount.vcxproj.filters index 033a76ff..d5014051 100644 --- a/src/Mount/Mount.vcxproj.filters +++ b/src/Mount/Mount.vcxproj.filters @@ -114,10 +114,31 @@ <ClCompile Include="..\Common\Token.cpp"> <Filter>Source Files\Common</Filter> </ClCompile> - <ClCompile Include="..\Common\IccDataExtractor.cpp"> + <ClCompile Include="..\Common\TLVParser.cpp"> <Filter>Source Files\Common</Filter> </ClCompile> - <ClCompile Include="..\Common\TLVParser.cpp"> + <ClCompile Include="..\Common\CommandAPDU.cpp"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\PCSCException.cpp"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\ResponseAPDU.cpp"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\SCardLoader.cpp"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\SCardManager.cpp"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\SCardReader.cpp"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\EMVCard.cpp"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\SCard.cpp"> <Filter>Source Files\Common</Filter> </ClCompile> </ItemGroup> @@ -229,10 +250,31 @@ <ClInclude Include="..\Common\Token.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\Common\IccDataExtractor.h"> + <ClInclude Include="..\Common\TLVParser.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\Common\TLVParser.h"> + <ClInclude Include="..\Common\CommandAPDU.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\PCSCException.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\ResponseAPDU.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\SCardLoader.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\SCardManager.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\SCardReader.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\EMVCard.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\SCard.h"> <Filter>Header Files</Filter> </ClInclude> </ItemGroup> diff --git a/src/Mount/Mount_vs2019.vcxproj b/src/Mount/Mount_vs2019.vcxproj index 13aef3ca..b75121e4 100644 --- a/src/Mount/Mount_vs2019.vcxproj +++ b/src/Mount/Mount_vs2019.vcxproj @@ -602,6 +602,17 @@ copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-arm64.exe" >NUL: </ResourceCompile> </ItemDefinitionGroup> <ItemGroup> + <ClCompile Include="..\Common\CommandAPDU.cpp" /> + <ClCompile Include="..\Common\EMVCard.cpp" /> + <ClCompile Include="..\Common\EMVToken.cpp" /> + <ClCompile Include="..\Common\PCSCException.cpp" /> + <ClCompile Include="..\Common\ResponseAPDU.cpp" /> + <ClCompile Include="..\Common\SCard.cpp" /> + <ClCompile Include="..\Common\SCardLoader.cpp" /> + <ClCompile Include="..\Common\SCardManager.cpp" /> + <ClCompile Include="..\Common\SCardReader.cpp" /> + <ClCompile Include="..\Common\TLVParser.cpp" /> + <ClCompile Include="..\Common\Token.cpp" /> <ClCompile Include="..\Setup\SelfExtract.c" /> <ClCompile Include="Favorites.cpp" /> <ClCompile Include="Hotkeys.c" /> @@ -675,6 +686,17 @@ copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-arm64.exe" >NUL: <Midl Include="MainCom.idl" /> </ItemGroup> <ItemGroup> + <ClInclude Include="..\Common\CommandAPDU.h" /> + <ClInclude Include="..\Common\EMVCard.h" /> + <ClInclude Include="..\Common\EMVToken.h" /> + <ClInclude Include="..\Common\PCSCException.h" /> + <ClInclude Include="..\Common\ResponseAPDU.h" /> + <ClInclude Include="..\Common\SCard.h" /> + <ClInclude Include="..\Common\SCardLoader.h" /> + <ClInclude Include="..\Common\SCardManager.h" /> + <ClInclude Include="..\Common\SCardReader.h" /> + <ClInclude Include="..\Common\TLVParser.h" /> + <ClInclude Include="..\Common\Token.h" /> <ClInclude Include="..\Common\Wipe.h" /> <ClInclude Include="..\Common\Apidrvr.h" /> <ClInclude Include="..\Common\BaseCom.h" /> diff --git a/src/Mount/Resource.h b/src/Mount/Resource.h index 69f99080..0687b9ae 100644 --- a/src/Mount/Resource.h +++ b/src/Mount/Resource.h @@ -199,7 +199,7 @@ #define IDC_FORCE_NEXT_BOOT_VERACRYPT 1176 #define IDC_FORCE_VERACRYPT_BOOT_ENTRY 1177 #define IDC_FORCE_VERACRYPT_FIRST_BOOT_ENTRY 1178 -#define IDC_ACTIVATE_EMV_OPTION 1179 +#define IDC_ENABLE_EMV_SUPPORT 1179 #define IDT_EMV_OPTIONS 1180 #define IDM_HELP 40001 #define IDM_ABOUT 40002 |