diff options
Diffstat (limited to 'src/tspi/rpc/tcstp/rpc_oper.c')
-rw-r--r-- | src/tspi/rpc/tcstp/rpc_oper.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/tspi/rpc/tcstp/rpc_oper.c b/src/tspi/rpc/tcstp/rpc_oper.c new file mode 100644 index 0000000..3795aab --- /dev/null +++ b/src/tspi/rpc/tcstp/rpc_oper.c @@ -0,0 +1,47 @@ + +/* + * 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 <assert.h> + +#include "trousers/tss.h" +#include "trousers/trousers.h" +#include "trousers_types.h" +#include "tsplog.h" +#include "hosttable.h" +#include "tcsd_wrap.h" +#include "rpc_tcstp_tsp.h" + + +TSS_RESULT +RPC_SetOperatorAuth_TP(struct host_table_entry *hte, + TCPA_SECRET *operatorAuth) /* in */ +{ + TSS_RESULT result; + + initData(&hte->comm, 2); + hte->comm.hdr.u.ordinal = TCSD_ORD_SETOPERATORAUTH; + LogDebugFn("TCS Context: 0x%x", hte->tcsContext); + + if (setData(TCSD_PACKET_TYPE_UINT32, 0, &hte->tcsContext, 0, &hte->comm)) + return TSPERR(TSS_E_INTERNAL_ERROR); + if (setData(TCSD_PACKET_TYPE_SECRET, 1, operatorAuth, 0, &hte->comm)) + return TSPERR(TSS_E_INTERNAL_ERROR); + + result = sendTCSDPacket(hte); + + if (result == TSS_SUCCESS) + result = hte->comm.hdr.u.result; + + return result; +} + |