VirtualBox

Changeset 74760 in vbox


Ignore:
Timestamp:
Oct 11, 2018 11:25:24 AM (6 years ago)
Author:
vboxsync
Message:

IPRT/ldr/asn1/pkcs7: Ironed out issues in decoding indefinite ASN.1 length records and successfully verified the first Mach-O signature. bugref:9232

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asn1.h

    r74672 r74760  
    16781678    /** The allocator virtual method table. */
    16791679    PCRTASN1ALLOCATORVTABLE     pAllocator;
     1680    /** Pointer to the first byte.  Useful for calculating offsets. */
     1681    uint8_t const              *pbFirst;
    16801682} RTASN1CURSORPRIMARY;
    16811683typedef RTASN1CURSORPRIMARY *PRTASN1CURSORPRIMARY;
     
    17981800 * @param   pCursor             The cursor we're decoding from.
    17991801 * @param   pSeqCore            The sequence core record.
     1802 * @sa      RTAsn1CursorCheckSetEnd, RTAsn1CursorCheckOctStrEnd,
     1803 *          RTAsn1CursorCheckEnd
    18001804 */
    18011805RTDECL(int) RTAsn1CursorCheckSeqEnd(PRTASN1CURSOR pCursor, PRTASN1SEQUENCECORE pSeqCore);
     
    18101814 * @param   pCursor             The cursor we're decoding from.
    18111815 * @param   pSetCore            The set core record.
     1816 * @sa      RTAsn1CursorCheckSeqEnd, RTAsn1CursorCheckOctStrEnd,
     1817 *          RTAsn1CursorCheckEnd
    18121818 */
    18131819RTDECL(int) RTAsn1CursorCheckSetEnd(PRTASN1CURSOR pCursor, PRTASN1SETCORE pSetCore);
     1820
     1821/**
     1822 * Specialization of RTAsn1CursorCheckEnd for handling indefinite length
     1823 * constructed octet strings.
     1824 *
     1825 * This function must used when parsing the content of an octet string, like
     1826 * for example the Content of a PKCS\#7 ContentInfo structure.  It makes sure
     1827 * we've reached the end of the data for the cursor, and in case of a an
     1828 * indefinite length sets it may adjust set length and the parent cursor.
     1829 *
     1830 * @returns IPRT status code.
     1831 * @param   pCursor             The cursor we're decoding from.
     1832 * @param   pOctetString        The octet string.
     1833 * @sa      RTAsn1CursorCheckSeqEnd, RTAsn1CursorCheckSetEnd,
     1834 *          RTAsn1CursorCheckEnd
     1835 */
     1836RTDECL(int) RTAsn1CursorCheckOctStrEnd(PRTASN1CURSOR pCursor, PRTASN1OCTETSTRING pOctetString);
     1837
    18141838
    18151839/**
  • trunk/include/iprt/crypto/pkcs7.h

    r74716 r74760  
    512512 * @param   pvUser              User argument for the callback.
    513513 * @param   pErrInfo            Optional error info buffer.
     514 * @sa      RTCrPkcs7VerifySignedDataWithExternalData
    514515 */
    515516RTDECL(int) RTCrPkcs7VerifySignedData(PCRTCRPKCS7CONTENTINFO pContentInfo, uint32_t fFlags,
     
    517518                                      PCRTTIMESPEC pValidationTime, PFNRTCRPKCS7VERIFYCERTCALLBACK pfnVerifyCert, void *pvUser,
    518519                                      PRTERRINFO pErrInfo);
     520
     521
     522/**
     523 * Verifies PKCS \#7 SignedData with external data.
     524 *
     525 * For compatability with alternative crypto providers, the user must work on
     526 * the top level PKCS \#7 structure instead directly on the SignedData.
     527 *
     528 * @returns IPRT status code.
     529 * @param   pContentInfo        PKCS \#7 content info structure.
     530 * @param   fFlags              RTCRPKCS7VERIFY_SD_F_XXX.
     531 * @param   hAdditionalCerts    Store containing additional certificates to
     532 *                              supplement those mentioned in the signed data.
     533 * @param   hTrustedCerts       Store containing trusted certificates.
     534 * @param   pValidationTime     The time we're supposed to validate the
     535 *                              certificates chains at.  Ignored for signatures
     536 *                              with valid signing time attributes.
     537 * @param   pfnVerifyCert       Callback for checking that a certificate used
     538 *                              for signing the data is suitable.
     539 * @param   pvUser              User argument for the callback.
     540 * @param   pvData              The signed external data.
     541 * @param   cbData              The size of the signed external data.
     542 * @param   pErrInfo            Optional error info buffer.
     543 * @sa      RTCrPkcs7VerifySignedData
     544 */
     545RTDECL(int) RTCrPkcs7VerifySignedDataWithExternalData(PCRTCRPKCS7CONTENTINFO pContentInfo, uint32_t fFlags,
     546                                                      RTCRSTORE hAdditionalCerts, RTCRSTORE hTrustedCerts,
     547                                                      PCRTTIMESPEC pValidationTime,
     548                                                      PFNRTCRPKCS7VERIFYCERTCALLBACK pfnVerifyCert, void *pvUser,
     549                                                      void const *pvData, size_t cbData, PRTERRINFO pErrInfo);
    519550
    520551/** @name RTCRPKCS7VERIFY_SD_F_XXX - Flags for RTCrPkcs7VerifySignedData
  • trunk/include/iprt/err.h

    r74656 r74760  
    27302730/** The encrypted digest algorithm does not match the one in the certificate. */
    27312731#define VERR_CR_PKCS7_SIGNER_INFO_DIGEST_ENCRYPT_MISMATCH       (-22359)
     2732/** The PKCS \#7 content is not data. */
     2733#define VERR_CR_PKCS7_NOT_DATA                                  (-22360)
    27322734/** @} */
    27332735
  • trunk/include/iprt/ldr.h

    r74707 r74760  
    11771177 * @param   pvSignature     The signature data. Format given by @a enmSignature.
    11781178 * @param   cbSignature     The size of the buffer @a pvSignature points to.
     1179 * @param   pvExternalData  Pointer to the signed data, if external. NULL if the
     1180 *                          data is internal to the signature structure.
     1181 * @param   cbExternalData Size of the signed data, if external.  0 if
     1182 *                          internal to the signature structure.
    11791183 * @param   pErrInfo        Pointer to an error info buffer, optional.
    11801184 * @param   pvUser          User argument.
     
    11831187typedef DECLCALLBACK(int) FNRTLDRVALIDATESIGNEDDATA(RTLDRMOD hLdrMod, RTLDRSIGNATURETYPE enmSignature,
    11841188                                                    void const *pvSignature, size_t cbSignature,
     1189                                                    void const *pvExternalData, size_t cbExternalData,
    11851190                                                    PRTERRINFO pErrInfo, void *pvUser);
    11861191/** Pointer to a signature verification callback. */
  • trunk/include/iprt/mangling.h

    r74672 r74760  
    27412741# define RTAsn1VtDelete                                 RT_MANGLER(RTAsn1VtDelete)
    27422742# define RTAsn1CursorCheckEnd                           RT_MANGLER(RTAsn1CursorCheckEnd)
     2743# define RTAsn1CursorCheckOctStrEnd                     RT_MANGLER(RTAsn1CursorCheckOctStrEnd)
    27432744# define RTAsn1CursorCheckSeqEnd                        RT_MANGLER(RTAsn1CursorCheckSeqEnd)
    27442745# define RTAsn1CursorCheckSetEnd                        RT_MANGLER(RTAsn1CursorCheckSetEnd)
     
    32563257# define RTCrPkcs7VerifyCertCallbackDefault             RT_MANGLER(RTCrPkcs7VerifyCertCallbackDefault)
    32573258# define RTCrPkcs7VerifySignedData                      RT_MANGLER(RTCrPkcs7VerifySignedData)
     3259# define RTCrPkcs7VerifySignedDataWithExternalData      RT_MANGLER(RTCrPkcs7VerifySignedDataWithExternalData)
    32583260# define RTCrPkcs7Cert_CheckSanity                      RT_MANGLER(RTCrPkcs7Cert_CheckSanity)
    32593261# define RTCrPkcs7Cert_Clone                            RT_MANGLER(RTCrPkcs7Cert_Clone)
  • trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp

    r69500 r74760  
    10531053static DECLCALLBACK(int) supHardNtViCallback(RTLDRMOD hLdrMod, RTLDRSIGNATURETYPE enmSignature,
    10541054                                             void const *pvSignature, size_t cbSignature,
     1055                                             void const *pvExternalData, size_t cbExternalData,
    10551056                                             PRTERRINFO pErrInfo, void *pvUser)
    10561057{
     
    10681069    AssertReturn(pContentInfo->u.pSignedData->SignerInfos.cItems == 1, VERR_INTERNAL_ERROR_5);
    10691070    PCRTCRPKCS7SIGNERINFO pSignerInfo = pContentInfo->u.pSignedData->SignerInfos.papItems[0];
     1071
     1072    AssertReturn(pvExternalData, VERR_INTERNAL_ERROR_5);
    10701073
    10711074    /*
  • trunk/src/VBox/Runtime/common/asn1/asn1-cursor.cpp

    r74672 r74760  
    7575    pPrimaryCursor->pErrInfo                = pErrInfo;
    7676    pPrimaryCursor->pAllocator              = pAllocator;
     77    pPrimaryCursor->pbFirst                 = (uint8_t const *)pvFirst;
    7778    return &pPrimaryCursor->Cursor;
    7879}
     
    239240static int rtAsn1CursorCheckSeqOrSetEnd(PRTASN1CURSOR pCursor, PRTASN1CORE pAsn1Core)
    240241{
    241     if (pCursor->cbLeft == 0)
    242         return VINF_SUCCESS;
    243 
    244     if (pAsn1Core->fFlags & RTASN1CORE_F_INDEFINITE_LENGTH)
    245     {
    246         if (pCursor->cbLeft >= 2)
     242    if (!(pAsn1Core->fFlags & RTASN1CORE_F_INDEFINITE_LENGTH))
     243    {
     244        if (pCursor->cbLeft == 0)
     245            return VINF_SUCCESS;
     246        return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_CURSOR_NOT_AT_END,
     247                                   "%u (%#x) bytes left over", pCursor->cbLeft, pCursor->cbLeft);
     248    }
     249
     250    if (pCursor->cbLeft >= 2)
     251    {
     252        if (   pCursor->pbCur[0] == 0
     253            && pCursor->pbCur[1] == 0)
    247254        {
    248             if (   pCursor->pbCur[0] == 0
    249                 && pCursor->pbCur[1] == 0)
     255            pAsn1Core->cb = (uint32_t)(pCursor->pbCur - pAsn1Core->uData.pu8);
     256            pCursor->cbLeft -= 2;
     257            pCursor->pbCur  += 2;
     258
     259            PRTASN1CURSOR pParentCursor = pCursor->pUp;
     260            if (   pParentCursor
     261                && (pParentCursor->fFlags & RTASN1CURSOR_FLAGS_INDEFINITE_LENGTH))
    250262            {
    251                 pAsn1Core->cb = (uint32_t)(pCursor->pbCur - pAsn1Core->uData.pu8);
    252                 pCursor->cbLeft -= 2;
    253                 pCursor->pbCur  += 2;
    254 
    255                 PRTASN1CURSOR pParentCursor = pCursor->pUp;
    256                 if (   pParentCursor
    257                     && (pParentCursor->fFlags & RTASN1CURSOR_FLAGS_INDEFINITE_LENGTH))
    258                 {
    259                     pParentCursor->pbCur  -= pCursor->cbLeft;
    260                     pParentCursor->cbLeft += pCursor->cbLeft;
    261                     return VINF_SUCCESS;
    262                 }
    263 
    264                 if (pCursor->cbLeft == 0)
    265                     return VINF_SUCCESS;
    266 
    267                 return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_CURSOR_NOT_AT_END,
    268                                            "%u (%#x) bytes left over (parent not indefinite length)", pCursor->cbLeft, pCursor->cbLeft);
     263                pParentCursor->pbCur  -= pCursor->cbLeft;
     264                pParentCursor->cbLeft += pCursor->cbLeft;
     265                return VINF_SUCCESS;
    269266            }
    270             return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_CURSOR_NOT_AT_END, "%u (%#x) bytes left over [indef: %.*Rhxs]",
    271                                        pCursor->cbLeft, pCursor->cbLeft, RT_MIN(pCursor->cbLeft, 16), pCursor->pbCur);
     267
     268            if (pCursor->cbLeft == 0)
     269                return VINF_SUCCESS;
     270
     271            return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_CURSOR_NOT_AT_END,
     272                                       "%u (%#x) bytes left over (parent not indefinite length)", pCursor->cbLeft, pCursor->cbLeft);
    272273        }
    273         return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_CURSOR_NOT_AT_END,
    274                                    "1 byte left over, expected two for indefinite length end-of-content sequence");
    275     }
    276 
     274        return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_CURSOR_NOT_AT_END, "%u (%#x) bytes left over [indef: %.*Rhxs]",
     275                                   pCursor->cbLeft, pCursor->cbLeft, RT_MIN(pCursor->cbLeft, 16), pCursor->pbCur);
     276    }
    277277    return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_CURSOR_NOT_AT_END,
    278                                "%u (%#x) bytes left over", pCursor->cbLeft, pCursor->cbLeft);
    279 
     278                               "1 byte left over, expected two for indefinite length end-of-content sequence");
    280279}
    281280
     
    290289{
    291290    return rtAsn1CursorCheckSeqOrSetEnd(pCursor, &pSetCore->Asn1Core);
     291}
     292
     293
     294RTDECL(int) RTAsn1CursorCheckOctStrEnd(PRTASN1CURSOR pCursor, PRTASN1OCTETSTRING pOctetString)
     295{
     296    return rtAsn1CursorCheckSeqOrSetEnd(pCursor, &pOctetString->Asn1Core);
    292297}
    293298
     
    426431                pCursor->fFlags   |= RTASN1CURSOR_FLAGS_INDEFINITE_LENGTH;
    427432                pAsn1Core->fFlags |= RTASN1CORE_F_INDEFINITE_LENGTH;
    428                 cb = pCursor->cbLeft - 2; /* tentatively for sequences and sets, definite for others */
     433                cb = pCursor->cbLeft; /* Start out with the whole sequence, adjusted later upon reach the end. */
    429434            }
    430435        }
  • trunk/src/VBox/Runtime/common/crypto/pkcs7-asn1-decoder.cpp

    r74672 r74760  
    144144                }
    145145                if (RT_SUCCESS(rc))
    146                     rc = RTAsn1CursorCheckEnd(&ContentCursor);
     146                    rc = RTAsn1CursorCheckOctStrEnd(&ContentCursor, &pThis->Content);
    147147                if (RT_SUCCESS(rc))
    148148                    return VINF_SUCCESS;
  • trunk/src/VBox/Runtime/common/crypto/pkcs7-verify.cpp

    r73665 r74760  
    5252static int rtCrPkcs7VerifySignedDataUsingOpenSsl(PCRTCRPKCS7CONTENTINFO pContentInfo, uint32_t fFlags,
    5353                                                 RTCRSTORE hAdditionalCerts, RTCRSTORE hTrustedCerts,
    54                                                  void const *pvContent, uint32_t cbContent, PRTERRINFO pErrInfo)
     54                                                 void const *pvContent, size_t cbContent, PRTERRINFO pErrInfo)
    5555{
    5656    RT_NOREF_PV(fFlags);
    5757
    5858    /*
    59      * Verify using OpenSSL.
     59     * Verify using OpenSSL.          ERR_PUT_error
    6060     */
    6161    int rcOssl;
    6262    unsigned char const *pbRawContent = RTASN1CORE_GET_RAW_ASN1_PTR(&pContentInfo->SeqCore.Asn1Core);
     63    uint32_t             cbRawContent = RTASN1CORE_GET_RAW_ASN1_SIZE(&pContentInfo->SeqCore.Asn1Core)
     64                                      + (pContentInfo->SeqCore.Asn1Core.fFlags & RTASN1CORE_F_INDEFINITE_LENGTH ? 2 : 0);
    6365    PKCS7 *pOsslPkcs7 = NULL;
    64     if (d2i_PKCS7(&pOsslPkcs7, &pbRawContent, RTASN1CORE_GET_RAW_ASN1_SIZE(&pContentInfo->SeqCore.Asn1Core)) == pOsslPkcs7)
     66    if (d2i_PKCS7(&pOsslPkcs7, &pbRawContent, cbRawContent) != NULL)
    6567    {
    6668        STACK_OF(X509) *pAddCerts = NULL;
     
    7880                if (pCerts->papItems[i]->enmChoice == RTCRPKCS7CERTCHOICE_X509)
    7981                    rtCrOpenSslAddX509CertToStack(pAddCerts, pCerts->papItems[i]->u.pX509Cert);
    80 
    8182
    8283            X509_STORE *pTrustedCerts = NULL;
     
    8788                rtCrOpenSslInit();
    8889
    89                 BIO *pBioContent = BIO_new_mem_buf((void *)pvContent, cbContent);
     90                BIO *pBioContent = BIO_new_mem_buf((void *)pvContent, (int)cbContent);
    9091                if (pBioContent)
    9192                {
     
    115116    }
    116117    else
     118    {
    117119        rcOssl = RTErrInfoSet(pErrInfo, VERR_CR_PKCS7_OSSL_D2I_FAILED, "d2i_PKCS7 failed");
     120        if (pErrInfo)
     121            ERR_print_errors_cb(rtCrOpenSslErrInfoCallback, pErrInfo);
     122    }
    118123
    119124    return rcOssl;
     
    575580
    576581
    577 RTDECL(int) RTCrPkcs7VerifySignedData(PCRTCRPKCS7CONTENTINFO pContentInfo, uint32_t fFlags,
    578                                       RTCRSTORE hAdditionalCerts, RTCRSTORE hTrustedCerts,
    579                                       PCRTTIMESPEC pValidationTime, PFNRTCRPKCS7VERIFYCERTCALLBACK pfnVerifyCert, void *pvUser,
    580                                       PRTERRINFO pErrInfo)
    581 {
    582     /*
    583      * Check the input.
     582/**
     583 * Worker.
     584 */
     585static int rtCrPkcs7VerifySignedDataEx(PCRTCRPKCS7CONTENTINFO pContentInfo, uint32_t fFlags,
     586                                       RTCRSTORE hAdditionalCerts, RTCRSTORE hTrustedCerts,
     587                                       PCRTTIMESPEC pValidationTime,
     588                                       PFNRTCRPKCS7VERIFYCERTCALLBACK pfnVerifyCert, void *pvUser,
     589                                       void const *pvContent, size_t cbContent, PRTERRINFO pErrInfo)
     590{
     591    /*
     592     * Check and adjust the input.
    584593     */
    585594    if (pfnVerifyCert)
     
    598607     * Hash the content info.
    599608     */
    600     /* Exactly what the content is, for some stupid reason unnecessarily
    601        complicated.  Figure it out here as we'll need it for the OpenSSL code
    602        path as well. */
    603     void const *pvContent = pSignedData->ContentInfo.Content.Asn1Core.uData.pv;
    604     uint32_t    cbContent = pSignedData->ContentInfo.Content.Asn1Core.cb;
    605     if (pSignedData->ContentInfo.Content.pEncapsulated)
    606     {
    607         pvContent = pSignedData->ContentInfo.Content.pEncapsulated->uData.pv;
    608         cbContent = pSignedData->ContentInfo.Content.pEncapsulated->cb;
    609     }
    610 
    611609    /* Check that there aren't too many or too few hash algorithms for our
    612610       implementation and purposes. */
     
    784782}
    785783
     784
     785RTDECL(int) RTCrPkcs7VerifySignedData(PCRTCRPKCS7CONTENTINFO pContentInfo, uint32_t fFlags,
     786                                      RTCRSTORE hAdditionalCerts, RTCRSTORE hTrustedCerts,
     787                                      PCRTTIMESPEC pValidationTime, PFNRTCRPKCS7VERIFYCERTCALLBACK pfnVerifyCert, void *pvUser,
     788                                      PRTERRINFO pErrInfo)
     789{
     790    /*
     791     * Find the content and pass it on to common worker.
     792     */
     793    if (!RTCrPkcs7ContentInfo_IsSignedData(pContentInfo))
     794        return RTErrInfoSet(pErrInfo, VERR_CR_PKCS7_NOT_SIGNED_DATA, "Not PKCS #7 SignedData.");
     795
     796    /* Exactly what the content is, is for some stupid reason unnecessarily complicated. */
     797    PCRTCRPKCS7SIGNEDDATA pSignedData = pContentInfo->u.pSignedData;
     798    void const *pvContent = pSignedData->ContentInfo.Content.Asn1Core.uData.pv;
     799    uint32_t    cbContent = pSignedData->ContentInfo.Content.Asn1Core.cb;
     800    if (pSignedData->ContentInfo.Content.pEncapsulated)
     801    {
     802        pvContent = pSignedData->ContentInfo.Content.pEncapsulated->uData.pv;
     803        cbContent = pSignedData->ContentInfo.Content.pEncapsulated->cb;
     804    }
     805
     806    return rtCrPkcs7VerifySignedDataEx(pContentInfo, fFlags, hAdditionalCerts, hTrustedCerts, pValidationTime,
     807                                       pfnVerifyCert, pvUser, pvContent, cbContent, pErrInfo);
     808}
     809
     810
     811RTDECL(int) RTCrPkcs7VerifySignedDataWithExternalData(PCRTCRPKCS7CONTENTINFO pContentInfo, uint32_t fFlags,
     812                                                      RTCRSTORE hAdditionalCerts, RTCRSTORE hTrustedCerts,
     813                                                      PCRTTIMESPEC pValidationTime,
     814                                                      PFNRTCRPKCS7VERIFYCERTCALLBACK pfnVerifyCert, void *pvUser,
     815                                                      void const *pvData, size_t cbData, PRTERRINFO pErrInfo)
     816{
     817    /*
     818     * Require 'data' as inner content type.
     819     */
     820    if (!RTCrPkcs7ContentInfo_IsSignedData(pContentInfo))
     821        return RTErrInfoSet(pErrInfo, VERR_CR_PKCS7_NOT_SIGNED_DATA, "Not PKCS #7 SignedData.");
     822    PCRTCRPKCS7SIGNEDDATA pSignedData = pContentInfo->u.pSignedData;
     823
     824    if (RTAsn1ObjId_CompareWithString(&pSignedData->ContentInfo.ContentType, RTCR_PKCS7_DATA_OID) != 0)
     825        return RTErrInfoSetF(pErrInfo, VERR_CR_PKCS7_NOT_DATA,
     826                             "The signedData content type is %s, expected 'data' (%s)",
     827                             pSignedData->ContentInfo.ContentType.szObjId, RTCR_PKCS7_DATA_OID);
     828
     829    return rtCrPkcs7VerifySignedDataEx(pContentInfo, fFlags, hAdditionalCerts, hTrustedCerts, pValidationTime,
     830                                       pfnVerifyCert, pvUser, pvData, cbData, pErrInfo);
     831}
     832
     833
  • trunk/src/VBox/Runtime/common/ldr/ldrMachO.cpp

    r74750 r74760  
    48494849                    rc = pfnCallback(&pThis->Core, RTLDRSIGNATURETYPE_PKCS7_SIGNED_DATA,
    48504850                                     &pSignature->ContentInfo, sizeof(pSignature->ContentInfo),
     4851                                     pSignature->aCodeDirs[0].pCodeDir, pSignature->aCodeDirs[0].cb,
    48514852                                     pErrInfo, pvUser);
    48524853                }
  • trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp

    r74721 r74760  
    28992899                rc = pfnCallback(&pModPe->Core, RTLDRSIGNATURETYPE_PKCS7_SIGNED_DATA,
    29002900                                 &pSignature->ContentInfo, sizeof(pSignature->ContentInfo),
     2901                                 NULL /*pvExternalData*/, 0 /*cbExternalData*/,
    29012902                                 pErrInfo, pvUser);
    29022903            }
  • trunk/src/VBox/Runtime/testcase/tstRTLdrVerifyPeImage.cpp

    r69111 r74760  
    4444static DECLCALLBACK(int) TestCallback(RTLDRMOD hLdrMod, RTLDRSIGNATURETYPE enmSignature,
    4545                                      void const *pvSignature, size_t cbSignature,
     46                                      void const *pvExternalData, size_t cbExternalData,
    4647                                      PRTERRINFO pErrInfo, void *pvUser)
    4748{
    4849    RT_NOREF_PV(hLdrMod); RT_NOREF_PV(enmSignature); RT_NOREF_PV(pvSignature); RT_NOREF_PV(cbSignature);
    49     RT_NOREF_PV(pErrInfo); RT_NOREF_PV(pvUser);
     50    RT_NOREF_PV(pErrInfo); RT_NOREF_PV(pvUser); RT_NOREF_PV(pvExternalData); RT_NOREF_PV(cbExternalData);
    5051    return VINF_SUCCESS;
    5152}
  • trunk/src/VBox/Runtime/tools/RTSignTool.cpp

    r74716 r74760  
    13711371static DECLCALLBACK(int) VerifyExeCallback(RTLDRMOD hLdrMod, RTLDRSIGNATURETYPE enmSignature,
    13721372                                           void const *pvSignature, size_t cbSignature,
     1373                                           void const *pvExternalData, size_t cbExternalData,
    13731374                                           PRTERRINFO pErrInfo, void *pvUser)
    13741375{
     
    13961397             * the authenticode policies into account.
    13971398             */
     1399            if (pvExternalData)
     1400                return RTCrPkcs7VerifySignedDataWithExternalData(pContentInfo,
     1401                                                                 RTCRPKCS7VERIFY_SD_F_COUNTER_SIGNATURE_SIGNING_TIME_ONLY
     1402                                                                 | RTCRPKCS7VERIFY_SD_F_ALWAYS_USE_SIGNING_TIME_IF_PRESENT
     1403                                                                 | RTCRPKCS7VERIFY_SD_F_ALWAYS_USE_MS_TIMESTAMP_IF_PRESENT,
     1404                                                                 pState->hAdditionalStore, pState->hRootStore, &ValidationTime,
     1405                                                                 VerifyExecCertVerifyCallback, pState,
     1406                                                                 pvExternalData, cbExternalData, pErrInfo);
    13981407            return RTCrPkcs7VerifySignedData(pContentInfo,
    13991408                                             RTCRPKCS7VERIFY_SD_F_COUNTER_SIGNATURE_SIGNING_TIME_ONLY
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