1use crate::{
15 data::{
16 Tpm2bAuth, Tpm2bCreationData, Tpm2bData, Tpm2bDigest, Tpm2bName, Tpm2bPublic,
17 Tpm2bSensitiveCreate, TpmAlgId, TpmCc, TpmRh, TpmiYesNo, TpmlPcrSelection, TpmtTkCreation,
18 },
19 tpm_struct, TpmTransient,
20};
21use core::fmt::Debug;
22
23tpm_struct! {
24 #[derive(Debug, Default, PartialEq, Eq, Clone)]
25 kind: Command,
26 name: TpmCreatePrimaryCommand,
27 cc: TpmCc::CreatePrimary,
28 handles: {
29 pub primary_handle: crate::data::TpmiRhHierarchy,
30 },
31 parameters: {
32 pub in_sensitive: Tpm2bSensitiveCreate,
33 pub in_public: Tpm2bPublic,
34 pub outside_info: Tpm2bData,
35 pub creation_pcr: TpmlPcrSelection,
36 }
37}
38
39tpm_struct! {
40 #[derive(Debug, PartialEq, Eq, Clone)]
41 kind: Response,
42 name: TpmCreatePrimaryResponse,
43 cc: TpmCc::CreatePrimary,
44 handles: {
45 pub object_handle: TpmTransient,
46 },
47 parameters: {
48 pub out_public: Tpm2bPublic,
49 pub creation_data: Tpm2bCreationData,
50 pub creation_hash: Tpm2bDigest,
51 pub creation_ticket: TpmtTkCreation,
52 pub name: Tpm2bName,
53 }
54}
55
56tpm_struct! {
57 #[derive(Debug, PartialEq, Eq, Clone, Copy)]
58 kind: Command,
59 name: TpmHierarchyControlCommand,
60 cc: TpmCc::HierarchyControl,
61 handles: {
62 pub auth_handle: crate::data::TpmiRhHierarchy,
63 },
64 parameters: {
65 pub enable: TpmRh,
66 pub state: TpmiYesNo,
67 }
68}
69
70tpm_struct! {
71 #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
72 kind: Response,
73 name: TpmHierarchyControlResponse,
74 cc: TpmCc::HierarchyControl,
75 handles: {},
76 parameters: {}
77}
78
79tpm_struct! {
80 #[derive(Debug, PartialEq, Eq, Clone)]
81 kind: Command,
82 name: TpmHierarchyChangeAuthCommand,
83 cc: TpmCc::HierarchyChangeAuth,
84 handles: {
85 pub auth_handle: crate::data::TpmiRhHierarchy,
86 },
87 parameters: {
88 pub new_auth: Tpm2bAuth,
89 }
90}
91
92tpm_struct! {
93 #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
94 kind: Response,
95 name: TpmHierarchyChangeAuthResponse,
96 cc: TpmCc::HierarchyChangeAuth,
97 handles: {},
98 parameters: {}
99}
100
101tpm_struct! {
102 #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
103 kind: Command,
104 name: TpmChangePpsCommand,
105 cc: TpmCc::ChangePps,
106 handles: {
107 pub auth_handle: crate::data::TpmiRhHierarchy,
108 },
109 parameters: {}
110}
111
112tpm_struct! {
113 #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
114 kind: Response,
115 name: TpmChangePpsResponse,
116 cc: TpmCc::ChangePps,
117 handles: {},
118 parameters: {}
119}
120
121tpm_struct! {
122 #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
123 kind: Command,
124 name: TpmChangeEpsCommand,
125 cc: TpmCc::ChangeEps,
126 handles: {
127 pub auth_handle: crate::data::TpmiRhHierarchy,
128 },
129 parameters: {}
130}
131
132tpm_struct! {
133 #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
134 kind: Response,
135 name: TpmChangeEpsResponse,
136 cc: TpmCc::ChangeEps,
137 handles: {},
138 parameters: {}
139}
140
141tpm_struct! {
142 #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
143 kind: Command,
144 name: TpmClearCommand,
145 cc: TpmCc::Clear,
146 handles: {
147 pub auth_handle: crate::data::TpmiRhHierarchy,
148 },
149 parameters: {}
150}
151
152tpm_struct! {
153 #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
154 kind: Response,
155 name: TpmClearResponse,
156 cc: TpmCc::Clear,
157 handles: {},
158 parameters: {}
159}
160
161tpm_struct! {
162 #[derive(Debug, PartialEq, Eq, Clone, Copy)]
163 kind: Command,
164 name: TpmClearControlCommand,
165 cc: TpmCc::ClearControl,
166 handles: {
167 pub auth: crate::data::TpmiRhHierarchy,
168 },
169 parameters: {
170 pub disable: TpmiYesNo,
171 }
172}
173
174tpm_struct! {
175 #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
176 kind: Response,
177 name: TpmClearControlResponse,
178 cc: TpmCc::ClearControl,
179 handles: {},
180 parameters: {}
181}
182
183tpm_struct! {
184 #[derive(Debug, PartialEq, Eq, Clone)]
185 kind: Command,
186 name: TpmSetPrimaryPolicyCommand,
187 cc: TpmCc::SetPrimaryPolicy,
188 handles: {
189 pub auth_handle: crate::data::TpmiRhHierarchy,
190 },
191 parameters: {
192 pub auth_policy: Tpm2bDigest,
193 pub hash_alg: TpmAlgId,
194 }
195}
196
197tpm_struct! {
198 #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
199 kind: Response,
200 name: TpmSetPrimaryPolicyResponse,
201 cc: TpmCc::SetPrimaryPolicy,
202 handles: {},
203 parameters: {}
204}
205
206tpm_struct! {
207 #[derive(Debug, PartialEq, Eq, Clone, Copy)]
208 kind: Command,
209 name: TpmReadOnlyControlCommand,
210 cc: TpmCc::ReadOnlyControl,
211 handles: {
212 pub auth_handle: crate::data::TpmiRhHierarchy,
213 },
214 parameters: {
215 pub state: TpmiYesNo,
216 }
217}
218
219tpm_struct! {
220 #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
221 kind: Response,
222 name: TpmReadOnlyControlResponse,
223 cc: TpmCc::ReadOnlyControl,
224 handles: {},
225 parameters: {}
226}