Changeset 51862 in vbox for trunk/include/iprt/crypto
- Timestamp:
- Jul 3, 2014 11:51:54 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 94716
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/crypto/spc.h
r51770 r51862 42 42 43 43 /** 44 * PE Image page hash table, version 2. 45 */ 46 typedef union RTCRSPCPEIMAGEPAGEHASHESV2 44 * PE Image page hash table, generic union. 45 * 46 * @remarks This table isn't used by ldrPE.cpp, it walks the table in a generic 47 * fashion using the hash size. So, we can ditch it if we feel like it. 48 */ 49 typedef union RTCRSPCPEIMAGEPAGEHASHES 47 50 { 48 51 /** MD5 page hashes. */ … … 81 84 uint8_t abHash[RTSHA512_HASH_SIZE]; 82 85 } aSha512[1]; 83 } RTCRSPCPEIMAGEPAGEHASHES V2;84 /** Pointer to a version 2 PE image hash table. */85 typedef RTCRSPCPEIMAGEPAGEHASHES V2 *PRTCRSPCPEIMAGEPAGEHASHESV2;86 /** Pointer to a const version 2 PE image hash table. */87 typedef RTCRSPCPEIMAGEPAGEHASHES V2 const *PCRTCRSPCPEIMAGEPAGEHASHESV2;88 89 90 /** 91 * Serialization wrapper for raw RTCRSPCPEIMAGEPAGEHASHES V2data.92 */ 93 typedef struct RTCRSPCSERIALIZEDPAGEHASHES V286 } RTCRSPCPEIMAGEPAGEHASHES; 87 /** Pointer to a PE image page hash table union. */ 88 typedef RTCRSPCPEIMAGEPAGEHASHES *PRTCRSPCPEIMAGEPAGEHASHES; 89 /** Pointer to a const PE image page hash table union. */ 90 typedef RTCRSPCPEIMAGEPAGEHASHES const *PCRTCRSPCPEIMAGEPAGEHASHES; 91 92 93 /** 94 * Serialization wrapper for raw RTCRSPCPEIMAGEPAGEHASHES data. 95 */ 96 typedef struct RTCRSPCSERIALIZEDPAGEHASHES 94 97 { 95 98 /** The page hashes are within a set. Dunno if there could be multiple … … 100 103 101 104 /** Pointer to the hash data within that string. 102 * The hash algorithm is the same as for the full image hash and givenin103 * RTCR PKCS7SIGNEDDATA::SignerInfos.paSignerInfos[0].DigestAlgorithm as well as104 * in RTCRSPCINDIRECTDATACONTENT::DigestInfo.DigestAlgorithm. */105 PCRTCRSPCPEIMAGEPAGEHASHES V2pData;105 * The hash algorithm is given by the object attribute type in 106 * RTCRSPCSERIALIZEDOBJECTATTRIBUTE. It is generally the same as for the 107 * whole image hash. */ 108 PCRTCRSPCPEIMAGEPAGEHASHES pData; 106 109 /** Field the user can use to store the number of pages in pData. */ 107 110 uint32_t cPages; 108 } RTCRSPCSERIALIZEDPAGEHASHES V2;109 /** Pointer to a serialized object attribute. */110 typedef RTCRSPCSERIALIZEDPAGEHASHES V2 *PRTCRSPCSERIALIZEDPAGEHASHESV2;111 /** Pointer to a const serialized object attribute. */112 typedef RTCRSPCSERIALIZEDPAGEHASHES V2 const *PCRTCRSPCSERIALIZEDPAGEHASHESV2;113 RTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCSERIALIZEDPAGEHASHES V2, RTDECL, RTCrSpcSerializedPageHashesV2, SetCore.Asn1Core);114 115 RTDECL(int) RTCrSpcSerializedPageHashes V2_UpdateDerivedData(PRTCRSPCSERIALIZEDPAGEHASHESV2pThis);111 } RTCRSPCSERIALIZEDPAGEHASHES; 112 /** Pointer to a serialized wrapper for page hashes. */ 113 typedef RTCRSPCSERIALIZEDPAGEHASHES *PRTCRSPCSERIALIZEDPAGEHASHES; 114 /** Pointer to a const serialized wrapper for page hashes. */ 115 typedef RTCRSPCSERIALIZEDPAGEHASHES const *PCRTCRSPCSERIALIZEDPAGEHASHES; 116 RTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCSERIALIZEDPAGEHASHES, RTDECL, RTCrSpcSerializedPageHashes, SetCore.Asn1Core); 117 118 RTDECL(int) RTCrSpcSerializedPageHashes_UpdateDerivedData(PRTCRSPCSERIALIZEDPAGEHASHES pThis); 116 119 117 120 … … 127 130 /** Unknown object. */ 128 131 RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_UNKNOWN, 129 /** Page hashes v2 (pPageHashesV2). */ 132 /** SHA-1 page hashes (pPageHashes). */ 133 RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V1, 134 /** SHA-256 page hashes (pPageHashes). */ 130 135 RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V2, 131 136 /** End of valid values. */ … … 153 158 /** The unknown value (RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_UNKNOWN). */ 154 159 PRTASN1CORE pCore; 155 /** Page hashes v2 (RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V2). */ 156 PRTCRSPCSERIALIZEDPAGEHASHESV2 pPageHashesV2; 160 /** Page hashes (RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V1 or 161 * RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V2). */ 162 PRTCRSPCSERIALIZEDPAGEHASHES pPageHashes; 157 163 } u; 158 164 } RTCRSPCSERIALIZEDOBJECTATTRIBUTE; … … 468 474 469 475 /** 470 * Gets the PE image hash v2 SPC serialized object attribute if present. 471 * 472 * @returns Pointer to the attribute with Type RTCRSPC_PE_IMAGE_HASHES_V2_OID if 473 * found, NULL if not found. 474 * @param pIndData The Authenticode SpcIndirectDataContent. 475 */ 476 RTDECL(PCRTCRSPCSERIALIZEDOBJECTATTRIBUTE) RTCrSpcIndirectDataContent_GetPeImageHashesV2(PCRTCRSPCINDIRECTDATACONTENT pIndData); 476 * Gets the first SPC serialized object attribute in a SPC PE image. 477 * 478 * @returns Pointer to the attribute with the given type, NULL if not found. 479 * @param pThis The Authenticode SpcIndirectDataContent. 480 */ 481 RTDECL(PCRTCRSPCSERIALIZEDOBJECTATTRIBUTE) 482 RTCrSpcIndirectDataContent_GetPeImageObjAttrib(PCRTCRSPCINDIRECTDATACONTENT pThis, 483 RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE enmType); 477 484 478 485 /** @} */
Note:
See TracChangeset
for help on using the changeset viewer.