VirtualBox

Changeset 51862 in vbox for trunk/include


Ignore:
Timestamp:
Jul 3, 2014 11:51:54 PM (11 years ago)
Author:
vboxsync
Message:

page hash updates.

Location:
trunk/include/iprt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/crypto/spc.h

    r51770 r51862  
    4242
    4343/**
    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 */
     49typedef union RTCRSPCPEIMAGEPAGEHASHES
    4750{
    4851    /** MD5 page hashes. */
     
    8184        uint8_t         abHash[RTSHA512_HASH_SIZE];
    8285    } aSha512[1];
    83 } RTCRSPCPEIMAGEPAGEHASHESV2;
    84 /** Pointer to a version 2 PE image hash table. */
    85 typedef RTCRSPCPEIMAGEPAGEHASHESV2 *PRTCRSPCPEIMAGEPAGEHASHESV2;
    86 /** Pointer to a const version 2 PE image hash table. */
    87 typedef RTCRSPCPEIMAGEPAGEHASHESV2 const *PCRTCRSPCPEIMAGEPAGEHASHESV2;
    88 
    89 
    90 /**
    91  * Serialization wrapper for raw RTCRSPCPEIMAGEPAGEHASHESV2 data.
    92  */
    93 typedef struct RTCRSPCSERIALIZEDPAGEHASHESV2
     86} RTCRSPCPEIMAGEPAGEHASHES;
     87/** Pointer to a PE image page hash table union. */
     88typedef RTCRSPCPEIMAGEPAGEHASHES *PRTCRSPCPEIMAGEPAGEHASHES;
     89/** Pointer to a const PE image page hash table union. */
     90typedef RTCRSPCPEIMAGEPAGEHASHES const *PCRTCRSPCPEIMAGEPAGEHASHES;
     91
     92
     93/**
     94 * Serialization wrapper for raw RTCRSPCPEIMAGEPAGEHASHES data.
     95 */
     96typedef struct RTCRSPCSERIALIZEDPAGEHASHES
    9497{
    9598    /** The page hashes are within a set. Dunno if there could be multiple
     
    100103
    101104    /** Pointer to the hash data within that string.
    102      * The hash algorithm is the same as for the full image hash and given in
    103      * RTCRPKCS7SIGNEDDATA::SignerInfos.paSignerInfos[0].DigestAlgorithm as well as
    104      * in RTCRSPCINDIRECTDATACONTENT::DigestInfo.DigestAlgorithm. */
    105     PCRTCRSPCPEIMAGEPAGEHASHESV2    pData;
     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;
    106109    /** Field the user can use to store the number of pages in pData. */
    107110    uint32_t                        cPages;
    108 } RTCRSPCSERIALIZEDPAGEHASHESV2;
    109 /** Pointer to a serialized object attribute.  */
    110 typedef RTCRSPCSERIALIZEDPAGEHASHESV2 *PRTCRSPCSERIALIZEDPAGEHASHESV2;
    111 /** Pointer to a const serialized object attribute.  */
    112 typedef RTCRSPCSERIALIZEDPAGEHASHESV2 const *PCRTCRSPCSERIALIZEDPAGEHASHESV2;
    113 RTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCSERIALIZEDPAGEHASHESV2, RTDECL, RTCrSpcSerializedPageHashesV2, SetCore.Asn1Core);
    114 
    115 RTDECL(int) RTCrSpcSerializedPageHashesV2_UpdateDerivedData(PRTCRSPCSERIALIZEDPAGEHASHESV2 pThis);
     111} RTCRSPCSERIALIZEDPAGEHASHES;
     112/** Pointer to a serialized wrapper for page hashes.  */
     113typedef RTCRSPCSERIALIZEDPAGEHASHES *PRTCRSPCSERIALIZEDPAGEHASHES;
     114/** Pointer to a const serialized wrapper for page hashes.  */
     115typedef RTCRSPCSERIALIZEDPAGEHASHES const *PCRTCRSPCSERIALIZEDPAGEHASHES;
     116RTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCSERIALIZEDPAGEHASHES, RTDECL, RTCrSpcSerializedPageHashes, SetCore.Asn1Core);
     117
     118RTDECL(int) RTCrSpcSerializedPageHashes_UpdateDerivedData(PRTCRSPCSERIALIZEDPAGEHASHES pThis);
    116119
    117120
     
    127130    /** Unknown object. */
    128131    RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_UNKNOWN,
    129     /** Page hashes v2 (pPageHashesV2). */
     132    /** SHA-1 page hashes (pPageHashes). */
     133    RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V1,
     134    /** SHA-256 page hashes (pPageHashes). */
    130135    RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V2,
    131136    /** End of valid values. */
     
    153158        /** The unknown value (RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_UNKNOWN). */
    154159        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;
    157163    } u;
    158164} RTCRSPCSERIALIZEDOBJECTATTRIBUTE;
     
    468474
    469475/**
    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 */
     481RTDECL(PCRTCRSPCSERIALIZEDOBJECTATTRIBUTE)
     482RTCrSpcIndirectDataContent_GetPeImageObjAttrib(PCRTCRSPCINDIRECTDATACONTENT pThis,
     483                                               RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE enmType);
    477484
    478485/** @} */
  • trunk/include/iprt/err.h

    r51800 r51862  
    23592359/** Internal SPC error: Bad object moniker data pointer. */
    23602360#define VERR_CR_SPC_MONIKER_BAD_DATA                            (-23412)
    2361 /** Multiple v2 PE image page hash tables. */
    2362 #define VERR_CR_SPC_PEIMAGE_MULTIPLE_V2_HASH_TABS               (-23413)
    2363 /** Version 1 PE image page hash tables has not been implemented/tested. */
    2364 #define VERR_CR_SPC_PEIMAGE_V1_HASH_TABS_NOT_IMPL               (-23414)
     2361/** Multiple PE image page hash tables. */
     2362#define VERR_CR_SPC_PEIMAGE_MULTIPLE_HASH_TABS                  (-23413)
    23652363/** Unknown SPC PE image attribute. */
    2366 #define VERR_CR_SPC_PEIMAGE_UNKNOWN_ATTRIBUTE                   (-23415)
     2364#define VERR_CR_SPC_PEIMAGE_UNKNOWN_ATTRIBUTE                   (-23414)
    23672365/** URL not expected in SPC PE image data. */
    2368 #define VERR_CR_SPC_PEIMAGE_URL_UNEXPECTED                      (-23416)
     2366#define VERR_CR_SPC_PEIMAGE_URL_UNEXPECTED                      (-23415)
    23692367/** PE image data without any valid content was not expected. */
    2370 #define VERR_CR_SPC_PEIMAGE_NO_CONTENT                          (-23417)
     2368#define VERR_CR_SPC_PEIMAGE_NO_CONTENT                          (-23416)
    23712369/** @} */
    23722370
  • trunk/include/iprt/mangling.h

    r51856 r51862  
    24472447# define RTCrSpcIndirectDataContent_Delete              RT_MANGLER(RTCrSpcIndirectDataContent_Delete)
    24482448# define RTCrSpcIndirectDataContent_Enum                RT_MANGLER(RTCrSpcIndirectDataContent_Enum)
    2449 # define RTCrSpcIndirectDataContent_GetPeImageHashesV2  RT_MANGLER(RTCrSpcIndirectDataContent_GetPeImageHashesV2)
     2449# define RTCrSpcIndirectDataContent_GetPeImageObjAttrib RT_MANGLER(RTCrSpcIndirectDataContent_GetPeImageObjAttrib)
    24502450# define RTCrSpcLink_Compare                            RT_MANGLER(RTCrSpcLink_Compare)
    24512451# define RTCrSpcLink_Delete                             RT_MANGLER(RTCrSpcLink_Delete)
     
    24632463# define RTCrSpcSerializedObject_Delete                 RT_MANGLER(RTCrSpcSerializedObject_Delete)
    24642464# define RTCrSpcSerializedObject_Enum                   RT_MANGLER(RTCrSpcSerializedObject_Enum)
    2465 # define RTCrSpcSerializedPageHashesV2_Compare          RT_MANGLER(RTCrSpcSerializedPageHashesV2_Compare)
    2466 # define RTCrSpcSerializedPageHashesV2_Delete           RT_MANGLER(RTCrSpcSerializedPageHashesV2_Delete)
    2467 # define RTCrSpcSerializedPageHashesV2_Enum             RT_MANGLER(RTCrSpcSerializedPageHashesV2_Enum)
    2468 # define RTCrSpcSerializedPageHashesV2_UpdateDerivedData RT_MANGLER(RTCrSpcSerializedPageHashesV2_UpdateDerivedData)
     2465# define RTCrSpcSerializedPageHashes_Compare            RT_MANGLER(RTCrSpcSerializedPageHashes_Compare)
     2466# define RTCrSpcSerializedPageHashes_Delete             RT_MANGLER(RTCrSpcSerializedPageHashes_Delete)
     2467# define RTCrSpcSerializedPageHashes_Enum               RT_MANGLER(RTCrSpcSerializedPageHashes_Enum)
     2468# define RTCrSpcSerializedPageHashes_UpdateDerivedData  RT_MANGLER(RTCrSpcSerializedPageHashes_UpdateDerivedData)
    24692469# define RTCrSpcString_Compare                          RT_MANGLER(RTCrSpcString_Compare)
    24702470# define RTCrSpcString_Delete                           RT_MANGLER(RTCrSpcString_Delete)
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