1 | // =================================================================== |
---|
2 | // |
---|
3 | // Copyright (c) 2005, Intel Corp. |
---|
4 | // All rights reserved. |
---|
5 | // |
---|
6 | // Redistribution and use in source and binary forms, with or without |
---|
7 | // modification, are permitted provided that the following conditions |
---|
8 | // are met: |
---|
9 | // |
---|
10 | // * Redistributions of source code must retain the above copyright |
---|
11 | // notice, this list of conditions and the following disclaimer. |
---|
12 | // * Redistributions in binary form must reproduce the above |
---|
13 | // copyright notice, this list of conditions and the following |
---|
14 | // disclaimer in the documentation and/or other materials provided |
---|
15 | // with the distribution. |
---|
16 | // * Neither the name of Intel Corporation nor the names of its |
---|
17 | // contributors may be used to endorse or promote products derived |
---|
18 | // from this software without specific prior written permission. |
---|
19 | // |
---|
20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
---|
21 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
---|
22 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
---|
23 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
---|
24 | // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
---|
25 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
---|
26 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
---|
27 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
---|
28 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
---|
29 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
30 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
---|
31 | // OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
32 | // =================================================================== |
---|
33 | // |
---|
34 | // vtsp.h |
---|
35 | // |
---|
36 | // Higher level interface to TCS. |
---|
37 | // |
---|
38 | // ================================================================== |
---|
39 | |
---|
40 | #ifndef __VTSP_H__ |
---|
41 | #define __VTSP_H__ |
---|
42 | |
---|
43 | #include "tcg.h" |
---|
44 | #include "tcs.h" |
---|
45 | |
---|
46 | #define KEY_BUFFER_SIZE 2048 |
---|
47 | |
---|
48 | TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE hContext, |
---|
49 | const buffer_t *inbuf, |
---|
50 | buffer_t *outbuf ); |
---|
51 | |
---|
52 | TPM_RESULT VTSP_OIAP( const TCS_CONTEXT_HANDLE hContext, |
---|
53 | TCS_AUTH *auth); |
---|
54 | |
---|
55 | TPM_RESULT VTSP_OSAP( const TCS_CONTEXT_HANDLE hContext, |
---|
56 | const TPM_ENTITY_TYPE entityType, |
---|
57 | const UINT32 entityValue, |
---|
58 | const TPM_AUTHDATA *usageAuth, |
---|
59 | TPM_SECRET *sharedsecret, |
---|
60 | TCS_AUTH *auth); |
---|
61 | |
---|
62 | TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext, |
---|
63 | const TCS_AUTH *auth); |
---|
64 | |
---|
65 | TPM_RESULT VTSP_ReadPubek( const TCS_CONTEXT_HANDLE hContext, |
---|
66 | CRYPTO_INFO *cypto_info); |
---|
67 | |
---|
68 | TPM_RESULT VTSP_TakeOwnership( const TCS_CONTEXT_HANDLE hContext, |
---|
69 | const TPM_AUTHDATA *ownerAuth, |
---|
70 | const TPM_AUTHDATA *srkAuth, |
---|
71 | CRYPTO_INFO *ek_cryptoInfo, |
---|
72 | TCS_AUTH *auth); |
---|
73 | |
---|
74 | TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE hContext, |
---|
75 | const TPM_AUTHDATA *ownerAuth, |
---|
76 | TCS_AUTH *auth); |
---|
77 | |
---|
78 | TPM_RESULT VTSP_CreateWrapKey( const TCS_CONTEXT_HANDLE hContext, |
---|
79 | const TPM_KEY_USAGE usage, |
---|
80 | const TPM_AUTHDATA *newKeyAuth, |
---|
81 | const TCS_KEY_HANDLE parentHandle, |
---|
82 | const TPM_AUTHDATA *osapSharedSecret, |
---|
83 | buffer_t *pubKeyBuf, |
---|
84 | TCS_AUTH *auth); |
---|
85 | |
---|
86 | TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE hContext, |
---|
87 | const TCS_KEY_HANDLE hUnwrappingKey, |
---|
88 | const buffer_t *rgbWrappedKeyBlob, |
---|
89 | const TPM_AUTHDATA *parentAuth, |
---|
90 | TPM_HANDLE *newKeyHandle, |
---|
91 | TCS_AUTH *pAuth, |
---|
92 | CRYPTO_INFO *cryptoinfo, |
---|
93 | const BOOL skipTPMLoad); |
---|
94 | |
---|
95 | TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE hContext, |
---|
96 | const TPM_KEY_HANDLE key_handle, |
---|
97 | const buffer_t *bound_data, |
---|
98 | const TPM_AUTHDATA *usage_auth, |
---|
99 | buffer_t *clear_data, |
---|
100 | TCS_AUTH *auth); |
---|
101 | |
---|
102 | TPM_RESULT VTSP_Bind( CRYPTO_INFO *cryptoInfo, |
---|
103 | const buffer_t *inData, |
---|
104 | buffer_t *outData); |
---|
105 | |
---|
106 | TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE hContext, |
---|
107 | const TPM_KEY_HANDLE keyHandle, |
---|
108 | const TPM_AUTHDATA *sealDataAuth, |
---|
109 | const TPM_PCR_COMPOSITE *pcrComp, |
---|
110 | const buffer_t *inData, |
---|
111 | TPM_STORED_DATA *sealedData, |
---|
112 | const TPM_SECRET *osapSharedSecret, |
---|
113 | TCS_AUTH *auth); |
---|
114 | |
---|
115 | TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE hContext, |
---|
116 | const TPM_KEY_HANDLE keyHandle, |
---|
117 | const TPM_STORED_DATA *sealedData, |
---|
118 | const TPM_AUTHDATA *key_usage_auth, |
---|
119 | const TPM_AUTHDATA *data_usage_auth, |
---|
120 | buffer_t *outData, |
---|
121 | TCS_AUTH *auth, |
---|
122 | TCS_AUTH *dataAuth); |
---|
123 | |
---|
124 | TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE hContext); |
---|
125 | |
---|
126 | #endif //_VTSP_H_ |
---|