VirtualBox

Changeset 53042 in vbox for trunk/src


Ignore:
Timestamp:
Oct 13, 2014 1:38:30 PM (10 years ago)
Author:
vboxsync
Message:

SUP: CERT_E_CHANING due to signatures rooted in 'Microsoft Digital Media Authority 2005' (igdusc64.dll / 3D).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp

    r53035 r53042  
    198198#ifdef IN_RING3
    199199static int supR3HardNtViCallWinVerifyTrust(HANDLE hFile, PCRTUTF16 pwszName, uint32_t fFlags, PRTERRINFO pErrInfo,
    200                                            PFNWINVERIFYTRUST pfnWinVerifyTrust);
     200                                           PFNWINVERIFYTRUST pfnWinVerifyTrust, HRESULT *phrcWinVerifyTrust);
    201201static int supR3HardNtViCallWinVerifyTrustCatFile(HANDLE hFile, PCRTUTF16 pwszName, uint32_t fFlags, PRTERRINFO pErrInfo,
    202202                                                  PFNWINVERIFYTRUST pfnWinVerifyTrust);
     
    20832083    RTErrInfoInitStatic(&ErrInfoStatic);
    20842084    int rc = supR3HardNtViCallWinVerifyTrust(NULL, g_SupLibHardenedExeNtPath.UniStr.Buffer, 0,
    2085                                              &ErrInfoStatic.Core, pfnWinVerifyTrust);
     2085                                             &ErrInfoStatic.Core, pfnWinVerifyTrust, NULL);
    20862086    if (RT_FAILURE(rc))
    20872087        supR3HardenedFatalMsg(pszProgName, kSupInitOp_Integrity, rc,
     
    20902090
    20912091    if (g_uNtVerCombined >= SUP_MAKE_NT_VER_SIMPLE(6, 0)) /* ntdll isn't signed on XP, assuming this is the case on W2K3 for now. */
    2092         supR3HardNtViCallWinVerifyTrust(NULL, L"\\SystemRoot\\System32\\ntdll.dll", 0, NULL, pfnWinVerifyTrust);
     2092        supR3HardNtViCallWinVerifyTrust(NULL, L"\\SystemRoot\\System32\\ntdll.dll", 0, NULL, pfnWinVerifyTrust, NULL);
    20932093    supR3HardNtViCallWinVerifyTrustCatFile(NULL, L"\\SystemRoot\\System32\\ntdll.dll", 0, NULL, pfnWinVerifyTrust);
    20942094
     
    21422142 * @param   pErrInfo            Pointer to error info structure. Optional.
    21432143 * @param   pfnWinVerifyTrust   Pointer to the API.
     2144 * @param   phrcWinVerifyTrust  Where to WinVerifyTrust error status on failure,
     2145 *                              optional.
    21442146 */
    21452147static int supR3HardNtViCallWinVerifyTrust(HANDLE hFile, PCRTUTF16 pwszName, uint32_t fFlags, PRTERRINFO pErrInfo,
    2146                                            PFNWINVERIFYTRUST pfnWinVerifyTrust)
    2147 {
     2148                                           PFNWINVERIFYTRUST pfnWinVerifyTrust, HRESULT *phrcWinVerifyTrust)
     2149{
     2150    if (phrcWinVerifyTrust)
     2151        *phrcWinVerifyTrust = S_OK;
     2152
    21482153    /*
    21492154     * Convert the name into a Windows name.
     
    22232228        SUP_DPRINTF(("supR3HardNtViCallWinVerifyTrust: WinVerifyTrust failed with %#x (%s) on '%ls'\n",
    22242229                     hrc, pszErrConst, pwszName));
     2230        if (phrcWinVerifyTrust)
     2231            *phrcWinVerifyTrust = hrc;
    22252232    }
    22262233
     
    26112618                else if (RT_SUCCESS(rc))
    26122619                {
    2613                     /** @todo having trouble with a 32-bit windows box when letting these calls thru */
    2614                     rc = supR3HardNtViCallWinVerifyTrust(hFile, pwszName, fFlags, pErrInfo, g_pfnWinVerifyTrust);
     2620                    HRESULT hrcWinVerifyTrust;
     2621                    rc = supR3HardNtViCallWinVerifyTrust(hFile, pwszName, fFlags, pErrInfo, g_pfnWinVerifyTrust,
     2622                                                         &hrcWinVerifyTrust);
     2623
     2624                    /* DLLs signed with special roots, like "Microsoft Digital Media Authority 2005",
     2625                       may fail here because the root cert is not in the normal certificate stores
     2626                       (if any).  Our verification code has the basics of these certificates included
     2627                       and can verify them, which is why we end up here instead of in the
     2628                       VINF_LDRVI_NOT_SIGNED case above.  Current workaround is to do as above.
     2629                       (Intel graphics driver DLLs, like igdusc64.dll. */
     2630                    if (   RT_FAILURE(rc)
     2631                        && hrcWinVerifyTrust == CERT_E_CHAINING
     2632                        && (fFlags & SUPHNTVI_F_ALLOW_CAT_FILE_VERIFICATION))
     2633                    {
     2634                        rc = supR3HardNtViCallWinVerifyTrustCatFile(hFile, pwszName, fFlags, pErrInfo, g_pfnWinVerifyTrust);
     2635                        SUP_DPRINTF(("supR3HardNtViCallWinVerifyTrustCatFile -> %d (was CERT_E_CHAINING)\n", rc));
     2636                    }
    26152637                }
    26162638                else
    26172639                {
    2618                     int rc2 = supR3HardNtViCallWinVerifyTrust(hFile, pwszName, fFlags, pErrInfo, g_pfnWinVerifyTrust);
     2640                    int rc2 = supR3HardNtViCallWinVerifyTrust(hFile, pwszName, fFlags, pErrInfo, g_pfnWinVerifyTrust, NULL);
    26192641                    AssertMsg(RT_FAILURE_NP(rc2),
    26202642                              ("rc=%Rrc, rc2=%Rrc %s", rc, rc2, pErrInfo ? pErrInfo->pszMsg : "<no-err-info>"));
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