- Timestamp:
- Oct 9, 2018 8:36:39 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/ldr.h
r74654 r74707 1181 1181 * 1182 1182 */ 1183 typedef DECLCALLBACK(int) FNRTLDRVALIDATESIGNEDDATA(RTLDRMOD hLdrMod, RTLDRSIGNATURETYPE enmSignature, void const *pvSignature, size_t cbSignature, 1183 typedef DECLCALLBACK(int) FNRTLDRVALIDATESIGNEDDATA(RTLDRMOD hLdrMod, RTLDRSIGNATURETYPE enmSignature, 1184 void const *pvSignature, size_t cbSignature, 1184 1185 PRTERRINFO pErrInfo, void *pvUser); 1185 1186 /** Pointer to a signature verification callback. */ -
trunk/src/VBox/Runtime/common/ldr/ldrMachO.cpp
r74676 r74707 3966 3966 3967 3967 /** 3968 * @interface_method_impl{RTLDROPS,pfnVerifySignature} 3969 */ 3970 static DECLCALLBACK(int) 3971 rtldrMachO_VerifySignature(PRTLDRMODINTERNAL pMod, PFNRTLDRVALIDATESIGNEDDATA pfnCallback, void *pvUser, PRTERRINFO pErrInfo) 3972 { 3973 #ifndef IPRT_WITHOUT_LDR_VERIFY 3974 PRTLDRMODMACHO pThis = RT_FROM_MEMBER(pMod, RTLDRMODMACHO, Core); 3975 3976 int rc = rtldrMachO_LoadSignatureBlob(pThis); 3977 if (RT_SUCCESS(rc)) 3978 { 3979 RT_NOREF(pfnCallback, pvUser, pErrInfo); 3980 #if 0 3981 int rc = rtldrPE_VerifySignatureImagePrecoditions(pModPe, pErrInfo); 3982 if (RT_SUCCESS(rc)) 3983 { 3984 PRTLDRPESIGNATURE pSignature = NULL; 3985 rc = rtldrPE_VerifySignatureRead(pModPe, &pSignature, pErrInfo); 3986 if (RT_SUCCESS(rc)) 3987 { 3988 rc = rtldrPE_VerifySignatureDecode(pModPe, pSignature, pErrInfo); 3989 if (RT_SUCCESS(rc)) 3990 rc = rtldrPE_VerifySignatureValidateHash(pModPe, pSignature, pErrInfo); 3991 if (RT_SUCCESS(rc)) 3992 { 3993 rc = pfnCallback(&pModPe->Core, RTLDRSIGNATURETYPE_PKCS7_SIGNED_DATA, 3994 &pSignature->ContentInfo, sizeof(pSignature->ContentInfo), 3995 pErrInfo, pvUser); 3996 } 3997 rtldrPE_VerifySignatureDestroy(pModPe, pSignature); 3998 } 3999 } 4000 #endif 4001 } 4002 return rc; 4003 #else 4004 RT_NOREF_PV(pMod); RT_NOREF_PV(pfnCallback); RT_NOREF_PV(pvUser); RT_NOREF_PV(pErrInfo); 4005 return VERR_NOT_SUPPORTED; 4006 #endif 4007 } 4008 4009 4010 /** 3968 4011 * Operations for a Mach-O module interpreter. 3969 4012 */ … … 3989 4032 rtldrMachO_ReadDbgInfo, 3990 4033 rtldrMachO_QueryProp, 3991 NULL /*pfnVerifySignature*/,4034 rtldrMachO_VerifySignature, 3992 4035 NULL /*pfnHashImage*/, 3993 4036 NULL /*pfnUnwindFrame*/, -
trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp
r74638 r74707 2840 2840 * 2841 2841 * Seems the difference between V1 and V2 page hash attributes is 2842 * that v1 uses SHA-1 while v2 uses SHA-256. The data structures to2843 * be identical otherwise. Initially we assumed the digest2842 * that v1 uses SHA-1 while v2 uses SHA-256. The data structures 2843 * seems to be identical otherwise. Initially we assumed the digest 2844 2844 * algorithm was supposed to be RTCRSPCINDIRECTDATACONTENT::DigestInfo, 2845 2845 * i.e. the same as for the whole image hash. The initial approach -
trunk/src/VBox/Runtime/tools/RTSignTool.cpp
r74692 r74707 1421 1421 1422 1422 1423 RTTIMESPEC Now; 1424 bool fTriedNow = false; 1423 1425 rc = RTLdrQueryProp(hLdrMod, RTLDRPROP_TIMESTAMP_SECONDS, &pState->uTimestamp, sizeof(pState->uTimestamp)); 1426 if (rc == VERR_NOT_FOUND) 1427 { 1428 fTriedNow = true; 1429 pState->uTimestamp = RTTimeSpecGetSeconds(RTTimeNow(&Now)); 1430 rc = VINF_SUCCESS; 1431 } 1424 1432 if (RT_SUCCESS(rc)) 1425 1433 { … … 1427 1435 if (RT_SUCCESS(rc)) 1428 1436 RTMsgInfo("'%s' is valid.\n", pszFilename); 1429 else if (rc == VERR_CR_X509_CPV_NOT_VALID_AT_TIME) 1430 { 1431 RTTIMESPEC Now; 1437 else if (rc == VERR_CR_X509_CPV_NOT_VALID_AT_TIME && !fTriedNow) 1438 { 1432 1439 pState->uTimestamp = RTTimeSpecGetSeconds(RTTimeNow(&Now)); 1433 1440 rc = RTLdrVerifySignature(hLdrMod, VerifyExeCallback, pState, RTErrInfoInitStatic(pStaticErrInfo));
Note:
See TracChangeset
for help on using the changeset viewer.