3
* Licensed Materials - Property of IBM
5
* trousers - An open source TCG Software Stack
7
* (C) Copyright International Business Machines Corp. 2007
16
#include "trousers/tss.h"
17
#include "trousers/trousers.h"
18
#include "trousers_types.h"
19
#include "spi_utils.h"
25
Tspi_TPM_SetOperatorAuth(TSS_HTPM hTpm, /* in */
26
TSS_HPOLICY hOperatorPolicy) /* in */
28
TSS_HCONTEXT tspContext;
30
TCPA_SECRET operatorAuth;
31
TSS_RESULT result = TSS_SUCCESS;
33
if ((result = obj_tpm_get_tsp_context(hTpm, &tspContext)))
36
if ((result = obj_policy_get_type(hOperatorPolicy, &type)))
39
if (type != TSS_POLICY_OPERATOR)
40
return TSPERR(TSS_E_BAD_PARAMETER);
42
if ((result = obj_policy_get_secret(hOperatorPolicy, TR_SECRET_CTX_NEW, &operatorAuth)))
45
if ((result = TCS_API(tspContext)->SetOperatorAuth(tspContext, &operatorAuth)))
48
if ((result = obj_tpm_set_policy(hTpm, hOperatorPolicy)))