Lines Matching +full:case +full:- +full:sensitive

10 Copyright © TCG 2006-2013
78 Copyright © TCG 2006-2013
176 Pre-processing ....................................................................................…
179 Start-up ..........................................................................................…
199 Copyright © TCG 2006-2013
320 Copyright © TCG 2006-2013
441 Copyright © TCG 2006-2013
534 Non-volatile Storage ..............................................................................…
564 Copyright © TCG 2006-2013
588 Copyright © TCG 2006-2013
601 Table 4 — Command-Independent Response Codes ......................................................…
640 Copyright © TCG 2006-2013
692 Copyright © TCG 2006-2013
744 Copyright © TCG 2006-2013
796 Copyright © TCG 2006-2013
848 Copyright © TCG 2006-2013
892 Copyright © TCG 2006-2013
951 Copyright © TCG 2006-2013
1019 column to indicate that the command may flush many objects and re-enumeration of the loaded
1043 Copyright © TCG 2006-2013
1093 command or response is TPM_ST_SESSIONS, then a 32-bit value will be present in the
1108 Copyright © TCG 2006-2013
1169 Copyright © TCG 2006-2013
1201 This is a corner case exception to the rule that TPM2_Startup() must be the first command.
1232 the handle shall reference a persistent object that is currently in TPM non-volatile memory
1246 Copyright © TCG 2006-2013
1335 Copyright © TCG 2006-2013
1375 a) The public and sensitive portions
1440 Copyright © TCG 2006-2013
1517 6) if policySession->commandLocality has been set, it shall match the locality of the command
1550 Copyright © TCG 2006-2013
1568 unmarshaled into a command-specific structure with the structure defined by the command schematic.
1569 Additionally, a response-specific output structure is assumed which will receive the values produce…
1578 parameters for use by the command-specific action code. No data movement need take place but it is
1601 Copyright © TCG 2006-2013
1656 a non-zero value was found in a reserved field of an attribute structure (TPMA_)
1695 audit data and will return a 10-octet response packet.
1705 Copyright © TCG 2006-2013
1731 Copyright © TCG 2006-2013
1750 A special case exists when the command tag parameter is not an allowed value (TPM_ST_SESSIONS or
1751 TPM_ST_NO_SESSIONS). For this case, it is assumed that the system software is attempting to send a
1777 Copyright © TCG 2006-2013
1786 Table 4 — Command-Independent Response Codes
1825 This response code indicates that the TPM is rate-limiting writes to the NV
1851 need an object 'slot'. The most common case where this might be returned is
1879 Copyright © TCG 2006-2013
1917 need a session 'slot'. The most common case where this might be returned is
1939 See Part 1, “Multi-tasking.”
1948 Copyright © TCG 2006-2013
1961 The actions code for each command makes assumptions about the behavior of various sub-systems.
1963 actions code is not written to anticipate all possible implementations of the sub-systems. Therefor…
1965 when the sub-system behavior changes.
1971 Copyright © TCG 2006-2013
1992 Pre-processing
2052 Copyright © TCG 2006-2013
2063 Start-up
2081 If the TPM performs self-tests after receiving _TPM_Init() and the TPM enters Failure mode before
2085 The means of signaling _TPM_Init shall be defined in the platform-specific specifications that defi…
2099 Copyright © TCG 2006-2013
2150 // No H-CRTM, yet.
2159 Copyright © TCG 2006-2013
2174 is necessary because of a system-wide reset. TPM2_Startup() is only valid after _TPM_Init Additional
2203 previous state of the TPM including the static Root of Trust for Measurement (S-RTM) PCR and the
2233 Copyright © TCG 2006-2013
2306 If a CRTM Event sequence is active, extend the PCR designated by the platform-specific
2312 the H-CRTM startup method is the same for this TPM2_Startup() as for the previous TPM2_Startup();
2321 PCR that are specified in a platform-specific specification to be preserved on TPM Resume are
2347 Copyright © TCG 2006-2013
2421 Copyright © TCG 2006-2013
2534 && in->startupType == TPM_SU_STATE
2540 if(in->startupType == TPM_SU_CLEAR && g_prevOrderlyState == TPM_SU_STATE)
2546 else if(in->startupType == TPM_SU_STATE && g_prevOrderlyState == TPM_SU_STATE)
2548 // For a resume, the H-CRTM startup method must be the same
2556 Copyright © TCG 2006-2013
2682 Copyright © TCG 2006-2013
2729 TPM-memory-resident session contexts;
2733 TPM-memory-resident transient objects; or
2737 TPM-memory-resident hash contexts created by TPM2_HashSequenceStart().
2751 Copyright © TCG 2006-2013
2813 Copyright © TCG 2006-2013
2884 if PCR bank has been re-configured, a CLEAR StateSave() is
2908 if(g_pcrReConfig && in->shutdownType == TPM_SU_STATE)
2912 PCRStateSave(in->shutdownType);
2919 if(in->shutdownType == TPM_SU_STATE)
2925 else if(in->shutdownType == TPM_SU_CLEAR)
2931 if(in->shutdownType == TPM_SU_CLEAR)
2933 else if(in->shutdownType == TPM_SU_STATE)
2941 Copyright © TCG 2006-2013
2965 Copyright © TCG 2006-2013
2997 If a self-test fails at any time, the TPM will enter Failure mode. While in Failure mode, the TPM w…
3005 Copyright © TCG 2006-2013
3022 a) return TPM_RC_TESTING and begin self-test of the required functions, or
3044 Copyright © TCG 2006-2013
3107 Copyright © TCG 2006-2013
3151 return CryptSelfTest(in->fullTest);
3158 Copyright © TCG 2006-2013
3214 Copyright © TCG 2006-2013
3282 Copyright © TCG 2006-2013
3324 return CryptIncrementalSelfTest(&in->toTest, &out->toDoList);
3331 Copyright © TCG 2006-2013
3345 This command returns manufacturer-specific information regarding the results of a self-test and an
3362 Copyright © TCG 2006-2013
3426 contains manufacturer-specific information
3429 Copyright © TCG 2006-2013
3469 out->testResult = CryptGetTestResult(&out->outData);
3477 Copyright © TCG 2006-2013
3563 Copyright © TCG 2006-2013
3639 Copyright © TCG 2006-2013
3759 Copyright © TCG 2006-2013
3880 in->nonceCaller.t.size < 16
3881 || in->nonceCaller.t.size > CryptGetHashDigestSize(in->authHash))
3884 if(in->tpmKey != TPM_RH_NULL)
3887 if(in->encryptedSalt.t.size == 0)
3890 tpmKey = ObjectGet(in->tpmKey);
3893 if(tpmKey->attributes.publicOnly)
3900 Copyright © TCG 2006-2013
3965 if(tpmKey->publicArea.objectAttributes.decrypt != SET)
3969 result = CryptSecretDecrypt(in->tpmKey, &in->nonceCaller, "SECRET",
3970 &in->encryptedSalt, &salt);
3977 if(in->encryptedSalt.t.size != 0)
3984 in->symmetric.algorithm != TPM_ALG_NULL
3985 && in->symmetric.algorithm != TPM_ALG_XOR
3986 && in->symmetric.mode.sym != TPM_ALG_CFB)
3995 result = SessionCreate(in->sessionType, in->authHash,
3996 &in->nonceCaller, &in->symmetric,
3997 in->bind, &salt, &out->sessionHandle);
4002 session = SessionGet(out->sessionHandle);
4004 out->nonceTPM = session->nonceTPM;
4012 Copyright © TCG 2006-2013
4037 Copyright © TCG 2006-2013
4099 Copyright © TCG 2006-2013
4153 session = SessionGet(in->sessionHandle);
4154 wasTrialSession = session->attributes.isTrialPolicy == SET;
4157 session->attributes.isTrialPolicy = wasTrialSession;
4165 Copyright © TCG 2006-2013
4184 data (creationData), its public area (outPublic), and its encrypted sensitive area (outPrivate). Pr…
4191 sensitive area loaded.
4196 The sensitive parameter may be encrypted using parameter encryption.
4198 is indicated as being TPM-generated, the value is filled in by bits from the RNG if the command is
4203 The TPM will create new data for the sensitive area and compute a TPMT_PUBLIC.unique from the
4204 sensitive area based on the object type:
4206 1) If inSensitive.data is the Empty Buffer, a TPM-generated key value is placed in the new object’s
4207 TPMT_SENSITIVE.sensitive.sym. The size of the key will be determined by
4211 inSensitive.data to TPMT_SENSITIVE.sensitive.sym of the new object.
4212 3) A TPM-generated obfuscation value is placed in TPMT_SENSITIVE.sensitive.seedValue. The
4214 value prevents the public unique value from leaking information about the sensitive area.
4219 unique ≔ HnameAlg(sensitive.seedValue.buffer || sensitive.any.buffer)
4224 1) If sensitive.data is not the Empty Buffer, then the TPM shall return TPM_RC_VALUE.
4230 Copyright © TCG 2006-2013
4239 2) A TPM-generated private key value is created with the size determined by the parameters of
4241 3) If the key is a Storage Key, a TPM-generated TPMT_SENSITIVE.symKey value is created;
4260 TPMT_SENSITIVE.sensitive of the new object.
4264 TPMT_SENSITIVE.sensitive.bits.data by MAX_SYM_DATA.
4276 3) If inSensitive.data is an Empty Buffer, a TPM-generated key value that is the size of the digest
4277 produced by the nameAlg in inPublic is placed in TPMT_SENSITIVE.sensitive.any.buffer.
4278 4) A TPM-generated obfuscation value that is the size of the digest produced by the nameAlg of
4287 The encryption key is derived from the symmetric seed in the sensitive area of the parent.
4309 Copyright © TCG 2006-2013
4352 the sensitive data
4430 Copyright © TCG 2006-2013
4450 non-duplicable storage key and its parent have different public
4455 sensitiveDataOrigin is CLEAR when 'sensitive. data' is an Empty
4456 Buffer, or is SET when 'sensitive. data' is not empty; fixedTPM,
4459 restricted, decrypt and sign attributes; attempt to inject sensitive data
4465 non-duplicable storage key and its parent have different name
4479 sensitive creation area; may also be returned if the TPM does not
4494 size of public auth policy or sensitive auth value does not match
4495 digest size of the name algorithm sensitive data size for the keyed
4500 a storage key with no symmetric algorithm specified; or non-storage
4505 unknown object type; non-duplicable storage key and its parent have
4507 decryption key in the storage hierarchy with both public and sensitive
4555 sensitive;
4559 Copyright © TCG 2006-2013
4633 parentObject = ObjectGet(in->parentHandle);
4640 (in->inPublic.t.publicArea.objectAttributes.sensitiveDataOrigin == SET)
4641 != (in->inSensitive.t.sensitive.data.t.size == 0))
4647 result = PublicAttributesValidation(FALSE, in->parentHandle,
4648 &in->inPublic.t.publicArea);
4651 // Validate the sensitive area values
4652 if( MemoryRemoveTrailingZeros(&in->inSensitive.t.sensitive.userAuth)
4653 > CryptGetHashDigestSize(in->inPublic.t.publicArea.nameAlg))
4657 result = CryptCreateObject(in->parentHandle, &in->inPublic.t.publicArea,
4658 &in->inSensitive.t.sensitive, &sensitive);
4662 FillInCreationData(in->parentHandle, in->inPublic.t.publicArea.nameAlg,
4663 &in->creationPCR, &in->outsideInfo,
4664 &out->creationData, &out->creationHash);
4666 out->outPublic.t.publicArea = in->inPublic.t.publicArea;
4668 ObjectComputeName(&(out->outPublic.t.publicArea), &name);
4670 TicketComputeCreation(EntityGetHierarchy(in->parentHandle), &name,
4671 &out->creationHash, &out->creationTicket);
4672 // Prepare output private data from sensitive
4673 SensitiveToPrivate(&sensitive, &name, in->parentHandle,
4674 out->outPublic.t.publicArea.nameAlg,
4675 &out->outPrivate);
4683 Copyright © TCG 2006-2013
4714 checked before the sensitive area is used, or unmarshaled.
4717 Checking the integrity before the data is used prevents attacks o n the sensitive area by fuzzing t…
4724 The TPM-computed Name is provided as a convenience to the caller for those cases where the
4732 For all objects, the size of the key in the sensitive area shall be consistent with the key size in…
4734 Before use, a loaded object shall be checked to validate that the public and sensitive portions are
4739 For a symmetric object, the unique value in the public area shall be the digest of the sensitive key
4744 For a two-prime RSA key, the remainder when dividing the public modulus by the private key shall
4756 Copyright © TCG 2006-2013
4845 Copyright © TCG 2006-2013
4967 sensitive;
4973 if(in->inPrivate.t.size == 0)
4975 parentObject = ObjectGet(in->parentHandle);
4983 if(parentObject->publicArea.objectAttributes.fixedTPM)
4990 Copyright © TCG 2006-2013
5049 if(in->inPublic.t.publicArea.objectAttributes.fixedTPM == SET)
5055 result = PublicAttributesValidation(TRUE, in->parentHandle,
5056 &in->inPublic.t.publicArea);
5061 ObjectComputeName(&in->inPublic.t.publicArea, &out->name);
5062 // Retrieve sensitive data. PrivateToSensitive() may return TPM_RC_INTEGRITY or
5065 result = PrivateToSensitive(&in->inPrivate, &out->name, in->parentHandle,
5066 in->inPublic.t.publicArea.nameAlg,
5067 &sensitive);
5072 hierarchy = ObjectGetHierarchy(in->parentHandle);
5076 result = ObjectLoad(hierarchy, &in->inPublic.t.publicArea, &sensitive,
5077 &out->name, in->parentHandle, skipChecks,
5078 &out->objectHandle);
5088 Copyright © TCG 2006-2013
5103 loading of a public area or both a public and sensitive area.
5107 Typical use for loading both a public and sensitive area is to allow the TPM to be used as a crypto
5112 public and sensitive portions of the object are loaded, hierarchy is required to be TPM_RH_NULL.
5143 and sensitive areas, but the TPM will validate that the size of the key in the sensitive area is co…
5155 sensitive portions cryptographically bound so that an attacker cannot mix pubic and sensitive areas.
5161 The TPM-computed Name is provided as a convenience to the caller for those cases where the
5168 Copyright © TCG 2006-2013
5194 Copyright © TCG 2006-2013
5229 the sensitive portion of the object (optional)
5280 Copyright © TCG 2006-2013
5301 both public and sensitive portions are loaded
5394 *sensitive;
5402 if(!HierarchyIsEnabled(in->hierarchy))
5405 if(in->inPublic.t.publicArea.authPolicy.t.size != 0
5406 && in->inPublic.t.publicArea.authPolicy.t.size !=
5407 CryptGetHashDigestSize(in->inPublic.t.publicArea.nameAlg))
5409 // For loading an object with both public and sensitive
5410 if(in->inPrivate.t.size != 0)
5413 if(in->hierarchy != TPM_RH_NULL)
5415 // An external object with a sensitive area must have fixedTPM == CLEAR
5422 Copyright © TCG 2006-2013
5465 in->inPublic.t.publicArea.objectAttributes.fixedTPM != CLEAR
5466 || in->inPublic.t.publicArea.objectAttributes.fixedParent != CLEAR
5467 || in->inPublic.t.publicArea.objectAttributes.restricted != CLEAR
5472 result = SchemeChecks(TRUE, TPM_RH_NULL, &in->inPublic.t.publicArea);
5477 ObjectComputeName(&in->inPublic.t.publicArea, &out->name);
5478 skipChecks = (in->inPublic.t.publicArea.nameAlg == TPM_ALG_NULL);
5479 // If a sensitive area was provided, load it
5480 if(in->inPrivate.t.size != 0)
5481 sensitive = &in->inPrivate.t.sensitiveArea;
5483 sensitive = NULL;
5486 result = ObjectLoad(in->hierarchy, &in->inPublic.t.publicArea,
5487 sensitive, &out->name, TPM_RH_NULL, skipChecks,
5488 &out->objectHandle);
5496 Copyright © TCG 2006-2013
5523 Copyright © TCG 2006-2013
5604 Copyright © TCG 2006-2013
5679 object = ObjectGet(in->objectHandle);
5685 out->outPublic.t.size = TPMT_PUBLIC_Marshal(&object->publicArea, NULL, NULL);
5687 out->outPublic.t.publicArea = object->publicArea;
5689 out->name.t.size = ObjectGetName(in->objectHandle, &out->name.t.name);
5691 ObjectGetQualifiedName(in->objectHandle, &out->qualifiedName);
5699 Copyright © TCG 2006-2013
5732 Copyright © TCG 2006-2013
5791 keyHandle algorithm-dependent encrypted seed that
5827 Copyright © TCG 2006-2013
5949 object = ObjectGet(in->keyHandle);
5951 activateObject = ObjectGet(in->activateHandle);
5954 !CryptIsAsymAlgorithm(object->publicArea.type)
5955 || object->publicArea.objectAttributes.decrypt == CLEAR
5956 || object->publicArea.objectAttributes.restricted == CLEAR)
5962 result = CryptSecretDecrypt(in->keyHandle, NULL,
5963 "IDENTITY", &in->secret, &data);
5973 Copyright © TCG 2006-2013
6001 result = CredentialToSecret(&in->credentialBlob,
6002 &activateObject->name,
6004 in->keyHandle,
6005 &out->certInfo);
6015 Copyright © TCG 2006-2013
6041 Copyright © TCG 2006-2013
6076 loaded public area, used to encrypt the sensitive area
6123 handle algorithm-dependent data that wraps the key
6127 Copyright © TCG 2006-2013
6230 object = ObjectGet(in->handle);
6234 !CryptIsAsymAlgorithm(object->publicArea.type)
6235 || object->publicArea.objectAttributes.decrypt == CLEAR
6236 || object->publicArea.objectAttributes.restricted == CLEAR
6241 if(in->credential.t.size > CryptGetHashDigestSize(object->publicArea.nameAlg))
6246 out->secret.t.size = sizeof(out->secret.t.secret);
6247 result = CryptSecretEncrypt(in->handle, "IDENTITY", &data, &out->secret);
6251 SecretToCredential(&in->credential, &in->objectName, (TPM2B_SEED *) &data,
6252 in->handle, &out->credentialBlob);
6260 Copyright © TCG 2006-2013
6277 A random, TPM-generated, Sealed Data Object may be created by the TPM with TPM2_Create() or
6291 Copyright © TCG 2006-2013
6362 Copyright © TCG 2006-2013
6423 object = ObjectGet(in->itemHandle);
6425 if(object->publicArea.type != TPM_ALG_KEYEDHASH)
6428 object->publicArea.objectAttributes.decrypt == SET
6429 || object->publicArea.objectAttributes.sign == SET
6430 || object->publicArea.objectAttributes.restricted == SET)
6434 MemoryCopy2B(&out->outData.b, &object->sensitive.sensitive.bits.b,
6435 sizeof(out->outData.t.buffer));
6443 Copyright © TCG 2006-2013
6457 This command is used to change the authorization secret for a TPM-resident object.
6458 If successful, a new private area for the TPM-resident object associated with objectHandle is retur…
6460 This command does not change the authorization of the TPM-resident object on which it operates.
6461 Therefore, the old authValue (of the TPM-resident object) is used when generating the response HMAC
6469 The TPM-resident object may be persistent and changing the authorization value of the persistent
6471 change the TPM-resident object.
6491 Copyright © TCG 2006-2013
6574 Copyright © TCG 2006-2013
6671 sensitive;
6678 object = ObjectGet(in->objectHandle);
6683 if( MemoryRemoveTrailingZeros(&in->newAuth)
6684 > CryptGetHashDigestSize(object->publicArea.nameAlg))
6690 ObjectGetQualifiedName(in->parentHandle, &parentQN);
6691 ObjectComputeQualifiedName(&parentQN, object->publicArea.nameAlg,
6692 &object->name, &QNCompare);
6693 ObjectGetQualifiedName(in->objectHandle, &objectQN);
6697 // Copy internal sensitive area
6698 sensitive = object->sensitive;
6700 sensitive.authValue = in->newAuth;
6701 // Prepare output private data from sensitive
6702 SensitiveToPrivate(&sensitive, &object->name, in->parentHandle,
6708 Copyright © TCG 2006-2013
6721 object->publicArea.nameAlg,
6722 &out->outPrivate);
6731 Copyright © TCG 2006-2013
6755 sensitive area could not be loaded in the TPM from which objectHandle is being duplicated.
6812 Copyright © TCG 2006-2013
6920 Copyright © TCG 2006-2013
7025 sensitive;
7039 object = ObjectGet(in->objectHandle);
7041 if(object->publicArea.objectAttributes.fixedParent == SET)
7044 if(object->publicArea.nameAlg == TPM_ALG_NULL)
7047 if(in->newParentHandle != TPM_RH_NULL
7048 && !ObjectIsStorage(in->newParentHandle))
7052 if(object->publicArea.objectAttributes.encryptedDuplication == SET)
7054 if(in->symmetricAlg.algorithm == TPM_ALG_NULL)
7056 if(in->newParentHandle == TPM_RH_NULL)
7062 Copyright © TCG 2006-2013
7127 if(in->symmetricAlg.algorithm == TPM_ALG_NULL)
7130 if(in->encryptionKeyIn.t.size != 0)
7136 innerKeySize = in->symmetricAlg.keyBits.sym;
7138 if(in->encryptionKeyIn.t.size != 0
7139 && in->encryptionKeyIn.t.size != (innerKeySize + 7) / 8)
7143 if(in->newParentHandle != TPM_RH_NULL)
7147 out->outSymSeed.t.size = sizeof(out->outSymSeed.t.secret);
7148 result = CryptSecretEncrypt(in->newParentHandle,
7149 "DUPLICATE", &data, &out->outSymSeed);
7158 out->outSymSeed.t.size = 0;
7160 // Copy sensitive area
7161 sensitive = object->sensitive;
7162 // Prepare output private data from sensitive
7163 SensitiveToDuplicate(&sensitive, &object->name, in->newParentHandle,
7164 object->publicArea.nameAlg, (TPM2B_SEED *) &data,
7165 &in->symmetricAlg, &in->encryptionKeyIn,
7166 &out->duplicate);
7167 out->encryptionKeyOut = in->encryptionKeyIn;
7175 Copyright © TCG 2006-2013
7192 to the methods appropriate for newParent and the blob is re-encrypted and a new integrity value is
7193 computed. The re-encrypted blob is returned in outDuplicate and the symmetric key returned in
7205 Copyright © TCG 2006-2013
7306 Copyright © TCG 2006-2013
7396 key, or unmarshal the private buffer to sensitive
7429 if((in->inSymSeed.t.size == 0 && in->oldParent != TPM_RH_NULL)
7430 || (in->inSymSeed.t.size != 0 && in->oldParent == TPM_RH_NULL))
7432 if(in->oldParent != TPM_RH_NULL)
7435 oldParent = ObjectGet(in->oldParent);
7437 if(!ObjectIsStorage(in->oldParent))
7442 result = CryptSecretDecrypt(in->oldParent, NULL,
7443 "DUPLICATE", &in->inSymSeed, &data);
7451 Copyright © TCG 2006-2013
7525 result = UnwrapOuter(in->oldParent, &in->name,
7526 oldParent->publicArea.nameAlg, (TPM2B_SEED *) &data,
7528 in->inDuplicate.t.size, in->inDuplicate.t.buffer);
7533 CryptGetHashDigestSize(oldParent->publicArea.nameAlg);
7534 privateBlob.t.size = in->inDuplicate.t.size - hashSize;
7535 MemoryCopy(privateBlob.t.buffer, in->inDuplicate.t.buffer + hashSize,
7541 privateBlob = in->inDuplicate;
7546 if(in->newParent != TPM_RH_NULL)
7550 newParent = ObjectGet(in->newParent);
7552 if(!ObjectIsStorage(in->newParent))
7557 out->outSymSeed.t.size = sizeof(out->outSymSeed.t.secret);
7558 result = CryptSecretEncrypt(in->newParent,
7559 "DUPLICATE", &data, &out->outSymSeed);
7564 CryptGetHashDigestSize(newParent->publicArea.nameAlg);
7565 out->outDuplicate.t.size = privateBlob.t.size;
7566 MemoryCopy(out->outDuplicate.t.buffer + hashSize, privateBlob.t.buffer,
7567 privateBlob.t.size, sizeof(out->outDuplicate.t.buffer));
7569 out->outDuplicate.t.size = ProduceOuterWrap(in->newParent, &in->name,
7570 newParent->publicArea.nameAlg,
7573 out->outDuplicate.t.size,
7574 out->outDuplicate.t.buffer);
7578 out->outSymSeed.t.size = 0;
7580 out->outDuplicate = privateBlob;
7587 Copyright © TCG 2006-2013
7605 Copyright © TCG 2006-2013
7625 Recovery of the sensitive data of the object occurs in the TPM in a three-step process in the follo…
7629 If present, the outer layer of symmetric encryption is removed. If inSymSeed has a non-zero size, t…
7658 by a non-zero value for duplicate.data.integrity.size. The integrity of the private area is validat…
7666 It is not necessary to validate that the sensitive area data is cryptographically bound to the publ…
7679 parent. So, it is sufficient to validate the object’s properties (attribute and public -private bin…
7683 checked before the sensitive area is used, or unmarshaled.
7688 Checking the integrity before the data is used prevents attacks on the sensitive area by fuzzing the
7695 Copyright © TCG 2006-2013
7705 The symmetric re-encryption is the normal integrity generation and symmetric encryption applied to
7712 Copyright © TCG 2006-2013
7823 the sensitive area encrypted with the symmetric key of
7827 Copyright © TCG 2006-2013
7850 non-duplicable storage key represented by objectPublic and its
7871 non-duplicable storage key represented by objectPublic and its
7877 secret; or unmarshaling sensitive value from duplicate failed the
7915 RSA key referenced by parentHandle; or unmarshaling sensitive
7921 non-storage key with symmetric algorithm different from
7926 unsupported type of objectPublic; or non-duplicable storage key
7943 Copyright © TCG 2006-2013
8039 sensitive;
8052 in->objectPublic.t.publicArea.objectAttributes.fixedTPM == SET
8053 || in->objectPublic.t.publicArea.objectAttributes.fixedParent == SET)
8056 parentObject = ObjectGet(in->parentHandle);
8059 if(in->symmetricAlg.algorithm != TPM_ALG_NULL)
8062 innerKeySize = in->symmetricAlg.keyBits.sym;
8064 if(in->encryptionKey.t.size != (innerKeySize + 7) / 8)
8071 if(in->encryptionKey.t.size != 0)
8075 if(in->inSymSeed.t.size != 0)
8080 result = CryptSecretDecrypt(in->parentHandle, NULL, "DUPLICATE",
8081 &in->inSymSeed, &data);
8091 ObjectComputeName(&(in->objectPublic.t.publicArea), &name);
8097 Copyright © TCG 2006-2013
8153 // Retrieve sensitive from private.
8155 result = DuplicateToSensitive(&in->duplicate, &name, in->parentHandle,
8156 in->objectPublic.t.publicArea.nameAlg,
8157 (TPM2B_SEED *) &data, &in->symmetricAlg,
8158 &in->encryptionKey, &sensitive);
8163 if(parentObject->publicArea.objectAttributes.fixedTPM == SET)
8171 result = PublicAttributesValidation(TRUE, in->parentHandle,
8172 &in->objectPublic.t.publicArea);
8177 result = ObjectLoad(TPM_RH_NULL, &in->objectPublic.t.publicArea,
8178 &sensitive, NULL, in->parentHandle, FALSE,
8187 // Prepare output private data from sensitive
8188 SensitiveToPrivate(&sensitive, &name, in->parentHandle,
8189 in->objectPublic.t.publicArea.nameAlg,
8190 &out->outPrivate);
8198 Copyright © TCG 2006-2013
8215 The commands in this clause provide low-level primitives for access to the asymmetric algorithms
8297 Copyright © TCG 2006-2013
8358 the last octet in label is not zero. If a zero octet occurs before label.buffer[label.size-1], the …
8377 Copyright © TCG 2006-2013
8475 Copyright © TCG 2006-2013
8555 the key referenced by keyHandle, or label is not a null-terminated
8583 rsaKey = ObjectGet(in->keyHandle);
8585 if(rsaKey->publicArea.type != TPM_ALG_RSA)
8588 if(rsaKey->publicArea.objectAttributes.decrypt != SET)
8591 if(in->label.t.size > 0)
8593 // label is present, so make sure that is it NULL-terminated
8594 if(in->label.t.buffer[in->label.t.size - 1] != 0)
8596 label = (char *)in->label.t.buffer;
8600 scheme = CryptSelectRSAScheme(in->keyHandle, &in->inScheme);
8606 out->outData.t.size = sizeof(out->outData.t.buffer);
8612 Copyright © TCG 2006-2013
8627 result = CryptEncryptRSA(&out->outData.t.size, out->outData.t.buffer, rsaKey,
8628 scheme, in->message.t.size, in->message.t.buffer,
8638 Copyright © TCG 2006-2013
8672 shall be a NULL-terminated string or the TPM will return TPM_RC_VALUE.
8688 Copyright © TCG 2006-2013
8782 Copyright © TCG 2006-2013
8890 rsaKey = ObjectGet(in->keyHandle);
8892 if(rsaKey->publicArea.type != TPM_ALG_RSA)
8896 rsaKey->publicArea.objectAttributes.restricted == SET
8897 || rsaKey->publicArea.objectAttributes.decrypt == CLEAR)
8904 NOTE: Proper operation of this command requires that the sensitive area
8906 to use the sensitive area of the key. In order to check the authorization,
8907 the sensitive area has to be loaded, even if authorization is with policy.
8909 // If label is present, make sure that it is a NULL-terminated string
8910 if(in->label.t.size > 0)
8912 // Present, so make sure that it is NULL-terminated
8913 if(in->label.t.buffer[in->label.t.size - 1] != 0)
8915 label = (char *)in->label.t.buffer;
8919 scheme = CryptSelectRSAScheme(in->keyHandle, &in->inScheme);
8926 Copyright © TCG 2006-2013
8955 out->message.t.size = sizeof(out->message.t.buffer);
8956 result = CryptDecryptRSA(&out->message.t.size, out->message.t.buffer, rsaKey,
8957 scheme, in->cipherText.t.size,
8958 in->cipherText.t.buffer,
8968 Copyright © TCG 2006-2013
8985 keyHandle shall refer to a loaded ECC key. The sensitive portion of this key need not be loaded.
9000 Copyright © TCG 2006-2013
9075 Copyright © TCG 2006-2013
9147 keyHandle does not reference a non-restricted decryption ECC key
9167 sensitive;
9171 eccKey = ObjectGet(in->keyHandle);
9172 // Input key must be a non-restricted, decrypt ECC key
9174 eccKey->publicArea.type != TPM_ALG_ECC
9175 || eccKey->publicArea.objectAttributes.restricted == SET
9176 || eccKey->publicArea.objectAttributes.decrypt != SET
9183 CryptNewEccKey(eccKey->publicArea.parameters.eccDetail.curveID,
9184 &out->pubPoint.t.point, &sensitive);
9185 out->pubPoint.t.size = TPMS_ECC_POINT_Marshal(&out->pubPoint.t.point,
9188 result = CryptEccPointMultiply(&out->zPoint.t.point,
9189 eccKey->publicArea.parameters.eccDetail.curveID,
9190 &sensitive, &eccKey->publicArea.unique.ecc);
9200 out->zPoint.t.size = TPMS_ECC_POINT_Marshal(&out->zPoint.t.point, NULL, NULL);
9209 Copyright © TCG 2006-2013
9237 Copyright © TCG 2006-2013
9315 Copyright © TCG 2006-2013
9335 keyHandle does not reference a non-restricted decryption ECC key
9403 eccKey = ObjectGet(in->keyHandle);
9404 // Input key must be a non-restricted, decrypt ECC key
9406 eccKey->publicArea.type != TPM_ALG_ECC
9407 || eccKey->publicArea.objectAttributes.restricted == SET
9408 || eccKey->publicArea.objectAttributes.decrypt != SET
9413 result = CryptEccPointMultiply(&out->outPoint.t.point,
9414 eccKey->publicArea.parameters.eccDetail.curveID,
9415 &eccKey->sensitive.sensitive.ecc,
9416 &in->inPoint.t.point);
9419 out->outPoint.t.size = TPMS_ECC_POINT_Marshal(&out->outPoint.t.point,
9429 Copyright © TCG 2006-2013
9443 This command returns the parameters of an ECC curve identified by its TCG-assigned curveID.
9503 Copyright © TCG 2006-2013
9557 if(CryptEccGetParameters(in->curveID, &out->parameters))
9570 This command supports two-phase key exchange protocols. The command is used in combination with
9579 The TPM will compute Z or Zs and Ze according to the selected scheme. If the scheme is not a two-ph…
9582 The two-phase key schemes that were assigned an algorithm ID as of the time of the publication of t…
9591 For TPM_ALG_ECDH outZ1 will be Zs and outZ2 will Ze as defined in 6.1.1.2 of SP800-56A.
9597 Copyright © TCG 2006-2013
9607 A non-restricted decryption key using ECDH may be used in either TPM2_ECDH_ZGen() or
9621 The Z values returned by the TPM are a full point and not ju st an x-coordinate.
9630 Copyright © TCG 2006-2013
9734 Copyright © TCG 2006-2013
9844 eccKey = ObjectGet(in->keyA);
9846 if(eccKey->publicArea.type != TPM_ALG_ECC)
9850 eccKey->publicArea.objectAttributes.restricted == SET
9851 || eccKey->publicArea.objectAttributes.decrypt != SET
9856 scheme = eccKey->publicArea.parameters.asymDetail.scheme.scheme;
9859 if(scheme != in->inScheme)
9863 scheme = in->inScheme;
9867 if(!CryptEccIsPointOnCurve(eccKey->publicArea.parameters.eccDetail.curveID,
9868 &in->inQsB.t.point))
9870 if(!CryptEccIsPointOnCurve(eccKey->publicArea.parameters.eccDetail.curveID,
9876 Copyright © TCG 2006-2013
9911 &in->inQeB.t.point))
9913 if(!CryptGenerateR(&r, &in->counter,
9914 eccKey->publicArea.parameters.eccDetail.curveID,
9918 result = CryptEcc2PhaseKeyExchange(&out->outZ1.t.point,
9919 &out->outZ2.t.point,
9920 eccKey->publicArea.parameters.eccDetail.curveID,
9922 &eccKey->sensitive.sensitive.ecc,
9924 &in->inQsB.t.point,
9925 &in->inQeB.t.point);
9928 CryptEndCommit(in->counter);
9937 Copyright © TCG 2006-2013
9952 The commands in this clause provide low-level primitives for access to the symmetric algorithms
9965 Copyright © TCG 2006-2013
9999 In Output Feedback (OFB), the output of the pseudo-random function (the block encryption
10042 Copyright © TCG 2006-2013
10062 incremental results and return TPM_RC_SUCCESS rather than TPM_RC_CANCEL. In such case,
10069 Copyright © TCG 2006-2013
10172 Copyright © TCG 2006-2013
10278 symKey = ObjectGet(in->keyHandle);
10281 symKey->publicArea.type != TPM_ALG_SYMCIPHER
10282 || symKey->attributes.publicOnly == SET)
10285 if( in->mode == TPM_ALG_NULL)
10286 in->mode = symKey->publicArea.parameters.symDetail.sym.mode.sym;
10290 symKey->publicArea.objectAttributes.restricted == SET
10291 && symKey->publicArea.parameters.symDetail.sym.mode.sym != in->mode)
10295 // TPM_ALG_NULL so setting in->mode to the mode of the key should have
10297 if(in->mode == TPM_ALG_NULL)
10301 keySize = symKey->publicArea.parameters.symDetail.sym.keyBits.sym;
10302 alg = symKey->publicArea.parameters.symDetail.sym.algorithm;
10305 (in->mode == TPM_ALG_ECB && in->ivIn.t.size != 0)
10306 || (in->mode != TPM_ALG_ECB && in->ivIn.t.size != blockSize))
10313 Copyright © TCG 2006-2013
10368 (in->mode == TPM_ALG_CBC || in->mode == TPM_ALG_ECB)
10369 && (in->inData.t.size % blockSize) != 0)
10374 out->ivOut = in->ivIn;
10376 key = symKey->sensitive.sensitive.sym.t.buffer;
10379 out->outData.t.size = in->inData.t.size;
10380 if(in->decrypt == YES)
10383 CryptSymmetricDecrypt(out->outData.t.buffer,
10385 keySize, in->mode, key,
10386 &(out->ivOut),
10387 in->inData.t.size,
10388 in->inData.t.buffer);
10393 CryptSymmetricEncrypt(out->outData.t.buffer,
10396 in->mode, key,
10397 &(out->ivOut),
10398 in->inData.t.size,
10399 in->inData.t.buffer);
10408 Copyright © TCG 2006-2013
10438 Copyright © TCG 2006-2013
10531 Copyright © TCG 2006-2013
10610 out->outHash.t.size = CryptStartHash(in->hashAlg, &hashState);
10612 CryptUpdateDigest2B(&hashState, &in->data.b);
10614 CryptCompleteHash2B(&hashState, &out->outHash.b);
10616 out->validation.tag = TPM_ST_HASHCHECK;
10617 out->validation.hierarchy = in->hierarchy;
10618 if(in->hierarchy == TPM_RH_NULL)
10621 out->validation.hierarchy = TPM_RH_NULL;
10622 out->validation.digest.t.size = 0;
10624 else if( in->data.t.size >= sizeof(TPM_GENERATED)
10625 && !TicketIsSafe(&in->data.b))
10628 out->validation.hierarchy = TPM_RH_NULL;
10629 out->validation.digest.t.size = 0;
10634 TicketComputeHashCheck(in->hierarchy, &out->outHash, &out->validation);
10643 Copyright © TCG 2006-2013
10680 Copyright © TCG 2006-2013
10763 Copyright © TCG 2006-2013
10869 hmacObject = ObjectGet(in->handle);
10870 publicArea = &hmacObject->publicArea;
10872 if(publicArea->type != TPM_ALG_KEYEDHASH)
10874 if(publicArea->objectAttributes.sign != SET)
10877 hashAlg = publicArea->parameters.keyedHashDetail.scheme.details.hmac.hashAlg;
10880 if(publicArea->objectAttributes.restricted == SET)
10882 if(in->hashAlg != TPM_ALG_NULL && in->hashAlg != hashAlg)
10887 // for a non-restricted key, use hashAlg if it is provided;
10888 if(in->hashAlg != TPM_ALG_NULL)
10889 hashAlg = in->hashAlg;
10901 Copyright © TCG 2006-2013
10923 out->outHMAC.t.size = CryptStartHMAC2B(hashAlg,
10924 &hmacObject->sensitive.sensitive.bits.b,
10927 CryptUpdateDigest2B(&hmacState, &in->buffer.b);
10929 CryptCompleteHMAC2B(&hmacState, &out->outHMAC.b);
10937 Copyright © TCG 2006-2013
10968 data returned by this command is TPM implementation-dependent.
10974 Copyright © TCG 2006-2013
11042 Copyright © TCG 2006-2013
11093 if(in->bytesRequested > sizeof(TPMU_HA))
11094 out->randomBytes.t.size = sizeof(TPMU_HA);
11096 out->randomBytes.t.size = in->bytesRequested;
11097 CryptGenerateRandom(out->randomBytes.t.size, out->randomBytes.t.buffer);
11105 Copyright © TCG 2006-2013
11122 The "additional information" is as defined in SP800 -90A.
11130 Copyright © TCG 2006-2013
11192 Copyright © TCG 2006-2013
11226 CryptStirRandom(in->inData.t.size, in->inData.t.buffer);
11234 Copyright © TCG 2006-2013
11263 The structure of a sequence object is vendor -dependent.
11273 hashAlg is TPM_ALG_NULL in which case it will use the default scheme of the key.
11373 Copyright © TCG 2006-2013
11455 Copyright © TCG 2006-2013
11560 hmacObject = ObjectGet(in->handle);
11561 publicArea = &hmacObject->publicArea;
11563 if(publicArea->type != TPM_ALG_KEYEDHASH)
11565 if(publicArea->objectAttributes.sign != SET)
11568 hashAlg = publicArea->parameters.keyedHashDetail.scheme.details.hmac.hashAlg;
11571 if(publicArea->objectAttributes.restricted == SET)
11573 if(in->hashAlg != TPM_ALG_NULL && in->hashAlg != hashAlg)
11578 // for a non-restricted key, use hashAlg if it is provided;
11579 if(in->hashAlg != TPM_ALG_NULL)
11580 hashAlg = in->hashAlg;
11593 Copyright © TCG 2006-2013
11613 in->handle,
11614 &in->auth,
11615 &out->sequenceHandle);
11622 Copyright © TCG 2006-2013
11648 Copyright © TCG 2006-2013
11723 Copyright © TCG 2006-2013
11776 if(in->hashAlg == TPM_ALG_NULL)
11779 return ObjectCreateEventSequence(&in->auth, &out->sequenceHandle);
11782 return ObjectCreateHashSequence(in->hashAlg, &in->auth, &out->sequenceHandle);
11789 Copyright © TCG 2006-2013
11825 Copyright © TCG 2006-2013
11895 Copyright © TCG 2006-2013
11985 object = ObjectGet(in->sequenceHandle);
11990 if(object->attributes.eventSeq == SET)
12000 CryptUpdateDigest2B(&hashObject->state.hashState[i], &in->buffer.b);
12008 if(hashObject->attributes.hashSeq == SET)
12011 if(hashObject->attributes.firstBlock == CLEAR)
12014 hashObject->attributes.firstBlock = SET;
12018 if(TicketIsSafe(&in->buffer.b))
12019 hashObject->attributes.ticketSafe = SET;
12022 CryptUpdateDigest2B(&hashObject->state.hashState[0], &in->buffer.b);
12028 Copyright © TCG 2006-2013
12050 else if(object->attributes.hmacSeq == SET)
12055 CryptUpdateDigest2B(&hashObject->state.hmacState, &in->buffer.b);
12065 Copyright © TCG 2006-2013
12105 Copyright © TCG 2006-2013
12196 Copyright © TCG 2006-2013
12290 object = ObjectGet(in->sequenceHandle);
12293 object->attributes.hashSeq == CLEAR
12294 && object->attributes.hmacSeq == CLEAR)
12297 if(object->attributes.hashSeq == SET)
12303 CryptUpdateDigest2B(&hashObject->state.hashState[0], &in->buffer.b);
12305 out->result.t.size
12307 CryptGetContextAlg(&hashObject->state.hashState[0]));
12308 CryptCompleteHash2B(&hashObject->state.hashState[0], &out->result.b);
12310 if(hashObject->attributes.firstBlock == CLEAR)
12314 if(TicketIsSafe(&in->buffer.b))
12315 hashObject->attributes.ticketSafe = SET;
12318 out->validation.tag = TPM_ST_HASHCHECK;
12319 out->validation.hierarchy = in->hierarchy;
12320 if(in->hierarchy == TPM_RH_NULL)
12323 out->validation.digest.t.size = 0;
12329 Copyright © TCG 2006-2013
12378 else if(object->attributes.ticketSafe == CLEAR)
12381 out->validation.hierarchy = TPM_RH_NULL;
12382 out->validation.digest.t.size = 0;
12387 TicketComputeHashCheck(out->validation.hierarchy,
12388 &out->result, &out->validation);
12399 CryptUpdateDigest2B(&hashObject->state.hmacState, &in->buffer.b);
12401 out->result.t.size =
12403 CryptGetContextAlg(&hashObject->state.hmacState.hashState));
12404 CryptCompleteHMAC2B(&(hashObject->state.hmacState), &out->result.b);
12406 out->validation.tag = TPM_ST_HASHCHECK;
12407 out->validation.hierarchy = TPM_RH_NULL;
12408 out->validation.digest.t.size = 0;
12412 object->attributes.evict = SET;
12420 Copyright © TCG 2006-2013
12448 Copyright © TCG 2006-2013
12532 Copyright © TCG 2006-2013
12634 hashObject = (HASH_OBJECT *)ObjectGet(in->sequenceHandle);
12636 if(hashObject->attributes.eventSeq != SET)
12639 if(in->pcrHandle != TPM_RH_NULL)
12642 if(!PCRIsExtendAllowed(in->pcrHandle))
12649 // state will have to change if this is a state-saved PCR regardless
12654 if(gp.orderlyState != SHUTDOWN_NONE && PCRIsStateSaved(in->pcrHandle))
12662 out->results.count = 0;
12671 Copyright © TCG 2006-2013
12704 CryptUpdateDigest2B(&hashObject->state.hashState[i], &in->buffer.b);
12706 out->results.digests[out->results.count].hashAlg = hashAlg;
12707 CryptCompleteHash(&hashObject->state.hashState[i],
12709 (BYTE *) &out->results.digests[out->results.count].digest);
12711 if(in->pcrHandle != TPM_RH_NULL)
12712 PCRExtend(in->pcrHandle, hashAlg,
12714 (BYTE *) &out->results.digests[out->results.count].digest);
12715 out->results.count++;
12719 hashObject->attributes.evict = SET;
12727 Copyright © TCG 2006-2013
12770 number. These values may be considered privacy-sensitive, because they would aid in the correlation…
12779 which the bits are added is implementation-dependent.
12801 Copyright © TCG 2006-2013
12817 Copyright © TCG 2006-2013
12832 …ic area with a given Name is selfconsistent and associated with a valid sensitive area. If a relyi…
12847 has not validated that the public area is associated with a matched sensitive area, then the public
12857 Copyright © TCG 2006-2013
12957 Copyright © TCG 2006-2013
13060 result = FillInAttestInfo(in->signHandle,
13061 &in->inScheme,
13062 &in->qualifyingData,
13076 ObjectGetName(in->objectHandle,
13079 ObjectGetQualifiedName(in->objectHandle,
13085 result = SignAttestInfo(in->signHandle,
13086 &in->inScheme,
13088 &in->qualifyingData,
13089 &out->certifyInfo,
13095 Copyright © TCG 2006-2013
13119 &out->signature);
13128 if(in->signHandle != TPM_RH_NULL)
13137 Copyright © TCG 2006-2013
13180 Copyright © TCG 2006-2013
13230 user-provided qualifying data
13290 Copyright © TCG 2006-2013
13399 name.t.size = ObjectGetName(in->objectHandle, &name.t.name);
13400 // Re-compute ticket
13401 TicketComputeCreation(in->creationTicket.hierarchy, &name,
13402 &in->creationHash, &ticket);
13404 if(!Memory2BEqual(&ticket.digest.b, &in->creationTicket.digest.b))
13408 result = FillInAttestInfo(in->signHandle, &in->inScheme, &in->qualifyingData,
13422 certifyInfo.attested.creation.creationHash = in->creationHash;
13428 Copyright © TCG 2006-2013
13466 result = SignAttestInfo(in->signHandle,
13467 &in->inScheme,
13469 &in->qualifyingData,
13470 &out->certifyInfo,
13471 &out->signature);
13479 if(in->signHandle != TPM_RH_NULL)
13488 Copyright © TCG 2006-2013
13516 Copyright © TCG 2006-2013
13611 Copyright © TCG 2006-2013
13715 result = FillInAttestInfo(in->signHandle,
13716 &in->inScheme,
13717 &in->qualifyingData,
13732 hashAlg = in->inScheme.details.any.hashAlg;
13737 &in->PCRselect,
13741 quoted.attested.quote.pcrSelect = in->PCRselect;
13747 Copyright © TCG 2006-2013
13786 result = SignAttestInfo(in->signHandle,
13787 &in->inScheme,
13789 &in->qualifyingData,
13790 &out->quoted,
13791 &out->signature);
13796 if(in->signHandle != TPM_RH_NULL)
13805 Copyright © TCG 2006-2013
13850 Copyright © TCG 2006-2013
13905 user-provided qualifying data – may be zero-length
13955 Copyright © TCG 2006-2013
14061 session = SessionGet(in->sessionHandle);
14063 if(session->attributes.isAudit == CLEAR)
14068 result = FillInAttestInfo(in->signHandle,
14069 &in->inScheme,
14070 &in->qualifyingData,
14088 Copyright © TCG 2006-2013
14125 auditInfo.attested.sessionAudit.sessionDigest = session->u2.auditDigest;
14127 if(g_exclusiveAuditSession == in->sessionHandle)
14135 result = SignAttestInfo(in->signHandle,
14136 &in->inScheme,
14138 &in->qualifyingData,
14139 &out->auditInfo,
14140 &out->signature);
14145 if(in->signHandle != TPM_RH_NULL)
14154 Copyright © TCG 2006-2013
14179 The way that the TPM tracks that the digest is clear is vendor -dependent. The reference
14193 Copyright © TCG 2006-2013
14291 Copyright © TCG 2006-2013
14393 result = FillInAttestInfo(in->signHandle,
14394 &in->inScheme,
14395 &in->qualifyingData,
14428 Copyright © TCG 2006-2013
14461 result = SignAttestInfo(in->signHandle,
14462 &in->inScheme,
14464 &in->qualifyingData,
14465 &out->auditInfo,
14466 &out->signature);
14470 if(in->signHandle != TPM_RH_NULL)
14485 Copyright © TCG 2006-2013
14521 correlate the obfuscated values with the clear -text values.
14527 Copyright © TCG 2006-2013
14616 standard TPM-generated attestation block
14628 Copyright © TCG 2006-2013
14730 result = FillInAttestInfo(in->signHandle,
14731 &in->inScheme,
14732 &in->qualifyingData,
14755 result = SignAttestInfo(in->signHandle,
14761 Copyright © TCG 2006-2013
14785 &in->inScheme,
14787 &in->qualifyingData,
14788 &out->timeInfo,
14789 &out->signature);
14794 if(in->signHandle != TPM_RH_NULL)
14803 Copyright © TCG 2006-2013
14821 …Mgenerated keys are only useful for a single operation. Some of these single-use keys are used in …
14844 pseudo-random values for the ephemeral keys. Instead of keeping the full value of the key in memory…
14846 new pseudo-random value.
14847 Using the counter to generate pseudo-random private ephemeral keys greatly simplifies tracking of k…
14860 Copyright © TCG 2006-2013
14908 a signing operation; values of i are 0 to 2n-1
14951 Copyright © TCG 2006-2013
14972 Copyright © TCG 2006-2013
15022 octet array used to derive x-coordinate of a base point
15073 least-significant 16 bits of commitCount
15079 Copyright © TCG 2006-2013
15201 eccKey = ObjectGet(in->signHandle);
15203 if(eccKey->publicArea.type != TPM_ALG_ECC)
15206 if(eccKey->publicArea.objectAttributes.restricted == SET)
15208 if(eccKey->publicArea.objectAttributes.sign != SET)
15211 eccKey->publicArea.parameters.eccDetail.scheme.scheme))
15217 if(in->s2.t.size)
15221 if((in->s2.t.size == 0) != (in->y2.t.size == 0))
15227 Copyright © TCG 2006-2013
15304 eccKey->publicArea.parameters.eccDetail.curveID);
15314 eccKey->publicArea.parameters.eccDetail.curveID,
15315 &eccKey->name))
15318 if(in->s2.t.size != 0)
15322 MemoryCopy2B(&P2.y.b, &in->y2.b, sizeof(P2.y.t.buffer));
15326 hashResults = CryptHashBlock(eccKey->publicArea.nameAlg,
15327 in->s2.t.size,
15328 in->s2.t.buffer,
15329 p->size,
15340 if(!CryptEccIsPointOnCurve(eccKey->publicArea.parameters.eccDetail.curveID,
15343 if(eccKey->attributes.publicOnly == SET)
15350 if(in->P1.t.size > 4)
15357 Copyright © TCG 2006-2013
15398 pP1 = &in->P1.t.point;
15399 if(!CryptEccIsPointOnCurve(eccKey->publicArea.parameters.eccDetail.curveID,
15407 result = CryptCommitCompute(&out->K.t.point,
15408 &out->L.t.point,
15409 &out->E.t.point,
15410 eccKey->publicArea.parameters.eccDetail.curveID,
15413 &eccKey->sensitive.sensitive.ecc,
15417 out->K.t.size = TPMS_ECC_POINT_Marshal(&out->K.t.point, NULL, NULL);
15418 out->L.t.size = TPMS_ECC_POINT_Marshal(&out->L.t.point, NULL, NULL);
15419 out->E.t.size = TPMS_ECC_POINT_Marshal(&out->E.t.point, NULL, NULL);
15422 out->counter = CryptCommit();
15431 Copyright © TCG 2006-2013
15445 TPM2_EC_Ephemeral() creates an ephemeral key for use in a two-phase key exchange protocol.
15453 Copyright © TCG 2006-2013
15521 least-significant 16 bits of commitCount
15527 Copyright © TCG 2006-2013
15596 in->curveID,
15599 CryptEccPointMultiply(&out->Q.t.point, in->curveID, &r, NULL);
15601 out->counter = CryptCommit();
15610 Copyright © TCG 2006-2013
15641 The sensitive area of the symmetric object is required to allow verification of the symmetric
15648 Copyright © TCG 2006-2013
15727 Copyright © TCG 2006-2013
15834 signObject = ObjectGet(in->keyHandle);
15836 if(signObject->publicArea.objectAttributes.sign != SET)
15838 // If it doesn't have a sensitive area loaded
15841 signObject->attributes.publicOnly == SET
15842 && signObject->publicArea.type == TPM_ALG_KEYEDHASH
15847 result = CryptVerifySignature(in->keyHandle, &in->digest, &in->signature);
15851 hierarchy = ObjectGetHierarchy(in->keyHandle);
15854 || signObject->publicArea.nameAlg == TPM_ALG_NULL)
15858 out->validation.tag = TPM_ST_VERIFIED;
15859 out->validation.hierarchy = TPM_RH_NULL;
15860 out->validation.digest.t.size = 0;
15869 Copyright © TCG 2006-2013
15887 name.t.size = ObjectGetName(in->keyHandle, &name.t.name);
15889 TicketComputeVerified(hierarchy, &in->digest, &name, &out->validation);
15898 Copyright © TCG 2006-2013
15949 Copyright © TCG 2006-2013
16041 Copyright © TCG 2006-2013
16148 signKey = ObjectGet(in->keyHandle);
16151 in->validation.digest.t.size != 0
16152 || signKey->publicArea.objectAttributes.restricted == SET)
16155 TicketComputeHashCheck(in->validation.hierarchy, &in->digest, &ticket);
16156 if(!Memory2BEqual(&in->validation.digest.b, &ticket.digest.b))
16162 result = CryptSelectSignScheme(in->keyHandle, &in->inScheme);
16172 result = CryptSign(in->keyHandle, &in->inScheme, &in->digest, &out->signature);
16178 Copyright © TCG 2006-2013
16197 Copyright © TCG 2006-2013
16249 Copyright © TCG 2006-2013
16293 Copyright © TCG 2006-2013
16378 Copyright © TCG 2006-2013
16479 in->auditAlg != TPM_ALG_NULL
16480 && in->auditAlg != gp.auditHashAlg)
16483 if(in->setList.count != 0 || in->clearList.count != 0)
16486 gp.auditHashAlg = in->auditAlg;
16496 for(i = 0; i < in->setList.count; i++)
16498 if(CommandAuditSet(in->setList.commandCodes[i]))
16501 for(i = 0; i < in->clearList.count; i++)
16503 if(CommandAuditClear(in->clearList.commandCodes[i]))
16514 Copyright © TCG 2006-2013
16535 Copyright © TCG 2006-2013
16552 In TPM 1.2, an Event was hashed using SHA-1 and then the 20-octet digest was extended to a PCR
16565 an authorization policy. The platform-specific specifications determine which PCR may be controlled…
16571 If a platform-specific specification indicates that PCR are grouped, then all the PCR in the group …
16574 modifies (Extends or resets) a PCR unless the platform-specific specification explicitly excludes t…
16581 A platform-specific specification may designate a set of PCR that are under control of the TCB. The…
16593 Copyright © TCG 2006-2013
16644 the bank-specific data to be extended
16684 Copyright © TCG 2006-2013
16756 Copyright © TCG 2006-2013
16856 data left over. In either case, it will cause an unmarshaling error and this
16860 if(in->pcrHandle == TPM_RH_NULL)
16863 if(!PCRIsExtendAllowed(in->pcrHandle))
16867 if(PCRIsStateSaved(in->pcrHandle) && gp.orderlyState != SHUTDOWN_NONE)
16875 for(i = 0; i < in->digests.count; i++)
16877 PCRExtend(in->pcrHandle, in->digests.digests[i].hashAlg,
16878 CryptGetHashDigestSize(in->digests.digests[i].hashAlg),
16879 (BYTE *) &in->digests.digests[i].digest);
16888 Copyright © TCG 2006-2013
16929 Copyright © TCG 2006-2013
17005 Copyright © TCG 2006-2013
17103 if(in->pcrHandle != TPM_RH_NULL)
17106 if(!PCRIsExtendAllowed(in->pcrHandle))
17110 if(PCRIsStateSaved(in->pcrHandle) && gp.orderlyState != SHUTDOWN_NONE)
17118 out->digests.count = HASH_COUNT;
17123 out->digests.digests[i].hashAlg = hash;
17125 CryptUpdateDigest2B(&hashState, &in->eventData.b);
17127 (BYTE *) &out->digests.digests[i].digest);
17128 if(in->pcrHandle != TPM_RH_NULL)
17129 PCRExtend(in->pcrHandle, hash, size,
17130 (BYTE *) &out->digests.digests[i].digest);
17139 Copyright © TCG 2006-2013
17174 Copyright © TCG 2006-2013
17255 Copyright © TCG 2006-2013
17303 PCRRead(&in->pcrSelectionIn, &out->pcrValues, &out->pcrUpdateCounter);
17304 out->pcrSelectionOut = in->pcrSelectionIn;
17312 Copyright © TCG 2006-2013
17354 Copyright © TCG 2006-2013
17449 Copyright © TCG 2006-2013
17526 out->allocationSuccess = PCRAllocate(&in->pcrAllocation, &out->maxPCR,
17527 &out->sizeNeeded, &out->sizeAvailable);
17528 // if re-configuration succeeds, set the flag to indicate PCR configuration is
17530 if(out->allocationSuccess == YES)
17539 Copyright © TCG 2006-2013
17555 A policy may only be associated with a PCR that has been defined by a platform-specific specificati…
17558 A platform-specific specification may group PCR so that they share a common policy. In such case, a
17563 PCR will be set to the default value defined in the platform-specific specification.
17586 Copyright © TCG 2006-2013
17668 Copyright © TCG 2006-2013
17755 if(in->authPolicy.t.size != CryptGetHashDigestSize(in->policyDigest))
17758 if(!PCRBelongsPolicyGroup(in->pcrNum, &groupIndex))
17762 gp.pcrPolicies.hashAlg[groupIndex] = in->policyDigest;
17763 gp.pcrPolicies.policy[groupIndex] = in->authPolicy;
17773 Copyright © TCG 2006-2013
17788 An authValue may only be associated with a PCR that has been defined by a platform-specific
17790 authorization for pcrNum, the TPM shall return TPM_RC_VALUE. A platform-specific specification may
17791 group PCR so that they share a common authorization value. In such case, a pcrNum that selects any …
17800 Copyright © TCG 2006-2013
17871 Copyright © TCG 2006-2013
17944 if(!PCRBelongsAuthGroup(in->pcrHandle, &groupIndex))
17947 // state clear data. If this is the case, Check if NV is available.
17958 gc.pcrAuthValues.auth[groupIndex] = in->auth;
17966 Copyright © TCG 2006-2013
17991 TPM_RC_LOCALITY is returned because the reset attributes are defined on a per -locality basis.
17997 Copyright © TCG 2006-2013
18061 Copyright © TCG 2006-2013
18134 if(!PCRIsResetAllowed(in->pcrHandle))
18138 if(PCRIsStateSaved(in->pcrHandle) && gp.orderlyState != SHUTDOWN_NONE)
18147 PCRSetValue(in->pcrHandle, 0);
18150 PCRChanged(in->pcrHandle);
18158 Copyright © TCG 2006-2013
18173 Measurement (D-CRTM) measurement sequence. On receipt of this indication, the TPM will initialize an
18177 A platform-specific specification may allow this indication before TPM2_Startup().
18189 Copyright © TCG 2006-2013
18276 // slot numbers and handle numbers. To handle the general case, scan for
18306 Copyright © TCG 2006-2013
18330 Copyright © TCG 2006-2013
18405 pAssert(hashObject->attributes.eventSeq);
18412 CryptUpdateDigest(&hashObject->state.hashState[i], dataSize, data);
18421 Copyright © TCG 2006-2013
18442 the platform-specific specifications as resettable by this event to the value indicated in the plat…
18452 index for CRTM PCR designated by a platform-specific
18461 initialization value specified in the platform-specific specification
18469 a platform-specific specification excludes modifications of PCR[DRTM] from causing an increment.
18470 A platform-specific specification may allow an H-CRTM Event Sequence before TPM2_Startup(). If so,
18471 _TPM_Hash_End will complete the digest, initialize PCR[0] with a digest-size value of 4, and then e…
18472 the H-CRTM Event Sequence data into PCR[0].
18485 Copyright © TCG 2006-2013
18602 CryptCompleteHash2B(&hashObject->state.hashState[i], &digest.b);
18604 // If this is H-DRTM, copy to HCRM PCR
18615 Copyright © TCG 2006-2013
18647 Copyright © TCG 2006-2013
18696 Copyright © TCG 2006-2013
18729 is non-zero, then the TPM shall return TPM_RC_EXPIRED.
18777 Copyright © TCG 2006-2013
18833 PolicyUpdate() uses two hashes because arg2 and arg3 are variable-sized and the concatenation of
18842 Copyright © TCG 2006-2013
18919 Copyright © TCG 2006-2013
18970 implementation-specific representation of the expiration time of
18996 Copyright © TCG 2006-2013
19040 time limit on authorization set by authorizing object. This 32-bit
19077 Copyright © TCG 2006-2013
19101 Copyright © TCG 2006-2013
19220 implementation-specific time value, used to indicate to
19228 the command was non-zero; this ticket will use the
19232 Copyright © TCG 2006-2013
19256 expiration indicates a time in the past or expiration is non-zero but no
19261 authObject need to have sensitive portion loaded
19352 expiration = (in->expiration < 0)
19353 ? -(in->expiration) : in->expiration;
19363 session = SessionGet(in->policySession);
19364 authObject = ObjectGet(in->authObject);
19374 if(session->attributes.isTrialPolicy == CLEAR)
19377 authTimeout = expiration * 1000 + session->startTime;
19379 &in->cpHashA, &in->nonceTPM,
19389 Copyright © TCG 2006-2013
19463 // Re-compute the digest being signed
19482 This 32-bit value is set to zero if the expiration
19501 authHash.t.size = CryptStartHash(CryptGetSignHashAlg(&in->auth),
19504 CryptUpdateDigest2B(&hashState, &in->nonceTPM.b);
19506 CryptUpdateDigestInt(&hashState, sizeof(UINT32), (BYTE*) &in->expiration);
19508 CryptUpdateDigest2B(&hashState, &in->cpHashA.b);
19510 CryptUpdateDigest2B(&hashState, &in->policyRef.b);
19515 result = CryptVerifySignature(in->authObject, &authHash, &in->auth);
19521 entityName.t.size = EntityGetName(in->authObject, &entityName.t.name);
19524 PolicyContextUpdate(TPM_CC_PolicySigned, &entityName, &in->policyRef,
19525 &in->cpHashA, authTimeout, session);
19527 // Create ticket and timeout buffer if in->expiration < 0 and this is not
19530 // when expiration is non-zero.
19532 in->expiration < 0
19533 && session->attributes.isTrialPolicy == CLEAR
19540 Copyright © TCG 2006-2013
19580 // TPM-specific.
19582 // array and it may not be aligned to accept a 64-bit value. The method
19583 // used has the side-effect of making the returned value a big-endian,
19584 // 64-bit value that is byte aligned.
19585 out->timeout.t.size = sizeof(UINT64);
19586 UINT64_TO_BYTE_ARRAY(authTimeout, out->timeout.t.buffer);
19588 TicketComputeAuth(TPM_ST_AUTH_SIGNED, EntityGetHierarchy(in->authObject),
19589 authTimeout, &in->cpHashA, &in->policyRef, &entityName,
19590 &out->policyTicket);
19596 out->timeout.t.size = 0;
19598 out->policyTicket.tag = TPM_ST_AUTH_SIGNED;
19599 out->policyTicket.hierarchy = TPM_RH_NULL;
19600 out->policyTicket.digest.t.size = 0;
19609 Copyright © TCG 2006-2013
19623 This command includes a secret-based authorization to a policy. The caller proves knowledge of the
19661 Copyright © TCG 2006-2013
19770 implementation-specific time value used to indicate to
19779 the command was non-zero
19785 Copyright © TCG 2006-2013
19889 expiration = (in->expiration < 0)
19890 ? -(in->expiration) : in->expiration;
19900 session = SessionGet(in->policySession);
19902 if(session->attributes.isTrialPolicy == CLEAR)
19905 authTimeout = expiration * 1000 + session->startTime;
19907 &in->cpHashA, &in->nonceTPM,
19916 entityName.t.size = EntityGetName(in->authHandle, &entityName.t.name);
19919 PolicyContextUpdate(TPM_CC_PolicySecret, &entityName, &in->policyRef,
19925 Copyright © TCG 2006-2013
19973 &in->cpHashA, authTimeout, session);
19975 // Create ticket and timeout buffer if in->expiration < 0 and this is not
19978 // when expiration is non-zero.
19980 in->expiration < 0
19981 && session->attributes.isTrialPolicy == CLEAR
19985 // TPM-specific.
19987 // array and it may not be aligned to accept a 64-bit value. The method
19988 // used has the side-effect of making the returned value a big-endian,
19989 // 64-bit value that is byte aligned.
19990 out->timeout.t.size = sizeof(UINT64);
19991 UINT64_TO_BYTE_ARRAY(authTimeout, out->timeout.t.buffer);
19993 TicketComputeAuth(TPM_ST_AUTH_SECRET, EntityGetHierarchy(in->authHandle),
19994 authTimeout, &in->cpHashA, &in->policyRef,
19995 &entityName, &out->policyTicket);
20000 out->timeout.t.size = 0;
20002 out->policyTicket.tag = TPM_ST_AUTH_SECRET;
20003 out->policyTicket.hierarchy = TPM_RH_NULL;
20004 out->policyTicket.digest.t.size = 0;
20013 Copyright © TCG 2006-2013
20049 Copyright © TCG 2006-2013
20151 Copyright © TCG 2006-2013
20258 session = SessionGet(in->policySession);
20265 if(session->attributes.isTrialPolicy)
20267 // Restore timeout data. The format of timeout buffer is TPM-specific.
20270 if(in->timeout.t.size != sizeof(UINT64))
20272 timeout = BYTE_ARRAY_TO_UINT64(in->timeout.t.buffer);
20275 &in->cpHashA, NULL,
20283 // Re-generate policy ticket by input parameters
20284 TicketComputeAuth(in->ticket.tag, in->ticket.hierarchy, timeout, &in->cpHashA,
20285 &in->policyRef, &in->authName, &ticketToCompare);
20291 Copyright © TCG 2006-2013
20325 if(!Memory2BEqual(&in->ticket.digest.b, &ticketToCompare.digest.b))
20330 if(in->ticket.tag == TPM_ST_AUTH_SIGNED)
20332 else if(in->ticket.tag == TPM_ST_AUTH_SECRET)
20339 PolicyContextUpdate(commandCode, &in->authName, &in->policyRef,
20340 &in->cpHashA, timeout, session);
20348 Copyright © TCG 2006-2013
20404 Copyright © TCG 2006-2013
20473 Copyright © TCG 2006-2013
20564 session = SessionGet(in->policySession);
20566 for(i = 0; i < in->pHashList.count; i++)
20569 session->attributes.isTrialPolicy == SET
20570 || (Memory2BEqual(&session->u2.policyDigest.b,
20571 &in->pHashList.digests[i].b))
20580 session->u2.policyDigest.t.size = CryptStartHash(session->authHashAlg,
20583 MemorySet(session->u2.policyDigest.t.buffer, 0,
20584 session->u2.policyDigest.t.size);
20585 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
20589 for(i = 0; i < in->pHashList.count; i++)
20592 CryptUpdateDigest2B(&hashState, &in->pHashList.digests[i].b);
20595 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
20606 Copyright © TCG 2006-2013
20622 Copyright © TCG 2006-2013
20703 Copyright © TCG 2006-2013
20779 Copyright © TCG 2006-2013
20885 session = SessionGet(in->policySession);
20887 if(session->attributes.isTrialPolicy == CLEAR)
20890 if(session->pcrCounter != 0 && session->pcrCounter != gr.pcrCounter)
20893 PCRComputeCurrentDigest(session->authHashAlg, &in->pcrs, &pcrDigest);
20896 if(in->pcrDigest.t.size != 0)
20898 if(!Memory2BEqual(&in->pcrDigest.b, &pcrDigest.b))
20905 pcrDigest = in->pcrDigest;
20914 CryptStartHash(session->authHashAlg, &hashState);
20916 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
20922 Copyright © TCG 2006-2013
20958 pcrSize = TPML_PCR_SELECTION_Marshal(&in->pcrs, &buffer, NULL);
20963 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
20965 if(session->attributes.isTrialPolicy == CLEAR)
20967 session->pcrCounter = gr.pcrCounter;
20976 Copyright © TCG 2006-2013
21015 Copyright © TCG 2006-2013
21084 Copyright © TCG 2006-2013
21187 session = SessionGet(in->policySession);
21190 marshalSize = TPMA_LOCALITY_Marshal(&in->locality, &buffer, NULL);
21196 TPMA_LOCALITY_Marshal(&session->commandLocality, &buffer, NULL);
21218 Copyright © TCG 2006-2013
21290 CryptStartHash(session->authHashAlg, &hashState);
21292 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
21298 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
21302 TPMA_LOCALITY_Unmarshal(&session->commandLocality, &buffer,
21311 Copyright © TCG 2006-2013
21385 The signed arithmetic operations are performed using twos-compliment.
21391 written. It is possible to use this change in the NV Index to create a write-once Index.
21397 Copyright © TCG 2006-2013
21493 Copyright © TCG 2006-2013
21607 nvBuffer[sizeof(in->operandB.t.buffer)];
21618 NvGetIndexInfo(in->nvIndex, &nvIndex);
21620 session = SessionGet(in->policySession);
21622 if(session->attributes.isTrialPolicy == CLEAR)
21627 result = NvReadAccessChecks(in->authHandle, in->nvIndex);
21630 if((nvIndex.publicArea.dataSize - in->offset) < in->operandB.t.size)
21634 NvGetIndexData(in->nvIndex, &nvIndex, in->offset,
21635 in->operandB.t.size, nvBuffer);
21636 switch(in->operation)
21642 Copyright © TCG 2006-2013
21716 case TPM_EO_EQ:
21718 if(CryptCompare(in->operandB.t.size, nvBuffer,
21719 in->operandB.t.size, in->operandB.t.buffer)
21722 case TPM_EO_NEQ:
21724 if(CryptCompare(in->operandB.t.size, nvBuffer,
21725 in->operandB.t.size, in->operandB.t.buffer)
21728 case TPM_EO_SIGNED_GT:
21730 if(CryptCompareSigned(in->operandB.t.size, nvBuffer,
21731 in->operandB.t.size, in->operandB.t.buffer)
21734 case TPM_EO_UNSIGNED_GT:
21736 if(CryptCompare(in->operandB.t.size, nvBuffer,
21737 in->operandB.t.size, in->operandB.t.buffer)
21740 case TPM_EO_SIGNED_LT:
21742 if(CryptCompareSigned(in->operandB.t.size, nvBuffer,
21743 in->operandB.t.size, in->operandB.t.buffer)
21746 case TPM_EO_UNSIGNED_LT:
21748 if(CryptCompare(in->operandB.t.size, nvBuffer,
21749 in->operandB.t.size, in->operandB.t.buffer)
21752 case TPM_EO_SIGNED_GE:
21754 if(CryptCompareSigned(in->operandB.t.size, nvBuffer,
21755 in->operandB.t.size, in->operandB.t.buffer)
21758 case TPM_EO_UNSIGNED_GE:
21760 if(CryptCompare(in->operandB.t.size, nvBuffer,
21761 in->operandB.t.size, in->operandB.t.buffer)
21764 case TPM_EO_SIGNED_LE:
21766 if(CryptCompareSigned(in->operandB.t.size, nvBuffer,
21767 in->operandB.t.size, in->operandB.t.buffer)
21770 case TPM_EO_UNSIGNED_LE:
21772 if(CryptCompare(in->operandB.t.size, nvBuffer,
21773 in->operandB.t.size, in->operandB.t.buffer)
21776 case TPM_EO_BITSET:
21784 Copyright © TCG 2006-2013
21875 for (i = 0; i < in->operandB.t.size; i++)
21876 if((nvBuffer[i] & in->operandB.t.buffer[i])
21877 != in->operandB.t.buffer[i])
21881 case TPM_EO_BITCLEAR:
21885 for (i = 0; i < in->operandB.t.size; i++)
21886 if((nvBuffer[i] & in->operandB.t.buffer[i]) != 0)
21897 argHash.t.size = CryptStartHash(session->authHashAlg, &hashState);
21899 CryptUpdateDigest2B(&hashState, &in->operandB.b);
21901 CryptUpdateDigestInt(&hashState, sizeof(UINT16), &in->offset);
21903 CryptUpdateDigestInt(&hashState, sizeof(TPM_EO), &in->operation);
21908 CryptStartHash(session->authHashAlg, &hashState);
21910 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
21916 nvName.t.size = EntityGetName(in->nvIndex, &nvName.t.name);
21919 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
21927 Copyright © TCG 2006-2013
21990 The signed arithmetic operations are performed using twos-compliment.
21998 Copyright © TCG 2006-2013
22083 Copyright © TCG 2006-2013
22191 // The time and clock vales are the first two 64-bit values in the clock
22192 if(in->offset < <K>sizeof(UINT64) + sizeof(UINT64))
22202 session = SessionGet(in->policySession);
22204 if(session->attributes.isTrialPolicy == CLEAR)
22208 result = TimeGetRange(in->offset, in->operandB.t.size, &infoData);
22211 switch(in->operation)
22213 case TPM_EO_EQ:
22215 if(CryptCompare(in->operandB.t.size, infoData,
22216 in->operandB.t.size, in->operandB.t.buffer) != 0)
22219 case TPM_EO_NEQ:
22221 if(CryptCompare(in->operandB.t.size, infoData,
22227 Copyright © TCG 2006-2013
22300 in->operandB.t.size, in->operandB.t.buffer)
22303 case TPM_EO_SIGNED_GT:
22305 if(CryptCompareSigned(in->operandB.t.size, infoData,
22306 in->operandB.t.size, in->operandB.t.buffer)
22309 case TPM_EO_UNSIGNED_GT:
22311 if(CryptCompare(in->operandB.t.size, infoData,
22312 in->operandB.t.size, in->operandB.t.buffer)
22315 case TPM_EO_SIGNED_LT:
22317 if(CryptCompareSigned(in->operandB.t.size, infoData,
22318 in->operandB.t.size, in->operandB.t.buffer)
22321 case TPM_EO_UNSIGNED_LT:
22323 if(CryptCompare(in->operandB.t.size, infoData,
22324 in->operandB.t.size, in->operandB.t.buffer)
22327 case TPM_EO_SIGNED_GE:
22329 if(CryptCompareSigned(in->operandB.t.size, infoData,
22330 in->operandB.t.size, in->operandB.t.buffer)
22333 case TPM_EO_UNSIGNED_GE:
22335 if(CryptCompare(in->operandB.t.size, infoData,
22336 in->operandB.t.size, in->operandB.t.buffer)
22339 case TPM_EO_SIGNED_LE:
22341 if(CryptCompareSigned(in->operandB.t.size, infoData,
22342 in->operandB.t.size, in->operandB.t.buffer)
22345 case TPM_EO_UNSIGNED_LE:
22347 if(CryptCompare(in->operandB.t.size, infoData,
22348 in->operandB.t.size, in->operandB.t.buffer)
22351 case TPM_EO_BITSET:
22355 for (i = 0; i < in->operandB.t.size; i++)
22357 (infoData[i] & in->operandB.t.buffer[i])
22358 != in->operandB.t.buffer[i])
22362 case TPM_EO_BITCLEAR:
22370 Copyright © TCG 2006-2013
22441 for (i = 0; i < in->operandB.t.size; i++)
22442 if((infoData[i] & in->operandB.t.buffer[i]) != 0)
22453 argHash.t.size = CryptStartHash(session->authHashAlg, &hashState);
22455 CryptUpdateDigest2B(&hashState, &in->operandB.b);
22457 CryptUpdateDigestInt(&hashState, sizeof(UINT16), &in->offset);
22459 CryptUpdateDigestInt(&hashState, sizeof(TPM_EO), &in->operation);
22464 CryptStartHash(session->authHashAlg, &hashState);
22466 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
22472 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
22480 Copyright © TCG 2006-2013
22533 Copyright © TCG 2006-2013
22613 Copyright © TCG 2006-2013
22697 session = SessionGet(in->policySession);
22698 if(session->commandCode != 0 && session->commandCode != in->code)
22700 if(!CommandIsImplemented(in->code))
22706 CryptStartHash(session->authHashAlg, &hashState);
22708 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
22712 CryptUpdateDigestInt(&hashState, sizeof(TPM_CC), &in->code);
22714 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
22716 session->commandCode = in->code;
22724 Copyright © TCG 2006-2013
22750 Copyright © TCG 2006-2013
22818 Copyright © TCG 2006-2013
22887 session = SessionGet(in->policySession);
22891 CryptStartHash(session->authHashAlg, &hashState);
22893 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
22897 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
22899 session->attributes.isPPRequired = SET;
22907 Copyright © TCG 2006-2013
22948 Copyright © TCG 2006-2013
23023 Copyright © TCG 2006-2013
23121 session = SessionGet(in->policySession);
23125 in->cpHashA.t.size != 0
23126 && session->u1.cpHash.t.size != 0
23127 && !Memory2BEqual(&in->cpHashA.b, &session->u1.cpHash.b)
23131 if(in->cpHashA.t.size != CryptGetHashDigestSize(session->authHashAlg))
23137 CryptStartHash(session->authHashAlg, &hashState);
23139 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
23143 CryptUpdateDigest2B(&hashState, &in->cpHashA.b);
23145 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
23147 session->u1.cpHash = in->cpHashA;
23148 session->attributes.iscpHashDefined = SET;
23155 Copyright © TCG 2006-2013
23171 Copyright © TCG 2006-2013
23238 Copyright © TCG 2006-2013
23310 Copyright © TCG 2006-2013
23411 session = SessionGet(in->policySession);
23414 if(in->nameHash.t.size != 0 && session->u1.cpHash.t.size != 0)
23417 if(in->nameHash.t.size != CryptGetHashDigestSize(session->authHashAlg))
23423 CryptStartHash(session->authHashAlg, &hashState);
23425 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
23429 CryptUpdateDigest2B(&hashState, &in->nameHash.b);
23431 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
23433 session->attributes.iscpHashDefined = CLEAR;
23435 session->u1.cpHash = in->nameHash;
23443 Copyright © TCG 2006-2013
23519 the new parent. In that case, the authorizing entity would approve the policyDigest of equation (31…
23525 Copyright © TCG 2006-2013
23610 Copyright © TCG 2006-2013
23707 session = SessionGet(in->policySession);
23709 if(session->u1.cpHash.t.size != 0)
23712 if(session->commandCode != 0)
23716 session->u1.cpHash.t.size = CryptStartHash(session->authHashAlg, &hashState);
23718 CryptUpdateDigest2B(&hashState, &in->objectName.b);
23720 CryptUpdateDigest2B(&hashState, &in->newParentName.b);
23722 CryptCompleteHash2B(&hashState, &session->u1.cpHash.b);
23726 session->u2.policyDigest.t.size
23727 = CryptStartHash(session->authHashAlg, &hashState);
23729 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
23733 if(in->includeObject == YES)
23734 CryptUpdateDigest2B(&hashState, &in->objectName.b);
23740 Copyright © TCG 2006-2013
23768 CryptUpdateDigest2B(&hashState, &in->newParentName.b);
23770 CryptUpdateDigestInt(&hashState, sizeof(TPMI_YES_NO), &in->includeObject);
23772 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
23774 session->attributes.iscpHashDefined = CLEAR;
23776 session->commandCode = TPM_CC_Duplicate;
23784 Copyright © TCG 2006-2013
23845 Copyright © TCG 2006-2013
23936 Copyright © TCG 2006-2013
24046 session = SessionGet(in->policySession);
24048 hashAlg = BYTE_ARRAY_TO_UINT16(in->keySign.t.name);
24054 if(digestSize != (in->keySign.t.size - 2))
24057 if(session->attributes.isTrialPolicy == CLEAR)
24061 if(!Memory2BEqual(&session->u2.policyDigest.b,
24062 &in->approvedPolicy.b))
24070 CryptUpdateDigest2B(&hashState, &in->approvedPolicy.b);
24076 Copyright © TCG 2006-2013
24114 CryptUpdateDigest2B(&hashState, &in->policyRef.b);
24117 // re-compute TPMT_TK_VERIFIED
24118 TicketComputeVerified(in->checkTicket.hierarchy, &authHash,
24119 &in->keySign, &ticket);
24121 if(!Memory2BEqual(&in->checkTicket.digest.b, &ticket.digest.b))
24126 MemorySet(session->u2.policyDigest.t.buffer, 0,
24127 session->u2.policyDigest.t.size);
24129 PolicyContextUpdate(TPM_CC_PolicyAuthorize, &in->keySign, &in->policyRef,
24138 Copyright © TCG 2006-2013
24170 Copyright © TCG 2006-2013
24238 Copyright © TCG 2006-2013
24313 session = SessionGet(in->policySession);
24318 CryptStartHash(session->authHashAlg, &hashState);
24320 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
24324 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
24326 session->attributes.isAuthValueNeeded = SET;
24327 session->attributes.isPasswordNeeded = CLEAR;
24335 Copyright © TCG 2006-2013
24378 Copyright © TCG 2006-2013
24444 Copyright © TCG 2006-2013
24519 session = SessionGet(in->policySession);
24523 CryptStartHash(session->authHashAlg, &hashState);
24525 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
24529 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
24531 session->attributes.isPasswordNeeded = SET;
24532 session->attributes.isAuthValueNeeded = CLEAR;
24540 Copyright © TCG 2006-2013
24555 to perform the actions required to pre-compute the authPolicy for an object.
24561 Copyright © TCG 2006-2013
24633 Copyright © TCG 2006-2013
24687 session = SessionGet(in->policySession);
24688 out->policyDigest = session->u2.policyDigest;
24696 Copyright © TCG 2006-2013
24728 A typical use case is a simple policy for the first write during manufacturing provisioning that wo…
24736 Copyright © TCG 2006-2013
24809 Copyright © TCG 2006-2013
24904 session = SessionGet(in->policySession);
24907 if(session->attributes.checkNvWritten == SET)
24910 (session->attributes.nvWrittenState == SET)
24911 != (in->writtenSet == YES)))
24916 session->attributes.checkNvWritten = SET;
24917 session->attributes.nvWrittenState = (in->writtenSet == YES);
24923 CryptStartHash(session->authHashAlg, &hashState);
24925 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
24929 CryptUpdateDigestInt(&hashState, sizeof(TPMI_YES_NO), &in->writtenSet);
24931 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
24939 Copyright © TCG 2006-2013
24952 Copyright © TCG 2006-2013
24972 The command will create and load a Primary Object. The sensitive area is not returned.
24975 Since the sensitive data is not returned, the key cannot be reloaded.
25008 Copyright © TCG 2006-2013
25052 the sensitive data, see Part 1 Sensitive Values
25136 Copyright © TCG 2006-2013
25164 sensitiveDataOrigin is CLEAR when 'sensitive. data' is an Empty
25165 Buffer, or is SET when 'sensitive. data' is not empty; fixedTPM,
25168 restricted, decrypt and sign attributes; attempt to inject sensitive data
25188 size of public auth policy or sensitive auth value does not match
25189 digest size of the name algorithm sensitive data size for the keyed
25194 a storage key with no symmetric algorithm specified; or non-storage
25249 sensitive;
25255 (in->inPublic.t.publicArea.objectAttributes.sensitiveDataOrigin == SET)
25256 != (in->inSensitive.t.sensitive.data.t.size == 0 ))
25262 result = PublicAttributesValidation(FALSE, in->primaryHandle,
25263 &in->inPublic.t.publicArea);
25266 // Validate the sensitive area values
25267 if( MemoryRemoveTrailingZeros(&in->inSensitive.t.sensitive.userAuth)
25268 > CryptGetHashDigestSize(in->inPublic.t.publicArea.nameAlg))
25274 Copyright © TCG 2006-2013
25326 result = CryptCreateObject(in->primaryHandle, &in->inPublic.t.publicArea,
25327 &in->inSensitive.t.sensitive,&sensitive);
25331 FillInCreationData(in->primaryHandle, in->inPublic.t.publicArea.nameAlg,
25332 &in->creationPCR, &in->outsideInfo, &out->creationData,
25333 &out->creationHash);
25335 out->outPublic = in->inPublic;
25337 ObjectComputeName(&(out->outPublic.t.publicArea), &out->name);
25339 TicketComputeCreation(EntityGetHierarchy(in->primaryHandle), &out->name,
25340 &out->creationHash, &out->creationTicket);
25343 result = ObjectLoad(in->primaryHandle, &in->inPublic.t.publicArea, &sensitive,
25344 &out->name, in->primaryHandle, TRUE, &out->objectHandle);
25352 Copyright © TCG 2006-2013
25395 Copyright © TCG 2006-2013
25475 Copyright © TCG 2006-2013
25564 select = (in->state == YES);
25568 switch(in->enable)
25573 case TPM_RH_PLATFORM:
25574 case TPM_RH_PLATFORM_NV:
25575 if(in->authHandle != TPM_RH_PLATFORM)
25581 case TPM_RH_OWNER:
25583 in->authHandle != TPM_RH_PLATFORM
25584 && in->authHandle != TPM_RH_OWNER)
25587 gc.shEnable == FALSE && in->state == YES
25588 && in->authHandle != TPM_RH_PLATFORM)
25595 case TPM_RH_ENDORSEMENT:
25597 in->authHandle != TPM_RH_PLATFORM
25598 && in->authHandle != TPM_RH_ENDORSEMENT)
25601 gc.ehEnable == FALSE && in->state == YES
25602 && in->authHandle != TPM_RH_PLATFORM)
25615 Copyright © TCG 2006-2013
25686 switch(in->enable)
25688 case TPM_RH_OWNER:
25691 case TPM_RH_ENDORSEMENT:
25694 case TPM_RH_PLATFORM:
25697 case TPM_RH_PLATFORM_NV:
25720 if(select == CLEAR && in->enable != TPM_RH_PLATFORM_NV)
25722 ObjectFlushHierarchy(in->enable);
25734 Copyright © TCG 2006-2013
25760 Copyright © TCG 2006-2013
25841 Copyright © TCG 2006-2013
25932 in->authPolicy.t.size != 0
25933 && in->authPolicy.t.size != CryptGetHashDigestSize(in->hashAlg))
25944 switch(in->authHandle)
25946 case TPM_RH_OWNER:
25947 gp.ownerAlg = in->hashAlg;
25948 gp.ownerPolicy = in->authPolicy;
25952 case TPM_RH_ENDORSEMENT:
25953 gp.endorsementAlg = in->hashAlg;
25954 gp.endorsementPolicy = in->authPolicy;
25958 case TPM_RH_PLATFORM:
25959 gc.platformAlg = in->hashAlg;
25960 gc.platformPolicy = in->authPolicy;
25975 Copyright © TCG 2006-2013
26016 Copyright © TCG 2006-2013
26080 Copyright © TCG 2006-2013
26186 // Re-initialize PCR policies
26202 Copyright © TCG 2006-2013
26222 In the reference implementation, ehProof is a non-volatile value from the RNG. It is allowed that t…
26224 ehProof can be generated on an as-needed basis or made a non-volatile value.
26232 Copyright © TCG 2006-2013
26296 Copyright © TCG 2006-2013
26420 Copyright © TCG 2006-2013
26496 Copyright © TCG 2006-2013
26560 Copyright © TCG 2006-2013
26687 Copyright © TCG 2006-2013
26763 Copyright © TCG 2006-2013
26792 Copyright © TCG 2006-2013
26863 Copyright © TCG 2006-2013
26937 if(in->auth == TPM_RH_LOCKOUT && in->disable == NO)
26940 if(in->disable == YES)
26953 Copyright © TCG 2006-2013
26985 Copyright © TCG 2006-2013
27056 Copyright © TCG 2006-2013
27151 if( MemoryRemoveTrailingZeros(&in->newAuth)
27155 switch(in->authHandle)
27157 case TPM_RH_OWNER:
27158 gp.ownerAuth = in->newAuth;
27161 case TPM_RH_ENDORSEMENT:
27162 gp.endorsementAuth = in->newAuth;
27165 case TPM_RH_PLATFORM:
27166 gc.platformAuth = in->newAuth;
27170 case TPM_RH_LOCKOUT:
27171 gp.lockoutAuth = in->newAuth;
27185 Copyright © TCG 2006-2013
27216 occur, the authorization failure counter will be decremented by one. This property is called “self-
27217 Self-healing shall not cause the count of failed attempts to decrement below zero.
27218 The count of failed attempts, the lockout interval, and self-healing interval are settable using
27237 Copyright © TCG 2006-2013
27301 Copyright © TCG 2006-2013
27376 Copyright © TCG 2006-2013
27410 Copyright © TCG 2006-2013
27498 Copyright © TCG 2006-2013
27566 gp.maxTries = in->newMaxTries;
27567 gp.recoveryTime = in->newRecoveryTime;
27568 gp.lockoutRecovery = in->lockoutRecovery;
27583 Copyright © TCG 2006-2013
27632 Copyright © TCG 2006-2013
27710 Copyright © TCG 2006-2013
27788 for(i = 0; i < in->setList.count; i++)
27792 if(CommandIsImplemented(in->setList.commandCodes[i]))
27793 PhysicalPresenceCommandSet(in->setList.commandCodes[i]);
27795 for(i = 0; i < in->clearList.count; i++)
27800 if(CommandIsImplemented(in->clearList.commandCodes[i]))
27801 PhysicalPresenceCommandClear(in->clearList.commandCodes[i]);
27811 Copyright © TCG 2006-2013
27826 algorithmSet setting is a vendor-dependent value.
27843 Copyright © TCG 2006-2013
27886 a TPM vendor-dependent value indicating the
27914 Copyright © TCG 2006-2013
27971 gp.algorithmSet = in->algorithmSet;
27981 Copyright © TCG 2006-2013
28040 The system may attempt to abandon the firmware upgrade by using a zero-length buffer in
28050 when the power interruption occurred. In such case, the TPM firmware may be reset to one of two oth…
28067 Copyright © TCG 2006-2013
28077 The TPM is required to accept the previous firmware as either a vendor -provided update or as
28081 data block in a TPM vendor-specific manner), the TPM will complete the upgrade process. If the TPM …
28128 Copyright © TCG 2006-2013
28172 A loaded key is used rather than a hard-coded key to reduce the amount of memory needed for this
28173 key data in case more than one vendor key is needed.
28179 Copyright © TCG 2006-2013
28265 Copyright © TCG 2006-2013
28313 Copyright © TCG 2006-2013
28328 fuData is vendor-specific. This command is only possible following a successful
28348 Copyright © TCG 2006-2013
28423 Copyright © TCG 2006-2013
28477 Copyright © TCG 2006-2013
28493 would be the first block given to the TPM in case of a failure recovery. If the TPM2_FirmwareRead
28513 Copyright © TCG 2006-2013
28583 Copyright © TCG 2006-2013
28633 Copyright © TCG 2006-2013
28679 Copyright © TCG 2006-2013
28748 Copyright © TCG 2006-2013
28865 // the update of state reset data. If this is the case, check if NV is
28879 out->context.savedHandle = in->saveHandle;
28882 fingerprintSize = sizeof(out->context.sequence);
28887 switch(HandleGetType(in->saveHandle))
28889 case TPM_HT_TRANSIENT:
28896 Copyright © TCG 2006-2013
28972 *object = ObjectGet(in->saveHandle);
28974 (OBJECT *)(out->context.contextBlob.t.buffer
28980 out->context.contextBlob.t.size = integritySize +
28991 out->context.sequence = gr.objectContextID;
28997 out->context.savedHandle = 0x80000001;
29000 else if(object->attributes.stClear == SET)
29002 out->context.savedHandle = 0x80000002;
29006 out->context.savedHandle = 0x80000000;
29009 out->context.hierarchy = ObjectDataGetHierarchy(object);
29012 case TPM_HT_HMAC_SESSION:
29013 case TPM_HT_POLICY_SESSION:
29016 *session = SessionGet(in->saveHandle);
29021 out->context.contextBlob.t.size = integritySize +
29027 MemoryCopy(out->context.contextBlob.t.buffer
29035 Copyright © TCG 2006-2013
29100 sizeof(out->context.contextBlob.t.buffer)
29101 - integritySize - fingerprintSize);
29106 // SessionContextSave() will flush the in-memory context
29108 result = SessionContextSave(out->context.savedHandle, &contextID);
29111 out->context.sequence = contextID;
29113 out->context.hierarchy = TPM_RH_NULL;
29124 MemoryCopy(out->context.contextBlob.t.buffer + integritySize,
29125 &out->context.sequence, sizeof(out->context.sequence),
29126 sizeof(out->context.contextBlob.t.buffer) - integritySize);
29128 ComputeContextProtectionKey(&out->context, &symKey, &iv);
29130 CryptSymmetricEncrypt(out->context.contextBlob.t.buffer + integritySize,
29133 out->context.contextBlob.t.size - integritySize,
29134 out->context.contextBlob.t.buffer + integritySize);
29138 ComputeContextIntegrity(&out->context, &integrity);
29140 buffer = out->context.contextBlob.t.buffer;
29152 Copyright © TCG 2006-2013
29184 Copyright © TCG 2006-2013
29255 Copyright © TCG 2006-2013
29384 handleType = HandleGetType(in->context.savedHandle);
29391 buffer = in->context.contextBlob.t.buffer;
29392 size = (INT32) in->context.contextBlob.t.size;
29397 ComputeContextIntegrity(&in->context, &ingerityToCompare);
29403 Copyright © TCG 2006-2013
29480 ComputeContextProtectionKey(&in->context, &symKey, &iv);
29482 CryptSymmetricDecrypt(in->context.contextBlob.t.buffer + integritySize,
29485 in->context.contextBlob.t.size - integritySize,
29486 in->context.contextBlob.t.buffer + integritySize);
29488 MemoryCopy(&fingerprint, in->context.contextBlob.t.buffer + integritySize,
29491 if(fingerprint != in->context.sequence)
29496 case TPM_HT_TRANSIENT:
29500 *outObject = (OBJECT *)(in->context.contextBlob.t.buffer
29503 in->context.savedHandle = TRANSIENT_FIRST;
29506 if(!HierarchyIsEnabled(in->context.hierarchy))
29510 result = ObjectContextLoad(outObject, &out->loadedHandle);
29516 SequenceDataImportExport(ObjectGet(out->loadedHandle),
29520 case TPM_HT_POLICY_SESSION:
29521 case TPM_HT_HMAC_SESSION:
29525 *session = (SESSION *)(in->context.contextBlob.t.buffer
29529 // the update of state reset data. If this is the case, check if NV is
29536 Copyright © TCG 2006-2013
29592 if(!SessionIsSaved(in->context.savedHandle))
29596 result = SessionContextLoad(session, &in->context.savedHandle);
29599 out->loadedHandle = in->context.savedHandle;
29618 Copyright © TCG 2006-2013
29670 Copyright © TCG 2006-2013
29736 Copyright © TCG 2006-2013
29810 switch(HandleGetType(in->flushHandle))
29812 case TPM_HT_TRANSIENT:
29813 if(!ObjectIsPresent(in->flushHandle))
29816 ObjectFlush(in->flushHandle);
29818 case TPM_HT_HMAC_SESSION:
29819 case TPM_HT_POLICY_SESSION:
29821 !SessionIsLoaded(in->flushHandle)
29822 && !SessionIsSaved(in->flushHandle)
29827 if(in->flushHandle == g_exclusiveAuditSession)
29830 SessionFlush(in->flushHandle);
29848 Copyright © TCG 2006-2013
29905 …l TPM memory is non volatile and not subject to endurance issues. In such case, there is no moveme…
29914 Copyright © TCG 2006-2013
29944 Copyright © TCG 2006-2013
30024 Copyright © TCG 2006-2013
30134 evictObject = ObjectGet(in->objectHandle);
30137 evictObject->attributes.temporary == SET
30138 || evictObject->attributes.stClear == SET
30139 || evictObject->attributes.publicOnly == SET
30145 evictObject->attributes.evict == SET
30146 && evictObject->evictHandle != in->persistentHandle
30150 if(in->auth == TPM_RH_PLATFORM)
30153 if(evictObject->attributes.evict == CLEAR)
30162 Copyright © TCG 2006-2013
30219 if(evictObject->attributes.ppsHierarchy == CLEAR)
30222 if(!NvIsPlatformPersistentHandle(in->persistentHandle))
30227 else if(in->auth == TPM_RH_OWNER)
30230 if(evictObject->attributes.ppsHierarchy == SET)
30234 evictObject->attributes.evict == CLEAR
30235 && !NvIsOwnerPersistentHandle(in->persistentHandle)
30247 if(evictObject->attributes.evict == CLEAR)
30252 result = NvAddEvictObject(in->persistentHandle, evictObject);
30258 NvDeleteEntity(evictObject->evictHandle);
30267 Copyright © TCG 2006-2013
30292 privacy sensitive. The values may be read without authorization because the TCB will not disclose
30301 Copyright © TCG 2006-2013
30363 Copyright © TCG 2006-2013
30400 out->currentTime.time = g_time;
30401 TimeFillInfo(&out->currentTime.clockInfo);
30409 Copyright © TCG 2006-2013
30435 If the value of Clock after the update makes the volatile and non-volatile versions of
30437 the non-volatile version of TPMS_CLOCK_INFO.clock before returning.
30444 Copyright © TCG 2006-2013
30514 Copyright © TCG 2006-2013
30580 ((1ULL << NV_CLOCK_UPDATE_INTERVAL)- 1)
30585 if(in->newTime > 0xFFFF000000000000ULL
30586 || in->newTime < go.clock)
30592 go.clock = in->newTime;
30595 if((in->newTime & CLOCK_UPDATE_MASK) > (clockNow & CLOCK_UPDATE_MASK))
30609 Copyright © TCG 2006-2013
30637 If the frequency tolerance of the TPM's input clock is +/-10 percent, then the TPM will return
30643 The interpretation of “fine” and “coarse” adjustments is implementation-specific.
30657 Copyright © TCG 2006-2013
30727 Copyright © TCG 2006-2013
30760 TimeSetAdjustRate(in->rateAdjust);
30771 Copyright © TCG 2006-2013
30845 Copyright © TCG 2006-2013
30976 manufacturer-specific values
30985 Copyright © TCG 2006-2013
31002 parameter. The range of the returned handles is determined by the handle type (the most-significant
31030 specific commands are implemented, the vendor-specific command attribute with the lowest
31031 commandIndex, is returned after the non-vendor-specific (base) command.
31057 property is a 32-bit value. The properties are returned in groups. Each property group is on a 256v…
31083 Copyright © TCG 2006-2013
31098 If no next capability exists, the TPM will return a zero-length list and moreData will have a value…
31104 Copyright © TCG 2006-2013
31190 Copyright © TCG 2006-2013
31283 out->capabilityData.capability = in->capability;
31284 switch(in->capability)
31286 case TPM_CAP_ALGS:
31287 out->moreData = AlgorithmCapGetImplemented((TPM_ALG_ID) in->property,
31288 in->propertyCount, &out->capabilityData.data.algorithms);
31290 case TPM_CAP_HANDLES:
31291 switch(HandleGetType((TPM_HANDLE) in->property))
31293 case TPM_HT_TRANSIENT:
31295 out->moreData = ObjectCapGetLoaded((TPM_HANDLE) in->property,
31296 in->propertyCount,
31297 &out->capabilityData.data.handles);
31299 case TPM_HT_PERSISTENT:
31301 out->moreData = NvCapGetPersistent((TPM_HANDLE) in->property,
31302 in->propertyCount,
31303 &out->capabilityData.data.handles);
31305 case TPM_HT_NV_INDEX:
31307 out->moreData = NvCapGetIndex((TPM_HANDLE) in->property,
31308 in->propertyCount,
31309 &out->capabilityData.data.handles);
31311 case TPM_HT_LOADED_SESSION:
31313 out->moreData = SessionCapGetLoaded((TPM_HANDLE) in->property,
31314 in->propertyCount,
31315 &out->capabilityData.data.handles);
31317 case TPM_HT_ACTIVE_SESSION:
31319 out->moreData = SessionCapGetSaved((TPM_HANDLE) in->property,
31320 in->propertyCount,
31321 &out->capabilityData.data.handles);
31327 Copyright © TCG 2006-2013
31401 case TPM_HT_PCR:
31403 out->moreData = PCRCapGetHandles((TPM_HANDLE) in->property,
31404 in->propertyCount,
31405 &out->capabilityData.data.handles);
31407 case TPM_HT_PERMANENT:
31409 out->moreData = PermanentCapGetHandles(
31410 (TPM_HANDLE) in->property,
31411 in->propertyCount,
31412 &out->capabilityData.data.handles);
31420 case TPM_CAP_COMMANDS:
31421 out->moreData = CommandCapGetCCList((TPM_CC) in->property,
31422 in->propertyCount,
31423 &out->capabilityData.data.command);
31425 case TPM_CAP_PP_COMMANDS:
31426 out->moreData = PhysicalPresenceCapGetCCList((TPM_CC) in->property,
31427 in->propertyCount, &out->capabilityData.data.ppCommands);
31429 case TPM_CAP_AUDIT_COMMANDS:
31430 out->moreData = CommandAuditCapGetCCList((TPM_CC) in->property,
31431 in->propertyCount,
31432 &out->capabilityData.data.auditCommands);
31434 case TPM_CAP_PCRS:
31436 if(in->property != 0)
31438 out->moreData = PCRCapGetAllocation(in->propertyCount,
31439 &out->capabilityData.data.assignedPCR);
31441 case TPM_CAP_PCR_PROPERTIES:
31442 out->moreData = PCRCapGetProperties((TPM_PT_PCR) in->property,
31443 in->propertyCount,
31444 &out->capabilityData.data.pcrProperties);
31446 case TPM_CAP_TPM_PROPERTIES:
31447 out->moreData = TPMCapGetProperties((TPM_PT) in->property,
31448 in->propertyCount,
31449 &out->capabilityData.data.tpmProperties);
31452 case TPM_CAP_ECC_CURVES:
31453 out->moreData = CryptCapGetECCCurve((TPM_ECC_CURVE
31454 ) in->property,
31455 in->propertyCount,
31456 &out->capabilityData.data.eccCurves);
31459 case TPM_CAP_VENDOR_PROPERTY:
31470 Copyright © TCG 2006-2013
31491 Copyright © TCG 2006-2013
31514 Copyright © TCG 2006-2013
31578 Copyright © TCG 2006-2013
31630 Copyright © TCG 2006-2013
31641 Non-volatile Storage
31651 An Index may have an Index-specific authValue and authPolicy. The authValue may be used to authorize
31702 Copyright © TCG 2006-2013
31717 When an NV counter is created, the TPM shall initialize the 8-octet counter value with a number tha…
31722 occasionally update the non-volatile version of the counter. An orderly shutdown is one occasion to
31723 update the non-volatile count. If the difference between the volatile and non-volatile version of t…
31729 non-volatile counter and set that as the current count.
31739 counter is the sum of both the volatile and non-volatile parts. If so, then the TPM may initialize …
31745 highest value. In this search, the TPM would use the sum of the non -volatile and RAM portions of
31753 Copyright © TCG 2006-2013
31855 Copyright © TCG 2006-2013
31874 Copyright © TCG 2006-2013
31950 Copyright © TCG 2006-2013
32030 'auth->size' or 'publicInfo->authPolicy. size' is larger than the digest
32031 size of 'publicInfo->nameAlg', or 'publicInfo->dataSize' is not
32032 consistent with 'publicInfo->attributes'.
32052 nameSize = CryptGetHashDigestSize(in->publicInfo.t.nvPublic.nameAlg);
32063 if(in->authHandle == TPM_RH_PLATFORM && gc.phEnableNV == CLEAR)
32065 attributes = in->publicInfo.t.nvPublic.attributes;
32070 && (in->publicInfo.t.nvPublic.dataSize != 8))
32074 in->publicInfo.t.nvPublic.authPolicy.t.size != 0
32075 && in->publicInfo.t.nvPublic.authPolicy.t.size != nameSize)
32078 MemoryRemoveTrailingZeros(&in->auth);
32079 if(in->auth.t.size > nameSize)
32086 Copyright © TCG 2006-2013
32226 Copyright © TCG 2006-2013
32275 in->publicInfo.t.nvPublic.attributes.TPMA_NV_PLATFORMCREATE == SET
32276 && in->authHandle == TPM_RH_OWNER
32279 in->publicInfo.t.nvPublic.attributes.TPMA_NV_PLATFORMCREATE == CLEAR
32280 && in->authHandle == TPM_RH_PLATFORM
32288 in->publicInfo.t.nvPublic.attributes.TPMA_NV_POLICY_DELETE == SET
32289 && TPM_RH_PLATFORM != in->authHandle
32295 in->publicInfo.t.nvPublic.attributes.TPMA_NV_EXTEND == SET
32296 && in->publicInfo.t.nvPublic.dataSize != nameSize
32300 if(NvIsUndefinedIndex(in->publicInfo.t.nvPublic.nvIndex))
32304 result = NvDefineIndex(&in->publicInfo.t.nvPublic, &in->auth);
32314 Copyright © TCG 2006-2013
32342 Copyright © TCG 2006-2013
32413 Copyright © TCG 2006-2013
32498 NvGetIndexInfo(in->nvIndex, &nvIndex);
32505 in->authHandle == TPM_RH_OWNER
32510 NvDeleteEntity(in->nvIndex);
32518 Copyright © TCG 2006-2013
32532 This command allows removal of a platform-created NV Index that has TPMA_NV_POLICY_DELETE
32570 Copyright © TCG 2006-2013
32642 Copyright © TCG 2006-2013
32718 NvGetIndexInfo(in->nvIndex, &nvIndex);
32724 NvDeleteEntity(in->nvIndex);
32732 Copyright © TCG 2006-2013
32747 not privacy-sensitive and no authorization is required to read this data.
32753 Copyright © TCG 2006-2013
32828 Copyright © TCG 2006-2013
32884 NvGetIndexInfo(in->nvIndex, &nvIndex);
32886 out->nvPublic.t.nvPublic = nvIndex.publicArea;
32888 out->nvName.t.size = NvGetName(in->nvIndex, &out->nvName.t.name);
32896 Copyright © TCG 2006-2013
32943 Copyright © TCG 2006-2013
33026 Copyright © TCG 2006-2013
33127 NvGetIndexInfo(in->nvIndex, &nvIndex);
33130 result = NvWriteAccessChecks(in->authHandle, in->nvIndex);
33141 if((in->data.t.size + in->offset) > nvIndex.publicArea.dataSize)
33147 && in->data.t.size < nvIndex.publicArea.dataSize)
33153 return NvWriteIndexData(in->nvIndex, &nvIndex, in->offset,
33159 Copyright © TCG 2006-2013
33170 in->data.t.size, in->data.t.buffer);
33178 Copyright © TCG 2006-2013
33227 If TPMA_NV_ORDERLY is SET, and the difference between the volatile and non-volatile versions of this
33228 field is greater than MAX_ORDERLY_COUNT, then the non-volatile version of the counter is updated.
33232 TPM_NV_COUNTER both SET, then in the Event of a non-orderly shutdown, the non-volatile value
33239 past the maximum allowed value (MAX_ORDERLY_COUNT), the non-volatile version of the count is
33246 Copyright © TCG 2006-2013
33317 Copyright © TCG 2006-2013
33418 result = NvWriteAccessChecks(in->authHandle, in->nvIndex);
33422 NvGetIndexInfo(in->nvIndex, &nvIndex);
33432 NvGetIntIndexData(in->nvIndex, &nvIndex, &countValue);
33451 Copyright © TCG 2006-2013
33474 return NvWriteIndexData(in->nvIndex, &nvIndex, 0, 8, &countValue);
33481 Copyright © TCG 2006-2013
33542 Copyright © TCG 2006-2013
33619 Copyright © TCG 2006-2013
33726 result = NvWriteAccessChecks(in->authHandle, in->nvIndex);
33730 NvGetIndexInfo(in->nvIndex, &nvIndex);
33734 // If the Index is not-orderly, or if this is the first write, NV will
33751 NvGetIndexData(in->nvIndex, &nvIndex, 0,
33757 Copyright © TCG 2006-2013
33800 CryptUpdateDigest2B(&hashState, &in->data.b);
33805 return NvWriteIndexData(in->nvIndex, &nvIndex, 0,
33813 Copyright © TCG 2006-2013
33842 Copyright © TCG 2006-2013
33922 Copyright © TCG 2006-2013
34026 result = NvWriteAccessChecks(in->authHandle, in->nvIndex);
34030 NvGetIndexInfo(in->nvIndex, &nvIndex);
34034 // If the Index is not-orderly, or if this is the first write, NV will
34057 Copyright © TCG 2006-2013
34076 NvGetIntIndexData(in->nvIndex, &nvIndex, &bitValue);
34078 bitValue |= in->bits;
34081 return NvWriteIndexData(in->nvIndex, &nvIndex, 0, 8, &bitValue);
34088 Copyright © TCG 2006-2013
34118 Copyright © TCG 2006-2013
34192 Copyright © TCG 2006-2013
34296 result = NvWriteAccessChecks(in->authHandle, in->nvIndex);
34306 NvGetIndexInfo(in->nvIndex, &nvIndex);
34308 // can not be write-locked
34317 NvWriteIndexInfo(in->nvIndex, &nvIndex);
34323 Copyright © TCG 2006-2013
34341 Copyright © TCG 2006-2013
34383 Copyright © TCG 2006-2013
34450 Copyright © TCG 2006-2013
34522 Copyright © TCG 2006-2013
34564 If authorization sessions are present, they are checked before the read -lock status of the NV Index
34577 Copyright © TCG 2006-2013
34672 Copyright © TCG 2006-2013
34767 NvGetIndexInfo(in->nvIndex, &nvIndex);
34771 result = NvReadAccessChecks(in->authHandle, in->nvIndex);
34775 if((in->size + in->offset) > nvIndex.publicArea.dataSize)
34779 out->data.t.size = in->size;
34781 NvGetIndexData(in->nvIndex, &nvIndex, in->offset, in->size, out->data.t.buffer);
34789 Copyright © TCG 2006-2013
34822 Copyright © TCG 2006-2013
34897 Copyright © TCG 2006-2013
35001 result = NvReadAccessChecks(in->authHandle, in->nvIndex);
35013 NvGetIndexInfo(in->nvIndex, &nvIndex);
35014 // if TPMA_NV_READ_STCLEAR is not set, the index can not be read-locked
35021 NvWriteIndexInfo(in->nvIndex, &nvIndex);
35029 Copyright © TCG 2006-2013
35052 approval while other commands may use policy that is not command -dependent.
35063 Copyright © TCG 2006-2013
35136 Copyright © TCG 2006-2013
35216 NvGetIndexInfo(in->nvIndex, &nvIndex);
35219 MemoryRemoveTrailingZeros(&(in->newAuth));
35221 if(in->newAuth.t.size > CryptGetHashDigestSize(nvIndex.publicArea.nameAlg))
35225 nvIndex.authValue = in->newAuth;
35227 NvWriteIndexInfo(in->nvIndex, &nvIndex);
35235 Copyright © TCG 2006-2013
35261 Copyright © TCG 2006-2013
35323 user-provided qualifying data
35386 Copyright © TCG 2006-2013
35504 // the reporting of clock info. If this is the case, check if NV is
35517 NvGetIndexInfo(in->nvIndex, &nvIndex);
35520 result = NvReadAccessChecks(in->authHandle, in->nvIndex);
35525 if((in->size + in->offset) > nvIndex.publicArea.dataSize)
35533 Copyright © TCG 2006-2013
35601 result = FillInAttestInfo(in->signHandle,
35602 &in->inScheme,
35603 &in->qualifyingData,
35617 NvGetName(in->nvIndex, &certifyInfo.attested.nv.indexName.t.name);
35619 certifyInfo.attested.nv.nvContents.t.size = in->size;
35621 certifyInfo.attested.nv.offset = in->offset;
35623 NvGetIndexData(in->nvIndex, &nvIndex,
35624 in->offset, in->size,
35632 result = SignAttestInfo(in->signHandle,
35633 &in->inScheme,
35635 &in->qualifyingData,
35636 &out->certifyInfo,
35637 &out->signature);
35642 if(in->signHandle != TPM_RH_NULL)
35651 Copyright © TCG 2006-2013