1 /*
2  * Copyright (c) 2010-2012 United States Government, as represented by
3  * the Secretary of Defense.  All rights reserved.
4  *
5  * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
6  * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
7  * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
8  * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
9  * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
10  * SOFTWARE.
11  */
12 
13 #ifndef MANAGER_H
14 #define MANAGER_H
15 
16 #include <tpmfront.h>
17 #include <tpmback.h>
18 #include "tpm/tpm_structures.h"
19 
20 /* Create a command response error header */
21 int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode);
22 /* Request random bytes from hardware tpm, returns 0 on success */
23 TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32* numbytes);
24 /* Retreive 256 bit AES encryption key from manager */
25 TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length);
26 /* Manager securely saves our 256 bit AES encryption key */
27 TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length);
28 /* Send a TPM_PCRRead command passthrough the manager to the hw tpm */
29 TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest);
30 
31 #endif
32