Lines Matching defs:pSignature

2277     PRTLDRPESIGNATURE pSignature = (PRTLDRPESIGNATURE)RTMemTmpAllocZ(sizeof(*pSignature) + 64 + pModPe->SecurityDir.Size);
2278 if (!pSignature)
2280 sizeof(*pSignature) + 64 + pModPe->SecurityDir.Size);
2281 pSignature->pRawData = RT_ALIGN_PT(pSignature + 1, 64, WIN_CERTIFICATE const *);
2287 int rc = pModPe->Core.pReader->pfnRead(pModPe->Core.pReader, (void *)pSignature->pRawData,
2295 WIN_CERTIFICATE const *pEntry = pSignature->pRawData;
2328 *ppSignature = pSignature;
2334 RTMemTmpFree(pSignature);
2343 * @param pSignature The signature data to destroy.
2345 static void rtldrPE_VerifySignatureDestroy(PRTLDRMODPE pModPe, PRTLDRPESIGNATURE pSignature)
2347 RTCrPkcs7ContentInfo_Delete(&pSignature->ContentInfo);
2348 RTMemTmpFree(pSignature);
2357 * @param pSignature The signature data.
2360 static int rtldrPE_VerifySignatureDecode(PRTLDRMODPE pModPe, PRTLDRPESIGNATURE pSignature, PRTERRINFO pErrInfo)
2362 WIN_CERTIFICATE const *pEntry = pSignature->pRawData;
2375 int rc = RTCrPkcs7ContentInfo_DecodeAsn1(&PrimaryCursor.Cursor, 0, &pSignature->ContentInfo, "CI");
2378 if (RTCrPkcs7ContentInfo_IsSignedData(&pSignature->ContentInfo))
2380 pSignature->pSignedData = pSignature->ContentInfo.u.pSignedData;
2385 if (!strcmp(pSignature->pSignedData->ContentInfo.ContentType.szObjId, RTCRSPCINDIRECTDATACONTENT_OID))
2387 pSignature->pIndData = pSignature->pSignedData->ContentInfo.u.pIndirectDataContent;
2388 Assert(pSignature->pIndData);
2394 rc = RTCrPkcs7SignedData_CheckSanity(pSignature->pSignedData,
2400 rc = RTCrSpcIndirectDataContent_CheckSanityEx(pSignature->pIndData,
2401 pSignature->pSignedData,
2406 PCRTCRX509ALGORITHMIDENTIFIER pDigestAlgorithm = &pSignature->pIndData->DigestInfo.DigestAlgorithm;
2407 pSignature->enmDigest = RTCrX509AlgorithmIdentifier_QueryDigestType(pDigestAlgorithm);
2408 AssertReturn(pSignature->enmDigest != RTDIGESTTYPE_INVALID, VERR_INTERNAL_ERROR_4); /* Checked above! */
2414 pSignature->pSignedData->ContentInfo.ContentType.szObjId, RTCRSPCINDIRECTDATACONTENT_OID);
2621 * @param pSignature The decoded signature data.
2624 static int rtldrPE_VerifySignatureValidateHash(PRTLDRMODPE pModPe, PRTLDRPESIGNATURE pSignature, PRTERRINFO pErrInfo)
2626 AssertReturn(pSignature->enmDigest > RTDIGESTTYPE_INVALID && pSignature->enmDigest < RTDIGESTTYPE_END, VERR_INTERNAL_ERROR_4);
2627 AssertPtrReturn(pSignature->pIndData, VERR_INTERNAL_ERROR_5);
2628 AssertReturn(RTASN1CORE_IS_PRESENT(&pSignature->pIndData->DigestInfo.Digest.Asn1Core), VERR_INTERNAL_ERROR_5);
2629 AssertPtrReturn(pSignature->pIndData->DigestInfo.Digest.Asn1Core.uData.pv, VERR_INTERNAL_ERROR_5);
2631 uint32_t const cbHash = rtLdrPE_HashGetHashSize(pSignature->enmDigest);
2632 AssertReturn(pSignature->pIndData->DigestInfo.Digest.Asn1Core.cb == cbHash, VERR_INTERNAL_ERROR_5);
2657 int rc = rtldrPE_HashImageCommon(pModPe, pvScratch, cbScratch, pSignature->enmDigest,
2658 &pSignature->HashCtx, &pSignature->HashRes, pErrInfo);
2661 if (!memcmp(&pSignature->HashRes, pSignature->pIndData->DigestInfo.Digest.Asn1Core.uData.pv, cbHash))
2676 pAttrib = RTCrSpcIndirectDataContent_GetPeImageObjAttrib(pSignature->pIndData,
2682 pAttrib = RTCrSpcIndirectDataContent_GetPeImageObjAttrib(pSignature->pIndData,
2691 cbHash, &pSignature->HashRes,
2692 cbHash, pSignature->pIndData->DigestInfo.Digest.Asn1Core.uData.pv);
2712 PRTLDRPESIGNATURE pSignature = NULL;
2713 rc = rtldrPE_VerifySignatureRead(pModPe, &pSignature, pErrInfo);
2716 rc = rtldrPE_VerifySignatureDecode(pModPe, pSignature, pErrInfo);
2718 rc = rtldrPE_VerifySignatureValidateHash(pModPe, pSignature, pErrInfo);
2722 &pSignature->ContentInfo, sizeof(pSignature->ContentInfo),
2725 rtldrPE_VerifySignatureDestroy(pModPe, pSignature);