VirtualBox

Changeset 52537 in vbox for trunk/src/VBox/HostDrivers


Ignore:
Timestamp:
Aug 31, 2014 7:28:17 PM (10 years ago)
Author:
vboxsync
Message:

IPRT,SUP: First part of timestamp counter signatures support.

File:
1 edited

Legend:

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

    r52529 r52537  
    874874 */
    875875static DECLCALLBACK(int) supHardNtViCertVerifyCallback(PCRTCRX509CERTIFICATE pCert, RTCRX509CERTPATHS hCertPaths,
    876                                                        void *pvUser, PRTERRINFO pErrInfo)
     876                                                       uint32_t fFlags, void *pvUser, PRTERRINFO pErrInfo)
    877877{
    878878    PSUPHNTVIRDR pNtViRdr = (PSUPHNTVIRDR)pvUser;
     
    894894     * Standard code signing capabilites required.
    895895     */
    896     int rc = RTCrPkcs7VerifyCertCallbackCodeSigning(pCert, hCertPaths, NULL, pErrInfo);
    897     if (RT_SUCCESS(rc))
     896    int rc = RTCrPkcs7VerifyCertCallbackCodeSigning(pCert, hCertPaths, fFlags, NULL, pErrInfo);
     897    if (   RT_SUCCESS(rc)
     898        && (fFlags & RTCRPKCS7VCC_F_SIGNED_DATA))
    898899    {
    899900        /*
     
    992993
    993994    /*
    994      * Verify the signature.
     995     * Verify the signature.  We instruct the verifier to use the signing time
     996     * counter signature present when present, falling back on the timestamp
     997     * planted by the linker when absent.  In ring-0 we don't have all the
     998     * necessary timestamp server root certificate info, so we have to allow
     999     * using counter signatures unverified there.
    9951000     */
    9961001    RTTIMESPEC ValidationTime;
    9971002    RTTimeSpecSetSeconds(&ValidationTime, pNtViRdr->uTimestamp);
    9981003
    999     return RTCrPkcs7VerifySignedData(pContentInfo, 0, g_hSpcAndNtKernelSuppStore, g_hSpcAndNtKernelRootStore, &ValidationTime,
    1000                                      supHardNtViCertVerifyCallback, pNtViRdr, pErrInfo);
     1004    uint32_t fFlags = RTCRPKCS7VERIFY_SD_F_ALWAYS_USE_SIGNING_TIME_IF_PRESENT
     1005                    | RTCRPKCS7VERIFY_SD_F_COUNTER_SIGNATURE_SIGNING_TIME_ONLY;
     1006#ifdef IN_RING0
     1007    fFlags |= RTCRPKCS7VERIFY_SD_F_USE_SIGNING_TIME_UNVERIFIED;
     1008#endif
     1009    return RTCrPkcs7VerifySignedData(pContentInfo, fFlags, g_hSpcAndNtKernelSuppStore, g_hSpcAndNtKernelRootStore,
     1010                                     &ValidationTime, supHardNtViCertVerifyCallback, pNtViRdr, pErrInfo);
    10011011}
    10021012
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