tpm2: rev162: Rename TPM_GENERATED to TPM_CONSTANTS32

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2020-04-17 17:50:09 -04:00 committed by Stefan Berger
parent c3b7295941
commit 4521d02dc5
6 changed files with 19 additions and 17 deletions

View File

@ -194,9 +194,9 @@ TPM_KEY_BITS_Marshal(TPM_KEY_BITS *source, BYTE **buffer, INT32 *size)
return written;
}
/* Table 2:7 - Definition of TPM_GENERATED Constants (EnumTable()) */
/* Table 2:7 - Definition of TPM_CONSTANTS32 Constants (EnumTable()) */
UINT16
TPM_GENERATED_Marshal(TPM_GENERATED *source, BYTE **buffer, INT32 *size)
TPM_CONSTANTS32_Marshal(TPM_CONSTANTS32 *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += UINT32_Marshal(source, buffer, size);
@ -1106,7 +1106,7 @@ TPMS_ATTEST_Marshal(TPMS_ATTEST *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += TPM_GENERATED_Marshal(&source->magic, buffer, size);
written += TPM_CONSTANTS32_Marshal(&source->magic, buffer, size);
written += TPMI_ST_ATTEST_Marshal(&source->type, buffer, size);
written += TPM2B_NAME_Marshal(&source->qualifiedSigner, buffer, size);
written += TPM2B_DATA_Marshal(&source->extraData, buffer, size);

View File

@ -3,7 +3,7 @@
/* Parameter Marshaling */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: Marshal_fp.h 1519 2019-11-15 20:43:51Z kgoldman $ */
/* $Id: Marshal_fp.h 1603 2020-04-03 17:48:43Z kgoldman $ */
/* */
/* Licenses and Notices */
/* */
@ -55,7 +55,7 @@
/* arising in any way out of use or reliance upon this specification or any */
/* information herein. */
/* */
/* (c) Copyright IBM Corp. and others, 2016 - 2019 */
/* (c) Copyright IBM Corp. and others, 2016 - 2020 */
/* */
/********************************************************************************/
@ -83,7 +83,7 @@ extern "C" {
UINT16
TPM_KEY_BITS_Marshal(TPM_KEY_BITS *source, BYTE **buffer, INT32 *size);
UINT16
TPM_GENERATED_Marshal(TPM_GENERATED *source, BYTE **buffer, INT32 *size);
TPM_CONSTANTS32_Marshal(TPM_CONSTANTS32 *source, BYTE **buffer, INT32 *size);
UINT16
TPM_ALG_ID_Marshal(TPM_ALG_ID *source, BYTE **buffer, INT32 *size);
UINT16

View File

@ -3,7 +3,7 @@
/* Symmetric Commands */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: SymmetricCommands.c 1490 2019-07-26 21:13:22Z kgoldman $ */
/* $Id: SymmetricCommands.c 1594 2020-03-26 22:15:48Z kgoldman $ */
/* */
/* Licenses and Notices */
/* */
@ -226,7 +226,7 @@ TPM2_Hash(
out->validation.hierarchy = TPM_RH_NULL;
out->validation.digest.t.size = 0;
}
else if(in->data.t.size >= sizeof(TPM_GENERATED)
else if(in->data.t.size >= sizeof(TPM_GENERATED_VALUE)
&& !TicketIsSafe(&in->data.b))
{
// Ticket is not safe

View File

@ -3,7 +3,7 @@
/* Functions used for ticket computations. */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: Ticket.c 1490 2019-07-26 21:13:22Z kgoldman $ */
/* $Id: Ticket.c 1594 2020-03-26 22:15:48Z kgoldman $ */
/* */
/* Licenses and Notices */
/* */
@ -55,7 +55,7 @@
/* arising in any way out of use or reliance upon this specification or any */
/* information herein. */
/* */
/* (c) Copyright IBM Corp. and others, 2016 - 2018 */
/* (c) Copyright IBM Corp. and others, 2016 - 2020 */
/* */
/********************************************************************************/
@ -77,7 +77,7 @@ TicketIsSafe(
TPM2B *buffer
)
{
TPM_GENERATED valueToCompare = TPM_GENERATED_VALUE;
TPM_CONSTANTS32 valueToCompare = TPM_GENERATED_VALUE;
BYTE bufferToCompare[sizeof(valueToCompare)];
BYTE *marshalBuffer;
//
@ -86,7 +86,7 @@ TicketIsSafe(
if(buffer->size < sizeof(valueToCompare))
return FALSE;
marshalBuffer = bufferToCompare;
TPM_GENERATED_Marshal(&valueToCompare, &marshalBuffer, NULL);
TPM_CONSTANTS32_Marshal(&valueToCompare, &marshalBuffer, NULL);
if(MemoryEqual(buffer->buffer, bufferToCompare, sizeof(valueToCompare)))
return FALSE;
else

View File

@ -323,11 +323,11 @@ typedef UINT32 TPM_SPEC;
#define SPEC_DAY_OF_YEAR 312
#define TPM_SPEC_DAY_OF_YEAR (TPM_SPEC)(SPEC_DAY_OF_YEAR)
/* Table 2:7 - Definition of TPM_GENERATED Constants */
/* Table 2:7 - Definition of TPM_CONSTANTS32 Constants */
typedef UINT32 TPM_GENERATED;
#define TYPE_OF_TPM_GENERATED UINT32
#define TPM_GENERATED_VALUE (TPM_GENERATED)(0xFF544347)
typedef UINT32 TPM_CONSTANTS32;
#define TYPE_OF_TPM_CONSTANTS32 UINT32
#define TPM_GENERATED_VALUE (TPM_CONSTANTS32)(0xFF544347)
/* Table 2:16 - Definition of TPM_RC Constants */
typedef UINT32 TPM_RC;
@ -1656,7 +1656,7 @@ typedef union {
} TPMU_ATTEST;
/* Table 2:123 - Definition of TPMS_ATTEST Structure */
typedef struct {
TPM_GENERATED magic;
TPM_CONSTANTS32 magic;
TPMI_ST_ATTEST type;
TPM2B_NAME qualifiedSigner;
TPM2B_DATA extraData;

View File

@ -87,8 +87,10 @@ extern "C" {
TPM2B_Unmarshal(TPM2B *target, UINT16 targetSize, BYTE **buffer, INT32 *size);
LIB_EXPORT TPM_RC
TPM_KEY_BITS_Unmarshal(TPM_KEY_BITS *target, BYTE **buffer, INT32 *size);
#if 0
LIB_EXPORT TPM_RC
TPM_GENERATED_Unmarshal(TPM_GENERATED *target, BYTE **buffer, INT32 *size);
#endif
LIB_EXPORT TPM_RC
TPM_ALG_ID_Unmarshal(TPM_ALG_ID *target, BYTE **buffer, INT32 *size);
LIB_EXPORT TPM_RC