VirtualBox

Changeset 104923 in vbox for trunk/include/iprt/formats


Ignore:
Timestamp:
Jun 14, 2024 3:15:25 PM (6 months ago)
Author:
vboxsync
Message:

Devices/Trace: Some more TPM trace decoding, bugref:10701

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/formats/tpm.h

    r104918 r104923  
    5252/** TPM interface object handle. */
    5353typedef TPMHANDLE TPMIDHOBJECT;
     54
     55/** A TPM boolean value (TPMI_YES_NO). */
     56typedef uint8_t  TPMYESNO;
     57/** A No aka False value for TPMYESNO. */
     58#define TPMYESNO_NO         0
     59/** A Yes aka True value for TPMYESNO. */
     60#define TPMYESNO_YES        1
     61
     62/** A TPM capability value (TPM_CAP). */
     63typedef uint32_t TPMCAP;
     64
     65
     66/**
     67 * TPM sized buffer.
     68 */
     69#pragma pack(1)
     70typedef struct TPMBUF
     71{
     72    /** Size of the buffer in bytes - can be 0. */
     73    uint16_t            u16Size;
     74    /** Buffer area. */
     75    uint8_t             abBuf[RT_FLEXIBLE_ARRAY_NESTED];
     76} TPMBUF;
     77#pragma pack()
     78/** Pointer to a TPM buffer. */
     79typedef TPMBUF *PTPMBUF;
     80/** Pointer to a const TPM buffer. */
     81typedef const TPMBUF *PCTPMBUF;
     82
    5483
    5584
     
    73102/** Pointer to a const TPM request header. */
    74103typedef const TPMREQHDR *PCTPMREQHDR;
     104
     105
     106/**
     107 * TPM response header (everything big endian).
     108 */
     109#pragma pack(1)
     110typedef struct TPMRESPHDR
     111{
     112    /** The tag for this request. */
     113    uint16_t            u16Tag;
     114    /** Size of the response in bytes. */
     115    uint32_t            cbResp;
     116    /** The error code for the response. */
     117    uint32_t            u32ErrCode;
     118} TPMRESPHDR;
     119#pragma pack()
     120AssertCompileSize(TPMRESPHDR, 2 + 4 + 4);
     121/** Pointer to a TPM response header. */
     122typedef TPMRESPHDR *PTPMRESPHDR;
     123/** Pointer to a const TPM response header. */
     124typedef const TPMRESPHDR *PCTPMRESPHDR;
    75125
    76126
     
    507557/** Pointer to a const TPM2_CC_GET_CAPABILITY request. */
    508558typedef const TPM2REQGETCAPABILITY *PCTPM2REQGETCAPABILITY;
     559
     560/**
     561 * TPM2_CC_GET_CAPABILITY response.
     562 */
     563#pragma pack(1)
     564typedef struct TPM2RESPGETCAPABILITY
     565{
     566    /** Request header. */
     567    TPMREQHDR                   Hdr;
     568    /** The capability group to query. */
     569    TPMYESNO                    fMoreData;
     570    /** The capability being returned (part of TPMS_CAPABILITY_DATA). */
     571    TPMCAP                      u32Cap;
     572    /** Capability data. */
     573    uint8_t                     abCap[RT_FLEXIBLE_ARRAY_NESTED];
     574} TPM2RESPGETCAPABILITY;
     575#pragma pack()
     576/** Pointer to a TPM2_CC_GET_CAPABILITY request. */
     577typedef TPM2RESPGETCAPABILITY *PTPM2RESPGETCAPABILITY;
     578/** Pointer to a const TPM2_CC_GET_CAPABILITY request. */
     579typedef const TPM2RESPGETCAPABILITY *PCTPM2RESPGETCAPABILITY;
    509580/** @} */
    510581
     
    531602
    532603
    533 /**
    534  * TPM response header (everything big endian).
    535  */
    536 #pragma pack(1)
    537 typedef struct TPMRESPHDR
    538 {
    539     /** The tag for this request. */
    540     uint16_t            u16Tag;
    541     /** Size of the response in bytes. */
    542     uint32_t            cbResp;
    543     /** The error code for the response. */
    544     uint32_t            u32ErrCode;
    545 } TPMRESPHDR;
    546 #pragma pack()
    547 AssertCompileSize(TPMRESPHDR, 2 + 4 + 4);
    548 /** Pointer to a TPM response header. */
    549 typedef TPMRESPHDR *PTPMRESPHDR;
    550 /** Pointer to a const TPM response header. */
    551 typedef const TPMRESPHDR *PCTPMRESPHDR;
     604/** @name Defines related to TPM2_CC_GET_RANDOM.
     605 * @{ */
     606/**
     607 * TPM2_CC_GET_RANDOM request.
     608 */
     609#pragma pack(1)
     610typedef struct TPM2REQGETRANDOM
     611{
     612    /** Request header. */
     613    TPMREQHDR                   Hdr;
     614    /** The number of random bytes requested. */
     615    uint16_t                    u16RandomBytes;
     616} TPM2REQGETRANDOM;
     617#pragma pack()
     618/** Pointer to a TPM2_CC_GET_RANDOM request. */
     619typedef TPM2REQGETRANDOM *PTPM2REQGETRANDOM;
     620/** Pointer to a const TPM2_CC_GET_RANDOM request. */
     621typedef const TPM2REQGETRANDOM *PCTPM2REQGETRANDOM;
     622
     623/**
     624 * TPM2_CC_GET_RANDOM response.
     625 */
     626#pragma pack(1)
     627typedef struct TPM2RESPGETRANDOM
     628{
     629    /** Request header. */
     630    TPMRESPHDR                  Hdr;
     631    /** The buffer holding the response data. */
     632    TPMBUF                      Buf;
     633} TPM2RESPGETRANDOM;
     634#pragma pack()
     635/** Pointer to a TPM2_CC_GET_RANDOM response. */
     636typedef TPM2RESPGETRANDOM *PTPM2RESPGETRANDOM;
     637/** Pointer to a const TPM2_CC_GET_RANDOM response. */
     638typedef const TPM2RESPGETRANDOM *PCTPM2RESPGETRANDOM;
     639/** @} */
    552640
    553641
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