3
* Licensed Materials - Property of IBM
5
* trousers - An open source TCG Software Stack
7
* (C) Copyright International Business Machines Corp. 2004-2006
16
#include <sys/types.h>
20
#include "trousers/tss.h"
21
#include "trousers/trousers.h"
22
#include "trousers_types.h"
23
#include "trousers_types.h"
24
#include "spi_utils.h"
25
#include "capabilities.h"
31
get_tpm_flags(TSS_HCONTEXT tspContext, TSS_HTPM hTPM, UINT32 *volFlags, UINT32 *nonVolFlags)
38
Trspi_HashCtx hashCtx;
40
if ((result = obj_tpm_get_policy(hTPM, TSS_POLICY_USAGE, &hPolicy)))
43
/* do an owner authorized get capability call */
44
result = Trspi_HashInit(&hashCtx, TSS_HASH_SHA1);
45
result |= Trspi_Hash_UINT32(&hashCtx, TPM_ORD_GetCapabilityOwner);
46
if ((result |= Trspi_HashFinal(&hashCtx, digest.digest)))
49
if ((result = secret_PerformAuth_OIAP(hTPM, TPM_ORD_GetCapabilityOwner, hPolicy, FALSE,
53
if ((result = TCS_API(tspContext)->GetCapabilityOwner(tspContext, &auth, &version,
54
nonVolFlags, volFlags)))
57
result = Trspi_HashInit(&hashCtx, TSS_HASH_SHA1);
58
result |= Trspi_Hash_UINT32(&hashCtx, result);
59
result |= Trspi_Hash_UINT32(&hashCtx, TPM_ORD_GetCapabilityOwner);
60
result |= Trspi_Hash_VERSION(&hashCtx, (TSS_VERSION *)&version);
61
result |= Trspi_Hash_UINT32(&hashCtx, *nonVolFlags);
62
result |= Trspi_Hash_UINT32(&hashCtx, *volFlags);
63
if ((result |= Trspi_HashFinal(&hashCtx, digest.digest)))
66
return obj_policy_validate_auth_oiap(hPolicy, &digest, &auth);