Changeset 95699 in vbox for trunk/src/VBox/Installer/win/Stub
- Timestamp:
- Jul 18, 2022 9:49:58 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/win/Stub/VBoxStub.cpp
r95696 r95699 805 805 } 806 806 807 808 807 #ifdef VBOX_WITH_CODE_SIGNING 808 809 # ifdef VBOX_WITH_VBOX_LEGACY_TS_CA 810 /** 811 * Install the timestamp CA currently needed to support legacy Windows versions. 812 * 813 * See @bugref{8691} for details. 814 * 815 * @returns Fully complained exit code. 816 */ 817 static RTEXITCODE InstallTimestampCA(bool fForce) 818 { 819 /* 820 * Windows 10 desktop should be fine with attestation signed drivers, however 821 * the driver guard (DG) may alter that. Not sure yet how to detect, but 822 * OTOH 1809 and later won't accept the SHA-1 stuff regardless, so out of 823 * options there. 824 * 825 * The Windows 2016 server and later is not fine with attestation signed 826 * drivers, so we need to do the legacy trick there. 827 */ 828 if ( !fForce 829 && RTSystemGetNtVersion() >= RTSYSTEM_MAKE_NT_VERSION(10, 0, 0) 830 && RTSystemGetNtProductType() == VER_NT_WORKSTATION) 831 return RTEXITCODE_SUCCESS; 832 833 if (!addCertToStore(CERT_SYSTEM_STORE_LOCAL_MACHINE, "Root", g_abVBoxLegacyWinCA, sizeof(g_abVBoxLegacyWinCA))) 834 return ShowError("Failed add the legacy Windows timestamp CA to the root certificate store."); 835 return RTEXITCODE_SUCCESS; 836 } 837 # endif /* VBOX_WITH_VBOX_LEGACY_TS_CA*/ 838 809 839 /** 810 840 * Install the public certificate into TrustedPublishers so the installer won't … … 821 851 g_aVBoxStubTrustedCerts[i].pab, 822 852 g_aVBoxStubTrustedCerts[i].cb)) 823 return ShowError("Failed to construct install certificate."); 824 } 825 826 # ifdef VBOX_WITH_VBOX_LEGACY_TS_CA 827 if ( RTSystemGetNtVersion() < RTSYSTEM_MAKE_NT_VERSION(10, 0, 0) 828 || false /** @todo windows server 2016 and later */ ) 829 { 830 if (!addCertToStore(CERT_SYSTEM_STORE_LOCAL_MACHINE, "Root", g_abVBoxLegacyWinCA, sizeof(g_abVBoxLegacyWinCA))) 831 return ShowError("Failed to construct install certificate."); 832 } 833 # endif 853 return ShowError("Failed to add our certificate(s) to trusted publisher store."); 854 } 834 855 return RTEXITCODE_SUCCESS; 835 856 } 857 836 858 #endif /* VBOX_WITH_CODE_SIGNING */ 837 838 859 839 860 /** … … 1051 1072 #ifdef VBOX_WITH_CODE_SIGNING 1052 1073 bool fEnableSilentCert = true; 1074 bool fInstallTimestampCA = true; 1075 bool fForceTimestampCaInstall = false; 1053 1076 #endif 1054 1077 bool fIgnoreReboot = false; … … 1078 1101 { "-no-silent-cert", 'c', RTGETOPT_REQ_NOTHING }, 1079 1102 { "/no-silent-cert", 'c', RTGETOPT_REQ_NOTHING }, 1103 { "--no-install-timestamp-ca", 't', RTGETOPT_REQ_NOTHING }, 1104 { "--force-install-timestamp-ca", 'T', RTGETOPT_REQ_NOTHING }, 1080 1105 #endif 1081 1106 { "--logging", 'l', RTGETOPT_REQ_NOTHING }, … … 1138 1163 fEnableSilentCert = false; 1139 1164 break; 1165 case 't': 1166 fInstallTimestampCA = false; 1167 break; 1168 case 'T': 1169 fForceTimestampCaInstall = fInstallTimestampCA = true; 1170 break; 1140 1171 #endif 1141 1172 case 'l': … … 1227 1258 " Adds <prop>=<value> to the MSI parameters,\n" 1228 1259 " quoting the property value if necessary\n" 1260 #ifdef VBOX_WITH_CODE_SIGNING 1229 1261 "--no-silent-cert\n" 1230 1262 " Do not install VirtualBox Certificate automatically\n" 1231 1263 " when --silent option is specified\n" 1264 #endif 1265 #ifdef VBOX_WITH_VBOX_LEGACY_TS_CA 1266 "--force-install-timestamp-ca\n" 1267 " Install the timestamp CA needed for supporting\n" 1268 " legacy Windows versions regardless of the version or\n" 1269 " type of Windows VirtualBox is being installed on.\n" 1270 " Default: All except Windows 10 & 11 desktop\n" 1271 "--no-install-timestamp-ca\n" 1272 " Do not install the above mentioned timestamp CA.\n" 1273 #endif 1232 1274 "--path\n" 1233 1275 " Sets the path of the extraction directory\n" … … 1402 1444 rcExit = CopyCustomDir(szExtractPath); 1403 1445 #ifdef VBOX_WITH_CODE_SIGNING 1446 # ifdef VBOX_WITH_VBOX_LEGACY_TS_CA 1447 if (rcExit == RTEXITCODE_SUCCESS && fInstallTimestampCA) 1448 rcExit = InstallTimestampCA(fForceTimestampCaInstall); 1449 # endif 1404 1450 if (rcExit == RTEXITCODE_SUCCESS && fEnableSilentCert && g_fSilent) 1405 1451 rcExit = InstallCertificates();
Note:
See TracChangeset
for help on using the changeset viewer.