2 TPM Specification data structures (TCG TPM Specification Version 1.2 Revision 94)
3 See http://trustedcomputinggroup.org for latest specification updates
5 Copyright (c) 2006 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 /// The start of TPM return codes
22 #define TPM_BASE (MAX_BIT + (MAX_BIT >> 1))
25 // All structures MUST be packed on a byte boundary.
31 // Part 2, section 2.2.3: Helper redefinitions
34 /// Indicates the conditions where it is required that authorization be presented
36 typedef UINT8 TPM_AUTH_DATA_USAGE
;
38 /// The information as to what the payload is in an encrypted structure
40 typedef UINT8 TPM_PAYLOAD_TYPE
;
42 /// The version info breakdown
44 typedef UINT8 TPM_VERSION_BYTE
;
46 /// The request or response authorization type
48 typedef UINT16 TPM_TAG
;
50 /// The protocol in use
52 typedef UINT16 TPM_PROTOCOL_ID
;
54 /// Indicates the start state
56 typedef UINT16 TPM_STARTUP_TYPE
;
58 /// The definition of the encryption scheme
60 typedef UINT16 TPM_ENC_SCHEME
;
62 /// The definition of the signature scheme
64 typedef UINT16 TPM_SIG_SCHEME
;
66 /// The definition of the migration scheme
68 typedef UINT16 TPM_MIGRATE_SCHEME
;
70 /// Sets the state of the physical presence mechanism
72 typedef UINT16 TPM_PHYSICAL_PRESENCE
;
74 /// Indicates the types of entity that are supported by the TPM
76 typedef UINT16 TPM_ENTITY_TYPE
;
78 /// Indicates the permitted usage of the key
80 typedef UINT16 TPM_KEY_USAGE
;
82 /// The type of asymmetric encrypted structure in use by the endorsement key
84 typedef UINT16 TPM_EK_TYPE
;
86 /// The tag for the structure
88 typedef UINT16 TPM_STRUCTURE_TAG
;
90 /// The platform specific spec to which the information relates to
92 typedef UINT16 TPM_PLATFORM_SPECIFIC
;
94 /// The command ordinal
96 typedef UINT32 TPM_COMMAND_CODE
;
98 /// Identifies a TPM capability area
100 typedef UINT32 TPM_CAPABILITY_AREA
;
102 /// Indicates information regarding a key
104 typedef UINT32 TPM_KEY_FLAGS
;
106 /// Indicates the type of algorithm
108 typedef UINT32 TPM_ALGORITHM_ID
;
110 /// The locality modifier
112 typedef UINT32 TPM_MODIFIER_INDICATOR
;
114 /// The actual number of a counter
116 typedef UINT32 TPM_ACTUAL_COUNT
;
118 /// Attributes that define what options are in use for a transport session
120 typedef UINT32 TPM_TRANSPORT_ATTRIBUTES
;
122 /// Handle to an authorization session
124 typedef UINT32 TPM_AUTHHANDLE
;
126 /// Index to a DIR register
128 typedef UINT32 TPM_DIRINDEX
;
130 /// The area where a key is held assigned by the TPM
132 typedef UINT32 TPM_KEY_HANDLE
;
134 /// Index to a PCR register
136 typedef UINT32 TPM_PCRINDEX
;
138 /// The return code from a function
140 typedef UINT32 TPM_RESULT
;
142 /// The types of resources that a TPM may have using internal resources
144 typedef UINT32 TPM_RESOURCE_TYPE
;
146 /// Allows for controlling of the key when loaded and how to handle TPM_Startup issues
148 typedef UINT32 TPM_KEY_CONTROL
;
150 /// The index into the NV storage area
152 typedef UINT32 TPM_NV_INDEX
;
154 /// The family ID. Families ID's are automatically assigned a sequence number by the TPM.
155 /// A trusted process can set the FamilyID value in an individual row to NULL, which
156 /// invalidates that row. The family ID resets to NULL on each change of TPM Owner.
158 typedef UINT32 TPM_FAMILY_ID
;
160 /// IA value used as a label for the most recent verification of this family. Set to zero when not in use.
162 typedef UINT32 TPM_FAMILY_VERIFICATION
;
164 /// How the TPM handles var
166 typedef UINT32 TPM_STARTUP_EFFECTS
;
168 /// The mode of a symmetric encryption
170 typedef UINT32 TPM_SYM_MODE
;
174 typedef UINT32 TPM_FAMILY_FLAGS
;
176 /// The index value for the delegate NV table
178 typedef UINT32 TPM_DELEGATE_INDEX
;
180 /// The restrictions placed on delegation of CMK commands
182 typedef UINT32 TPM_CMK_DELEGATE
;
184 /// The ID value of a monotonic counter
186 typedef UINT32 TPM_COUNT_ID
;
188 /// A command to execute
190 typedef UINT32 TPM_REDIT_COMMAND
;
192 /// A transport session handle
194 typedef UINT32 TPM_TRANSHANDLE
;
196 /// A generic handle could be key, transport etc
198 typedef UINT32 TPM_HANDLE
;
200 /// What operation is happening
202 typedef UINT32 TPM_FAMILY_OPERATION
;
205 // Part 2, section 2.2.4: Vendor specific
206 // The following defines allow for the quick specification of a
207 // vendor specific item.
209 #define TPM_Vendor_Specific32 ((UINT32) 0x00000400)
210 #define TPM_Vendor_Specific8 ((UINT8) 0x80)
213 // Part 2, section 3.1: TPM_STRUCTURE_TAG
215 #define TPM_TAG_CONTEXTBLOB ((TPM_STRUCTURE_TAG) 0x0001)
216 #define TPM_TAG_CONTEXT_SENSITIVE ((TPM_STRUCTURE_TAG) 0x0002)
217 #define TPM_TAG_CONTEXTPOINTER ((TPM_STRUCTURE_TAG) 0x0003)
218 #define TPM_TAG_CONTEXTLIST ((TPM_STRUCTURE_TAG) 0x0004)
219 #define TPM_TAG_SIGNINFO ((TPM_STRUCTURE_TAG) 0x0005)
220 #define TPM_TAG_PCR_INFO_LONG ((TPM_STRUCTURE_TAG) 0x0006)
221 #define TPM_TAG_PERSISTENT_FLAGS ((TPM_STRUCTURE_TAG) 0x0007)
222 #define TPM_TAG_VOLATILE_FLAGS ((TPM_STRUCTURE_TAG) 0x0008)
223 #define TPM_TAG_PERSISTENT_DATA ((TPM_STRUCTURE_TAG) 0x0009)
224 #define TPM_TAG_VOLATILE_DATA ((TPM_STRUCTURE_TAG) 0x000A)
225 #define TPM_TAG_SV_DATA ((TPM_STRUCTURE_TAG) 0x000B)
226 #define TPM_TAG_EK_BLOB ((TPM_STRUCTURE_TAG) 0x000C)
227 #define TPM_TAG_EK_BLOB_AUTH ((TPM_STRUCTURE_TAG) 0x000D)
228 #define TPM_TAG_COUNTER_VALUE ((TPM_STRUCTURE_TAG) 0x000E)
229 #define TPM_TAG_TRANSPORT_INTERNAL ((TPM_STRUCTURE_TAG) 0x000F)
230 #define TPM_TAG_TRANSPORT_LOG_IN ((TPM_STRUCTURE_TAG) 0x0010)
231 #define TPM_TAG_TRANSPORT_LOG_OUT ((TPM_STRUCTURE_TAG) 0x0011)
232 #define TPM_TAG_AUDIT_EVENT_IN ((TPM_STRUCTURE_TAG) 0x0012)
233 #define TPM_TAG_AUDIT_EVENT_OUT ((TPM_STRUCTURE_TAG) 0x0013)
234 #define TPM_TAG_CURRENT_TICKS ((TPM_STRUCTURE_TAG) 0x0014)
235 #define TPM_TAG_KEY ((TPM_STRUCTURE_TAG) 0x0015)
236 #define TPM_TAG_STORED_DATA12 ((TPM_STRUCTURE_TAG) 0x0016)
237 #define TPM_TAG_NV_ATTRIBUTES ((TPM_STRUCTURE_TAG) 0x0017)
238 #define TPM_TAG_NV_DATA_PUBLIC ((TPM_STRUCTURE_TAG) 0x0018)
239 #define TPM_TAG_NV_DATA_SENSITIVE ((TPM_STRUCTURE_TAG) 0x0019)
240 #define TPM_TAG_DELEGATIONS ((TPM_STRUCTURE_TAG) 0x001A)
241 #define TPM_TAG_DELEGATE_PUBLIC ((TPM_STRUCTURE_TAG) 0x001B)
242 #define TPM_TAG_DELEGATE_TABLE_ROW ((TPM_STRUCTURE_TAG) 0x001C)
243 #define TPM_TAG_TRANSPORT_AUTH ((TPM_STRUCTURE_TAG) 0x001D)
244 #define TPM_TAG_TRANSPORT_PUBLIC ((TPM_STRUCTURE_TAG) 0x001E)
245 #define TPM_TAG_PERMANENT_FLAGS ((TPM_STRUCTURE_TAG) 0x001F)
246 #define TPM_TAG_STCLEAR_FLAGS ((TPM_STRUCTURE_TAG) 0x0020)
247 #define TPM_TAG_STANY_FLAGS ((TPM_STRUCTURE_TAG) 0x0021)
248 #define TPM_TAG_PERMANENT_DATA ((TPM_STRUCTURE_TAG) 0x0022)
249 #define TPM_TAG_STCLEAR_DATA ((TPM_STRUCTURE_TAG) 0x0023)
250 #define TPM_TAG_STANY_DATA ((TPM_STRUCTURE_TAG) 0x0024)
251 #define TPM_TAG_FAMILY_TABLE_ENTRY ((TPM_STRUCTURE_TAG) 0x0025)
252 #define TPM_TAG_DELEGATE_SENSITIVE ((TPM_STRUCTURE_TAG) 0x0026)
253 #define TPM_TAG_DELG_KEY_BLOB ((TPM_STRUCTURE_TAG) 0x0027)
254 #define TPM_TAG_KEY12 ((TPM_STRUCTURE_TAG) 0x0028)
255 #define TPM_TAG_CERTIFY_INFO2 ((TPM_STRUCTURE_TAG) 0x0029)
256 #define TPM_TAG_DELEGATE_OWNER_BLOB ((TPM_STRUCTURE_TAG) 0x002A)
257 #define TPM_TAG_EK_BLOB_ACTIVATE ((TPM_STRUCTURE_TAG) 0x002B)
258 #define TPM_TAG_DAA_BLOB ((TPM_STRUCTURE_TAG) 0x002C)
259 #define TPM_TAG_DAA_CONTEXT ((TPM_STRUCTURE_TAG) 0x002D)
260 #define TPM_TAG_DAA_ENFORCE ((TPM_STRUCTURE_TAG) 0x002E)
261 #define TPM_TAG_DAA_ISSUER ((TPM_STRUCTURE_TAG) 0x002F)
262 #define TPM_TAG_CAP_VERSION_INFO ((TPM_STRUCTURE_TAG) 0x0030)
263 #define TPM_TAG_DAA_SENSITIVE ((TPM_STRUCTURE_TAG) 0x0031)
264 #define TPM_TAG_DAA_TPM ((TPM_STRUCTURE_TAG) 0x0032)
265 #define TPM_TAG_CMK_MIGAUTH ((TPM_STRUCTURE_TAG) 0x0033)
266 #define TPM_TAG_CMK_SIGTICKET ((TPM_STRUCTURE_TAG) 0x0034)
267 #define TPM_TAG_CMK_MA_APPROVAL ((TPM_STRUCTURE_TAG) 0x0035)
268 #define TPM_TAG_QUOTE_INFO2 ((TPM_STRUCTURE_TAG) 0x0036)
271 // Part 2, section 4: TPM Types
275 // Part 2, section 4.1: TPM_RESOURCE_TYPE
277 #define TPM_RT_KEY ((TPM_RESOURCE_TYPE) 0x00000001) ///< The handle is a key handle and is the result of a LoadKey type operation
278 #define TPM_RT_AUTH ((TPM_RESOURCE_TYPE) 0x00000002) ///< The handle is an authorization handle. Auth handles come from TPM_OIAP, TPM_OSAP and TPM_DSAP
279 #define TPM_RT_HASH ((TPM_RESOURCE_TYPE) 0x00000003) ///< Reserved for hashes
280 #define TPM_RT_TRANS ((TPM_RESOURCE_TYPE) 0x00000004) ///< The handle is for a transport session. Transport handles come from TPM_EstablishTransport
281 #define TPM_RT_CONTEXT ((TPM_RESOURCE_TYPE) 0x00000005) ///< Resource wrapped and held outside the TPM using the context save/restore commands
282 #define TPM_RT_COUNTER ((TPM_RESOURCE_TYPE) 0x00000006) ///< Reserved for counters
283 #define TPM_RT_DELEGATE ((TPM_RESOURCE_TYPE) 0x00000007) ///< The handle is for a delegate row. These are the internal rows held in NV storage by the TPM
284 #define TPM_RT_DAA_TPM ((TPM_RESOURCE_TYPE) 0x00000008) ///< The value is a DAA TPM specific blob
285 #define TPM_RT_DAA_V0 ((TPM_RESOURCE_TYPE) 0x00000009) ///< The value is a DAA V0 parameter
286 #define TPM_RT_DAA_V1 ((TPM_RESOURCE_TYPE) 0x0000000A) ///< The value is a DAA V1 parameter
289 // Part 2, section 4.2: TPM_PAYLOAD_TYPE
291 #define TPM_PT_ASYM ((TPM_PAYLOAD_TYPE) 0x01) ///< The entity is an asymmetric key
292 #define TPM_PT_BIND ((TPM_PAYLOAD_TYPE) 0x02) ///< The entity is bound data
293 #define TPM_PT_MIGRATE ((TPM_PAYLOAD_TYPE) 0x03) ///< The entity is a migration blob
294 #define TPM_PT_MAINT ((TPM_PAYLOAD_TYPE) 0x04) ///< The entity is a maintenance blob
295 #define TPM_PT_SEAL ((TPM_PAYLOAD_TYPE) 0x05) ///< The entity is sealed data
296 #define TPM_PT_MIGRATE_RESTRICTED ((TPM_PAYLOAD_TYPE) 0x06) ///< The entity is a restricted-migration asymmetric key
297 #define TPM_PT_MIGRATE_EXTERNAL ((TPM_PAYLOAD_TYPE) 0x07) ///< The entity is a external migratable key
298 #define TPM_PT_CMK_MIGRATE ((TPM_PAYLOAD_TYPE) 0x08) ///< The entity is a CMK migratable blob
299 #define TPM_PT_VENDOR_SPECIFIC ((TPM_PAYLOAD_TYPE) 0x80) ///< 0x80 - 0xFF Vendor specific payloads
302 // Part 2, section 4.3: TPM_ENTITY_TYPE
304 #define TPM_ET_KEYHANDLE ((UINT16) 0x0001) ///< The entity is a keyHandle or key
305 #define TPM_ET_OWNER ((UINT16) 0x0002) ///< The entity is the TPM Owner
306 #define TPM_ET_DATA ((UINT16) 0x0003) ///< The entity is some data
307 #define TPM_ET_SRK ((UINT16) 0x0004) ///< The entity is the SRK
308 #define TPM_ET_KEY ((UINT16) 0x0005) ///< The entity is a key or keyHandle
309 #define TPM_ET_REVOKE ((UINT16) 0x0006) ///< The entity is the RevokeTrust value
310 #define TPM_ET_DEL_OWNER_BLOB ((UINT16) 0x0007) ///< The entity is a delegate owner blob
311 #define TPM_ET_DEL_ROW ((UINT16) 0x0008) ///< The entity is a delegate row
312 #define TPM_ET_DEL_KEY_BLOB ((UINT16) 0x0009) ///< The entity is a delegate key blob
313 #define TPM_ET_COUNTER ((UINT16) 0x000A) ///< The entity is a counter
314 #define TPM_ET_NV ((UINT16) 0x000B) ///< The entity is a NV index
315 #define TPM_ET_RESERVED_HANDLE ((UINT16) 0x0040) ///< Reserved. This value avoids collisions with the handle MSB setting.
317 // TPM_ENTITY_TYPE MSB Values: The MSB is used to indicate the ADIP encryption sheme when applicable
319 #define TPM_ET_XOR ((UINT16) 0x0000) ///< ADIP encryption scheme: XOR
320 #define TPM_ET_AES128 ((UINT16) 0x0006) ///< ADIP encryption scheme: AES 128 bits
323 // Part 2, section 4.4.1: Reserved Key Handles
325 #define TPM_KH_SRK ((TPM_KEY_HANDLE) 0x40000000) ///< The handle points to the SRK
326 #define TPM_KH_OWNER ((TPM_KEY_HANDLE) 0x40000001) ///< The handle points to the TPM Owner
327 #define TPM_KH_REVOKE ((TPM_KEY_HANDLE) 0x40000002) ///< The handle points to the RevokeTrust value
328 #define TPM_KH_TRANSPORT ((TPM_KEY_HANDLE) 0x40000003) ///< The handle points to the EstablishTransport static authorization
329 #define TPM_KH_OPERATOR ((TPM_KEY_HANDLE) 0x40000004) ///< The handle points to the Operator auth
330 #define TPM_KH_ADMIN ((TPM_KEY_HANDLE) 0x40000005) ///< The handle points to the delegation administration auth
331 #define TPM_KH_EK ((TPM_KEY_HANDLE) 0x40000006) ///< The handle points to the PUBEK, only usable with TPM_OwnerReadInternalPub
334 // Part 2, section 4.5: TPM_STARTUP_TYPE
336 #define TPM_ST_CLEAR ((TPM_STARTUP_TYPE) 0x0001) ///< The TPM is starting up from a clean state
337 #define TPM_ST_STATE ((TPM_STARTUP_TYPE) 0x0002) ///< The TPM is starting up from a saved state
338 #define TPM_ST_DEACTIVATED ((TPM_STARTUP_TYPE) 0x0003) ///< The TPM is to startup and set the deactivated flag to TRUE
341 // Part 2, section 4.6: TPM_STATUP_EFFECTS
342 // The table makeup is still an open issue.
346 // Part 2, section 4.7: TPM_PROTOCOL_ID
348 #define TPM_PID_OIAP ((TPM_PROTOCOL_ID) 0x0001) ///< The OIAP protocol.
349 #define TPM_PID_OSAP ((TPM_PROTOCOL_ID) 0x0002) ///< The OSAP protocol.
350 #define TPM_PID_ADIP ((TPM_PROTOCOL_ID) 0x0003) ///< The ADIP protocol.
351 #define TPM_PID_ADCP ((TPM_PROTOCOL_ID) 0x0004) ///< The ADCP protocol.
352 #define TPM_PID_OWNER ((TPM_PROTOCOL_ID) 0x0005) ///< The protocol for taking ownership of a TPM.
353 #define TPM_PID_DSAP ((TPM_PROTOCOL_ID) 0x0006) ///< The DSAP protocol
354 #define TPM_PID_TRANSPORT ((TPM_PROTOCOL_ID) 0x0007) ///< The transport protocol
357 // Part 2, section 4.8: TPM_ALGORITHM_ID
358 // The TPM MUST support the algorithms TPM_ALG_RSA, TPM_ALG_SHA, TPM_ALG_HMAC,
361 #define TPM_ALG_RSA ((TPM_ALGORITHM_ID) 0x00000001) ///< The RSA algorithm.
362 #define TPM_ALG_DES ((TPM_ALGORITHM_ID) 0x00000002) ///< The DES algorithm
363 #define TPM_ALG_3DES ((TPM_ALGORITHM_ID) 0x00000003) ///< The 3DES algorithm in EDE mode
364 #define TPM_ALG_SHA ((TPM_ALGORITHM_ID) 0x00000004) ///< The SHA1 algorithm
365 #define TPM_ALG_HMAC ((TPM_ALGORITHM_ID) 0x00000005) ///< The RFC 2104 HMAC algorithm
366 #define TPM_ALG_AES128 ((TPM_ALGORITHM_ID) 0x00000006) ///< The AES algorithm, key size 128
367 #define TPM_ALG_MGF1 ((TPM_ALGORITHM_ID) 0x00000007) ///< The XOR algorithm using MGF1 to create a string the size of the encrypted block
368 #define TPM_ALG_AES192 ((TPM_ALGORITHM_ID) 0x00000008) ///< AES, key size 192
369 #define TPM_ALG_AES256 ((TPM_ALGORITHM_ID) 0x00000009) ///< AES, key size 256
370 #define TPM_ALG_XOR ((TPM_ALGORITHM_ID) 0x0000000A) ///< XOR using the rolling nonces
373 // Part 2, section 4.9: TPM_PHYSICAL_PRESENCE
375 #define TPM_PHYSICAL_PRESENCE_HW_DISABLE ((TPM_PHYSICAL_PRESENCE) 0x0200) ///< Sets the physicalPresenceHWEnable to FALSE
376 #define TPM_PHYSICAL_PRESENCE_CMD_DISABLE ((TPM_PHYSICAL_PRESENCE) 0x0100) ///< Sets the physicalPresenceCMDEnable to FALSE
377 #define TPM_PHYSICAL_PRESENCE_LIFETIME_LOCK ((TPM_PHYSICAL_PRESENCE) 0x0080) ///< Sets the physicalPresenceLifetimeLock to TRUE
378 #define TPM_PHYSICAL_PRESENCE_HW_ENABLE ((TPM_PHYSICAL_PRESENCE) 0x0040) ///< Sets the physicalPresenceHWEnable to TRUE
379 #define TPM_PHYSICAL_PRESENCE_CMD_ENABLE ((TPM_PHYSICAL_PRESENCE) 0x0020) ///< Sets the physicalPresenceCMDEnable to TRUE
380 #define TPM_PHYSICAL_PRESENCE_NOTPRESENT ((TPM_PHYSICAL_PRESENCE) 0x0010) ///< Sets PhysicalPresence = FALSE
381 #define TPM_PHYSICAL_PRESENCE_PRESENT ((TPM_PHYSICAL_PRESENCE) 0x0008) ///< Sets PhysicalPresence = TRUE
382 #define TPM_PHYSICAL_PRESENCE_LOCK ((TPM_PHYSICAL_PRESENCE) 0x0004) ///< Sets PhysicalPresenceLock = TRUE
385 // Part 2, section 4.10: TPM_MIGRATE_SCHEME
387 #define TPM_MS_MIGRATE ((TPM_MIGRATE_SCHEME) 0x0001) ///< A public key that can be used with all TPM migration commands other than 'ReWrap' mode.
388 #define TPM_MS_REWRAP ((TPM_MIGRATE_SCHEME) 0x0002) ///< A public key that can be used for the ReWrap mode of TPM_CreateMigrationBlob.
389 #define TPM_MS_MAINT ((TPM_MIGRATE_SCHEME) 0x0003) ///< A public key that can be used for the Maintenance commands
390 #define TPM_MS_RESTRICT_MIGRATE ((TPM_MIGRATE_SCHEME) 0x0004) ///< The key is to be migrated to a Migration Authority.
391 #define TPM_MS_RESTRICT_APPROVE_DOUBLE ((TPM_MIGRATE_SCHEME) 0x0005) ///< The key is to be migrated to an entity approved by a Migration Authority using double wrapping
394 // Part 2, section 4.11: TPM_EK_TYPE
396 #define TPM_EK_TYPE_ACTIVATE ((TPM_EK_TYPE) 0x0001) ///< The blob MUST be TPM_EK_BLOB_ACTIVATE
397 #define TPM_EK_TYPE_AUTH ((TPM_EK_TYPE) 0x0002) ///< The blob MUST be TPM_EK_BLOB_AUTH
400 // Part 2, section 4.12: TPM_PLATFORM_SPECIFIC
402 #define TPM_PS_PC_11 ((TPM_PLATFORM_SPECIFIC) 0x0001) ///< PC Specific version 1.1
403 #define TPM_PS_PC_12 ((TPM_PLATFORM_SPECIFIC) 0x0002) ///< PC Specific version 1.2
404 #define TPM_PS_PDA_12 ((TPM_PLATFORM_SPECIFIC) 0x0003) ///< PDA Specific version 1.2
405 #define TPM_PS_Server_12 ((TPM_PLATFORM_SPECIFIC) 0x0004) ///< Server Specific version 1.2
406 #define TPM_PS_Mobile_12 ((TPM_PLATFORM_SPECIFIC) 0x0005) ///< Mobil Specific version 1.2
409 // Part 2, section 5: Basic Structures
413 /// Part 2, section 5.1: TPM_STRUCT_VER
415 typedef struct tdTPM_STRUCT_VER
{
423 /// Part 2, section 5.3: TPM_VERSION
425 typedef struct tdTPM_VERSION
{
426 TPM_VERSION_BYTE major
;
427 TPM_VERSION_BYTE minor
;
433 #define TPM_SHA1_160_HASH_LEN 0x14
434 #define TPM_SHA1BASED_NONCE_LEN TPM_SHA1_160_HASH_LEN
437 /// Part 2, section 5.4: TPM_DIGEST
439 typedef struct tdTPM_DIGEST
{
440 UINT8 digest
[TPM_SHA1_160_HASH_LEN
];
444 /// This SHALL be the digest of the chosen identityLabel and privacyCA for a new TPM identity
446 typedef TPM_DIGEST TPM_CHOSENID_HASH
;
448 /// This SHALL be the hash of a list of PCR indexes and PCR values that a key or data is bound to
450 typedef TPM_DIGEST TPM_COMPOSITE_HASH
;
452 /// This SHALL be the value of a DIR register
454 typedef TPM_DIGEST TPM_DIRVALUE
;
456 typedef TPM_DIGEST TPM_HMAC
;
458 /// The value inside of the PCR
460 typedef TPM_DIGEST TPM_PCRVALUE
;
462 /// This SHALL be the value of the current internal audit state
464 typedef TPM_DIGEST TPM_AUDITDIGEST
;
466 /// This SHALL be a random value generated by a TPM immediately after the EK is installed
467 /// in that TPM, whenever an EK is installed in that TPM
469 typedef TPM_DIGEST TPM_DAA_TPM_SEED
;
471 /// This SHALL be a random value
473 typedef TPM_DIGEST TPM_DAA_CONTEXT_SEED
;
476 /// Part 2, section 5.5: TPM_NONCE
478 typedef struct tdTPM_NONCE
{
483 // Part 2, section 5.6: TPM_AUTHDATA
486 /// The AuthData data is the information that is saved or passed to provide proof of ownership
489 typedef UINT8 tdTPM_AUTHDATA
[20];
491 typedef tdTPM_AUTHDATA TPM_AUTHDATA
;
493 /// A secret plaintext value used in the authorization process
495 typedef TPM_AUTHDATA TPM_SECRET
;
497 /// A ciphertext (encrypted) version of AuthData data. The encryption mechanism depends on the context
499 typedef TPM_AUTHDATA TPM_ENCAUTH
;
502 /// Part 2, section 5.7: TPM_KEY_HANDLE_LIST
503 /// Size of handle is loaded * sizeof(TPM_KEY_HANDLE)
505 typedef struct tdTPM_KEY_HANDLE_LIST
{
507 TPM_KEY_HANDLE handle
[1];
508 } TPM_KEY_HANDLE_LIST
;
511 // Part 2, section 5.8: TPM_KEY_USAGE values
514 /// TPM_KEY_SIGNING SHALL indicate a signing key. The [private] key SHALL be
515 /// used for signing operations, only. This means that it MUST be a leaf of the
516 /// Protected Storage key hierarchy.
518 #define TPM_KEY_SIGNING ((UINT16) 0x0010)
520 /// TPM_KEY_STORAGE SHALL indicate a storage key. The key SHALL be used to wrap
521 /// and unwrap other keys in the Protected Storage hierarchy
523 #define TPM_KEY_STORAGE ((UINT16) 0x0011)
525 /// TPM_KEY_IDENTITY SHALL indicate an identity key. The key SHALL be used for
526 /// operations that require a TPM identity, only.
528 #define TPM_KEY_IDENTITY ((UINT16) 0x0012)
530 /// TPM_KEY_AUTHCHANGE SHALL indicate an ephemeral key that is in use during
531 /// the ChangeAuthAsym process, only.
533 #define TPM_KEY_AUTHCHANGE ((UINT16) 0x0013)
535 /// TPM_KEY_BIND SHALL indicate a key that can be used for TPM_Bind and
536 /// TPM_Unbind operations only.
538 #define TPM_KEY_BIND ((UINT16) 0x0014)
540 /// TPM_KEY_LEGACY SHALL indicate a key that can perform signing and binding
541 /// operations. The key MAY be used for both signing and binding operations.
542 /// The TPM_KEY_LEGACY key type is to allow for use by applications where both
543 /// signing and encryption operations occur with the same key. The use of this
544 /// key type is not recommended TPM_KEY_MIGRATE 0x0016 This SHALL indicate a
545 /// key in use for TPM_MigrateKey
547 #define TPM_KEY_LEGACY ((UINT16) 0x0015)
549 /// TPM_KEY_MIGRAGE SHALL indicate a key in use for TPM_MigrateKey
551 #define TPM_KEY_MIGRATE ((UINT16) 0x0016)
554 // Part 2, section 5.8.1: Mandatory Key Usage Schemes
557 #define TPM_ES_NONE ((TPM_ENC_SCHEME) 0x0001)
558 #define TPM_ES_RSAESPKCSv15 ((TPM_ENC_SCHEME) 0x0002)
559 #define TPM_ES_RSAESOAEP_SHA1_MGF1 ((TPM_ENC_SCHEME) 0x0003)
560 #define TPM_ES_SYM_CNT ((TPM_ENC_SCHEME) 0x0004)
561 #define TPM_ES_SYM_OFB ((TPM_ENC_SCHEME) 0x0005)
563 #define TPM_SS_NONE ((TPM_SIG_SCHEME) 0x0001)
564 #define TPM_SS_RSASSAPKCS1v15_SHA1 ((TPM_SIG_SCHEME) 0x0002)
565 #define TPM_SS_RSASSAPKCS1v15_DER ((TPM_SIG_SCHEME) 0x0003)
566 #define TPM_SS_RSASSAPKCS1v15_INFO ((TPM_SIG_SCHEME) 0x0004)
569 // Part 2, section 5.9: TPM_AUTH_DATA_USAGE values
571 #define TPM_AUTH_NEVER ((TPM_AUTH_DATA_USAGE) 0x00)
572 #define TPM_AUTH_ALWAYS ((TPM_AUTH_DATA_USAGE) 0x01)
573 #define TPM_AUTH_PRIV_USE_ONLY ((TPM_AUTH_DATA_USAGE) 0x03)
576 /// Part 2, section 5.10: TPM_KEY_FLAGS
578 typedef enum tdTPM_KEY_FLAGS
{
579 redirection
= 0x00000001,
580 migratable
= 0x00000002,
581 isVolatile
= 0x00000004,
582 pcrIgnoredOnRead
= 0x00000008,
583 migrateAuthority
= 0x00000010
584 } TPM_KEY_FLAGS_BITS
;
587 /// Part 2, section 5.11: TPM_CHANGEAUTH_VALIDATE
589 typedef struct tdTPM_CHANGEAUTH_VALIDATE
{
590 TPM_SECRET newAuthSecret
;
592 } TPM_CHANGEAUTH_VALIDATE
;
595 /// Part 2, section 5.12: TPM_MIGRATIONKEYAUTH
596 /// decalared after section 10 to catch declaration of TPM_PUBKEY
598 /// Part 2 section 10.1: TPM_KEY_PARMS
599 /// [size_is(parmSize)] BYTE* parms;
601 typedef struct tdTPM_KEY_PARMS
{
602 TPM_ALGORITHM_ID algorithmID
;
603 TPM_ENC_SCHEME encScheme
;
604 TPM_SIG_SCHEME sigScheme
;
610 /// Part 2, section 10.4: TPM_STORE_PUBKEY
612 typedef struct tdTPM_STORE_PUBKEY
{
618 /// Part 2, section 10.5: TPM_PUBKEY
620 typedef struct tdTPM_PUBKEY
{
621 TPM_KEY_PARMS algorithmParms
;
622 TPM_STORE_PUBKEY pubKey
;
626 /// Part 2, section 5.12: TPM_MIGRATIONKEYAUTH
628 typedef struct tdTPM_MIGRATIONKEYAUTH
{
629 TPM_PUBKEY migrationKey
;
630 TPM_MIGRATE_SCHEME migrationScheme
;
632 } TPM_MIGRATIONKEYAUTH
;
635 /// Part 2, section 5.13: TPM_COUNTER_VALUE
637 typedef struct tdTPM_COUNTER_VALUE
{
638 TPM_STRUCTURE_TAG tag
;
640 TPM_ACTUAL_COUNT counter
;
644 /// Part 2, section 5.14: TPM_SIGN_INFO
645 /// Size of data indicated by dataLen
647 typedef struct tdTPM_SIGN_INFO
{
648 TPM_STRUCTURE_TAG tag
;
656 /// Part 2, section 5.15: TPM_MSA_COMPOSITE
657 /// Number of migAuthDigest indicated by MSAlist
659 typedef struct tdTPM_MSA_COMPOSITE
{
661 TPM_DIGEST migAuthDigest
[1];
665 /// Part 2, section 5.16: TPM_CMK_AUTH
667 typedef struct tdTPM_CMK_AUTH
{
668 TPM_DIGEST migrationAuthorityDigest
;
669 TPM_DIGEST destinationKeyDigest
;
670 TPM_DIGEST sourceKeyDigest
;
674 // Part 2, section 5.17: TPM_CMK_DELEGATE
676 #define TPM_CMK_DELEGATE_SIGNING ((TPM_CMK_DELEGATE) BIT31)
677 #define TPM_CMK_DELEGATE_STORAGE ((TPM_CMK_DELEGATE) BIT30)
678 #define TPM_CMK_DELEGATE_BIND ((TPM_CMK_DELEGATE) BIT29)
679 #define TPM_CMK_DELEGATE_LEGACY ((TPM_CMK_DELEGATE) BIT28)
680 #define TPM_CMK_DELEGATE_MIGRATE ((TPM_CMK_DELEGATE) BIT27)
683 /// Part 2, section 5.18: TPM_SELECT_SIZE
685 typedef struct tdTPM_SELECT_SIZE
{
692 /// Part 2, section 5,19: TPM_CMK_MIGAUTH
694 typedef struct tdTPM_CMK_MIGAUTH
{
695 TPM_STRUCTURE_TAG tag
;
696 TPM_DIGEST msaDigest
;
697 TPM_DIGEST pubKeyDigest
;
701 /// Part 2, section 5.20: TPM_CMK_SIGTICKET
703 typedef struct tdTPM_CMK_SIGTICKET
{
704 TPM_STRUCTURE_TAG tag
;
705 TPM_DIGEST verKeyDigest
;
706 TPM_DIGEST signedData
;
710 /// Part 2, section 5.21: TPM_CMK_MA_APPROVAL
712 typedef struct tdTPM_CMK_MA_APPROVAL
{
713 TPM_STRUCTURE_TAG tag
;
714 TPM_DIGEST migrationAuthorityDigest
;
715 } TPM_CMK_MA_APPROVAL
;
718 // Part 2, section 6: Command Tags
720 #define TPM_TAG_RQU_COMMAND ((TPM_STRUCTURE_TAG) 0x00C1)
721 #define TPM_TAG_RQU_AUTH1_COMMAND ((TPM_STRUCTURE_TAG) 0x00C2)
722 #define TPM_TAG_RQU_AUTH2_COMMAND ((TPM_STRUCTURE_TAG) 0x00C3)
723 #define TPM_TAG_RSP_COMMAND ((TPM_STRUCTURE_TAG) 0x00C4)
724 #define TPM_TAG_RSP_AUTH1_COMMAND ((TPM_STRUCTURE_TAG) 0x00C5)
725 #define TPM_TAG_RSP_AUTH2_COMMAND ((TPM_STRUCTURE_TAG) 0x00C6)
728 /// Part 2, section 7.1: TPM_PERMANENT_FLAGS
730 typedef struct tdTPM_PERMANENT_FLAGS
{
731 TPM_STRUCTURE_TAG tag
;
736 BOOLEAN disableOwnerClear
;
737 BOOLEAN allowMaintenance
;
738 BOOLEAN physicalPresenceLifetimeLock
;
739 BOOLEAN physicalPresenceHWEnable
;
740 BOOLEAN physicalPresenceCMDEnable
;
746 BOOLEAN enableRevokeEK
;
749 BOOLEAN tpmEstablished
;
750 BOOLEAN maintenanceDone
;
751 } TPM_PERMANENT_FLAGS
;
754 // Part 2, section 7.1.1: Flag Restrictions (of TPM_PERMANENT_FLAGS)
756 #define TPM_PF_DISABLE ((TPM_CAPABILITY_AREA) 1)
757 #define TPM_PF_OWNERSHIP ((TPM_CAPABILITY_AREA) 2)
758 #define TPM_PF_DEACTIVATED ((TPM_CAPABILITY_AREA) 3)
759 #define TPM_PF_READPUBEK ((TPM_CAPABILITY_AREA) 4)
760 #define TPM_PF_DISABLEOWNERCLEAR ((TPM_CAPABILITY_AREA) 5)
761 #define TPM_PF_ALLOWMAINTENANCE ((TPM_CAPABILITY_AREA) 6)
762 #define TPM_PF_PHYSICALPRESENCELIFETIMELOCK ((TPM_CAPABILITY_AREA) 7)
763 #define TPM_PF_PHYSICALPRESENCEHWENABLE ((TPM_CAPABILITY_AREA) 8)
764 #define TPM_PF_PHYSICALPRESENCECMDENABLE ((TPM_CAPABILITY_AREA) 9)
765 #define TPM_PF_CEKPUSED ((TPM_CAPABILITY_AREA) 10)
766 #define TPM_PF_TPMPOST ((TPM_CAPABILITY_AREA) 11)
767 #define TPM_PF_TPMPOSTLOCK ((TPM_CAPABILITY_AREA) 12)
768 #define TPM_PF_FIPS ((TPM_CAPABILITY_AREA) 13)
769 #define TPM_PF_OPERATOR ((TPM_CAPABILITY_AREA) 14)
770 #define TPM_PF_ENABLEREVOKEEK ((TPM_CAPABILITY_AREA) 15)
771 #define TPM_PF_NV_LOCKED ((TPM_CAPABILITY_AREA) 16)
772 #define TPM_PF_READSRKPUB ((TPM_CAPABILITY_AREA) 17)
773 #define TPM_PF_TPMESTABLISHED ((TPM_CAPABILITY_AREA) 18)
774 #define TPM_PF_MAINTENANCEDONE ((TPM_CAPABILITY_AREA) 19)
777 /// Part 2, section 7.2: TPM_STCLEAR_FLAGS
779 typedef struct tdTPM_STCLEAR_FLAGS
{
780 TPM_STRUCTURE_TAG tag
;
782 BOOLEAN disableForceClear
;
783 BOOLEAN physicalPresence
;
784 BOOLEAN physicalPresenceLock
;
789 // Part 2, section 7.2.1: Flag Restrictions (of TPM_STCLEAR_FLAGS)
791 #define TPM_SF_DEACTIVATED ((TPM_CAPABILITY_AREA) 1)
792 #define TPM_SF_DISABLEFORCECLEAR ((TPM_CAPABILITY_AREA) 2)
793 #define TPM_SF_PHYSICALPRESENCE ((TPM_CAPABILITY_AREA) 3)
794 #define TPM_SF_PHYSICALPRESENCELOCK ((TPM_CAPABILITY_AREA) 4)
795 #define TPM_SF_BGLOBALLOCK ((TPM_CAPABILITY_AREA) 5)
798 /// Part 2, section 7.3: TPM_STANY_FLAGS
800 typedef struct tdTPM_STANY_FLAGS
{
801 TPM_STRUCTURE_TAG tag
;
802 BOOLEAN postInitialise
;
803 TPM_MODIFIER_INDICATOR localityModifier
;
804 BOOLEAN transportExclusive
;
809 // Part 2, section 7.3.1: Flag Restrictions (of TPM_STANY_FLAGS)
811 #define TPM_AF_POSTINITIALISE ((TPM_CAPABILITY_AREA) 1)
812 #define TPM_AF_LOCALITYMODIFIER ((TPM_CAPABILITY_AREA) 2)
813 #define TPM_AF_TRANSPORTEXCLUSIVE ((TPM_CAPABILITY_AREA) 3)
814 #define TPM_AF_TOSPRESENT ((TPM_CAPABILITY_AREA) 4)
817 // All those structures defined in section 7.4, 7.5, 7.6 are not normative and
818 // thus no definitions here
822 // Part 2, section 8: PCR Structures
826 /// Part 2, section 8.1: TPM_PCR_SELECTION
827 /// Size of pcrSelect[] indicated by sizeOfSelect
829 typedef struct tdTPM_PCR_SELECTION
{
835 /// Part 2, section 8.2: TPM_PCR_COMPOSITE
836 /// Size of pcrValue[] indicated by valueSize
838 typedef struct tdTPM_PCR_COMPOSITE
{
839 TPM_PCR_SELECTION select
;
841 TPM_PCRVALUE pcrValue
[1];
845 /// Part 2, section 8.3: TPM_PCR_INFO
847 typedef struct tdTPM_PCR_INFO
{
848 TPM_PCR_SELECTION pcrSelection
;
849 TPM_COMPOSITE_HASH digestAtRelease
;
850 TPM_COMPOSITE_HASH digestAtCreation
;
854 /// Part 2, section 8.6: TPM_LOCALITY_SELECTION
856 typedef UINT8 TPM_LOCALITY_SELECTION
;
858 #define TPM_LOC_FOUR ((UINT8) 0x10)
859 #define TPM_LOC_THREE ((UINT8) 0x08)
860 #define TPM_LOC_TWO ((UINT8) 0x04)
861 #define TPM_LOC_ONE ((UINT8) 0x02)
862 #define TPM_LOC_ZERO ((UINT8) 0x01)
865 /// Part 2, section 8.4: TPM_PCR_INFO_LONG
867 typedef struct tdTPM_PCR_INFO_LONG
{
868 TPM_STRUCTURE_TAG tag
;
869 TPM_LOCALITY_SELECTION localityAtCreation
;
870 TPM_LOCALITY_SELECTION localityAtRelease
;
871 TPM_PCR_SELECTION creationPCRSelection
;
872 TPM_PCR_SELECTION releasePCRSelection
;
873 TPM_COMPOSITE_HASH digestAtCreation
;
874 TPM_COMPOSITE_HASH digestAtRelease
;
878 /// Part 2, section 8.5: TPM_PCR_INFO_SHORT
880 typedef struct tdTPM_PCR_INFO_SHORT
{
881 TPM_PCR_SELECTION pcrSelection
;
882 TPM_LOCALITY_SELECTION localityAtRelease
;
883 TPM_COMPOSITE_HASH digestAtRelease
;
884 } TPM_PCR_INFO_SHORT
;
887 /// Part 2, section 8.8: TPM_PCR_ATTRIBUTES
889 typedef struct tdTPM_PCR_ATTRIBUTES
{
891 TPM_LOCALITY_SELECTION pcrExtendLocal
;
892 TPM_LOCALITY_SELECTION pcrResetLocal
;
893 } TPM_PCR_ATTRIBUTES
;
896 // Part 2, section 9: Storage Structures
900 /// Part 2, section 9.1: TPM_STORED_DATA
901 /// [size_is(sealInfoSize)] BYTE* sealInfo;
902 /// [size_is(encDataSize)] BYTE* encData;
904 typedef struct tdTPM_STORED_DATA
{
913 /// Part 2, section 9.2: TPM_STORED_DATA12
914 /// [size_is(sealInfoSize)] BYTE* sealInfo;
915 /// [size_is(encDataSize)] BYTE* encData;
917 typedef struct tdTPM_STORED_DATA12
{
918 TPM_STRUCTURE_TAG tag
;
927 /// Part 2, section 9.3: TPM_SEALED_DATA
928 /// [size_is(dataSize)] BYTE* data;
930 typedef struct tdTPM_SEALED_DATA
{
931 TPM_PAYLOAD_TYPE payload
;
934 TPM_DIGEST storedDigest
;
940 /// Part 2, section 9.4: TPM_SYMMETRIC_KEY
941 /// [size_is(size)] BYTE* data;
943 typedef struct tdTPM_SYMMETRIC_KEY
{
944 TPM_ALGORITHM_ID algId
;
945 TPM_ENC_SCHEME encScheme
;
951 /// Part 2, section 9.5: TPM_BOUND_DATA
953 typedef struct tdTPM_BOUND_DATA
{
955 TPM_PAYLOAD_TYPE payload
;
956 UINT8 payloadData
[1];
960 // Part 2 section 10: TPM_KEY complex
964 // Section 10.1, 10.4, and 10.5 have been defined previously
968 /// Part 2, section 10.2: TPM_KEY
969 /// [size_is(encDataSize)] BYTE* encData;
971 typedef struct tdTPM_KEY
{
973 TPM_KEY_USAGE keyUsage
;
974 TPM_KEY_FLAGS keyFlags
;
975 TPM_AUTH_DATA_USAGE authDataUsage
;
976 TPM_KEY_PARMS algorithmParms
;
979 TPM_STORE_PUBKEY pubKey
;
985 /// Part 2, section 10.3: TPM_KEY12
986 /// [size_is(encDataSize)] BYTE* encData;
988 typedef struct tdTPM_KEY12
{
989 TPM_STRUCTURE_TAG tag
;
991 TPM_KEY_USAGE keyUsage
;
992 TPM_KEY_FLAGS keyFlags
;
993 TPM_AUTH_DATA_USAGE authDataUsage
;
994 TPM_KEY_PARMS algorithmParms
;
997 TPM_STORE_PUBKEY pubKey
;
1003 /// Part 2, section 10.7: TPM_STORE_PRIVKEY
1004 /// [size_is(keyLength)] BYTE* key;
1006 typedef struct tdTPM_STORE_PRIVKEY
{
1009 } TPM_STORE_PRIVKEY
;
1012 /// Part 2, section 10.6: TPM_STORE_ASYMKEY
1014 typedef struct tdTPM_STORE_ASYMKEY
{ // pos len total
1015 TPM_PAYLOAD_TYPE payload
; // 0 1 1
1016 TPM_SECRET usageAuth
; // 1 20 21
1017 TPM_SECRET migrationAuth
; // 21 20 41
1018 TPM_DIGEST pubDataDigest
; // 41 20 61
1019 TPM_STORE_PRIVKEY privKey
; // 61 132-151 193-214
1020 } TPM_STORE_ASYMKEY
;
1023 /// Part 2, section 10.8: TPM_MIGRATE_ASYMKEY
1024 /// [size_is(partPrivKeyLen)] BYTE* partPrivKey;
1026 typedef struct tdTPM_MIGRATE_ASYMKEY
{ // pos len total
1027 TPM_PAYLOAD_TYPE payload
; // 0 1 1
1028 TPM_SECRET usageAuth
; // 1 20 21
1029 TPM_DIGEST pubDataDigest
; // 21 20 41
1030 UINT32 partPrivKeyLen
; // 41 4 45
1031 UINT8
*partPrivKey
; // 45 112-127 157-172
1032 } TPM_MIGRATE_ASYMKEY
;
1035 /// Part 2, section 10.9: TPM_KEY_CONTROL
1037 #define TPM_KEY_CONTROL_OWNER_EVICT ((UINT32) 0x00000001)
1040 // Part 2, section 11: Signed Structures
1044 /// Part 2, section 11.1: TPM_CERTIFY_INFO Structure
1046 typedef struct tdTPM_CERTIFY_INFO
{
1047 TPM_STRUCT_VER version
;
1048 TPM_KEY_USAGE keyUsage
;
1049 TPM_KEY_FLAGS keyFlags
;
1050 TPM_AUTH_DATA_USAGE authDataUsage
;
1051 TPM_KEY_PARMS algorithmParms
;
1052 TPM_DIGEST pubkeyDigest
;
1054 BOOLEAN parentPCRStatus
;
1060 /// Part 2, section 11.2: TPM_CERTIFY_INFO2 Structure
1062 typedef struct tdTPM_CERTIFY_INFO2
{
1063 TPM_STRUCTURE_TAG tag
;
1065 TPM_PAYLOAD_TYPE payloadType
;
1066 TPM_KEY_USAGE keyUsage
;
1067 TPM_KEY_FLAGS keyFlags
;
1068 TPM_AUTH_DATA_USAGE authDataUsage
;
1069 TPM_KEY_PARMS algorithmParms
;
1070 TPM_DIGEST pubkeyDigest
;
1072 BOOLEAN parentPCRStatus
;
1075 UINT32 migrationAuthoritySize
;
1076 UINT8
*migrationAuthority
;
1077 } TPM_CERTIFY_INFO2
;
1080 /// Part 2, section 11.3 TPM_QUOTE_INFO Structure
1082 typedef struct tdTPM_QUOTE_INFO
{
1083 TPM_STRUCT_VER version
;
1085 TPM_COMPOSITE_HASH digestValue
;
1086 TPM_NONCE externalData
;
1090 /// Part 2, section 11.4 TPM_QUOTE_INFO2 Structure
1092 typedef struct tdTPM_QUOTE_INFO2
{
1093 TPM_STRUCTURE_TAG tag
;
1095 TPM_NONCE externalData
;
1096 TPM_PCR_INFO_SHORT infoShort
;
1100 // Part 2, section 12: Identity Structures
1104 /// Part 2, section 12.1 TPM_EK_BLOB
1106 typedef struct tdTPM_EK_BLOB
{
1107 TPM_STRUCTURE_TAG tag
;
1114 /// Part 2, section 12.2 TPM_EK_BLOB_ACTIVATE
1116 typedef struct tdTPM_EK_BLOB_ACTIVATE
{
1117 TPM_STRUCTURE_TAG tag
;
1118 TPM_SYMMETRIC_KEY sessionKey
;
1119 TPM_DIGEST idDigest
;
1120 TPM_PCR_INFO_SHORT pcrInfo
;
1121 } TPM_EK_BLOB_ACTIVATE
;
1124 /// Part 2, section 12.3 TPM_EK_BLOB_AUTH
1126 typedef struct tdTPM_EK_BLOB_AUTH
{
1127 TPM_STRUCTURE_TAG tag
;
1128 TPM_SECRET authValue
;
1133 /// Part 2, section 12.5 TPM_IDENTITY_CONTENTS
1135 typedef struct tdTPM_IDENTITY_CONTENTS
{
1138 TPM_CHOSENID_HASH labelPrivCADigest
;
1139 TPM_PUBKEY identityPubKey
;
1140 } TPM_IDENTITY_CONTENTS
;
1143 /// Part 2, section 12.6 TPM_IDENTITY_REQ
1145 typedef struct tdTPM_IDENTITY_REQ
{
1148 TPM_KEY_PARMS asymAlgorithm
;
1149 TPM_KEY_PARMS symAlgorithm
;
1155 /// Part 2, section 12.7 TPM_IDENTITY_PROOF
1157 typedef struct tdTPM_IDENTITY_PROOF
{
1160 UINT32 identityBindingSize
;
1161 UINT32 endorsementSize
;
1162 UINT32 platformSize
;
1163 UINT32 conformanceSize
;
1164 TPM_PUBKEY identityKey
;
1166 UINT8
*identityBinding
;
1167 UINT8
*endorsementCredential
;
1168 UINT8
*platformCredential
;
1169 UINT8
*conformanceCredential
;
1170 } TPM_IDENTITY_PROOF
;
1173 /// Part 2, section 12.8 TPM_ASYM_CA_CONTENTS
1175 typedef struct tdTPM_ASYM_CA_CONTENTS
{
1176 TPM_SYMMETRIC_KEY sessionKey
;
1177 TPM_DIGEST idDigest
;
1178 } TPM_ASYM_CA_CONTENTS
;
1181 /// Part 2, section 12.9 TPM_SYM_CA_ATTESTATION
1183 typedef struct tdTPM_SYM_CA_ATTESTATION
{
1185 TPM_KEY_PARMS algorithm
;
1187 } TPM_SYM_CA_ATTESTATION
;
1190 /// Part 2, section 15: Tick Structures
1191 /// Placed here out of order because definitions are used in section 13.
1193 typedef struct tdTPM_CURRENT_TICKS
{
1194 TPM_STRUCTURE_TAG tag
;
1195 UINT64 currentTicks
;
1197 TPM_NONCE tickNonce
;
1198 } TPM_CURRENT_TICKS
;
1201 /// Part 2, section 13: Transport structures
1205 /// Part 2, section 13.1: TPM _TRANSPORT_PUBLIC
1207 typedef struct tdTPM_TRANSPORT_PUBLIC
{
1208 TPM_STRUCTURE_TAG tag
;
1209 TPM_TRANSPORT_ATTRIBUTES transAttributes
;
1210 TPM_ALGORITHM_ID algId
;
1211 TPM_ENC_SCHEME encScheme
;
1212 } TPM_TRANSPORT_PUBLIC
;
1215 // Part 2, section 13.1.1 TPM_TRANSPORT_ATTRIBUTES Definitions
1217 #define TPM_TRANSPORT_ENCRYPT ((UINT32)BIT0)
1218 #define TPM_TRANSPORT_LOG ((UINT32)BIT1)
1219 #define TPM_TRANSPORT_EXCLUSIVE ((UINT32)BIT2)
1222 /// Part 2, section 13.2 TPM_TRANSPORT_INTERNAL
1224 typedef struct tdTPM_TRANSPORT_INTERNAL
{
1225 TPM_STRUCTURE_TAG tag
;
1226 TPM_AUTHDATA authData
;
1227 TPM_TRANSPORT_PUBLIC transPublic
;
1228 TPM_TRANSHANDLE transHandle
;
1229 TPM_NONCE transNonceEven
;
1230 TPM_DIGEST transDigest
;
1231 } TPM_TRANSPORT_INTERNAL
;
1234 /// Part 2, section 13.3 TPM_TRANSPORT_LOG_IN structure
1236 typedef struct tdTPM_TRANSPORT_LOG_IN
{
1237 TPM_STRUCTURE_TAG tag
;
1238 TPM_DIGEST parameters
;
1239 TPM_DIGEST pubKeyHash
;
1240 } TPM_TRANSPORT_LOG_IN
;
1243 /// Part 2, section 13.4 TPM_TRANSPORT_LOG_OUT structure
1245 typedef struct tdTPM_TRANSPORT_LOG_OUT
{
1246 TPM_STRUCTURE_TAG tag
;
1247 TPM_CURRENT_TICKS currentTicks
;
1248 TPM_DIGEST parameters
;
1249 TPM_MODIFIER_INDICATOR locality
;
1250 } TPM_TRANSPORT_LOG_OUT
;
1253 /// Part 2, section 13.5 TPM_TRANSPORT_AUTH structure
1255 typedef struct tdTPM_TRANSPORT_AUTH
{
1256 TPM_STRUCTURE_TAG tag
;
1257 TPM_AUTHDATA authData
;
1258 } TPM_TRANSPORT_AUTH
;
1261 // Part 2, section 14: Audit Structures
1265 /// Part 2, section 14.1 TPM_AUDIT_EVENT_IN structure
1267 typedef struct tdTPM_AUDIT_EVENT_IN
{
1268 TPM_STRUCTURE_TAG tag
;
1269 TPM_DIGEST inputParms
;
1270 TPM_COUNTER_VALUE auditCount
;
1271 } TPM_AUDIT_EVENT_IN
;
1274 /// Part 2, section 14.2 TPM_AUDIT_EVENT_OUT structure
1276 typedef struct tdTPM_AUDIT_EVENT_OUT
{
1277 TPM_STRUCTURE_TAG tag
;
1278 TPM_COMMAND_CODE ordinal
;
1279 TPM_DIGEST outputParms
;
1280 TPM_COUNTER_VALUE auditCount
;
1281 TPM_RESULT returnCode
;
1282 } TPM_AUDIT_EVENT_OUT
;
1285 // Part 2, section 16: Return Codes
1288 #define TPM_VENDOR_ERROR TPM_Vendor_Specific32
1289 #define TPM_NON_FATAL 0x00000800
1291 #define TPM_SUCCESS ((TPM_RESULT) TPM_BASE)
1292 #define TPM_AUTHFAIL ((TPM_RESULT) (TPM_BASE + 1))
1293 #define TPM_BADINDEX ((TPM_RESULT) (TPM_BASE + 2))
1294 #define TPM_BAD_PARAMETER ((TPM_RESULT) (TPM_BASE + 3))
1295 #define TPM_AUDITFAILURE ((TPM_RESULT) (TPM_BASE + 4))
1296 #define TPM_CLEAR_DISABLED ((TPM_RESULT) (TPM_BASE + 5))
1297 #define TPM_DEACTIVATED ((TPM_RESULT) (TPM_BASE + 6))
1298 #define TPM_DISABLED ((TPM_RESULT) (TPM_BASE + 7))
1299 #define TPM_DISABLED_CMD ((TPM_RESULT) (TPM_BASE + 8))
1300 #define TPM_FAIL ((TPM_RESULT) (TPM_BASE + 9))
1301 #define TPM_BAD_ORDINAL ((TPM_RESULT) (TPM_BASE + 10))
1302 #define TPM_INSTALL_DISABLED ((TPM_RESULT) (TPM_BASE + 11))
1303 #define TPM_INVALID_KEYHANDLE ((TPM_RESULT) (TPM_BASE + 12))
1304 #define TPM_KEYNOTFOUND ((TPM_RESULT) (TPM_BASE + 13))
1305 #define TPM_INAPPROPRIATE_ENC ((TPM_RESULT) (TPM_BASE + 14))
1306 #define TPM_MIGRATEFAIL ((TPM_RESULT) (TPM_BASE + 15))
1307 #define TPM_INVALID_PCR_INFO ((TPM_RESULT) (TPM_BASE + 16))
1308 #define TPM_NOSPACE ((TPM_RESULT) (TPM_BASE + 17))
1309 #define TPM_NOSRK ((TPM_RESULT) (TPM_BASE + 18))
1310 #define TPM_NOTSEALED_BLOB ((TPM_RESULT) (TPM_BASE + 19))
1311 #define TPM_OWNER_SET ((TPM_RESULT) (TPM_BASE + 20))
1312 #define TPM_RESOURCES ((TPM_RESULT) (TPM_BASE + 21))
1313 #define TPM_SHORTRANDOM ((TPM_RESULT) (TPM_BASE + 22))
1314 #define TPM_SIZE ((TPM_RESULT) (TPM_BASE + 23))
1315 #define TPM_WRONGPCRVAL ((TPM_RESULT) (TPM_BASE + 24))
1316 #define TPM_BAD_PARAM_SIZE ((TPM_RESULT) (TPM_BASE + 25))
1317 #define TPM_SHA_THREAD ((TPM_RESULT) (TPM_BASE + 26))
1318 #define TPM_SHA_ERROR ((TPM_RESULT) (TPM_BASE + 27))
1319 #define TPM_FAILEDSELFTEST ((TPM_RESULT) (TPM_BASE + 28))
1320 #define TPM_AUTH2FAIL ((TPM_RESULT) (TPM_BASE + 29))
1321 #define TPM_BADTAG ((TPM_RESULT) (TPM_BASE + 30))
1322 #define TPM_IOERROR ((TPM_RESULT) (TPM_BASE + 31))
1323 #define TPM_ENCRYPT_ERROR ((TPM_RESULT) (TPM_BASE + 32))
1324 #define TPM_DECRYPT_ERROR ((TPM_RESULT) (TPM_BASE + 33))
1325 #define TPM_INVALID_AUTHHANDLE ((TPM_RESULT) (TPM_BASE + 34))
1326 #define TPM_NO_ENDORSEMENT ((TPM_RESULT) (TPM_BASE + 35))
1327 #define TPM_INVALID_KEYUSAGE ((TPM_RESULT) (TPM_BASE + 36))
1328 #define TPM_WRONG_ENTITYTYPE ((TPM_RESULT) (TPM_BASE + 37))
1329 #define TPM_INVALID_POSTINIT ((TPM_RESULT) (TPM_BASE + 38))
1330 #define TPM_INAPPROPRIATE_SIG ((TPM_RESULT) (TPM_BASE + 39))
1331 #define TPM_BAD_KEY_PROPERTY ((TPM_RESULT) (TPM_BASE + 40))
1332 #define TPM_BAD_MIGRATION ((TPM_RESULT) (TPM_BASE + 41))
1333 #define TPM_BAD_SCHEME ((TPM_RESULT) (TPM_BASE + 42))
1334 #define TPM_BAD_DATASIZE ((TPM_RESULT) (TPM_BASE + 43))
1335 #define TPM_BAD_MODE ((TPM_RESULT) (TPM_BASE + 44))
1336 #define TPM_BAD_PRESENCE ((TPM_RESULT) (TPM_BASE + 45))
1337 #define TPM_BAD_VERSION ((TPM_RESULT) (TPM_BASE + 46))
1338 #define TPM_NO_WRAP_TRANSPORT ((TPM_RESULT) (TPM_BASE + 47))
1339 #define TPM_AUDITFAIL_UNSUCCESSFUL ((TPM_RESULT) (TPM_BASE + 48))
1340 #define TPM_AUDITFAIL_SUCCESSFUL ((TPM_RESULT) (TPM_BASE + 49))
1341 #define TPM_NOTRESETABLE ((TPM_RESULT) (TPM_BASE + 50))
1342 #define TPM_NOTLOCAL ((TPM_RESULT) (TPM_BASE + 51))
1343 #define TPM_BAD_TYPE ((TPM_RESULT) (TPM_BASE + 52))
1344 #define TPM_INVALID_RESOURCE ((TPM_RESULT) (TPM_BASE + 53))
1345 #define TPM_NOTFIPS ((TPM_RESULT) (TPM_BASE + 54))
1346 #define TPM_INVALID_FAMILY ((TPM_RESULT) (TPM_BASE + 55))
1347 #define TPM_NO_NV_PERMISSION ((TPM_RESULT) (TPM_BASE + 56))
1348 #define TPM_REQUIRES_SIGN ((TPM_RESULT) (TPM_BASE + 57))
1349 #define TPM_KEY_NOTSUPPORTED ((TPM_RESULT) (TPM_BASE + 58))
1350 #define TPM_AUTH_CONFLICT ((TPM_RESULT) (TPM_BASE + 59))
1351 #define TPM_AREA_LOCKED ((TPM_RESULT) (TPM_BASE + 60))
1352 #define TPM_BAD_LOCALITY ((TPM_RESULT) (TPM_BASE + 61))
1353 #define TPM_READ_ONLY ((TPM_RESULT) (TPM_BASE + 62))
1354 #define TPM_PER_NOWRITE ((TPM_RESULT) (TPM_BASE + 63))
1355 #define TPM_FAMILYCOUNT ((TPM_RESULT) (TPM_BASE + 64))
1356 #define TPM_WRITE_LOCKED ((TPM_RESULT) (TPM_BASE + 65))
1357 #define TPM_BAD_ATTRIBUTES ((TPM_RESULT) (TPM_BASE + 66))
1358 #define TPM_INVALID_STRUCTURE ((TPM_RESULT) (TPM_BASE + 67))
1359 #define TPM_KEY_OWNER_CONTROL ((TPM_RESULT) (TPM_BASE + 68))
1360 #define TPM_BAD_COUNTER ((TPM_RESULT) (TPM_BASE + 69))
1361 #define TPM_NOT_FULLWRITE ((TPM_RESULT) (TPM_BASE + 70))
1362 #define TPM_CONTEXT_GAP ((TPM_RESULT) (TPM_BASE + 71))
1363 #define TPM_MAXNVWRITES ((TPM_RESULT) (TPM_BASE + 72))
1364 #define TPM_NOOPERATOR ((TPM_RESULT) (TPM_BASE + 73))
1365 #define TPM_RESOURCEMISSING ((TPM_RESULT) (TPM_BASE + 74))
1366 #define TPM_DELEGATE_LOCK ((TPM_RESULT) (TPM_BASE + 75))
1367 #define TPM_DELEGATE_FAMILY ((TPM_RESULT) (TPM_BASE + 76))
1368 #define TPM_DELEGATE_ADMIN ((TPM_RESULT) (TPM_BASE + 77))
1369 #define TPM_TRANSPORT_NOTEXCLUSIVE ((TPM_RESULT) (TPM_BASE + 78))
1370 #define TPM_OWNER_CONTROL ((TPM_RESULT) (TPM_BASE + 79))
1371 #define TPM_DAA_RESOURCES ((TPM_RESULT) (TPM_BASE + 80))
1372 #define TPM_DAA_INPUT_DATA0 ((TPM_RESULT) (TPM_BASE + 81))
1373 #define TPM_DAA_INPUT_DATA1 ((TPM_RESULT) (TPM_BASE + 82))
1374 #define TPM_DAA_ISSUER_SETTINGS ((TPM_RESULT) (TPM_BASE + 83))
1375 #define TPM_DAA_TPM_SETTINGS ((TPM_RESULT) (TPM_BASE + 84))
1376 #define TPM_DAA_STAGE ((TPM_RESULT) (TPM_BASE + 85))
1377 #define TPM_DAA_ISSUER_VALIDITY ((TPM_RESULT) (TPM_BASE + 86))
1378 #define TPM_DAA_WRONG_W ((TPM_RESULT) (TPM_BASE + 87))
1379 #define TPM_BAD_HANDLE ((TPM_RESULT) (TPM_BASE + 88))
1380 #define TPM_BAD_DELEGATE ((TPM_RESULT) (TPM_BASE + 89))
1381 #define TPM_BADCONTEXT ((TPM_RESULT) (TPM_BASE + 90))
1382 #define TPM_TOOMANYCONTEXTS ((TPM_RESULT) (TPM_BASE + 91))
1383 #define TPM_MA_TICKET_SIGNATURE ((TPM_RESULT) (TPM_BASE + 92))
1384 #define TPM_MA_DESTINATION ((TPM_RESULT) (TPM_BASE + 93))
1385 #define TPM_MA_SOURCE ((TPM_RESULT) (TPM_BASE + 94))
1386 #define TPM_MA_AUTHORITY ((TPM_RESULT) (TPM_BASE + 95))
1387 #define TPM_PERMANENTEK ((TPM_RESULT) (TPM_BASE + 97))
1388 #define TPM_BAD_SIGNATURE ((TPM_RESULT) (TPM_BASE + 98))
1389 #define TPM_NOCONTEXTSPACE ((TPM_RESULT) (TPM_BASE + 99))
1391 #define TPM_RETRY ((TPM_RESULT) (TPM_BASE + TPM_NON_FATAL))
1392 #define TPM_NEEDS_SELFTEST ((TPM_RESULT) (TPM_BASE + TPM_NON_FATAL + 1))
1393 #define TPM_DOING_SELFTEST ((TPM_RESULT) (TPM_BASE + TPM_NON_FATAL + 2))
1394 #define TPM_DEFEND_LOCK_RUNNING ((TPM_RESULT) (TPM_BASE + TPM_NON_FATAL + 3))
1397 // Part 2, section 17: Ordinals
1399 // Ordinals are 32 bit values. The upper byte contains values that serve as
1400 // flag indicators, the next byte contains values indicating what committee
1401 // designated the ordinal, and the final two bytes contain the Command
1404 // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
1405 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1406 // |P|C|V| Reserved| Purview | Command Ordinal Index |
1407 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1411 // * P is Protected/Unprotected command. When 0 the command is a Protected
1412 // command, when 1 the command is an Unprotected command.
1414 // * C is Non-Connection/Connection related command. When 0 this command
1415 // passes through to either the protected (TPM) or unprotected (TSS)
1418 // * V is TPM/Vendor command. When 0 the command is TPM defined, when 1 the
1419 // command is vendor defined.
1421 // * All reserved area bits are set to 0.
1424 #define TPM_ORD_ActivateIdentity ((TPM_COMMAND_CODE) 0x0000007A)
1425 #define TPM_ORD_AuthorizeMigrationKey ((TPM_COMMAND_CODE) 0x0000002B)
1426 #define TPM_ORD_CertifyKey ((TPM_COMMAND_CODE) 0x00000032)
1427 #define TPM_ORD_CertifyKey2 ((TPM_COMMAND_CODE) 0x00000033)
1428 #define TPM_ORD_CertifySelfTest ((TPM_COMMAND_CODE) 0x00000052)
1429 #define TPM_ORD_ChangeAuth ((TPM_COMMAND_CODE) 0x0000000C)
1430 #define TPM_ORD_ChangeAuthAsymFinish ((TPM_COMMAND_CODE) 0x0000000F)
1431 #define TPM_ORD_ChangeAuthAsymStart ((TPM_COMMAND_CODE) 0x0000000E)
1432 #define TPM_ORD_ChangeAuthOwner ((TPM_COMMAND_CODE) 0x00000010)
1433 #define TPM_ORD_CMK_ApproveMA ((TPM_COMMAND_CODE) 0x0000001D)
1434 #define TPM_ORD_CMK_ConvertMigration ((TPM_COMMAND_CODE) 0x00000024)
1435 #define TPM_ORD_CMK_CreateBlob ((TPM_COMMAND_CODE) 0x0000001B)
1436 #define TPM_ORD_CMK_CreateKey ((TPM_COMMAND_CODE) 0x00000013)
1437 #define TPM_ORD_CMK_CreateTicket ((TPM_COMMAND_CODE) 0x00000012)
1438 #define TPM_ORD_CMK_SetRestrictions ((TPM_COMMAND_CODE) 0x0000001C)
1439 #define TPM_ORD_ContinueSelfTest ((TPM_COMMAND_CODE) 0x00000053)
1440 #define TPM_ORD_ConvertMigrationBlob ((TPM_COMMAND_CODE) 0x0000002A)
1441 #define TPM_ORD_CreateCounter ((TPM_COMMAND_CODE) 0x000000DC)
1442 #define TPM_ORD_CreateEndorsementKeyPair ((TPM_COMMAND_CODE) 0x00000078)
1443 #define TPM_ORD_CreateMaintenanceArchive ((TPM_COMMAND_CODE) 0x0000002C)
1444 #define TPM_ORD_CreateMigrationBlob ((TPM_COMMAND_CODE) 0x00000028)
1445 #define TPM_ORD_CreateRevocableEK ((TPM_COMMAND_CODE) 0x0000007F)
1446 #define TPM_ORD_CreateWrapKey ((TPM_COMMAND_CODE) 0x0000001F)
1447 #define TPM_ORD_DAA_JOIN ((TPM_COMMAND_CODE) 0x00000029)
1448 #define TPM_ORD_DAA_SIGN ((TPM_COMMAND_CODE) 0x00000031)
1449 #define TPM_ORD_Delegate_CreateKeyDelegation ((TPM_COMMAND_CODE) 0x000000D4)
1450 #define TPM_ORD_Delegate_CreateOwnerDelegation ((TPM_COMMAND_CODE) 0x000000D5)
1451 #define TPM_ORD_Delegate_LoadOwnerDelegation ((TPM_COMMAND_CODE) 0x000000D8)
1452 #define TPM_ORD_Delegate_Manage ((TPM_COMMAND_CODE) 0x000000D2)
1453 #define TPM_ORD_Delegate_ReadTable ((TPM_COMMAND_CODE) 0x000000DB)
1454 #define TPM_ORD_Delegate_UpdateVerification ((TPM_COMMAND_CODE) 0x000000D1)
1455 #define TPM_ORD_Delegate_VerifyDelegation ((TPM_COMMAND_CODE) 0x000000D6)
1456 #define TPM_ORD_DirRead ((TPM_COMMAND_CODE) 0x0000001A)
1457 #define TPM_ORD_DirWriteAuth ((TPM_COMMAND_CODE) 0x00000019)
1458 #define TPM_ORD_DisableForceClear ((TPM_COMMAND_CODE) 0x0000005E)
1459 #define TPM_ORD_DisableOwnerClear ((TPM_COMMAND_CODE) 0x0000005C)
1460 #define TPM_ORD_DisablePubekRead ((TPM_COMMAND_CODE) 0x0000007E)
1461 #define TPM_ORD_DSAP ((TPM_COMMAND_CODE) 0x00000011)
1462 #define TPM_ORD_EstablishTransport ((TPM_COMMAND_CODE) 0x000000E6)
1463 #define TPM_ORD_EvictKey ((TPM_COMMAND_CODE) 0x00000022)
1464 #define TPM_ORD_ExecuteTransport ((TPM_COMMAND_CODE) 0x000000E7)
1465 #define TPM_ORD_Extend ((TPM_COMMAND_CODE) 0x00000014)
1466 #define TPM_ORD_FieldUpgrade ((TPM_COMMAND_CODE) 0x000000AA)
1467 #define TPM_ORD_FlushSpecific ((TPM_COMMAND_CODE) 0x000000BA)
1468 #define TPM_ORD_ForceClear ((TPM_COMMAND_CODE) 0x0000005D)
1469 #define TPM_ORD_GetAuditDigest ((TPM_COMMAND_CODE) 0x00000085)
1470 #define TPM_ORD_GetAuditDigestSigned ((TPM_COMMAND_CODE) 0x00000086)
1471 #define TPM_ORD_GetAuditEvent ((TPM_COMMAND_CODE) 0x00000082)
1472 #define TPM_ORD_GetAuditEventSigned ((TPM_COMMAND_CODE) 0x00000083)
1473 #define TPM_ORD_GetCapability ((TPM_COMMAND_CODE) 0x00000065)
1474 #define TPM_ORD_GetCapabilityOwner ((TPM_COMMAND_CODE) 0x00000066)
1475 #define TPM_ORD_GetCapabilitySigned ((TPM_COMMAND_CODE) 0x00000064)
1476 #define TPM_ORD_GetOrdinalAuditStatus ((TPM_COMMAND_CODE) 0x0000008C)
1477 #define TPM_ORD_GetPubKey ((TPM_COMMAND_CODE) 0x00000021)
1478 #define TPM_ORD_GetRandom ((TPM_COMMAND_CODE) 0x00000046)
1479 #define TPM_ORD_GetTestResult ((TPM_COMMAND_CODE) 0x00000054)
1480 #define TPM_ORD_GetTicks ((TPM_COMMAND_CODE) 0x000000F1)
1481 #define TPM_ORD_IncrementCounter ((TPM_COMMAND_CODE) 0x000000DD)
1482 #define TPM_ORD_Init ((TPM_COMMAND_CODE) 0x00000097)
1483 #define TPM_ORD_KeyControlOwner ((TPM_COMMAND_CODE) 0x00000023)
1484 #define TPM_ORD_KillMaintenanceFeature ((TPM_COMMAND_CODE) 0x0000002E)
1485 #define TPM_ORD_LoadAuthContext ((TPM_COMMAND_CODE) 0x000000B7)
1486 #define TPM_ORD_LoadContext ((TPM_COMMAND_CODE) 0x000000B9)
1487 #define TPM_ORD_LoadKey ((TPM_COMMAND_CODE) 0x00000020)
1488 #define TPM_ORD_LoadKey2 ((TPM_COMMAND_CODE) 0x00000041)
1489 #define TPM_ORD_LoadKeyContext ((TPM_COMMAND_CODE) 0x000000B5)
1490 #define TPM_ORD_LoadMaintenanceArchive ((TPM_COMMAND_CODE) 0x0000002D)
1491 #define TPM_ORD_LoadManuMaintPub ((TPM_COMMAND_CODE) 0x0000002F)
1492 #define TPM_ORD_MakeIdentity ((TPM_COMMAND_CODE) 0x00000079)
1493 #define TPM_ORD_MigrateKey ((TPM_COMMAND_CODE) 0x00000025)
1494 #define TPM_ORD_NV_DefineSpace ((TPM_COMMAND_CODE) 0x000000CC)
1495 #define TPM_ORD_NV_ReadValue ((TPM_COMMAND_CODE) 0x000000CF)
1496 #define TPM_ORD_NV_ReadValueAuth ((TPM_COMMAND_CODE) 0x000000D0)
1497 #define TPM_ORD_NV_WriteValue ((TPM_COMMAND_CODE) 0x000000CD)
1498 #define TPM_ORD_NV_WriteValueAuth ((TPM_COMMAND_CODE) 0x000000CE)
1499 #define TPM_ORD_OIAP ((TPM_COMMAND_CODE) 0x0000000A)
1500 #define TPM_ORD_OSAP ((TPM_COMMAND_CODE) 0x0000000B)
1501 #define TPM_ORD_OwnerClear ((TPM_COMMAND_CODE) 0x0000005B)
1502 #define TPM_ORD_OwnerReadInternalPub ((TPM_COMMAND_CODE) 0x00000081)
1503 #define TPM_ORD_OwnerReadPubek ((TPM_COMMAND_CODE) 0x0000007D)
1504 #define TPM_ORD_OwnerSetDisable ((TPM_COMMAND_CODE) 0x0000006E)
1505 #define TPM_ORD_PCR_Reset ((TPM_COMMAND_CODE) 0x000000C8)
1506 #define TPM_ORD_PcrRead ((TPM_COMMAND_CODE) 0x00000015)
1507 #define TPM_ORD_PhysicalDisable ((TPM_COMMAND_CODE) 0x00000070)
1508 #define TPM_ORD_PhysicalEnable ((TPM_COMMAND_CODE) 0x0000006F)
1509 #define TPM_ORD_PhysicalSetDeactivated ((TPM_COMMAND_CODE) 0x00000072)
1510 #define TPM_ORD_Quote ((TPM_COMMAND_CODE) 0x00000016)
1511 #define TPM_ORD_Quote2 ((TPM_COMMAND_CODE) 0x0000003E)
1512 #define TPM_ORD_ReadCounter ((TPM_COMMAND_CODE) 0x000000DE)
1513 #define TPM_ORD_ReadManuMaintPub ((TPM_COMMAND_CODE) 0x00000030)
1514 #define TPM_ORD_ReadPubek ((TPM_COMMAND_CODE) 0x0000007C)
1515 #define TPM_ORD_ReleaseCounter ((TPM_COMMAND_CODE) 0x000000DF)
1516 #define TPM_ORD_ReleaseCounterOwner ((TPM_COMMAND_CODE) 0x000000E0)
1517 #define TPM_ORD_ReleaseTransportSigned ((TPM_COMMAND_CODE) 0x000000E8)
1518 #define TPM_ORD_Reset ((TPM_COMMAND_CODE) 0x0000005A)
1519 #define TPM_ORD_ResetLockValue ((TPM_COMMAND_CODE) 0x00000040)
1520 #define TPM_ORD_RevokeTrust ((TPM_COMMAND_CODE) 0x00000080)
1521 #define TPM_ORD_SaveAuthContext ((TPM_COMMAND_CODE) 0x000000B6)
1522 #define TPM_ORD_SaveContext ((TPM_COMMAND_CODE) 0x000000B8)
1523 #define TPM_ORD_SaveKeyContext ((TPM_COMMAND_CODE) 0x000000B4)
1524 #define TPM_ORD_SaveState ((TPM_COMMAND_CODE) 0x00000098)
1525 #define TPM_ORD_Seal ((TPM_COMMAND_CODE) 0x00000017)
1526 #define TPM_ORD_Sealx ((TPM_COMMAND_CODE) 0x0000003D)
1527 #define TPM_ORD_SelfTestFull ((TPM_COMMAND_CODE) 0x00000050)
1528 #define TPM_ORD_SetCapability ((TPM_COMMAND_CODE) 0x0000003F)
1529 #define TPM_ORD_SetOperatorAuth ((TPM_COMMAND_CODE) 0x00000074)
1530 #define TPM_ORD_SetOrdinalAuditStatus ((TPM_COMMAND_CODE) 0x0000008D)
1531 #define TPM_ORD_SetOwnerInstall ((TPM_COMMAND_CODE) 0x00000071)
1532 #define TPM_ORD_SetOwnerPointer ((TPM_COMMAND_CODE) 0x00000075)
1533 #define TPM_ORD_SetRedirection ((TPM_COMMAND_CODE) 0x0000009A)
1534 #define TPM_ORD_SetTempDeactivated ((TPM_COMMAND_CODE) 0x00000073)
1535 #define TPM_ORD_SHA1Complete ((TPM_COMMAND_CODE) 0x000000A2)
1536 #define TPM_ORD_SHA1CompleteExtend ((TPM_COMMAND_CODE) 0x000000A3)
1537 #define TPM_ORD_SHA1Start ((TPM_COMMAND_CODE) 0x000000A0)
1538 #define TPM_ORD_SHA1Update ((TPM_COMMAND_CODE) 0x000000A1)
1539 #define TPM_ORD_Sign ((TPM_COMMAND_CODE) 0x0000003C)
1540 #define TPM_ORD_Startup ((TPM_COMMAND_CODE) 0x00000099)
1541 #define TPM_ORD_StirRandom ((TPM_COMMAND_CODE) 0x00000047)
1542 #define TPM_ORD_TakeOwnership ((TPM_COMMAND_CODE) 0x0000000D)
1543 #define TPM_ORD_Terminate_Handle ((TPM_COMMAND_CODE) 0x00000096)
1544 #define TPM_ORD_TickStampBlob ((TPM_COMMAND_CODE) 0x000000F2)
1545 #define TPM_ORD_UnBind ((TPM_COMMAND_CODE) 0x0000001E)
1546 #define TPM_ORD_Unseal ((TPM_COMMAND_CODE) 0x00000018)
1547 #define TSC_ORD_PhysicalPresence ((TPM_COMMAND_CODE) 0x4000000A)
1548 #define TSC_ORD_ResetEstablishmentBit ((TPM_COMMAND_CODE) 0x4000000B)
1551 // Part 2, section 18: Context structures
1555 /// Part 2, section 18.1: TPM_CONTEXT_BLOB
1557 typedef struct tdTPM_CONTEXT_BLOB
{
1558 TPM_STRUCTURE_TAG tag
;
1559 TPM_RESOURCE_TYPE resourceType
;
1562 UINT32 contextCount
;
1563 TPM_DIGEST integrityDigest
;
1564 UINT32 additionalSize
;
1565 UINT8
*additionalData
;
1566 UINT32 sensitiveSize
;
1567 UINT8
*sensitiveData
;
1571 /// Part 2, section 18.2 TPM_CONTEXT_SENSITIVE
1573 typedef struct tdTPM_CONTEXT_SENSITIVE
{
1574 TPM_STRUCTURE_TAG tag
;
1575 TPM_NONCE contextNonce
;
1576 UINT32 internalSize
;
1577 UINT8
*internalData
;
1578 } TPM_CONTEXT_SENSITIVE
;
1581 // Part 2, section 19: NV Structures
1585 // Part 2, section 19.1.1: Required TPM_NV_INDEX values
1587 #define TPM_NV_INDEX_LOCK ((UINT32)0xffffffff)
1588 #define TPM_NV_INDEX0 ((UINT32)0x00000000)
1589 #define TPM_NV_INDEX_DIR ((UINT32)0x10000001)
1590 #define TPM_NV_INDEX_EKCert ((UINT32)0x0000f000)
1591 #define TPM_NV_INDEX_TPM_CC ((UINT32)0x0000f001)
1592 #define TPM_NV_INDEX_PlatformCert ((UINT32)0x0000f002)
1593 #define TPM_NV_INDEX_Platform_CC ((UINT32)0x0000f003)
1595 // Part 2, section 19.1.2: Reserved Index values
1597 #define TPM_NV_INDEX_TSS_BASE ((UINT32)0x00011100)
1598 #define TPM_NV_INDEX_PC_BASE ((UINT32)0x00011200)
1599 #define TPM_NV_INDEX_SERVER_BASE ((UINT32)0x00011300)
1600 #define TPM_NV_INDEX_MOBILE_BASE ((UINT32)0x00011400)
1601 #define TPM_NV_INDEX_PERIPHERAL_BASE ((UINT32)0x00011500)
1602 #define TPM_NV_INDEX_GROUP_RESV_BASE ((UINT32)0x00010000)
1605 /// The typedefs TPM_NV_PER_ATTRIBUTES (not present in TPM 1.2 Spec. have been added
1606 /// and structure fields that were to hold the following values
1608 typedef UINT32 TPM_NV_PER_ATTRIBUTES
;
1611 /// Part 2, section 19.2: TPM_NV_ATTRIBUTES
1613 typedef struct tdTPM_NV_ATTRIBUTES
{
1614 TPM_STRUCTURE_TAG tag
;
1615 TPM_NV_PER_ATTRIBUTES attributes
;
1616 } TPM_NV_ATTRIBUTES
;
1618 #define TPM_NV_PER_READ_STCLEAR (BIT31)
1619 #define TPM_NV_PER_AUTHREAD (BIT18)
1620 #define TPM_NV_PER_OWNERREAD (BIT17)
1621 #define TPM_NV_PER_PPREAD (BIT16)
1622 #define TPM_NV_PER_GLOBALLOCK (BIT15)
1623 #define TPM_NV_PER_WRITE_STCLEAR (BIT14)
1624 #define TPM_NV_PER_WRITEDEFINE (BIT13)
1625 #define TPM_NV_PER_WRITEALL (BIT12)
1626 #define TPM_NV_PER_AUTHWRITE (BIT2)
1627 #define TPM_NV_PER_OWNERWRITE (BIT1)
1628 #define TPM_NV_PER_PPWRITE (BIT0)
1631 /// Part 2, section 19.3: TPM_NV_DATA_PUBLIC
1633 typedef struct tdTPM_NV_DATA_PUBLIC
{
1634 TPM_STRUCTURE_TAG tag
;
1635 TPM_NV_INDEX nvIndex
;
1636 TPM_PCR_INFO_SHORT pcrInfoRead
;
1637 TPM_PCR_INFO_SHORT pcrInfoWrite
;
1638 TPM_NV_ATTRIBUTES permission
;
1639 BOOLEAN bReadSTClear
;
1640 BOOLEAN bWriteSTClear
;
1641 BOOLEAN bWriteDefine
;
1643 } TPM_NV_DATA_PUBLIC
;
1646 // Part 2, section 20: Delegate Structures
1649 #define TPM_DEL_OWNER_BITS ((UINT32)0x00000001)
1650 #define TPM_DEL_KEY_BITS ((UINT32)0x00000002)
1652 /// Part 2, section 20.2: Delegate Definitions
1654 typedef struct tdTPM_DELEGATIONS
{
1655 TPM_STRUCTURE_TAG tag
;
1656 UINT32 delegateType
;
1662 // Part 2, section 20.2.1: Owner Permission Settings
1664 #define TPM_DELEGATE_SetOrdinalAuditStatus (BIT30)
1665 #define TPM_DELEGATE_DirWriteAuth (BIT29)
1666 #define TPM_DELEGATE_CMK_ApproveMA (BIT28)
1667 #define TPM_DELEGATE_CMK_CreateTicket (BIT26)
1668 #define TPM_DELEGATE_Delegate_LoadOwnerDelegation (BIT24)
1669 #define TPM_DELEGATE_DAA_Join (BIT23)
1670 #define TPM_DELEGATE_AuthorizeMigrationKey (BIT22)
1671 #define TPM_DELEGATE_CreateMaintenanceArchive (BIT21)
1672 #define TPM_DELEGATE_LoadMaintenanceArchive (BIT20)
1673 #define TPM_DELEGATE_KillMaintenanceFeature (BIT19)
1674 #define TPM_DELEGATE_OwnerReadInteralPub (BIT18)
1675 #define TPM_DELEGATE_ResetLockValue (BIT17)
1676 #define TPM_DELEGATE_OwnerClear (BIT16)
1677 #define TPM_DELEGATE_DisableOwnerClear (BIT15)
1678 #define TPM_DELEGATE_OwnerSetDisable (BIT13)
1679 #define TPM_DELEGATE_SetCapability (BIT12)
1680 #define TPM_DELEGATE_MakeIdentity (BIT11)
1681 #define TPM_DELEGATE_ActivateIdentity (BIT10)
1682 #define TPM_DELEGATE_OwnerReadPubek (BIT9)
1683 #define TPM_DELEGATE_DisablePubekRead (BIT8)
1684 #define TPM_DELEGATE_SetRedirection (BIT7)
1685 #define TPM_DELEGATE_FieldUpgrade (BIT6)
1686 #define TPM_DELEGATE_Delegate_UpdateVerification (BIT5)
1687 #define TPM_DELEGATE_CreateCounter (BIT4)
1688 #define TPM_DELEGATE_ReleaseCounterOwner (BIT3)
1689 #define TPM_DELEGATE_DelegateManage (BIT2)
1690 #define TPM_DELEGATE_Delegate_CreateOwnerDelegation (BIT1)
1691 #define TPM_DELEGATE_DAA_Sign (BIT0)
1694 // Part 2, section 20.2.3: Key Permission settings
1696 #define TPM_KEY_DELEGATE_CMK_ConvertMigration (BIT28)
1697 #define TPM_KEY_DELEGATE_TickStampBlob (BIT27)
1698 #define TPM_KEY_DELEGATE_ChangeAuthAsymStart (BIT26)
1699 #define TPM_KEY_DELEGATE_ChangeAuthAsymFinish (BIT25)
1700 #define TPM_KEY_DELEGATE_CMK_CreateKey (BIT24)
1701 #define TPM_KEY_DELEGATE_MigrateKey (BIT23)
1702 #define TPM_KEY_DELEGATE_LoadKey2 (BIT22)
1703 #define TPM_KEY_DELEGATE_EstablishTransport (BIT21)
1704 #define TPM_KEY_DELEGATE_ReleaseTransportSigned (BIT20)
1705 #define TPM_KEY_DELEGATE_Quote2 (BIT19)
1706 #define TPM_KEY_DELEGATE_Sealx (BIT18)
1707 #define TPM_KEY_DELEGATE_MakeIdentity (BIT17)
1708 #define TPM_KEY_DELEGATE_ActivateIdentity (BIT16)
1709 #define TPM_KEY_DELEGATE_GetAuditDigestSigned (BIT15)
1710 #define TPM_KEY_DELEGATE_Sign (BIT14)
1711 #define TPM_KEY_DELEGATE_CertifyKey2 (BIT13)
1712 #define TPM_KEY_DELEGATE_CertifyKey (BIT12)
1713 #define TPM_KEY_DELEGATE_CreateWrapKey (BIT11)
1714 #define TPM_KEY_DELEGATE_CMK_CreateBlob (BIT10)
1715 #define TPM_KEY_DELEGATE_CreateMigrationBlob (BIT9)
1716 #define TPM_KEY_DELEGATE_ConvertMigrationBlob (BIT8)
1717 #define TPM_KEY_DELEGATE_CreateKeyDelegation (BIT7)
1718 #define TPM_KEY_DELEGATE_ChangeAuth (BIT6)
1719 #define TPM_KEY_DELEGATE_GetPubKey (BIT5)
1720 #define TPM_KEY_DELEGATE_UnBind (BIT4)
1721 #define TPM_KEY_DELEGATE_Quote (BIT3)
1722 #define TPM_KEY_DELEGATE_Unseal (BIT2)
1723 #define TPM_KEY_DELEGATE_Seal (BIT1)
1724 #define TPM_KEY_DELEGATE_LoadKey (BIT0)
1727 // Part 2, section 20.3: TPM_FAMILY_FLAGS
1729 #define TPM_DELEGATE_ADMIN_LOCK (BIT1)
1730 #define TPM_FAMFLAG_ENABLE (BIT0)
1733 /// Part 2, section 20.4: TPM_FAMILY_LABEL
1735 typedef struct tdTPM_FAMILY_LABEL
{
1740 /// Part 2, section 20.5: TPM_FAMILY_TABLE_ENTRY
1742 typedef struct tdTPM_FAMILY_TABLE_ENTRY
{
1743 TPM_STRUCTURE_TAG tag
;
1744 TPM_FAMILY_LABEL label
;
1745 TPM_FAMILY_ID familyID
;
1746 TPM_FAMILY_VERIFICATION verificationCount
;
1747 TPM_FAMILY_FLAGS flags
;
1748 } TPM_FAMILY_TABLE_ENTRY
;
1751 // Part 2, section 20.6: TPM_FAMILY_TABLE
1753 #define TPM_NUM_FAMILY_TABLE_ENTRY_MIN 8
1755 typedef struct tdTPM_FAMILY_TABLE
{
1756 TPM_FAMILY_TABLE_ENTRY famTableRow
[TPM_NUM_FAMILY_TABLE_ENTRY_MIN
];
1760 /// Part 2, section 20.7: TPM_DELEGATE_LABEL
1762 typedef struct tdTPM_DELEGATE_LABEL
{
1764 } TPM_DELEGATE_LABEL
;
1767 /// Part 2, section 20.8: TPM_DELEGATE_PUBLIC
1769 typedef struct tdTPM_DELEGATE_PUBLIC
{
1770 TPM_STRUCTURE_TAG tag
;
1771 TPM_DELEGATE_LABEL label
;
1772 TPM_PCR_INFO_SHORT pcrInfo
;
1773 TPM_DELEGATIONS permissions
;
1774 TPM_FAMILY_ID familyID
;
1775 TPM_FAMILY_VERIFICATION verificationCount
;
1776 } TPM_DELEGATE_PUBLIC
;
1779 /// Part 2, section 20.9: TPM_DELEGATE_TABLE_ROW
1781 typedef struct tdTPM_DELEGATE_TABLE_ROW
{
1782 TPM_STRUCTURE_TAG tag
;
1783 TPM_DELEGATE_PUBLIC pub
;
1784 TPM_SECRET authValue
;
1785 } TPM_DELEGATE_TABLE_ROW
;
1788 // Part 2, section 20.10: TPM_DELEGATE_TABLE
1790 #define TPM_NUM_DELEGATE_TABLE_ENTRY_MIN 2
1792 typedef struct tdTPM_DELEGATE_TABLE
{
1793 TPM_DELEGATE_TABLE_ROW delRow
[TPM_NUM_DELEGATE_TABLE_ENTRY_MIN
];
1794 } TPM_DELEGATE_TABLE
;
1797 /// Part 2, section 20.11: TPM_DELEGATE_SENSITIVE
1799 typedef struct tdTPM_DELEGATE_SENSITIVE
{
1800 TPM_STRUCTURE_TAG tag
;
1801 TPM_SECRET authValue
;
1802 } TPM_DELEGATE_SENSITIVE
;
1805 /// Part 2, section 20.12: TPM_DELEGATE_OWNER_BLOB
1807 typedef struct tdTPM_DELEGATE_OWNER_BLOB
{
1808 TPM_STRUCTURE_TAG tag
;
1809 TPM_DELEGATE_PUBLIC pub
;
1810 TPM_DIGEST integrityDigest
;
1811 UINT32 additionalSize
;
1812 UINT8
*additionalArea
;
1813 UINT32 sensitiveSize
;
1814 UINT8
*sensitiveArea
;
1815 } TPM_DELEGATE_OWNER_BLOB
;
1818 /// Part 2, section 20.13: TTPM_DELEGATE_KEY_BLOB
1820 typedef struct tdTPM_DELEGATE_KEY_BLOB
{
1821 TPM_STRUCTURE_TAG tag
;
1822 TPM_DELEGATE_PUBLIC pub
;
1823 TPM_DIGEST integrityDigest
;
1824 TPM_DIGEST pubKeyDigest
;
1825 UINT32 additionalSize
;
1826 UINT8
*additionalArea
;
1827 UINT32 sensitiveSize
;
1828 UINT8
*sensitiveArea
;
1829 } TPM_DELEGATE_KEY_BLOB
;
1832 // Part 2, section 20.14: TPM_FAMILY_OPERATION Values
1834 #define TPM_FAMILY_CREATE ((UINT32)0x00000001)
1835 #define TPM_FAMILY_ENABLE ((UINT32)0x00000002)
1836 #define TPM_FAMILY_ADMIN ((UINT32)0x00000003)
1837 #define TPM_FAMILY_INVALIDATE ((UINT32)0x00000004)
1840 // Part 2, section 21.1: TPM_CAPABILITY_AREA for GetCapability
1842 #define TPM_CAP_ORD ((TPM_CAPABILITY_AREA) 0x00000001)
1843 #define TPM_CAP_ALG ((TPM_CAPABILITY_AREA) 0x00000002)
1844 #define TPM_CAP_PID ((TPM_CAPABILITY_AREA) 0x00000003)
1845 #define TPM_CAP_FLAG ((TPM_CAPABILITY_AREA) 0x00000004)
1846 #define TPM_CAP_PROPERTY ((TPM_CAPABILITY_AREA) 0x00000005)
1847 #define TPM_CAP_VERSION ((TPM_CAPABILITY_AREA) 0x00000006)
1848 #define TPM_CAP_KEY_HANDLE ((TPM_CAPABILITY_AREA) 0x00000007)
1849 #define TPM_CAP_CHECK_LOADED ((TPM_CAPABILITY_AREA) 0x00000008)
1850 #define TPM_CAP_SYM_MODE ((TPM_CAPABILITY_AREA) 0x00000009)
1851 #define TPM_CAP_KEY_STATUS ((TPM_CAPABILITY_AREA) 0x0000000C)
1852 #define TPM_CAP_NV_LIST ((TPM_CAPABILITY_AREA) 0x0000000D)
1853 #define TPM_CAP_MFR ((TPM_CAPABILITY_AREA) 0x00000010)
1854 #define TPM_CAP_NV_INDEX ((TPM_CAPABILITY_AREA) 0x00000011)
1855 #define TPM_CAP_TRANS_ALG ((TPM_CAPABILITY_AREA) 0x00000012)
1856 #define TPM_CAP_HANDLE ((TPM_CAPABILITY_AREA) 0x00000014)
1857 #define TPM_CAP_TRANS_ES ((TPM_CAPABILITY_AREA) 0x00000015)
1858 #define TPM_CAP_AUTH_ENCRYPT ((TPM_CAPABILITY_AREA) 0x00000017)
1859 #define TPM_CAP_SELECT_SIZE ((TPM_CAPABILITY_AREA) 0x00000018)
1860 #define TPM_CAP_VERSION_VAL ((TPM_CAPABILITY_AREA) 0x0000001A)
1862 #define TPM_CAP_FLAG_PERMANENT ((TPM_CAPABILITY_AREA) 0x00000108)
1863 #define TPM_CAP_FLAG_VOLATILE ((TPM_CAPABILITY_AREA) 0x00000109)
1866 // Part 2, section 21.2: CAP_PROPERTY Subcap values for GetCapability
1868 #define TPM_CAP_PROP_PCR ((TPM_CAPABILITY_AREA) 0x00000101)
1869 #define TPM_CAP_PROP_DIR ((TPM_CAPABILITY_AREA) 0x00000102)
1870 #define TPM_CAP_PROP_MANUFACTURER ((TPM_CAPABILITY_AREA) 0x00000103)
1871 #define TPM_CAP_PROP_KEYS ((TPM_CAPABILITY_AREA) 0x00000104)
1872 #define TPM_CAP_PROP_MIN_COUNTER ((TPM_CAPABILITY_AREA) 0x00000107)
1873 #define TPM_CAP_PROP_AUTHSESS ((TPM_CAPABILITY_AREA) 0x0000010A)
1874 #define TPM_CAP_PROP_TRANSESS ((TPM_CAPABILITY_AREA) 0x0000010B)
1875 #define TPM_CAP_PROP_COUNTERS ((TPM_CAPABILITY_AREA) 0x0000010C)
1876 #define TPM_CAP_PROP_MAX_AUTHSESS ((TPM_CAPABILITY_AREA) 0x0000010D)
1877 #define TPM_CAP_PROP_MAX_TRANSESS ((TPM_CAPABILITY_AREA) 0x0000010E)
1878 #define TPM_CAP_PROP_MAX_COUNTERS ((TPM_CAPABILITY_AREA) 0x0000010F)
1879 #define TPM_CAP_PROP_MAX_KEYS ((TPM_CAPABILITY_AREA) 0x00000110)
1880 #define TPM_CAP_PROP_OWNER ((TPM_CAPABILITY_AREA) 0x00000111)
1881 #define TPM_CAP_PROP_CONTEXT ((TPM_CAPABILITY_AREA) 0x00000112)
1882 #define TPM_CAP_PROP_MAX_CONTEXT ((TPM_CAPABILITY_AREA) 0x00000113)
1883 #define TPM_CAP_PROP_FAMILYROWS ((TPM_CAPABILITY_AREA) 0x00000114)
1884 #define TPM_CAP_PROP_TIS_TIMEOUT ((TPM_CAPABILITY_AREA) 0x00000115)
1885 #define TPM_CAP_PROP_STARTUP_EFFECT ((TPM_CAPABILITY_AREA) 0x00000116)
1886 #define TPM_CAP_PROP_DELEGATE_ROW ((TPM_CAPABILITY_AREA) 0x00000117)
1887 #define TPM_CAP_PROP_DAA_MAX ((TPM_CAPABILITY_AREA) 0x00000119)
1888 #define CAP_PROP_SESSION_DAA ((TPM_CAPABILITY_AREA) 0x0000011A)
1889 #define TPM_CAP_PROP_CONTEXT_DIST ((TPM_CAPABILITY_AREA) 0x0000011B)
1890 #define TPM_CAP_PROP_DAA_INTERRUPT ((TPM_CAPABILITY_AREA) 0x0000011C)
1891 #define TPM_CAP_PROP_SESSIONS ((TPM_CAPABILITY_AREA) 0x0000011D)
1892 #define TPM_CAP_PROP_MAX_SESSIONS ((TPM_CAPABILITY_AREA) 0x0000011E)
1893 #define TPM_CAP_PROP_CMK_RESTRICTION ((TPM_CAPABILITY_AREA) 0x0000011F)
1894 #define TPM_CAP_PROP_DURATION ((TPM_CAPABILITY_AREA) 0x00000120)
1895 #define TPM_CAP_PROP_ACTIVE_COUNTER ((TPM_CAPABILITY_AREA) 0x00000122)
1896 #define TPM_CAP_PROP_MAX_NV_AVAILABLE ((TPM_CAPABILITY_AREA) 0x00000123)
1897 #define TPM_CAP_PROP_INPUT_BUFFER ((TPM_CAPABILITY_AREA) 0x00000124)
1900 /// Part 2, section 21.6: TPM_CAP_VERSION_INFO
1901 /// [size_is(vendorSpecificSize)] BYTE* vendorSpecific;
1903 typedef struct tdTPM_CAP_VERSION_INFO
{
1904 TPM_STRUCTURE_TAG tag
;
1905 TPM_VERSION version
;
1908 UINT8 tpmVendorID
[4];
1909 UINT16 vendorSpecificSize
;
1910 UINT8
*vendorSpecific
;
1911 } TPM_CAP_VERSION_INFO
;
1914 // Part 2, section 22: DAA Structures
1918 // Part 2, section 22.1: Size definitions
1920 #define TPM_DAA_SIZE_r0 (43)
1921 #define TPM_DAA_SIZE_r1 (43)
1922 #define TPM_DAA_SIZE_r2 (128)
1923 #define TPM_DAA_SIZE_r3 (168)
1924 #define TPM_DAA_SIZE_r4 (219)
1925 #define TPM_DAA_SIZE_NT (20)
1926 #define TPM_DAA_SIZE_v0 (128)
1927 #define TPM_DAA_SIZE_v1 (192)
1928 #define TPM_DAA_SIZE_NE (256)
1929 #define TPM_DAA_SIZE_w (256)
1930 #define TPM_DAA_SIZE_issuerModulus (256)
1932 // Part 2, section 22.2: Constant definitions
1934 #define TPM_DAA_power0 (104)
1935 #define TPM_DAA_power1 (1024)
1938 /// Part 2, section 22.3: TPM_DAA_ISSUER
1940 typedef struct tdTPM_DAA_ISSUER
{
1941 TPM_STRUCTURE_TAG tag
;
1942 TPM_DIGEST DAA_digest_R0
;
1943 TPM_DIGEST DAA_digest_R1
;
1944 TPM_DIGEST DAA_digest_S0
;
1945 TPM_DIGEST DAA_digest_S1
;
1946 TPM_DIGEST DAA_digest_n
;
1947 TPM_DIGEST DAA_digest_gamma
;
1948 UINT8 DAA_generic_q
[26];
1952 /// Part 2, section 22.4: TPM_DAA_TPM
1954 typedef struct tdTPM_DAA_TPM
{
1955 TPM_STRUCTURE_TAG tag
;
1956 TPM_DIGEST DAA_digestIssuer
;
1957 TPM_DIGEST DAA_digest_v0
;
1958 TPM_DIGEST DAA_digest_v1
;
1959 TPM_DIGEST DAA_rekey
;
1964 /// Part 2, section 22.5: TPM_DAA_CONTEXT
1966 typedef struct tdTPM_DAA_CONTEXT
{
1967 TPM_STRUCTURE_TAG tag
;
1968 TPM_DIGEST DAA_digestContext
;
1969 TPM_DIGEST DAA_digest
;
1970 TPM_DAA_CONTEXT_SEED DAA_contextSeed
;
1971 UINT8 DAA_scratch
[256];
1976 /// Part 2, section 22.6: TPM_DAA_JOINDATA
1978 typedef struct tdTPM_DAA_JOINDATA
{
1979 UINT8 DAA_join_u0
[128];
1980 UINT8 DAA_join_u1
[138];
1981 TPM_DIGEST DAA_digest_n0
;
1985 /// Part 2, section 22.8: TPM_DAA_BLOB
1987 typedef struct tdTPM_DAA_BLOB
{
1988 TPM_STRUCTURE_TAG tag
;
1989 TPM_RESOURCE_TYPE resourceType
;
1991 TPM_DIGEST blobIntegrity
;
1992 UINT32 additionalSize
;
1993 UINT8
*additionalData
;
1994 UINT32 sensitiveSize
;
1995 UINT8
*sensitiveData
;
1999 /// Part 2, section 22.9: TPM_DAA_SENSITIVE
2001 typedef struct tdTPM_DAA_SENSITIVE
{
2002 TPM_STRUCTURE_TAG tag
;
2003 UINT32 internalSize
;
2004 UINT8
*internalData
;
2005 } TPM_DAA_SENSITIVE
;
2009 // Part 2, section 23: Redirection
2013 /// Part 2 section 23.1: TPM_REDIR_COMMAND
2014 /// This section defines exactly one value but does not
2015 /// give it a name. The definition of TPM_SetRedirection in Part3
2016 /// refers to exactly one name but does not give its value. We join
2019 #define TPM_REDIR_GPIO (0x00000001)
2022 /// TPM Command Headers defined in Part 3
2024 typedef struct tdTPM_RQU_COMMAND_HDR
{
2025 TPM_STRUCTURE_TAG tag
;
2027 TPM_COMMAND_CODE ordinal
;
2028 } TPM_RQU_COMMAND_HDR
;
2031 /// TPM Response Headers defined in Part 3
2033 typedef struct tdTPM_RSP_COMMAND_HDR
{
2034 TPM_STRUCTURE_TAG tag
;
2036 TPM_RESULT returnCode
;
2037 } TPM_RSP_COMMAND_HDR
;