rev180: Add (unused) parameter to PublicAttributesValidation

Add yet unused parameter 'primaryHierarchy to PublicAttributesValidation.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2023-12-13 17:24:12 -05:00 committed by Stefan Berger
parent ba195ee8ab
commit a0a48464ac
5 changed files with 16 additions and 6 deletions

View File

@ -87,8 +87,8 @@ TPM2_CreatePrimary(
// Check attributes in input public area. CreateChecks() checks the things that
// are unique to creation and then validates the attributes and values that are
// common to create and load.
result = CreateChecks(NULL, publicArea,
in->inSensitive.sensitive.data.t.size);
result = CreateChecks(
NULL, in->primaryHandle, publicArea, in->inSensitive.sensitive.data.t.size);
if(result != TPM_RC_SUCCESS)
return RcSafeAddToResult(result, RC_CreatePrimary_inPublic);
// Validate the sensitive area values

View File

@ -426,7 +426,7 @@ ObjectLoad(OBJECT* object, // IN: pointer to object slot
// consistency with the parent, OR
// - parent is NULL but the object is not a primary object, either
result =
PublicAttributesValidation(parent, publicArea);
PublicAttributesValidation(parent, /*primaryHierarchy = */ 0, publicArea);
}
if(result != TPM_RC_SUCCESS)
return RcSafeAddToResult(result, blamePublic);

View File

@ -144,6 +144,7 @@ TPM2_Create(Create_In* in, // IN: input parameter list
// are unique to creation and then validates the attributes and values that are
// common to create and load.
result = CreateChecks(parentObject,
/* primaryHierarchy = */ 0,
publicArea,
in->inSensitive.sensitive.data.t.size);
if(result != TPM_RC_SUCCESS)
@ -587,7 +588,7 @@ TPM2_CreateLoaded(CreateLoaded_In* in, // IN: input parameter list
publicArea->objectAttributes, TPMA_OBJECT, sensitiveDataOrigin))
return TPM_RCS_ATTRIBUTES;
// Check the rest of the attributes
result = PublicAttributesValidation(parent, publicArea);
result = PublicAttributesValidation(parent, 0, publicArea);
if(result != TPM_RC_SUCCESS)
return RcSafeAddToResult(result, RC_CreateLoaded_inPublic);
// Process the template and sensitive areas to get the actual 'label' and
@ -613,7 +614,9 @@ TPM2_CreateLoaded(CreateLoaded_In* in, // IN: input parameter list
// Check attributes in input public area. CreateChecks() checks the things
// that are unique to creation and then validates the attributes and values
// that are common to create and load.
result = CreateChecks(parent, publicArea,
result = CreateChecks(parent,
(parent == NULL) ? in->parentHandle : 0,
publicArea,
in->inSensitive.sensitive.data.t.size);
if(result != TPM_RC_SUCCESS)

View File

@ -397,6 +397,7 @@ BOOL ObjectIsParent(OBJECT* parentObject // IN: parent handle
// other returns from PublicAttributesValidation()
TPM_RC
CreateChecks(OBJECT* parentObject,
TPMI_RH_HIERARCHY primaryHierarchy,
TPMT_PUBLIC* publicArea,
UINT16 sensitiveDataSize)
{
@ -443,7 +444,8 @@ CreateChecks(OBJECT* parentObject,
}
if(TPM_RC_SUCCESS == result)
{
result = PublicAttributesValidation(parentObject, publicArea);
result =
PublicAttributesValidation(parentObject, primaryHierarchy, publicArea);
}
return result;
}
@ -663,6 +665,8 @@ TPM_RC
PublicAttributesValidation(
// IN: input parent object (if ordinary or derived object; NULL otherwise)
OBJECT* parentObject,
// IN: hierarchy (if primary object; 0 otherwise)
TPMI_RH_HIERARCHY primaryHierarchy,
// IN: public area of the object
TPMT_PUBLIC* publicArea)
{

View File

@ -99,6 +99,7 @@ BOOL ObjectIsParent(OBJECT* parentObject // IN: parent handle
// other returns from PublicAttributesValidation()
TPM_RC
CreateChecks(OBJECT* parentObject,
TPMI_RH_HIERARCHY primaryHierarchy,
TPMT_PUBLIC* publicArea,
UINT16 sensitiveDataSize);
@ -145,6 +146,8 @@ TPM_RC
PublicAttributesValidation(
// IN: input parent object (if ordinary or derived object; NULL otherwise)
OBJECT* parentObject,
// IN: hierarchy (if primary object; 0 otherwise)
TPMI_RH_HIERARCHY primaryHierarchy,
// IN: public area of the object
TPMT_PUBLIC* publicArea);