diff options
Diffstat (limited to 'src/Format')
-rw-r--r-- | src/Format/Format.vcxproj | 420 | ||||
-rw-r--r-- | src/Format/Format.vcxproj.filters | 356 | ||||
-rw-r--r-- | src/Format/Format.vcxproj.user | 3 | ||||
-rw-r--r-- | src/Format/FormatCom.cpp | 44 | ||||
-rw-r--r-- | src/Format/FormatCom.idl | 12 | ||||
-rw-r--r-- | src/Format/InPlace.c | 83 | ||||
-rw-r--r-- | src/Format/Tcformat.c | 191 |
7 files changed, 1055 insertions, 54 deletions
diff --git a/src/Format/Format.vcxproj b/src/Format/Format.vcxproj new file mode 100644 index 00000000..0b4a8312 --- /dev/null +++ b/src/Format/Format.vcxproj @@ -0,0 +1,420 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{9DC1ABE2-D18B-48FB-81D2-8C50ADC57BCF}</ProjectGuid> + <RootNamespace>Format</RootNamespace> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>Windows7.1SDK</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>Windows7.1SDK</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>Windows7.1SDK</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>Windows7.1SDK</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> + <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> + <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> + <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</GenerateManifest> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> + <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest> + <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">VeraCryptFormat</TargetName> + <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">VeraCryptFormat</TargetName> + <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">VeraCryptFormat</TargetName> + <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">VeraCryptFormat</TargetName> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Midl> + <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName> + </Midl> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>VOLFORMAT;WIN32;DEBUG;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <BufferSecurityCheck>true</BufferSecurityCheck> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> + <DisableSpecificWarnings>4057;4100;4127;4201;4204;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings> + </ClCompile> + <Link> + <AdditionalDependencies>..\Crypto\Debug\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)VeraCryptFormat.exe</OutputFile> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ProgramDatabaseFile>$(OutDir)Format.pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <DataExecutionPrevention>true</DataExecutionPrevention> + <TargetMachine>MachineX86</TargetMachine> + </Link> + <Manifest> + <AdditionalManifestFiles>Format.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles> + </Manifest> + <PostBuildEvent> + <Command>md "..\Debug\Setup Files" 2>NUL: +copy Debug\VeraCryptFormat.exe "..\Debug\Setup Files\VeraCrypt Format.exe" >NUL: +</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Midl> + <TargetEnvironment>X64</TargetEnvironment> + <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName> + </Midl> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>VOLFORMAT;WIN32;DEBUG;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <BufferSecurityCheck>true</BufferSecurityCheck> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <DisableSpecificWarnings>4057;4100;4127;4201;4204;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings> + </ClCompile> + <Link> + <AdditionalDependencies>..\Crypto\x64\Debug\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)VeraCryptFormat.exe</OutputFile> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ProgramDatabaseFile>$(OutDir)Format.pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <DataExecutionPrevention>true</DataExecutionPrevention> + <TargetMachine>MachineX64</TargetMachine> + </Link> + <Manifest> + <AdditionalManifestFiles>Format.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles> + </Manifest> + <PostBuildEvent> + <Command>md "..\Debug\Setup Files" 2>NUL: +copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt Format-x64.exe" >NUL: +</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Midl> + <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName> + </Midl> + <ClCompile> + <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions> + <Optimization>MaxSpeed</Optimization> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>VOLFORMAT;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <BufferSecurityCheck>true</BufferSecurityCheck> + <PrecompiledHeader> + </PrecompiledHeader> + <AssemblerOutput>All</AssemblerOutput> + <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat> + </DebugInformationFormat> + <DisableSpecificWarnings>4057;4100;4127;4201;4204;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings> + </ClCompile> + <Link> + <AdditionalDependencies>..\Crypto\Release\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)VeraCryptFormat.exe</OutputFile> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <GenerateDebugInformation>false</GenerateDebugInformation> + <GenerateMapFile>true</GenerateMapFile> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <DataExecutionPrevention>true</DataExecutionPrevention> + <TargetMachine>MachineX86</TargetMachine> + </Link> + <Manifest> + <AdditionalManifestFiles>Format.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles> + </Manifest> + <PostBuildEvent> + <Command>copy Release\VeraCryptFormat.exe "..\Release\Setup Files\VeraCrypt Format.exe"</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Midl> + <TargetEnvironment>X64</TargetEnvironment> + <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName> + </Midl> + <ClCompile> + <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions> + <Optimization>MaxSpeed</Optimization> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>VOLFORMAT;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <BufferSecurityCheck>true</BufferSecurityCheck> + <PrecompiledHeader> + </PrecompiledHeader> + <AssemblerOutput>All</AssemblerOutput> + <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat> + </DebugInformationFormat> + <DisableSpecificWarnings>4057;4100;4127;4201;4204;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings> + </ClCompile> + <Link> + <AdditionalDependencies>..\Crypto\x64\Release\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)VeraCryptFormat.exe</OutputFile> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <GenerateDebugInformation>false</GenerateDebugInformation> + <GenerateMapFile>true</GenerateMapFile> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <DataExecutionPrevention>true</DataExecutionPrevention> + <TargetMachine>MachineX64</TargetMachine> + </Link> + <Manifest> + <AdditionalManifestFiles>Format.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles> + </Manifest> + <PostBuildEvent> + <Command>copy $(TargetPath) "..\Release\Setup Files\VeraCrypt Format-x64.exe"</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\Common\XUnzip.cpp" /> + <ClCompile Include="..\Common\XZip.cpp" /> + <ClCompile Include="FormatCom.cpp" /> + <ClCompile Include="InPlace.c"> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs> + </ClCompile> + <ClCompile Include="Tcformat.c"> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs> + </ClCompile> + <ClCompile Include="..\Common\BaseCom.cpp" /> + <ClCompile Include="..\Common\BootEncryption.cpp" /> + <ClCompile Include="..\Common\Cmdline.c" /> + <ClCompile Include="..\Common\Combo.c" /> + <ClCompile Include="..\Common\Crc.c" /> + <ClCompile Include="..\Common\Crypto.c" /> + <ClCompile Include="..\Common\Dictionary.c"> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs> + </ClCompile> + <ClCompile Include="..\Common\Dlgcode.c"> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs> + </ClCompile> + <ClCompile Include="..\Common\EncryptionThreadPool.c" /> + <ClCompile Include="..\Common\Endian.c" /> + <ClCompile Include="..\Common\Fat.c" /> + <ClCompile Include="..\Common\Format.c" /> + <ClCompile Include="..\Common\GfMul.c" /> + <ClCompile Include="..\Common\Keyfiles.c"> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs> + </ClCompile> + <ClCompile Include="..\Common\Language.c" /> + <ClCompile Include="..\Common\Password.c" /> + <ClCompile Include="..\Common\Pkcs5.c" /> + <ClCompile Include="..\Common\Progress.c" /> + <ClCompile Include="..\Common\Random.c" /> + <ClCompile Include="..\Common\Registry.c" /> + <ClCompile Include="..\Common\SecurityToken.cpp" /> + <ClCompile Include="..\Common\Tests.c" /> + <ClCompile Include="..\Common\Volumes.c" /> + <ClCompile Include="..\Common\Wipe.c" /> + <ClCompile Include="..\Common\Xml.c" /> + <ClCompile Include="..\Common\Xts.c" /> + </ItemGroup> + <ItemGroup> + <Midl Include="FormatCom.idl" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\Common\BaseCom.h" /> + <ClInclude Include="..\Common\Common.h" /> + <ClInclude Include="..\Common\Crc.h" /> + <ClInclude Include="..\Common\Crypto.h" /> + <ClInclude Include="..\Common\Dictionary.h" /> + <ClInclude Include="..\Common\Dlgcode.h" /> + <ClInclude Include="..\Common\EncryptionThreadPool.h" /> + <ClInclude Include="..\Common\Endian.h" /> + <ClInclude Include="..\Common\Exception.h" /> + <ClInclude Include="..\Common\Fat.h" /> + <ClInclude Include="..\Common\Format.h" /> + <ClInclude Include="..\Common\XUnzip.h" /> + <ClInclude Include="..\Common\XZip.h" /> + <ClInclude Include="FormatCom.h" /> + <ClInclude Include="..\Common\GfMul.h" /> + <ClInclude Include="InPlace.h" /> + <ClInclude Include="..\Common\Keyfiles.h" /> + <ClInclude Include="..\Common\Language.h" /> + <ClInclude Include="..\Mount\Mount.h" /> + <ClInclude Include="..\Common\Pkcs5.h" /> + <ClInclude Include="..\Common\Progress.h" /> + <ClInclude Include="..\Common\Random.h" /> + <ClInclude Include="..\Common\Registry.h" /> + <ClInclude Include="resource.h" /> + <ClInclude Include="..\Common\Resource.h" /> + <ClInclude Include="..\Common\SecurityToken.h" /> + <ClInclude Include="..\Common\Tcdefs.h" /> + <ClInclude Include="Tcformat.h" /> + <ClInclude Include="..\Common\Tests.h" /> + <ClInclude Include="..\Common\Volumes.h" /> + <ClInclude Include="..\Common\Wipe.h" /> + <ClInclude Include="..\Common\Xml.h" /> + <ClInclude Include="..\Common\Xts.h" /> + </ItemGroup> + <ItemGroup> + <None Include="..\Boot\Windows\Release_Camellia\BootSector.bin" /> + <None Include="..\Boot\Windows\Release_Camellia_SHA2\BootSector.bin" /> + <None Include="..\Boot\Windows\Release_Serpent_SHA2\BootSector.bin" /> + <None Include="..\Boot\Windows\Rescue_Camellia\BootSector.bin" /> + <None Include="..\Boot\Windows\Rescue_Camellia_SHA2\BootSector.bin" /> + <None Include="..\Boot\Windows\Rescue_Twofish_SHA2\BootSector.bin" /> + <None Include="..\Boot\Windows\Rescue_Serpent_SHA2\BootSector.bin" /> + <None Include="..\Boot\Windows\Rescue_AES_SHA2\BootSector.bin" /> + <None Include="..\Boot\Windows\Rescue_SHA2\BootSector.bin" /> + <None Include="..\Boot\Windows\Release_SHA2\BootSector.bin" /> + <None Include="..\Boot\Windows\Release_AES_SHA2\BootSector.bin" /> + <None Include="..\Boot\Windows\Release_Twofish_SHA2\BootSector.bin" /> + <None Include="Format.tlb"> + <SubType>Designer</SubType> + </None> + <None Include="..\Common\VeraCrypt_mounted.ico" /> + <None Include="..\Common\VeraCrypt_Volume.ico" /> + <None Include="VeraCrypt_wizard.bmp" /> + <None Include="..\Boot\Windows\Release_AES\BootLoader.com.gz" /> + <None Include="..\Boot\Windows\Release\BootLoader.com.gz" /> + <None Include="..\Boot\Windows\Release_Twofish\BootLoader.com.gz" /> + <None Include="..\Boot\Windows\Rescue_Serpent\BootLoader.com.gz" /> + <None Include="..\Boot\Windows\Rescue_AES\BootLoader.com.gz" /> + <None Include="..\Boot\Windows\Rescue\BootLoader.com.gz" /> + <None Include="..\Boot\Windows\Rescue_Twofish\BootLoader.com.gz" /> + <None Include="..\Boot\Windows\Release_Serpent\BootLoader.com.gz" /> + <None Include="..\Boot\Windows\Rescue_AES\BootSector.bin" /> + <None Include="..\Boot\Windows\Rescue\BootSector.bin" /> + <None Include="..\Boot\Windows\Release\BootSector.bin" /> + <None Include="..\Boot\Windows\Release_Serpent\BootSector.bin" /> + <None Include="..\Boot\Windows\Rescue_Serpent\BootSector.bin" /> + <None Include="..\Boot\Windows\Rescue_Twofish\BootSector.bin" /> + <None Include="..\Boot\Windows\Release_Twofish\BootSector.bin" /> + <None Include="..\Boot\Windows\Release_AES\BootSector.bin" /> + <None Include="..\Boot\Windows\Release\Decompressor.com" /> + <None Include="..\Common\Language.xml" /> + <None Include="..\Resources\Texts\License.rtf" /> + <None Include="..\Common\Textual_logo_288dpi.bmp" /> + <None Include="..\Common\Textual_logo_96dpi.bmp" /> + <None Include="..\Common\Textual_logo_background.bmp" /> + <None Include="..\Common\VeraCrypt.ico" /> + </ItemGroup> + <ItemGroup> + <Manifest Include="Format.manifest" /> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="Format.rc" /> + <ResourceCompile Include="..\Common\Common.rc"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> + </ResourceCompile> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\Boot\Windows\Boot.vcxproj"> + <Project>{8b7f059f-e4c7-4e11-88f5-ee8b8433072e}</Project> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + </ProjectReference> + <ProjectReference Include="..\Crypto\Crypto.vcxproj"> + <Project>{993245cf-6b70-47ee-91bb-39f8fc6dc0e7}</Project> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + </ProjectReference> + <ProjectReference Include="..\Driver\Driver.vcxproj"> + <Project>{ef5ef444-18d0-40d7-8dfa-775ec4448602}</Project> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + </ProjectReference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/src/Format/Format.vcxproj.filters b/src/Format/Format.vcxproj.filters new file mode 100644 index 00000000..03d22739 --- /dev/null +++ b/src/Format/Format.vcxproj.filters @@ -0,0 +1,356 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Source Files\Common"> + <UniqueIdentifier>{c45e7f30-87b6-4c8e-9035-9a00f8b2ecb7}</UniqueIdentifier> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions> + </Filter> + <Filter Include="Resource Files\Common"> + <UniqueIdentifier>{881fda51-0ca5-4603-9de7-c618932554b4}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="FormatCom.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="InPlace.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="Tcformat.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\Common\BaseCom.cpp"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\BootEncryption.cpp"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Cmdline.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Combo.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Crc.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Crypto.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Dictionary.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Dlgcode.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\EncryptionThreadPool.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Endian.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Fat.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Format.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\GfMul.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Keyfiles.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Language.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Password.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Pkcs5.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Progress.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Random.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Registry.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\SecurityToken.cpp"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Tests.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Volumes.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Wipe.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Xml.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Xts.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\XZip.cpp"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\XUnzip.cpp"> + <Filter>Source Files\Common</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <Midl Include="FormatCom.idl"> + <Filter>Source Files</Filter> + </Midl> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\Common\BaseCom.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Common.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Crc.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Crypto.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Dictionary.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Dlgcode.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\EncryptionThreadPool.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Endian.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Exception.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Fat.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Format.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="FormatCom.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\GfMul.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="InPlace.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Keyfiles.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Language.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Mount\Mount.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Pkcs5.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Progress.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Random.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Registry.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="resource.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Resource.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\SecurityToken.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Tcdefs.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="Tcformat.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Tests.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Volumes.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Wipe.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Xml.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Xts.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\XZip.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\XUnzip.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <None Include="..\Boot\Windows\Release_Serpent_SHA2\BootSector.bin"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Boot\Windows\Rescue_Twofish_SHA2\BootSector.bin"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Boot\Windows\Rescue_Serpent_SHA2\BootSector.bin"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Boot\Windows\Rescue_AES_SHA2\BootSector.bin"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Boot\Windows\Rescue_SHA2\BootSector.bin"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Boot\Windows\Release_SHA2\BootSector.bin"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Boot\Windows\Release_AES_SHA2\BootSector.bin"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Boot\Windows\Release_Twofish_SHA2\BootSector.bin"> + <Filter>Resource Files</Filter> + </None> + <None Include="Format.tlb"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Common\VeraCrypt_mounted.ico"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Common\VeraCrypt_Volume.ico"> + <Filter>Resource Files</Filter> + </None> + <None Include="VeraCrypt_wizard.bmp"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Boot\Windows\Release_AES\BootLoader.com.gz"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Release\BootLoader.com.gz"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Release_Twofish\BootLoader.com.gz"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Rescue_Serpent\BootLoader.com.gz"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Rescue_AES\BootLoader.com.gz"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Rescue\BootLoader.com.gz"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Rescue_Twofish\BootLoader.com.gz"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Release_Serpent\BootLoader.com.gz"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Rescue_AES\BootSector.bin"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Rescue\BootSector.bin"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Release\BootSector.bin"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Release_Serpent\BootSector.bin"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Rescue_Serpent\BootSector.bin"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Rescue_Twofish\BootSector.bin"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Release_Twofish\BootSector.bin"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Release_AES\BootSector.bin"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Release\Decompressor.com"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Common\Language.xml"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Resources\Texts\License.rtf"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Common\Textual_logo_288dpi.bmp"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Common\Textual_logo_96dpi.bmp"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Common\Textual_logo_background.bmp"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Common\VeraCrypt.ico"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Boot\Windows\Release_Camellia\BootSector.bin"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Boot\Windows\Release_Camellia_SHA2\BootSector.bin"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Boot\Windows\Rescue_Camellia\BootSector.bin"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Boot\Windows\Rescue_Camellia_SHA2\BootSector.bin"> + <Filter>Resource Files</Filter> + </None> + </ItemGroup> + <ItemGroup> + <Manifest Include="Format.manifest"> + <Filter>Resource Files</Filter> + </Manifest> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="Format.rc"> + <Filter>Resource Files</Filter> + </ResourceCompile> + <ResourceCompile Include="..\Common\Common.rc"> + <Filter>Resource Files\Common</Filter> + </ResourceCompile> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/src/Format/Format.vcxproj.user b/src/Format/Format.vcxproj.user new file mode 100644 index 00000000..ace9a86a --- /dev/null +++ b/src/Format/Format.vcxproj.user @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +</Project>
\ No newline at end of file diff --git a/src/Format/FormatCom.cpp b/src/Format/FormatCom.cpp index 96e3e3cd..2aa5cea9 100644 --- a/src/Format/FormatCom.cpp +++ b/src/Format/FormatCom.cpp @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + Modifications and additions to the original source code (contained in this file) and all other portions of this file are Copyright (c) 2013-2016 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source @@ -74,7 +74,7 @@ public: AddRef (); return S_OK; } - + virtual DWORD STDMETHODCALLTYPE CallDriver (DWORD ioctl, BSTR input, BSTR *output) { return BaseCom::CallDriver (ioctl, input, output); @@ -137,6 +137,46 @@ public: return ::FormatFs (driveNo, clusterSize, fsType); } + virtual DWORD STDMETHODCALLTYPE GetFileSize (BSTR filePath, unsigned __int64 *pSize) + { + return BaseCom::GetFileSize (filePath, pSize); + } + + virtual DWORD STDMETHODCALLTYPE DeviceIoControl (BOOL readOnly, BOOL device, BSTR filePath, DWORD dwIoControlCode, BSTR input, BSTR *output) + { + return BaseCom::DeviceIoControl (readOnly, device, filePath, dwIoControlCode, input, output); + } + + virtual DWORD STDMETHODCALLTYPE InstallEfiBootLoader (BOOL preserveUserConfig, BOOL hiddenOSCreation, int pim, int hashAlg) + { + return BaseCom::InstallEfiBootLoader (preserveUserConfig, hiddenOSCreation, pim, hashAlg); + } + + virtual DWORD STDMETHODCALLTYPE BackupEfiSystemLoader () + { + return BaseCom::BackupEfiSystemLoader (); + } + + virtual DWORD STDMETHODCALLTYPE RestoreEfiSystemLoader () + { + return BaseCom::RestoreEfiSystemLoader (); + } + + virtual DWORD STDMETHODCALLTYPE GetEfiBootDeviceNumber (BSTR* pSdn) + { + return BaseCom::GetEfiBootDeviceNumber (pSdn); + } + + virtual DWORD STDMETHODCALLTYPE ReadEfiConfig (BSTR* pContent, DWORD *pcbRead) + { + return BaseCom::ReadEfiConfig (pContent, pcbRead); + } + + virtual DWORD STDMETHODCALLTYPE WriteEfiBootSectorUserConfig (DWORD userConfig, BSTR customUserMessage, int pim, int hashAlg) + { + return BaseCom::WriteEfiBootSectorUserConfig (userConfig, customUserMessage,pim, hashAlg); + } + protected: DWORD MessageThreadId; LONG RefCount; diff --git a/src/Format/FormatCom.idl b/src/Format/FormatCom.idl index 23d987a7..1eb09b43 100644 --- a/src/Format/FormatCom.idl +++ b/src/Format/FormatCom.idl @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + Modifications and additions to the original source code (contained in this file) and all other portions of this file are Copyright (c) 2013-2016 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source @@ -16,7 +16,7 @@ import "..\Common\Password.h"; [ uuid(56327DDA-F1A7-4e13-B128-520D129BDEF6), helpstring("VeraCrypt Format UAC Support Library"), - version(2.5) // Update ComSetup.cpp when changing version number + version(2.6) // Update ComSetup.cpp when changing version number ] library TrueCryptFormatCom { @@ -40,6 +40,14 @@ library TrueCryptFormatCom DWORD SetDriverServiceStartType (DWORD startType); DWORD WriteLocalMachineRegistryDwordValue (BSTR keyPath, BSTR valueName, DWORD value); BOOL FormatFs (int driveNo, int clusterSize, int fsType); + DWORD GetFileSize (BSTR filePath, unsigned __int64* pSize); + DWORD DeviceIoControl (BOOL readOnly, BOOL device, BSTR filePath, DWORD dwIoControlCode, BSTR input, BSTR *output); + DWORD InstallEfiBootLoader (BOOL preserveUserConfig, BOOL hiddenOSCreation, int pim, int hashAlg); + DWORD BackupEfiSystemLoader (); + DWORD RestoreEfiSystemLoader (); + DWORD GetEfiBootDeviceNumber (BSTR* pSdn); + DWORD ReadEfiConfig (BSTR* pContent, DWORD *pcbRead); + DWORD WriteEfiBootSectorUserConfig (DWORD userConfig, BSTR customUserMessage, int pim, int hashAlg); }; [ diff --git a/src/Format/InPlace.c b/src/Format/InPlace.c index d3b3212b..cfae573f 100644 --- a/src/Format/InPlace.c +++ b/src/Format/InPlace.c @@ -566,6 +566,8 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol // Prepare the backup header for (int wipePass = 0; wipePass < (wipeAlgorithm == TC_WIPE_NONE ? 1 : PRAND_HEADER_WIPE_PASSES); wipePass++) { + PCRYPTO_INFO dummyInfo = NULL; + nStatus = CreateVolumeHeaderInMemory (hwndDlg, FALSE, header, volParams->ea, @@ -603,10 +605,51 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol } // Fill the reserved sectors of the backup header area with random data - nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, cryptoInfo, dataAreaSize, FALSE, TRUE); + nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, cryptoInfo, dataAreaSize, FALSE, TRUE, TRUE); + + if (nStatus != ERR_SUCCESS) + goto closing_seq; + + // write fake hidden volume header to protect against attacks that use statistical entropy + // analysis to detect presence of hidden volumes + nStatus = CreateVolumeHeaderInMemory (hwndDlg, FALSE, + header, + volParams->ea, + FIRST_MODE_OF_OPERATION_ID, + NULL, + 0, + 0, + NULL, + &dummyInfo, + dataAreaSize, + dataAreaSize, + TC_VOLUME_DATA_OFFSET + dataAreaSize, // Start of the encrypted area = the first byte of the backup heeader (encrypting from the end) + dataAreaSize, // No data is encrypted yet + 0, + volParams->headerFlags | TC_HEADER_FLAG_NONSYS_INPLACE_ENC, + volParams->sectorSize, + wipeAlgorithm == TC_WIPE_NONE ? FALSE : (wipePass < PRAND_HEADER_WIPE_PASSES - 1)); if (nStatus != ERR_SUCCESS) goto closing_seq; + + crypto_close (dummyInfo); + + offset.QuadPart += TC_HIDDEN_VOLUME_HEADER_OFFSET; + + if (!SetFilePointerEx (dev, offset, NULL, FILE_BEGIN)) + { + nStatus = ERR_OS_ERROR; + goto closing_seq; + } + + // Write the fake hidden backup header to the partition + if (!WriteEffectiveVolumeHeader (TRUE, dev, (byte *) header)) + { + nStatus = ERR_OS_ERROR; + goto closing_seq; + } + } @@ -1045,6 +1088,8 @@ inplace_enc_read: for (int wipePass = 0; wipePass < (wipeAlgorithm == TC_WIPE_NONE ? 1 : PRAND_HEADER_WIPE_PASSES); wipePass++) { + PCRYPTO_INFO dummyInfo = NULL; + nStatus = CreateVolumeHeaderInMemory (hwndDlg, FALSE, header, headerCryptoInfo->ea, @@ -1077,10 +1122,44 @@ inplace_enc_read: } // Fill the reserved sectors of the header area with random data - nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, headerCryptoInfo, masterCryptoInfo->VolumeSize.Value, TRUE, FALSE); + nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, headerCryptoInfo, masterCryptoInfo->VolumeSize.Value, TRUE, FALSE, TRUE); if (nStatus != ERR_SUCCESS) goto closing_seq; + + // write fake hidden volume header to protect against attacks that use statistical entropy + // analysis to detect presence of hidden volumes + nStatus = CreateVolumeHeaderInMemory (hwndDlg, FALSE, + header, + headerCryptoInfo->ea, + headerCryptoInfo->mode, + NULL, + 0, + 0, + NULL, + &dummyInfo, + masterCryptoInfo->VolumeSize.Value, + masterCryptoInfo->VolumeSize.Value, + masterCryptoInfo->EncryptedAreaStart.Value, + masterCryptoInfo->EncryptedAreaLength.Value, + masterCryptoInfo->RequiredProgramVersion, + masterCryptoInfo->HeaderFlags | TC_HEADER_FLAG_NONSYS_INPLACE_ENC, + masterCryptoInfo->SectorSize, + wipeAlgorithm == TC_WIPE_NONE ? FALSE : (wipePass < PRAND_HEADER_WIPE_PASSES - 1)); + + if (nStatus != ERR_SUCCESS) + goto closing_seq; + + crypto_close (dummyInfo); + + offset.QuadPart += TC_HIDDEN_VOLUME_HEADER_OFFSET; + + if (SetFilePointerEx (dev, offset, NULL, FILE_BEGIN) == 0 + || !WriteEffectiveVolumeHeader (TRUE, dev, (byte *) header)) + { + nStatus = ERR_OS_ERROR; + goto closing_seq; + } } // Update the configuration files diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index 40c17d66..31140fd7 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -51,6 +51,7 @@ #include "Volumes.h" #include "Wipe.h" #include "Xml.h" +#include "SecurityToken.h" #include <Strsafe.h> @@ -254,6 +255,8 @@ BOOL bOperationSuccess = FALSE; BOOL bGuiMode = TRUE; +BOOL bSystemIsGPT = FALSE; + int nPbar = 0; /* Control ID of progress bar:- for format code */ wchar_t HeaderKeyGUIView [KEY_GUI_VIEW_SIZE]; @@ -930,11 +933,13 @@ static BOOL SysDriveOrPartitionFullyEncrypted (BOOL bSilent) BOOL SwitchWizardToSysEncMode (void) { WaitCursor (); + SystemDriveConfiguration config; try { BootEncStatus = BootEncObj->GetStatus(); bWholeSysDrive = BootEncObj->SystemPartitionCoversWholeDrive(); + config = BootEncObj->GetSystemDriveConfiguration (); } catch (Exception &e) { @@ -1412,6 +1417,24 @@ void ComboSelChangeEA (HWND hwndDlg) SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("TWOFISH_HELP")); } + else if (wcsncmp (name, L"GOST89", 6) == 0) + { + StringCbPrintfW (hyperLink, sizeof(hyperLink) / 2, GetString ("MORE_INFO_ABOUT"), L"GOST89"); + + SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("GOST89_HELP")); + } + else if (wcscmp (name, L"Kuznyechik") == 0) + { + StringCbPrintfW (hyperLink, sizeof(hyperLink) / 2, GetString ("MORE_INFO_ABOUT"), name); + + SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("KUZNYECHIK_HELP")); + } + else if (wcscmp (name, L"Camellia") == 0) + { + StringCbPrintfW (hyperLink, sizeof(hyperLink) / 2, GetString ("MORE_INFO_ABOUT"), name); + + SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("CAMELLIA_HELP")); + } else if (EAGetCipherCount (nIndex) > 1) { // Cascade @@ -1582,6 +1605,10 @@ static void RefreshMultiBootControls (HWND hwndDlg) nMultiBoot = 1; #endif + // For now, we force single configuration in wizard + if (bSystemIsGPT && nMultiBoot == 0) + nMultiBoot = 1; + SendMessage (GetDlgItem (hwndDlg, IDC_SINGLE_BOOT), BM_SETCHECK, nMultiBoot == 1 ? BST_CHECKED : BST_UNCHECKED, @@ -3605,6 +3632,13 @@ static BOOL FileSize4GBLimitQuestionNeeded (void) } +void DisableIfGpt(HWND control) +{ + if (bSystemIsGPT) { + EnableWindow(control, FALSE); + } +} + /* Except in response to the WM_INITDIALOG message, the dialog box procedure should return nonzero if it processes the message, and zero if it does not. - see DialogProc */ @@ -3662,6 +3696,8 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa SendMessage (GetDlgItem (hwndDlg, IDC_SYSENC_HIDDEN), WM_SETFONT, (WPARAM) hUserBoldFont, (LPARAM) TRUE); SendMessage (GetDlgItem (hwndDlg, IDC_SYSENC_NORMAL), WM_SETFONT, (WPARAM) hUserBoldFont, (LPARAM) TRUE); + DisableIfGpt(GetDlgItem(hwndDlg, IDC_SYSENC_HIDDEN)); + CheckButton (GetDlgItem (hwndDlg, bHiddenOS ? IDC_SYSENC_HIDDEN : IDC_SYSENC_NORMAL)); SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("SYSENC_HIDDEN_TYPE_HELP")); @@ -3701,6 +3737,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa SetWindowTextW (GetDlgItem (hwndDlg, IDT_WHOLE_SYS_DRIVE), GetString ("SYS_ENCRYPTION_SPAN_WHOLE_SYS_DRIVE_HELP")); CheckButton (GetDlgItem (hwndDlg, bWholeSysDrive ? IDC_WHOLE_SYS_DRIVE : IDC_SYS_PARTITION)); + DisableIfGpt(GetDlgItem(hwndDlg, IDC_WHOLE_SYS_DRIVE)); SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT")); SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV")); @@ -3778,7 +3815,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDCANCEL), GetString ("CANCEL")); RefreshMultiBootControls (hwndDlg); - + DisableIfGpt(GetDlgItem(hwndDlg, IDC_MULTI_BOOT)); EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), nMultiBoot > 0); EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), TRUE); EnableWindow (GetDlgItem (GetParent (hwndDlg), IDCANCEL), TRUE); @@ -4040,7 +4077,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa for (ea = EAGetFirst (); ea != 0; ea = EAGetNext (ea)) { - if (EAIsFormatEnabled (ea)) + if (EAIsFormatEnabled (ea) && (!SysEncInEffect () || bSystemIsGPT || EAIsMbrSysEncEnabled (ea))) AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX), EAGetName (buf, ea, 1), ea); } @@ -4054,13 +4091,13 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa if (SysEncInEffect ()) { - hash_algo = DEFAULT_HASH_ALGORITHM_BOOT; + hash_algo = bSystemIsGPT? SHA512 : DEFAULT_HASH_ALGORITHM_BOOT; RandSetHashFunction (hash_algo); for (hid = FIRST_PRF_ID; hid <= LAST_PRF_ID; hid++) { // For now, we keep RIPEMD160 for system encryption - if (((hid == RIPEMD160) || !HashIsDeprecated (hid)) && HashForSystemEncryption (hid)) + if (((hid == RIPEMD160) || !HashIsDeprecated (hid)) && (bSystemIsGPT || HashForSystemEncryption (hid))) AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO), HashGetName(hid), hid); } } @@ -4450,11 +4487,10 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("RESCUE_DISK")); SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT")); SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV")); - SetWindowTextW (GetDlgItem (hwndDlg, IDT_RESCUE_DISK_INFO), GetString ("RESCUE_DISK_INFO")); + SetWindowTextW (GetDlgItem (hwndDlg, IDT_RESCUE_DISK_INFO), bSystemIsGPT? GetString ("RESCUE_DISK_EFI_INFO"): GetString ("RESCUE_DISK_INFO")); SetDlgItemText (hwndDlg, IDC_RESCUE_DISK_ISO_PATH, szRescueDiskISO); EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), (GetWindowTextLength (GetDlgItem (hwndDlg, IDC_RESCUE_DISK_ISO_PATH)) > 1)); EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), TRUE); - SetCheckBox (hCurPage, IDC_SKIP_RESCUE_VERIFICATION, bDontVerifyRescueDisk); break; @@ -4466,10 +4502,19 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT")); SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV")); - StringCbPrintfW (szTmp, sizeof szTmp, - GetString (bDontVerifyRescueDisk ? "RESCUE_DISK_BURN_INFO_NO_CHECK" : "RESCUE_DISK_BURN_INFO"), - szRescueDiskISO, IsWindowsIsoBurnerAvailable() ? L"" : GetString ("RESCUE_DISK_BURN_INFO_NONWIN_ISO_BURNER")); + if (bSystemIsGPT) + { + StringCbPrintfW (szTmp, sizeof szTmp, + GetString (bDontVerifyRescueDisk ? "RESCUE_DISK_EFI_EXTRACT_INFO_NO_CHECK" : "RESCUE_DISK_EFI_EXTRACT_INFO"), + szRescueDiskISO, GetString ("RESCUE_DISK_EFI_EXTRACT_INFO_NOTE")); + } + else + { + StringCbPrintfW (szTmp, sizeof szTmp, + GetString (bDontVerifyRescueDisk ? "RESCUE_DISK_BURN_INFO_NO_CHECK" : "RESCUE_DISK_BURN_INFO"), + szRescueDiskISO, IsWindowsIsoBurnerAvailable() ? L"" : GetString ("RESCUE_DISK_BURN_INFO_NONWIN_ISO_BURNER")); + } SetWindowTextW (GetDlgItem (hwndDlg, IDT_RESCUE_DISK_BURN_INFO), szTmp); EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE); @@ -4478,14 +4523,21 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa would be confusion and bug reports). */ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), FALSE); - if (IsWindowsIsoBurnerAvailable()) - SetWindowTextW (GetDlgItem (hwndDlg, IDC_DOWNLOAD_CD_BURN_SOFTWARE), GetString ("LAUNCH_WIN_ISOBURN")); + if (bSystemIsGPT) + { + ShowWindow (GetDlgItem (hwndDlg, IDC_DOWNLOAD_CD_BURN_SOFTWARE), SW_HIDE); + } + else + { + if (IsWindowsIsoBurnerAvailable()) + SetWindowTextW (GetDlgItem (hwndDlg, IDC_DOWNLOAD_CD_BURN_SOFTWARE), GetString ("LAUNCH_WIN_ISOBURN")); - ToHyperlink (hwndDlg, IDC_DOWNLOAD_CD_BURN_SOFTWARE); + ToHyperlink (hwndDlg, IDC_DOWNLOAD_CD_BURN_SOFTWARE); - if (IsWindowsIsoBurnerAvailable() && !bDontVerifyRescueDisk) - LaunchWindowsIsoBurner (hwndDlg, szRescueDiskISO); - } + if (IsWindowsIsoBurnerAvailable() && !bDontVerifyRescueDisk) + LaunchWindowsIsoBurner (hwndDlg, szRescueDiskISO); + } + } break; case SYSENC_RESCUE_DISK_VERIFIED_PAGE: @@ -5442,7 +5494,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa DialogBoxParamW (hInst, MAKEINTRESOURCEW (IDD_BENCHMARK_DLG), hwndDlg, - (DLGPROC) BenchmarkDlgProc, (LPARAM) NULL); + (DLGPROC) BenchmarkDlgProc, (LPARAM) bSystemIsGPT); bFastPollEnabled = TRUE; bRandmixEnabled = TRUE; @@ -5464,6 +5516,12 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa Applink ("serpent", FALSE, ""); else if (wcscmp (name, L"Twofish") == 0) Applink ("twofish", FALSE, ""); + else if (wcscmp (name, L"GOST89") == 0) + Applink ("gost89", FALSE, ""); + else if (wcscmp (name, L"Kuznyechik") == 0) + Applink ("kuznyechik", FALSE, ""); + else if (wcscmp (name, L"Camellia") == 0) + Applink ("camellia", FALSE, ""); else if (EAGetCipherCount (nIndex) > 1) Applink ("cascades", TRUE, ""); @@ -5784,7 +5842,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa { HWND hHashAlgoItem = GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO); int selectedAlgo = (int) SendMessage (hHashAlgoItem, CB_GETITEMDATA, SendMessage (hHashAlgoItem, CB_GETCURSEL, 0, 0), 0); - if (!HashForSystemEncryption(selectedAlgo)) + if (!bSystemIsGPT && !HashForSystemEncryption(selectedAlgo)) { hash_algo = DEFAULT_HASH_ALGORITHM_BOOT; RandSetHashFunction (DEFAULT_HASH_ALGORITHM_BOOT); @@ -5972,6 +6030,14 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa return 0; } + try + { + bSystemIsGPT = BootEncObj->GetSystemDriveConfiguration().SystemPartition.IsGPT; + } + catch (...) + { + } + SendMessageW (GetDlgItem (hwndDlg, IDC_BOX_TITLE), WM_SETFONT, (WPARAM) hTitleFont, (LPARAM) TRUE); SetWindowTextW (hwndDlg, lpszTitle); @@ -6153,7 +6219,10 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa } SHGetFolderPath (NULL, CSIDL_MYDOCUMENTS, NULL, 0, szRescueDiskISO); - StringCbCatW (szRescueDiskISO, sizeof(szRescueDiskISO), L"\\VeraCrypt Rescue Disk.iso"); + if (bSystemIsGPT) + StringCbCatW (szRescueDiskISO, sizeof(szRescueDiskISO), L"\\VeraCrypt Rescue Disk.zip"); + else + StringCbCatW (szRescueDiskISO, sizeof(szRescueDiskISO), L"\\VeraCrypt Rescue Disk.iso"); if (IsOSAtLeast (WIN_VISTA)) { @@ -7326,7 +7395,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa nIndex = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETCURSEL, 0, 0); nVolumeEA = (int) SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0); - if (SysEncInEffect () + if (!bSystemIsGPT && SysEncInEffect () && EAGetCipherCount (nVolumeEA) > 1) // Cascade? { if (AskWarnNoYes ("CONFIRM_CASCADE_FOR_SYS_ENCRYPTION", hwndDlg) == IDNO) @@ -7910,40 +7979,43 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa return 1; } -retryCDDriveCheck: - if (!bDontVerifyRescueDisk && !BootEncObj->IsCDRecorderPresent()) + if (!bSystemIsGPT) { - char *multiChoiceStr[] = { 0, "CD_BURNER_NOT_PRESENT", - "CD_BURNER_NOT_PRESENT_WILL_STORE_ISO", - "CD_BURNER_NOT_PRESENT_WILL_CONNECT_LATER", - "CD_BURNER_NOT_PRESENT_CONNECTED_NOW", - 0 }; - - switch (AskMultiChoice ((void **) multiChoiceStr, FALSE, hwndDlg)) +retryCDDriveCheck: + if (!bDontVerifyRescueDisk && !BootEncObj->IsCDRecorderPresent()) { - case 1: - wchar_t msg[8192]; - StringCchPrintfW (msg, array_capacity (msg), GetString ("CD_BURNER_NOT_PRESENT_WILL_STORE_ISO_INFO"), szRescueDiskISO); - WarningDirect (msg, hwndDlg); + char *multiChoiceStr[] = { 0, "CD_BURNER_NOT_PRESENT", + "CD_BURNER_NOT_PRESENT_WILL_STORE_ISO", + "CD_BURNER_NOT_PRESENT_WILL_CONNECT_LATER", + "CD_BURNER_NOT_PRESENT_CONNECTED_NOW", + 0 }; - Warning ("RESCUE_DISK_BURN_NO_CHECK_WARN", hwndDlg); - bDontVerifyRescueDisk = TRUE; - nNewPageNo = SYSENC_RESCUE_DISK_VERIFIED_PAGE; - break; + switch (AskMultiChoice ((void **) multiChoiceStr, FALSE, hwndDlg)) + { + case 1: + wchar_t msg[8192]; + StringCchPrintfW (msg, array_capacity (msg), GetString ("CD_BURNER_NOT_PRESENT_WILL_STORE_ISO_INFO"), szRescueDiskISO); + WarningDirect (msg, hwndDlg); - case 2: - AbortProcessSilent(); + Warning ("RESCUE_DISK_BURN_NO_CHECK_WARN", hwndDlg); + bDontVerifyRescueDisk = TRUE; + nNewPageNo = SYSENC_RESCUE_DISK_VERIFIED_PAGE; + break; - case 3: - break; + case 2: + AbortProcessSilent(); - default: - goto retryCDDriveCheck; + case 3: + break; + + default: + goto retryCDDriveCheck; + } } - } - if (IsWindowsIsoBurnerAvailable() && !bDontVerifyRescueDisk) - Info ("RESCUE_DISK_WIN_ISOBURN_PRELAUNCH_NOTE", hwndDlg); + if (IsWindowsIsoBurnerAvailable() && !bDontVerifyRescueDisk) + Info ("RESCUE_DISK_WIN_ISOBURN_PRELAUNCH_NOTE", hwndDlg); + } NormalCursor (); } @@ -7961,8 +8033,15 @@ retryCDDriveCheck: { wchar_t szTmp[8000]; - StringCbPrintfW (szTmp, sizeof(szTmp), GetString ("RESCUE_DISK_CHECK_FAILED"), - IsWindowsIsoBurnerAvailable () ? L"" : GetString ("RESCUE_DISK_CHECK_FAILED_SENTENCE_APPENDIX")); + if (bSystemIsGPT) + { + StringCbCopyW (szTmp, sizeof(szTmp), GetString ("RESCUE_DISK_EFI_CHECK_FAILED")); + } + else + { + StringCbPrintfW (szTmp, sizeof(szTmp), GetString ("RESCUE_DISK_CHECK_FAILED"), + IsWindowsIsoBurnerAvailable () ? L"" : GetString ("RESCUE_DISK_CHECK_FAILED_SENTENCE_APPENDIX")); + } ErrorDirect (szTmp, hwndDlg); @@ -8024,7 +8103,7 @@ retryCDDriveCheck: } #endif - BootEncObj->Install (bHiddenOS ? true : false); + BootEncObj->Install (bHiddenOS ? true : false, hash_algo); } catch (Exception &e) { @@ -8777,6 +8856,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) OptionNoIsoCheck, OptionQuit, OptionTokenLib, + OptionTokenPin, CommandResumeSysEncLogOn, CommandResumeSysEnc, CommandDecryptSysEnc, @@ -8806,6 +8886,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) { OptionHistory, L"/history", L"/h", FALSE }, { OptionNoIsoCheck, L"/noisocheck", L"/n", FALSE }, { OptionTokenLib, L"/tokenlib", NULL, FALSE }, + { OptionTokenPin, L"/tokenpin", NULL, FALSE }, { OptionQuit, L"/quit", L"/q", FALSE }, { OptionEncryption, L"/encryption", NULL , FALSE }, { OptionFilesystem, L"/filesystem", NULL , FALSE }, @@ -9190,6 +9271,20 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) break; + case OptionTokenPin: + { + wchar_t szTmp[SecurityToken::MaxPasswordLength + 1] = {0}; + if (GetArgumentValue (lpszCommandLineArgs, &i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp)) == HAS_ARGUMENT) + { + if (0 == WideCharToMultiByte (CP_UTF8, 0, szTmp, -1, CmdTokenPin, TC_MAX_PATH, nullptr, nullptr)) + AbortProcess ("COMMAND_LINE_ERROR"); + } + else + AbortProcess ("COMMAND_LINE_ERROR"); + } + + break; + case OptionQuit: { // Used to indicate non-install elevation |