mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-06-17 10:06:06 -05:00
Windows: support new Microsoft EFI CA bootloaders
Embed both Microsoft UEFI CA 2011 and 2023 signed DCS EFI sets and select the 2023 set only when the firmware db trusts the required 2023 third-party CAs. Fall back to the 2011 EFI set when firmware db state cannot be determined, preserving pre-existing compatibility behavior and recording the reason in HKLM diagnostics. Refresh installed ESP modules during PostOOBE repair, keep backups before replacing existing DCS modules, and use the selected EFI set when creating rescue media. Record the selected EFI bootloader resource set and selection reason in HKLM, allow larger firmware db variables on systems with many Secure Boot certificates, and remove diagnostic registry keys on uninstall. Fix MSI SetupDLL COM typelib version constants so unregister targets the current Main and Format COM typelib versions. References: https://github.com/veracrypt/VeraCrypt/issues/1655
This commit is contained in:
@@ -10,11 +10,13 @@
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
// Keep these in sync with MainCom.idl and FormatCom.idl. MSI unregister targets these
|
||||
// exact typelib versions before removing older versions.
|
||||
#define TC_MAIN_COM_VERSION_MAJOR 2
|
||||
#define TC_MAIN_COM_VERSION_MINOR 11
|
||||
#define TC_MAIN_COM_VERSION_MINOR 14
|
||||
|
||||
#define TC_FORMAT_COM_VERSION_MAJOR 2
|
||||
#define TC_FORMAT_COM_VERSION_MINOR 9
|
||||
#define TC_FORMAT_COM_VERSION_MINOR 11
|
||||
|
||||
#include <atlbase.h>
|
||||
#include <comdef.h>
|
||||
@@ -52,9 +54,9 @@ extern "C" BOOL RegisterComServers (wchar_t *modulePath)
|
||||
UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR, 0, SYS_WIN32);
|
||||
UnRegisterTypeLib (LIBID_TrueCryptFormatCom, TC_FORMAT_COM_VERSION_MAJOR, TC_FORMAT_COM_VERSION_MINOR, 0, SYS_WIN32);
|
||||
// unregister older versions that may still exist
|
||||
for (WORD i = 7; i >= 1; i--)
|
||||
for (WORD i = 9; i >= 1; i--)
|
||||
UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR-i, 0, SYS_WIN32);
|
||||
for (WORD i = 5; i >= 1; i--)
|
||||
for (WORD i = 6; i >= 1; i--)
|
||||
UnRegisterTypeLib (LIBID_TrueCryptFormatCom, TC_FORMAT_COM_VERSION_MAJOR, TC_FORMAT_COM_VERSION_MINOR-i, 0, SYS_WIN32);
|
||||
|
||||
CRegObject ro;
|
||||
@@ -95,9 +97,9 @@ extern "C" BOOL UnregisterComServers (wchar_t *modulePath)
|
||||
return FALSE;
|
||||
|
||||
// unregister older versions that may still exist
|
||||
for (WORD i = 7; i >= 1; i--)
|
||||
for (WORD i = 9; i >= 1; i--)
|
||||
UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR-i, 0, SYS_WIN32);
|
||||
for (WORD i = 5; i >= 1; i--)
|
||||
for (WORD i = 6; i >= 1; i--)
|
||||
UnRegisterTypeLib (LIBID_TrueCryptFormatCom, TC_FORMAT_COM_VERSION_MAJOR, TC_FORMAT_COM_VERSION_MINOR-i, 0, SYS_WIN32);
|
||||
|
||||
wchar_t module[1024];
|
||||
|
||||
@@ -1730,6 +1730,9 @@ BOOL DoRegUninstall_Dll (MSIHANDLE hInstaller, BOOL bRemoveDeprecated)
|
||||
RegDeleteKey (HKEY_LOCAL_MACHINE, L"Software\\Classes\\VeraCryptVolume");
|
||||
*/
|
||||
|
||||
DeleteRegistryKey (HKEY_LOCAL_MACHINE, L"Software\\VeraCrypt\\Diagnostics\\EfiBootLoader");
|
||||
RegDeleteKey (HKEY_LOCAL_MACHINE, L"Software\\VeraCrypt\\Diagnostics");
|
||||
|
||||
if (!bRemoveDeprecated)
|
||||
{
|
||||
HKEY hKey;
|
||||
|
||||
Reference in New Issue
Block a user