diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2012-11-25 14:36:20 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2012-11-25 14:36:20 +0000 |
commit | c3649a2def02c41d837ae1f79dda729ccb91e677 (patch) | |
tree | bea46dff212fdef977fe9094a70a939e8cc21885 /src/tcs/tcsi_oper.c | |
download | trousers-upstream/0.3.9.tar.gz |
Imported Upstream version 0.3.9upstream/0.3.9upstream
Diffstat (limited to 'src/tcs/tcsi_oper.c')
-rw-r--r-- | src/tcs/tcsi_oper.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/tcs/tcsi_oper.c b/src/tcs/tcsi_oper.c new file mode 100644 index 0000000..eee6c76 --- /dev/null +++ b/src/tcs/tcsi_oper.c @@ -0,0 +1,49 @@ + +/* + * Licensed Materials - Property of IBM + * + * trousers - An open source TCG Software Stack + * + * (C) Copyright International Business Machines Corp. 2007 + * + */ + + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#include "trousers/tss.h" +#include "trousers_types.h" +#include "tcs_utils.h" +#include "tcslog.h" +#include "req_mgr.h" + +TSS_RESULT +TCSP_SetOperatorAuth_Internal(TCS_CONTEXT_HANDLE hContext, /* in */ + TCPA_SECRET *operatorAuth) /* in */ +{ + TSS_RESULT result; + UINT64 offset = 0; + UINT32 paramSize; + BYTE txBlob[TSS_TPM_TXBLOB_SIZE]; + + LogDebugFn("Enter"); + + if ((result = ctx_verify_context(hContext))) + return result; + + if ((result = tpm_rqu_build(TPM_ORD_SetOperatorAuth, &offset, txBlob, TPM_AUTHDATA_SIZE, + operatorAuth->authdata))) + return result; + + if ((result = req_mgr_submit_req(txBlob))) + goto done; + + result = UnloadBlob_Header(txBlob, ¶mSize); + + LogResult("SetOperatorAuth", result); +done: + return result; +} + |