3
* Licensed Materials - Property of IBM
5
* trousers - An open source TCG Software Stack
7
* (C) Copyright International Business Machines Corp. 2004-2006
17
#include "trousers/tss.h"
18
#include "trousers_types.h"
21
#include "tcs_utils.h"
22
#include "tcs_int_literals.h"
23
#include "capabilities.h"
26
#include "tcsd_wrap.h"
31
TCSP_UnBind_Internal(TCS_CONTEXT_HANDLE hContext, /* in */
32
TCS_KEY_HANDLE keyHandle, /* in */
33
UINT32 inDataSize, /* in */
34
BYTE * inData, /* in */
35
TPM_AUTH * privAuth, /* in, out */
36
UINT32 * outDataSize, /* out */
37
BYTE ** outData) /* out */
42
TCPA_KEY_HANDLE keySlot;
43
BYTE txBlob[TSS_TPM_TXBLOB_SIZE];
45
LogDebug("Entering TCSI_UnBind");
46
if ((result = ctx_verify_context(hContext)))
49
if (privAuth != NULL) {
50
LogDebug("Auth Used");
51
if ((result = auth_mgr_check(hContext, &privAuth->AuthHandle)))
57
LogDebugFn("calling ensureKeyIsLoaded for TCS handle 0x%x", keyHandle);
58
if ((result = ensureKeyIsLoaded(hContext, keyHandle, &keySlot)))
61
if ((result = tpm_rqu_build(TPM_ORD_UnBind, &offset, txBlob, keySlot, inDataSize, inData,
65
if ((result = req_mgr_submit_req(txBlob)))
68
result = UnloadBlob_Header(txBlob, ¶mSize);
70
result = tpm_rsp_parse(TPM_ORD_UnBind, txBlob, paramSize, outDataSize, outData,
75
auth_mgr_release_auth(privAuth, NULL, hContext);