diff --git a/src/tpm2/DuplicationCommands.c b/src/tpm2/DuplicationCommands.c index 3dee561c..68f68e55 100644 --- a/src/tpm2/DuplicationCommands.c +++ b/src/tpm2/DuplicationCommands.c @@ -3,7 +3,7 @@ /* Duplication Commands */ /* Written by Ken Goldman */ /* IBM Thomas J. Watson Research Center */ -/* $Id: DuplicationCommands.c 1259 2018-07-10 19:11:09Z kgoldman $ */ +/* $Id: DuplicationCommands.c 1476 2019-06-10 19:32:03Z 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 - 2019 */ /* */ /********************************************************************************/ @@ -343,7 +343,7 @@ TPM2_Import( if(result == TPM_RC_SUCCESS) { // Prepare output private data from sensitive - SensitiveToPrivate(&sensitive, &name.b, parentObject, + SensitiveToPrivate(&sensitive, &name, parentObject, in->objectPublic.publicArea.nameAlg, &out->outPrivate); } diff --git a/src/tpm2/ObjectCommands.c b/src/tpm2/ObjectCommands.c index 8e49c987..dd733f67 100644 --- a/src/tpm2/ObjectCommands.c +++ b/src/tpm2/ObjectCommands.c @@ -112,7 +112,7 @@ TPM2_Create( TicketComputeCreation(EntityGetHierarchy(in->parentHandle), &newObject->name, &out->creationHash, &out->creationTicket); // Prepare output private data from sensitive - SensitiveToPrivate(&newObject->sensitive, &newObject->name.b, parentObject, + SensitiveToPrivate(&newObject->sensitive, &newObject->name, parentObject, publicArea->nameAlg, &out->outPrivate); // Finish by copying the remaining return values @@ -395,7 +395,7 @@ TPM2_ObjectChangeAuth( sensitive = object->sensitive; sensitive.authValue = in->newAuth; // Protect the sensitive area - SensitiveToPrivate(&sensitive, &object->name.b, HandleToObject(in->parentHandle), + SensitiveToPrivate(&sensitive, &object->name, HandleToObject(in->parentHandle), object->publicArea.nameAlg, &out->outPrivate); return TPM_RC_SUCCESS; @@ -523,7 +523,7 @@ TPM2_CreateLoaded( // area if(parent != NULL && !derivation) // Prepare output private data from sensitive - SensitiveToPrivate(&newObject->sensitive, &newObject->name.b, + SensitiveToPrivate(&newObject->sensitive, &newObject->name, parent, newObject->publicArea.nameAlg, &out->outPrivate); else diff --git a/src/tpm2/Object_spt.c b/src/tpm2/Object_spt.c index 1bbe933a..937a5bd0 100644 --- a/src/tpm2/Object_spt.c +++ b/src/tpm2/Object_spt.c @@ -3,7 +3,7 @@ /* Object Command Support */ /* Written by Ken Goldman */ /* IBM Thomas J. Watson Research Center */ -/* $Id: Object_spt.c 1311 2018-08-23 21:39:29Z kgoldman $ */ +/* $Id: Object_spt.c 1476 2019-06-10 19:32:03Z 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 - 2019 */ /* */ /********************************************************************************/ @@ -872,7 +872,7 @@ UnwrapOuter( } /* 7.6.3.10 MarshalSensitive() */ /* This function is used to marshal a sensitive area. Among other things, it adjusts the size of the - authValue to be no smaller than the digest of nameAlg Returns the size of the marshaled area. */ + authValue to be no smaller than the digest of nameAlg. Returns the size of the marshaled area. */ static UINT16 MarshalSensitive( BYTE *buffer, // OUT: receiving buffer @@ -901,7 +901,7 @@ MarshalSensitive( void SensitiveToPrivate( TPMT_SENSITIVE *sensitive, // IN: sensitive structure - TPM2B *name, // IN: the name of the object + TPM2B_NAME *name, // IN: the name of the object OBJECT *parent, // IN: The parent object TPM_ALG_ID nameAlg, // IN: hash algorithm in public area. This // parameter is used when parentHandle is @@ -916,7 +916,7 @@ SensitiveToPrivate( UINT16 integritySize; UINT16 ivSize; // - pAssert(name != NULL && name->size != 0); + pAssert(name != NULL && name->t.size != 0); // Find the hash algorithm for integrity computation if(parent == NULL) { @@ -941,7 +941,7 @@ SensitiveToPrivate( // Marshal the sensitive area including authValue size adjustments. dataSize = MarshalSensitive(sensitiveData, sensitive, nameAlg); //Produce outer wrap, including encryption and HMAC - outPrivate->t.size = ProduceOuterWrap(parent, name, hashAlg, NULL, + outPrivate->t.size = ProduceOuterWrap(parent, &name->b, hashAlg, NULL, TRUE, dataSize, outPrivate->t.buffer); return; } diff --git a/src/tpm2/Object_spt_fp.h b/src/tpm2/Object_spt_fp.h index cf7d1b01..02353276 100644 --- a/src/tpm2/Object_spt_fp.h +++ b/src/tpm2/Object_spt_fp.h @@ -3,7 +3,7 @@ /* Object Command Support */ /* Written by Ken Goldman */ /* IBM Thomas J. Watson Research Center */ -/* $Id: Object_spt_fp.h 1047 2017-07-20 18:27:34Z kgoldman $ */ +/* $Id: Object_spt_fp.h 1476 2019-06-10 19:32:03Z 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, 2017 */ +/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ /* */ /********************************************************************************/ @@ -138,7 +138,7 @@ UnwrapOuter( void SensitiveToPrivate( TPMT_SENSITIVE *sensitive, // IN: sensitive structure - TPM2B *name, // IN: the name of the object + TPM2B_NAME *name, // IN: the name of the object OBJECT *parent, // IN: The parent object TPM_ALG_ID nameAlg, // IN: hash algorithm in public area. This // parameter is used when parentHandle is