mirror of
https://github.com/stefanberger/libtpms
synced 2026-01-09 05:50:48 +00:00
rev180: Sync PCRBelongsAuthGroup/PolicyGroup with upstream (bugfix?)
Since none of the authValuesGroup'd and policyAuthGroup's are != 0, the two functions will now always return false even though they returned TRUE before for 20 <= PCR <= 22. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
a12cb47243
commit
af4fc0e66d
@ -107,9 +107,15 @@ BOOL PCRBelongsAuthGroup(TPMI_DH_PCR handle, // IN: handle of PCR
|
||||
// one authorization group which contains PCR[20-22]. If the platform
|
||||
// specification requires differently, the implementation should be changed
|
||||
// accordingly
|
||||
if(handle >= 20 && handle <= 22)
|
||||
UINT32 pcr = handle - PCR_FIRST;
|
||||
PCR_Attributes currentPcrAttributes =
|
||||
_platPcr__GetPcrInitializationAttributes(pcr);
|
||||
|
||||
if(currentPcrAttributes.authValuesGroup != 0)
|
||||
{
|
||||
*groupIndex = 0;
|
||||
// turn 1-based group number into actual array index expected by callers
|
||||
*groupIndex = currentPcrAttributes.authValuesGroup - 1;
|
||||
pAssert_BOOL(*groupIndex < NUM_AUTHVALUE_PCR_GROUP);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -133,14 +139,19 @@ BOOL PCRBelongsPolicyGroup(
|
||||
// parameter is zero
|
||||
)
|
||||
{
|
||||
*groupIndex = 0;
|
||||
|
||||
#if defined NUM_POLICY_PCR_GROUP && NUM_POLICY_PCR_GROUP > 0
|
||||
// Platform specification decides if a PCR belongs to a policy group and
|
||||
// belongs to which group. In this implementation, we assume there is only
|
||||
// one policy group which contains PCR20-22. If the platform specification
|
||||
// requires differently, the implementation should be changed accordingly
|
||||
if(handle >= 20 && handle <= 22)
|
||||
// belongs to which group.
|
||||
UINT32 pcr = handle - PCR_FIRST;
|
||||
PCR_Attributes currentPcrAttributes =
|
||||
_platPcr__GetPcrInitializationAttributes(pcr);
|
||||
if(currentPcrAttributes.policyAuthGroup != 0)
|
||||
{
|
||||
*groupIndex = 0;
|
||||
// turn 1-based group number into actual array index expected by callers
|
||||
*groupIndex = currentPcrAttributes.policyAuthGroup - 1;
|
||||
pAssert_BOOL(*groupIndex < NUM_POLICY_PCR_GROUP);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user