VirtualBox

Changeset 64927 in vbox


Ignore:
Timestamp:
Dec 16, 2016 9:43:42 PM (8 years ago)
Author:
vboxsync
Message:

installer/win/VBoxStub: Add all the certificates we use, not just the SHA-1 one.

Location:
trunk/src/VBox/Installer/win/Stub
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/win/Stub/Makefile.kmk

    r62487 r64927  
    5656  VBoxStub.cpp_DEFS += VBOX_WITH_CODE_SIGNING
    5757
    58   $$(VBoxStub_0_OUTDIR)/VBoxStubPublicCert.h: $(VBOX_BIN2C) $(PATH_ROOT)/src/VBox/Additions/WINNT/tools/oracle-vbox.cer | $$(dir $$@)
    59         $(VBOX_BIN2C) _VBoxStubPublicCert $(PATH_ROOT)/src/VBox/Additions/WINNT/tools/oracle-vbox.cer $@
     58  $$(VBoxStub_0_OUTDIR)/VBoxStubPublicCert.h:  | $$(dir $$@) $(VBOX_RTSIGNTOOL) $(PATH_STAGE_SYS)/VBoxDrv.sys
     59        $(RM) -f -- "$@" "$@.cer0" "$@.cer1" "$@.cer2" "$@.array"
     60
     61        $(VBOX_RTSIGNTOOL) extract-exe-signer-cert --signature-index 0 --exe "$(PATH_STAGE_SYS)/VBoxDrv.sys" --output "$@.cer0" --der
     62        $(VBOX_BIN2C) -ascii --append VBoxStubTrustedCert0 "$@.cer0" $@
     63        $(APPEND) "$@.array" "    { g_abVBoxStubTrustedCert0, sizeof(g_abVBoxStubTrustedCert0) }, "
     64  if defined(VBOX_CERTIFICATE_SHA2_SUBJECT_NAME) && (!defined(VBOX_WITH_CORP_CODE_SIGNING) || "$(VBOX_WITH_CORP_CODE_SIGNING)" != "all")
     65        $(VBOX_RTSIGNTOOL) extract-exe-signer-cert --signature-index 1 --exe "$(PATH_STAGE_SYS)/VBoxDrv.sys" --output "$@.cer1" --der
     66        $(VBOX_BIN2C) -ascii --append VBoxStubTrustedCert1 "$@.cer1" $@
     67        $(APPEND) "$@.array" "    { g_abVBoxStubTrustedCert1, sizeof(g_abVBoxStubTrustedCert1) }, "
     68  endif
     69  if defined(VBOX_WITH_CORP_CODE_SIGNING) && "$(VBOX_WITH_CORP_CODE_SIGNING)" != "all" && "$(VBOX_SIGNING_MODE)" == "release"
     70        $(VBOX_RTSIGNTOOL) extract-exe-signer-cert --signature-index 1 --exe "" --output "$@.cer2" --der
     71        $(VBOX_BIN2C) -ascii --append VBoxStubTrustedCert1 "$@.cer2" $@
     72        $(APPEND) "$@.array" "    { g_abVBoxStubTrustedCert2, sizeof(g_abVBoxStubTrustedCert2) }, "
     73  endif
     74        $(APPEND) -n "$@" \
     75                "" \
     76                "struct { uint8_t const *pab; uint32_t cb; }" "g_aVBoxStubTrustedCerts[] = " \
     77               "{"
     78        $(SED) --append "$@" -e "" "$@.array"
     79        $(APPEND) -n "$@" \
     80               "};"
     81        $(RM) -f -- "$@.cer0" "$@.cer1" "$@.cer2" "$@.array"
     82
     83  VBoxStubPublicCert.h:: $$(VBoxStub_0_OUTDIR)/VBoxStubPublicCert.h
    6084
    6185 endif
  • trunk/src/VBox/Installer/win/Stub/VBoxStub.cpp

    r63311 r64927  
    698698 * @returns Fully complained exit code.
    699699 */
    700 static RTEXITCODE InstallCertificate(void)
    701 {
    702     if (addCertToStore(CERT_SYSTEM_STORE_LOCAL_MACHINE,
    703                        "TrustedPublisher",
    704                        g_ab_VBoxStubPublicCert,
    705                        sizeof(g_ab_VBoxStubPublicCert)))
    706         return RTEXITCODE_SUCCESS;
    707     return ShowError("Failed to construct install certificate.");
     700static RTEXITCODE InstallCertificates(void)
     701{
     702    for (uint32_t i = 0; i < RT_ELEMENTS(g_aVBoxStubTrustedCerts); i++)
     703    {
     704        if (!addCertToStore(CERT_SYSTEM_STORE_LOCAL_MACHINE,
     705                            "TrustedPublisher",
     706                            g_aVBoxStubTrustedCerts[i].pab,
     707                            g_aVBoxStubTrustedCerts[i].cb))
     708            return ShowError("Failed to construct install certificate.");
     709    }
     710    return RTEXITCODE_SUCCESS;
    708711}
    709712#endif /* VBOX_WITH_CODE_SIGNING */
     
    11331136                {
    11341137                    rcExit = CopyCustomDir(szExtractPath);
    1135     #ifdef VBOX_WITH_CODE_SIGNING
     1138#ifdef VBOX_WITH_CODE_SIGNING
    11361139                    if (rcExit == RTEXITCODE_SUCCESS && fEnableSilentCert && g_fSilent)
    1137                         rcExit = InstallCertificate();
    1138     #endif
     1140                        rcExit = InstallCertificates();
     1141#endif
    11391142                    unsigned iPackage = 0;
    11401143                    while (   iPackage < pHeader->byCntPkgs
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette