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
3761 Copyright © TCG 2006-2013
3882 in->nonceCaller.t.size < 16
3883 || in->nonceCaller.t.size > CryptGetHashDigestSize(in->authHash))
3886 if(in->tpmKey != TPM_RH_NULL)
3889 if(in->encryptedSalt.t.size == 0)
3892 tpmKey = ObjectGet(in->tpmKey);
3895 if(tpmKey->attributes.publicOnly)
3902 Copyright © TCG 2006-2013
3967 if(tpmKey->publicArea.objectAttributes.decrypt != SET)
3971 result = CryptSecretDecrypt(in->tpmKey, &in->nonceCaller, "SECRET",
3972 &in->encryptedSalt, &salt);
3979 if(in->encryptedSalt.t.size != 0)
3986 in->symmetric.algorithm != TPM_ALG_NULL
3987 && in->symmetric.algorithm != TPM_ALG_XOR
3988 && in->symmetric.mode.sym != TPM_ALG_CFB)
3997 result = SessionCreate(in->sessionType, in->authHash,
3998 &in->nonceCaller, &in->symmetric,
3999 in->bind, &salt, &out->sessionHandle);
4004 session = SessionGet(out->sessionHandle);
4006 out->nonceTPM = session->nonceTPM;
4014 Copyright © TCG 2006-2013
4039 Copyright © TCG 2006-2013
4101 Copyright © TCG 2006-2013
4155 session = SessionGet(in->sessionHandle);
4156 wasTrialSession = session->attributes.isTrialPolicy == SET;
4159 session->attributes.isTrialPolicy = wasTrialSession;
4167 Copyright © TCG 2006-2013
4186 data (creationData), its public area (outPublic), and its encrypted sensitive area (outPrivate). Pr…
4193 sensitive area loaded.
4198 The sensitive parameter may be encrypted using parameter encryption.
4200 is indicated as being TPM-generated, the value is filled in by bits from the RNG if the command is
4205 The TPM will create new data for the sensitive area and compute a TPMT_PUBLIC.unique from the
4206 sensitive area based on the object type:
4208 1) If inSensitive.data is the Empty Buffer, a TPM-generated key value is placed in the new object’s
4209 TPMT_SENSITIVE.sensitive.sym. The size of the key will be determined by
4213 inSensitive.data to TPMT_SENSITIVE.sensitive.sym of the new object.
4214 3) A TPM-generated obfuscation value is placed in TPMT_SENSITIVE.sensitive.seedValue. The
4216 value prevents the public unique value from leaking information about the sensitive area.
4221 unique ≔ HnameAlg(sensitive.seedValue.buffer || sensitive.any.buffer)
4226 1) If sensitive.data is not the Empty Buffer, then the TPM shall return TPM_RC_VALUE.
4232 Copyright © TCG 2006-2013
4241 2) A TPM-generated private key value is created with the size determined by the parameters of
4243 3) If the key is a Storage Key, a TPM-generated TPMT_SENSITIVE.symKey value is created;
4262 TPMT_SENSITIVE.sensitive of the new object.
4266 TPMT_SENSITIVE.sensitive.bits.data by MAX_SYM_DATA.
4278 3) If inSensitive.data is an Empty Buffer, a TPM-generated key value that is the size of the digest
4279 produced by the nameAlg in inPublic is placed in TPMT_SENSITIVE.sensitive.any.buffer.
4280 4) A TPM-generated obfuscation value that is the size of the digest produced by the nameAlg of
4289 The encryption key is derived from the symmetric seed in the sensitive area of the parent.
4311 Copyright © TCG 2006-2013
4354 the sensitive data
4432 Copyright © TCG 2006-2013
4452 non-duplicable storage key and its parent have different public
4457 sensitiveDataOrigin is CLEAR when 'sensitive. data' is an Empty
4458 Buffer, or is SET when 'sensitive. data' is not empty; fixedTPM,
4461 restricted, decrypt and sign attributes; attempt to inject sensitive data
4467 non-duplicable storage key and its parent have different name
4481 sensitive creation area; may also be returned if the TPM does not
4496 size of public auth policy or sensitive auth value does not match
4497 digest size of the name algorithm sensitive data size for the keyed
4502 a storage key with no symmetric algorithm specified; or non-storage
4507 unknown object type; non-duplicable storage key and its parent have
4509 decryption key in the storage hierarchy with both public and sensitive
4557 sensitive;
4561 Copyright © TCG 2006-2013
4635 parentObject = ObjectGet(in->parentHandle);
4642 (in->inPublic.t.publicArea.objectAttributes.sensitiveDataOrigin == SET)
4643 != (in->inSensitive.t.sensitive.data.t.size == 0))
4649 result = PublicAttributesValidation(FALSE, in->parentHandle,
4650 &in->inPublic.t.publicArea);
4653 // Validate the sensitive area values
4654 if( MemoryRemoveTrailingZeros(&in->inSensitive.t.sensitive.userAuth)
4655 > CryptGetHashDigestSize(in->inPublic.t.publicArea.nameAlg))
4659 result = CryptCreateObject(in->parentHandle, &in->inPublic.t.publicArea,
4660 &in->inSensitive.t.sensitive, &sensitive);
4664 FillInCreationData(in->parentHandle, in->inPublic.t.publicArea.nameAlg,
4665 &in->creationPCR, &in->outsideInfo,
4666 &out->creationData, &out->creationHash);
4668 out->outPublic.t.publicArea = in->inPublic.t.publicArea;
4670 ObjectComputeName(&(out->outPublic.t.publicArea), &name);
4672 TicketComputeCreation(EntityGetHierarchy(in->parentHandle), &name,
4673 &out->creationHash, &out->creationTicket);
4674 // Prepare output private data from sensitive
4675 SensitiveToPrivate(&sensitive, &name, in->parentHandle,
4676 out->outPublic.t.publicArea.nameAlg,
4677 &out->outPrivate);
4685 Copyright © TCG 2006-2013
4716 checked before the sensitive area is used, or unmarshaled.
4719 Checking the integrity before the data is used prevents attacks o n the sensitive area by fuzzing t…
4726 The TPM-computed Name is provided as a convenience to the caller for those cases where the
4734 For all objects, the size of the key in the sensitive area shall be consistent with the key size in…
4736 Before use, a loaded object shall be checked to validate that the public and sensitive portions are
4741 For a symmetric object, the unique value in the public area shall be the digest of the sensitive key
4746 For a two-prime RSA key, the remainder when dividing the public modulus by the private key shall
4758 Copyright © TCG 2006-2013
4847 Copyright © TCG 2006-2013
4969 sensitive;
4975 if(in->inPrivate.t.size == 0)
4977 parentObject = ObjectGet(in->parentHandle);
4985 if(parentObject->publicArea.objectAttributes.fixedTPM)
4992 Copyright © TCG 2006-2013
5051 if(in->inPublic.t.publicArea.objectAttributes.fixedTPM == SET)
5057 result = PublicAttributesValidation(TRUE, in->parentHandle,
5058 &in->inPublic.t.publicArea);
5063 ObjectComputeName(&in->inPublic.t.publicArea, &out->name);
5064 // Retrieve sensitive data. PrivateToSensitive() may return TPM_RC_INTEGRITY or
5067 result = PrivateToSensitive(&in->inPrivate, &out->name, in->parentHandle,
5068 in->inPublic.t.publicArea.nameAlg,
5069 &sensitive);
5074 hierarchy = ObjectGetHierarchy(in->parentHandle);
5078 result = ObjectLoad(hierarchy, &in->inPublic.t.publicArea, &sensitive,
5079 &out->name, in->parentHandle, skipChecks,
5080 &out->objectHandle);
5090 Copyright © TCG 2006-2013
5105 loading of a public area or both a public and sensitive area.
5109 Typical use for loading both a public and sensitive area is to allow the TPM to be used as a crypto
5114 public and sensitive portions of the object are loaded, hierarchy is required to be TPM_RH_NULL.
5145 and sensitive areas, but the TPM will validate that the size of the key in the sensitive area is co…
5157 sensitive portions cryptographically bound so that an attacker cannot mix pubic and sensitive areas.
5163 The TPM-computed Name is provided as a convenience to the caller for those cases where the
5170 Copyright © TCG 2006-2013
5196 Copyright © TCG 2006-2013
5231 the sensitive portion of the object (optional)
5282 Copyright © TCG 2006-2013
5303 both public and sensitive portions are loaded
5396 *sensitive;
5404 if(!HierarchyIsEnabled(in->hierarchy))
5407 if(in->inPublic.t.publicArea.authPolicy.t.size != 0
5408 && in->inPublic.t.publicArea.authPolicy.t.size !=
5409 CryptGetHashDigestSize(in->inPublic.t.publicArea.nameAlg))
5411 // For loading an object with both public and sensitive
5412 if(in->inPrivate.t.size != 0)
5415 if(in->hierarchy != TPM_RH_NULL)
5417 // An external object with a sensitive area must have fixedTPM == CLEAR
5424 Copyright © TCG 2006-2013
5467 in->inPublic.t.publicArea.objectAttributes.fixedTPM != CLEAR
5468 || in->inPublic.t.publicArea.objectAttributes.fixedParent != CLEAR
5469 || in->inPublic.t.publicArea.objectAttributes.restricted != CLEAR
5474 result = SchemeChecks(TRUE, TPM_RH_NULL, &in->inPublic.t.publicArea);
5479 ObjectComputeName(&in->inPublic.t.publicArea, &out->name);
5480 skipChecks = (in->inPublic.t.publicArea.nameAlg == TPM_ALG_NULL);
5481 // If a sensitive area was provided, load it
5482 if(in->inPrivate.t.size != 0)
5483 sensitive = &in->inPrivate.t.sensitiveArea;
5485 sensitive = NULL;
5488 result = ObjectLoad(in->hierarchy, &in->inPublic.t.publicArea,
5489 sensitive, &out->name, TPM_RH_NULL, skipChecks,
5490 &out->objectHandle);
5498 Copyright © TCG 2006-2013
5525 Copyright © TCG 2006-2013
5606 Copyright © TCG 2006-2013
5681 object = ObjectGet(in->objectHandle);
5687 out->outPublic.t.size = TPMT_PUBLIC_Marshal(&object->publicArea, NULL, NULL);
5689 out->outPublic.t.publicArea = object->publicArea;
5691 out->name.t.size = ObjectGetName(in->objectHandle, &out->name.t.name);
5693 ObjectGetQualifiedName(in->objectHandle, &out->qualifiedName);
5701 Copyright © TCG 2006-2013
5734 Copyright © TCG 2006-2013
5793 keyHandle algorithm-dependent encrypted seed that
5829 Copyright © TCG 2006-2013
5951 object = ObjectGet(in->keyHandle);
5953 activateObject = ObjectGet(in->activateHandle);
5956 !CryptIsAsymAlgorithm(object->publicArea.type)
5957 || object->publicArea.objectAttributes.decrypt == CLEAR
5958 || object->publicArea.objectAttributes.restricted == CLEAR)
5964 result = CryptSecretDecrypt(in->keyHandle, NULL,
5965 "IDENTITY", &in->secret, &data);
5975 Copyright © TCG 2006-2013
6003 result = CredentialToSecret(&in->credentialBlob,
6004 &activateObject->name,
6006 in->keyHandle,
6007 &out->certInfo);
6017 Copyright © TCG 2006-2013
6043 Copyright © TCG 2006-2013
6078 loaded public area, used to encrypt the sensitive area
6127 handle algorithm-dependent data that wraps the key
6131 Copyright © TCG 2006-2013
6234 object = ObjectGet(in->handle);
6238 !CryptIsAsymAlgorithm(object->publicArea.type)
6239 || object->publicArea.objectAttributes.decrypt == CLEAR
6240 || object->publicArea.objectAttributes.restricted == CLEAR
6245 if(in->credential.t.size > CryptGetHashDigestSize(object->publicArea.nameAlg))
6250 out->secret.t.size = sizeof(out->secret.t.secret);
6251 result = CryptSecretEncrypt(in->handle, "IDENTITY", &data, &out->secret);
6255 SecretToCredential(&in->credential, &in->objectName, (TPM2B_SEED *) &data,
6256 in->handle, &out->credentialBlob);
6264 Copyright © TCG 2006-2013
6281 A random, TPM-generated, Sealed Data Object may be created by the TPM with TPM2_Create() or
6295 Copyright © TCG 2006-2013
6366 Copyright © TCG 2006-2013
6427 object = ObjectGet(in->itemHandle);
6429 if(object->publicArea.type != TPM_ALG_KEYEDHASH)
6432 object->publicArea.objectAttributes.decrypt == SET
6433 || object->publicArea.objectAttributes.sign == SET
6434 || object->publicArea.objectAttributes.restricted == SET)
6438 MemoryCopy2B(&out->outData.b, &object->sensitive.sensitive.bits.b,
6439 sizeof(out->outData.t.buffer));
6447 Copyright © TCG 2006-2013
6461 This command is used to change the authorization secret for a TPM-resident object.
6462 If successful, a new private area for the TPM-resident object associated with objectHandle is retur…
6464 This command does not change the authorization of the TPM-resident object on which it operates.
6465 Therefore, the old authValue (of the TPM-resident object) is used when generating the response HMAC
6473 The TPM-resident object may be persistent and changing the authorization value of the persistent
6475 change the TPM-resident object.
6495 Copyright © TCG 2006-2013
6578 Copyright © TCG 2006-2013
6675 sensitive;
6682 object = ObjectGet(in->objectHandle);
6687 if( MemoryRemoveTrailingZeros(&in->newAuth)
6688 > CryptGetHashDigestSize(object->publicArea.nameAlg))
6694 ObjectGetQualifiedName(in->parentHandle, &parentQN);
6695 ObjectComputeQualifiedName(&parentQN, object->publicArea.nameAlg,
6696 &object->name, &QNCompare);
6697 ObjectGetQualifiedName(in->objectHandle, &objectQN);
6701 // Copy internal sensitive area
6702 sensitive = object->sensitive;
6704 sensitive.authValue = in->newAuth;
6705 // Prepare output private data from sensitive
6706 SensitiveToPrivate(&sensitive, &object->name, in->parentHandle,
6712 Copyright © TCG 2006-2013
6725 object->publicArea.nameAlg,
6726 &out->outPrivate);
6735 Copyright © TCG 2006-2013
6759 sensitive area could not be loaded in the TPM from which objectHandle is being duplicated.
6816 Copyright © TCG 2006-2013
6926 Copyright © TCG 2006-2013
7031 sensitive;
7045 object = ObjectGet(in->objectHandle);
7047 if(object->publicArea.objectAttributes.fixedParent == SET)
7050 if(object->publicArea.nameAlg == TPM_ALG_NULL)
7053 if(in->newParentHandle != TPM_RH_NULL
7054 && !ObjectIsStorage(in->newParentHandle))
7058 if(object->publicArea.objectAttributes.encryptedDuplication == SET)
7060 if(in->symmetricAlg.algorithm == TPM_ALG_NULL)
7062 if(in->newParentHandle == TPM_RH_NULL)
7068 Copyright © TCG 2006-2013
7133 if(in->symmetricAlg.algorithm == TPM_ALG_NULL)
7136 if(in->encryptionKeyIn.t.size != 0)
7142 innerKeySize = in->symmetricAlg.keyBits.sym;
7144 if(in->encryptionKeyIn.t.size != 0
7145 && in->encryptionKeyIn.t.size != (innerKeySize + 7) / 8)
7149 if(in->newParentHandle != TPM_RH_NULL)
7153 out->outSymSeed.t.size = sizeof(out->outSymSeed.t.secret);
7154 result = CryptSecretEncrypt(in->newParentHandle,
7155 "DUPLICATE", &data, &out->outSymSeed);
7164 out->outSymSeed.t.size = 0;
7166 // Copy sensitive area
7167 sensitive = object->sensitive;
7168 // Prepare output private data from sensitive
7169 SensitiveToDuplicate(&sensitive, &object->name, in->newParentHandle,
7170 object->publicArea.nameAlg, (TPM2B_SEED *) &data,
7171 &in->symmetricAlg, &in->encryptionKeyIn,
7172 &out->duplicate);
7173 out->encryptionKeyOut = in->encryptionKeyIn;
7181 Copyright © TCG 2006-2013
7198 to the methods appropriate for newParent and the blob is re-encrypted and a new integrity value is
7199 computed. The re-encrypted blob is returned in outDuplicate and the symmetric key returned in
7211 Copyright © TCG 2006-2013
7316 Copyright © TCG 2006-2013
7406 key, or unmarshal the private buffer to sensitive
7439 if((in->inSymSeed.t.size == 0 && in->oldParent != TPM_RH_NULL)
7440 || (in->inSymSeed.t.size != 0 && in->oldParent == TPM_RH_NULL))
7442 if(in->oldParent != TPM_RH_NULL)
7445 oldParent = ObjectGet(in->oldParent);
7447 if(!ObjectIsStorage(in->oldParent))
7452 result = CryptSecretDecrypt(in->oldParent, NULL,
7453 "DUPLICATE", &in->inSymSeed, &data);
7461 Copyright © TCG 2006-2013
7535 result = UnwrapOuter(in->oldParent, &in->name,
7536 oldParent->publicArea.nameAlg, (TPM2B_SEED *) &data,
7538 in->inDuplicate.t.size, in->inDuplicate.t.buffer);
7543 CryptGetHashDigestSize(oldParent->publicArea.nameAlg);
7544 privateBlob.t.size = in->inDuplicate.t.size - hashSize;
7545 MemoryCopy(privateBlob.t.buffer, in->inDuplicate.t.buffer + hashSize,
7551 privateBlob = in->inDuplicate;
7556 if(in->newParent != TPM_RH_NULL)
7560 newParent = ObjectGet(in->newParent);
7562 if(!ObjectIsStorage(in->newParent))
7567 out->outSymSeed.t.size = sizeof(out->outSymSeed.t.secret);
7568 result = CryptSecretEncrypt(in->newParent,
7569 "DUPLICATE", &data, &out->outSymSeed);
7574 CryptGetHashDigestSize(newParent->publicArea.nameAlg);
7575 out->outDuplicate.t.size = privateBlob.t.size;
7576 MemoryCopy(out->outDuplicate.t.buffer + hashSize, privateBlob.t.buffer,
7577 privateBlob.t.size, sizeof(out->outDuplicate.t.buffer));
7579 out->outDuplicate.t.size = ProduceOuterWrap(in->newParent, &in->name,
7580 newParent->publicArea.nameAlg,
7583 out->outDuplicate.t.size,
7584 out->outDuplicate.t.buffer);
7588 out->outSymSeed.t.size = 0;
7590 out->outDuplicate = privateBlob;
7597 Copyright © TCG 2006-2013
7615 Copyright © TCG 2006-2013
7635 Recovery of the sensitive data of the object occurs in the TPM in a three-step process in the follo…
7639 If present, the outer layer of symmetric encryption is removed. If inSymSeed has a non-zero size, t…
7668 by a non-zero value for duplicate.data.integrity.size. The integrity of the private area is validat…
7676 It is not necessary to validate that the sensitive area data is cryptographically bound to the publ…
7689 parent. So, it is sufficient to validate the object’s properties (attribute and public -private bin…
7693 checked before the sensitive area is used, or unmarshaled.
7698 Checking the integrity before the data is used prevents attacks on the sensitive area by fuzzing the
7705 Copyright © TCG 2006-2013
7715 The symmetric re-encryption is the normal integrity generation and symmetric encryption applied to
7722 Copyright © TCG 2006-2013
7834 the sensitive area encrypted with the symmetric key of
7838 Copyright © TCG 2006-2013
7861 non-duplicable storage key represented by objectPublic and its
7882 non-duplicable storage key represented by objectPublic and its
7888 secret; or unmarshaling sensitive value from duplicate failed the
7926 RSA key referenced by parentHandle; or unmarshaling sensitive
7932 non-storage key with symmetric algorithm different from
7937 unsupported type of objectPublic; or non-duplicable storage key
7954 Copyright © TCG 2006-2013
8050 sensitive;
8063 in->objectPublic.t.publicArea.objectAttributes.fixedTPM == SET
8064 || in->objectPublic.t.publicArea.objectAttributes.fixedParent == SET)
8067 parentObject = ObjectGet(in->parentHandle);
8070 if(in->symmetricAlg.algorithm != TPM_ALG_NULL)
8073 innerKeySize = in->symmetricAlg.keyBits.sym;
8075 if(in->encryptionKey.t.size != (innerKeySize + 7) / 8)
8082 if(in->encryptionKey.t.size != 0)
8086 if(in->inSymSeed.t.size != 0)
8091 result = CryptSecretDecrypt(in->parentHandle, NULL, "DUPLICATE",
8092 &in->inSymSeed, &data);
8102 ObjectComputeName(&(in->objectPublic.t.publicArea), &name);
8108 Copyright © TCG 2006-2013
8164 // Retrieve sensitive from private.
8166 result = DuplicateToSensitive(&in->duplicate, &name, in->parentHandle,
8167 in->objectPublic.t.publicArea.nameAlg,
8168 (TPM2B_SEED *) &data, &in->symmetricAlg,
8169 &in->encryptionKey, &sensitive);
8174 if(parentObject->publicArea.objectAttributes.fixedTPM == SET)
8182 result = PublicAttributesValidation(TRUE, in->parentHandle,
8183 &in->objectPublic.t.publicArea);
8188 result = ObjectLoad(TPM_RH_NULL, &in->objectPublic.t.publicArea,
8189 &sensitive, NULL, in->parentHandle, FALSE,
8198 // Prepare output private data from sensitive
8199 SensitiveToPrivate(&sensitive, &name, in->parentHandle,
8200 in->objectPublic.t.publicArea.nameAlg,
8201 &out->outPrivate);
8209 Copyright © TCG 2006-2013
8226 The commands in this clause provide low-level primitives for access to the asymmetric algorithms
8308 Copyright © TCG 2006-2013
8369 the last octet in label is not zero. If a zero octet occurs before label.buffer[label.size-1], the …
8388 Copyright © TCG 2006-2013
8486 Copyright © TCG 2006-2013
8566 the key referenced by keyHandle, or label is not a null-terminated
8594 rsaKey = ObjectGet(in->keyHandle);
8596 if(rsaKey->publicArea.type != TPM_ALG_RSA)
8599 if(rsaKey->publicArea.objectAttributes.decrypt != SET)
8602 if(in->label.t.size > 0)
8604 // label is present, so make sure that is it NULL-terminated
8605 if(in->label.t.buffer[in->label.t.size - 1] != 0)
8607 label = (char *)in->label.t.buffer;
8611 scheme = CryptSelectRSAScheme(in->keyHandle, &in->inScheme);
8617 out->outData.t.size = sizeof(out->outData.t.buffer);
8623 Copyright © TCG 2006-2013
8638 result = CryptEncryptRSA(&out->outData.t.size, out->outData.t.buffer, rsaKey,
8639 scheme, in->message.t.size, in->message.t.buffer,
8649 Copyright © TCG 2006-2013
8683 shall be a NULL-terminated string or the TPM will return TPM_RC_VALUE.
8699 Copyright © TCG 2006-2013
8793 Copyright © TCG 2006-2013
8901 rsaKey = ObjectGet(in->keyHandle);
8903 if(rsaKey->publicArea.type != TPM_ALG_RSA)
8907 rsaKey->publicArea.objectAttributes.restricted == SET
8908 || rsaKey->publicArea.objectAttributes.decrypt == CLEAR)
8915 NOTE: Proper operation of this command requires that the sensitive area
8917 to use the sensitive area of the key. In order to check the authorization,
8918 the sensitive area has to be loaded, even if authorization is with policy.
8920 // If label is present, make sure that it is a NULL-terminated string
8921 if(in->label.t.size > 0)
8923 // Present, so make sure that it is NULL-terminated
8924 if(in->label.t.buffer[in->label.t.size - 1] != 0)
8926 label = (char *)in->label.t.buffer;
8930 scheme = CryptSelectRSAScheme(in->keyHandle, &in->inScheme);
8937 Copyright © TCG 2006-2013
8966 out->message.t.size = sizeof(out->message.t.buffer);
8967 result = CryptDecryptRSA(&out->message.t.size, out->message.t.buffer, rsaKey,
8968 scheme, in->cipherText.t.size,
8969 in->cipherText.t.buffer,
8979 Copyright © TCG 2006-2013
8996 keyHandle shall refer to a loaded ECC key. The sensitive portion of this key need not be loaded.
9011 Copyright © TCG 2006-2013
9086 Copyright © TCG 2006-2013
9158 keyHandle does not reference a non-restricted decryption ECC key
9178 sensitive;
9182 eccKey = ObjectGet(in->keyHandle);
9183 // Input key must be a non-restricted, decrypt ECC key
9185 eccKey->publicArea.type != TPM_ALG_ECC
9186 || eccKey->publicArea.objectAttributes.restricted == SET
9187 || eccKey->publicArea.objectAttributes.decrypt != SET
9194 CryptNewEccKey(eccKey->publicArea.parameters.eccDetail.curveID,
9195 &out->pubPoint.t.point, &sensitive);
9196 out->pubPoint.t.size = TPMS_ECC_POINT_Marshal(&out->pubPoint.t.point,
9199 result = CryptEccPointMultiply(&out->zPoint.t.point,
9200 eccKey->publicArea.parameters.eccDetail.curveID,
9201 &sensitive, &eccKey->publicArea.unique.ecc);
9211 out->zPoint.t.size = TPMS_ECC_POINT_Marshal(&out->zPoint.t.point, NULL, NULL);
9220 Copyright © TCG 2006-2013
9248 Copyright © TCG 2006-2013
9326 Copyright © TCG 2006-2013
9346 keyHandle does not reference a non-restricted decryption ECC key
9414 eccKey = ObjectGet(in->keyHandle);
9415 // Input key must be a non-restricted, decrypt ECC key
9417 eccKey->publicArea.type != TPM_ALG_ECC
9418 || eccKey->publicArea.objectAttributes.restricted == SET
9419 || eccKey->publicArea.objectAttributes.decrypt != SET
9424 result = CryptEccPointMultiply(&out->outPoint.t.point,
9425 eccKey->publicArea.parameters.eccDetail.curveID,
9426 &eccKey->sensitive.sensitive.ecc,
9427 &in->inPoint.t.point);
9430 out->outPoint.t.size = TPMS_ECC_POINT_Marshal(&out->outPoint.t.point,
9440 Copyright © TCG 2006-2013
9454 This command returns the parameters of an ECC curve identified by its TCG-assigned curveID.
9514 Copyright © TCG 2006-2013
9568 if(CryptEccGetParameters(in->curveID, &out->parameters))
9581 This command supports two-phase key exchange protocols. The command is used in combination with
9590 The TPM will compute Z or Zs and Ze according to the selected scheme. If the scheme is not a two-ph…
9593 The two-phase key schemes that were assigned an algorithm ID as of the time of the publication of t…
9602 For TPM_ALG_ECDH outZ1 will be Zs and outZ2 will Ze as defined in 6.1.1.2 of SP800-56A.
9608 Copyright © TCG 2006-2013
9618 A non-restricted decryption key using ECDH may be used in either TPM2_ECDH_ZGen() or
9632 The Z values returned by the TPM are a full point and not ju st an x-coordinate.
9641 Copyright © TCG 2006-2013
9745 Copyright © TCG 2006-2013
9855 eccKey = ObjectGet(in->keyA);
9857 if(eccKey->publicArea.type != TPM_ALG_ECC)
9861 eccKey->publicArea.objectAttributes.restricted == SET
9862 || eccKey->publicArea.objectAttributes.decrypt != SET
9867 scheme = eccKey->publicArea.parameters.asymDetail.scheme.scheme;
9870 if(scheme != in->inScheme)
9874 scheme = in->inScheme;
9878 if(!CryptEccIsPointOnCurve(eccKey->publicArea.parameters.eccDetail.curveID,
9879 &in->inQsB.t.point))
9881 if(!CryptEccIsPointOnCurve(eccKey->publicArea.parameters.eccDetail.curveID,
9887 Copyright © TCG 2006-2013
9922 &in->inQeB.t.point))
9924 if(!CryptGenerateR(&r, &in->counter,
9925 eccKey->publicArea.parameters.eccDetail.curveID,
9929 result = CryptEcc2PhaseKeyExchange(&out->outZ1.t.point,
9930 &out->outZ2.t.point,
9931 eccKey->publicArea.parameters.eccDetail.curveID,
9933 &eccKey->sensitive.sensitive.ecc,
9935 &in->inQsB.t.point,
9936 &in->inQeB.t.point);
9939 CryptEndCommit(in->counter);
9948 Copyright © TCG 2006-2013
9963 The commands in this clause provide low-level primitives for access to the symmetric algorithms
9976 Copyright © TCG 2006-2013
10010 In Output Feedback (OFB), the output of the pseudo-random function (the block encryption
10053 Copyright © TCG 2006-2013
10073 incremental results and return TPM_RC_SUCCESS rather than TPM_RC_CANCEL. In such case,
10080 Copyright © TCG 2006-2013
10183 Copyright © TCG 2006-2013
10289 symKey = ObjectGet(in->keyHandle);
10292 symKey->publicArea.type != TPM_ALG_SYMCIPHER
10293 || symKey->attributes.publicOnly == SET)
10296 if( in->mode == TPM_ALG_NULL)
10297 in->mode = symKey->publicArea.parameters.symDetail.sym.mode.sym;
10301 symKey->publicArea.objectAttributes.restricted == SET
10302 && symKey->publicArea.parameters.symDetail.sym.mode.sym != in->mode)
10306 // TPM_ALG_NULL so setting in->mode to the mode of the key should have
10308 if(in->mode == TPM_ALG_NULL)
10312 keySize = symKey->publicArea.parameters.symDetail.sym.keyBits.sym;
10313 alg = symKey->publicArea.parameters.symDetail.sym.algorithm;
10316 (in->mode == TPM_ALG_ECB && in->ivIn.t.size != 0)
10317 || (in->mode != TPM_ALG_ECB && in->ivIn.t.size != blockSize))
10324 Copyright © TCG 2006-2013
10379 (in->mode == TPM_ALG_CBC || in->mode == TPM_ALG_ECB)
10380 && (in->inData.t.size % blockSize) != 0)
10385 out->ivOut = in->ivIn;
10387 key = symKey->sensitive.sensitive.sym.t.buffer;
10390 out->outData.t.size = in->inData.t.size;
10391 if(in->decrypt == YES)
10394 CryptSymmetricDecrypt(out->outData.t.buffer,
10396 keySize, in->mode, key,
10397 &(out->ivOut),
10398 in->inData.t.size,
10399 in->inData.t.buffer);
10404 CryptSymmetricEncrypt(out->outData.t.buffer,
10407 in->mode, key,
10408 &(out->ivOut),
10409 in->inData.t.size,
10410 in->inData.t.buffer);
10419 Copyright © TCG 2006-2013
10449 Copyright © TCG 2006-2013
10542 Copyright © TCG 2006-2013
10621 out->outHash.t.size = CryptStartHash(in->hashAlg, &hashState);
10623 CryptUpdateDigest2B(&hashState, &in->data.b);
10625 CryptCompleteHash2B(&hashState, &out->outHash.b);
10627 out->validation.tag = TPM_ST_HASHCHECK;
10628 out->validation.hierarchy = in->hierarchy;
10629 if(in->hierarchy == TPM_RH_NULL)
10632 out->validation.hierarchy = TPM_RH_NULL;
10633 out->validation.digest.t.size = 0;
10635 else if( in->data.t.size >= sizeof(TPM_GENERATED)
10636 && !TicketIsSafe(&in->data.b))
10639 out->validation.hierarchy = TPM_RH_NULL;
10640 out->validation.digest.t.size = 0;
10645 TicketComputeHashCheck(in->hierarchy, &out->outHash, &out->validation);
10654 Copyright © TCG 2006-2013
10691 Copyright © TCG 2006-2013
10774 Copyright © TCG 2006-2013
10880 hmacObject = ObjectGet(in->handle);
10881 publicArea = &hmacObject->publicArea;
10883 if(publicArea->type != TPM_ALG_KEYEDHASH)
10885 if(publicArea->objectAttributes.sign != SET)
10888 hashAlg = publicArea->parameters.keyedHashDetail.scheme.details.hmac.hashAlg;
10891 if(publicArea->objectAttributes.restricted == SET)
10893 if(in->hashAlg != TPM_ALG_NULL && in->hashAlg != hashAlg)
10898 // for a non-restricted key, use hashAlg if it is provided;
10899 if(in->hashAlg != TPM_ALG_NULL)
10900 hashAlg = in->hashAlg;
10912 Copyright © TCG 2006-2013
10934 out->outHMAC.t.size = CryptStartHMAC2B(hashAlg,
10935 &hmacObject->sensitive.sensitive.bits.b,
10938 CryptUpdateDigest2B(&hmacState, &in->buffer.b);
10940 CryptCompleteHMAC2B(&hmacState, &out->outHMAC.b);
10948 Copyright © TCG 2006-2013
10979 data returned by this command is TPM implementation-dependent.
10985 Copyright © TCG 2006-2013
11053 Copyright © TCG 2006-2013
11104 if(in->bytesRequested > sizeof(TPMU_HA))
11105 out->randomBytes.t.size = sizeof(TPMU_HA);
11107 out->randomBytes.t.size = in->bytesRequested;
11108 CryptGenerateRandom(out->randomBytes.t.size, out->randomBytes.t.buffer);
11116 Copyright © TCG 2006-2013
11133 The "additional information" is as defined in SP800 -90A.
11141 Copyright © TCG 2006-2013
11203 Copyright © TCG 2006-2013
11237 CryptStirRandom(in->inData.t.size, in->inData.t.buffer);
11245 Copyright © TCG 2006-2013
11274 The structure of a sequence object is vendor -dependent.
11284 hashAlg is TPM_ALG_NULL in which case it will use the default scheme of the key.
11384 Copyright © TCG 2006-2013
11466 Copyright © TCG 2006-2013
11571 hmacObject = ObjectGet(in->handle);
11572 publicArea = &hmacObject->publicArea;
11574 if(publicArea->type != TPM_ALG_KEYEDHASH)
11576 if(publicArea->objectAttributes.sign != SET)
11579 hashAlg = publicArea->parameters.keyedHashDetail.scheme.details.hmac.hashAlg;
11582 if(publicArea->objectAttributes.restricted == SET)
11584 if(in->hashAlg != TPM_ALG_NULL && in->hashAlg != hashAlg)
11589 // for a non-restricted key, use hashAlg if it is provided;
11590 if(in->hashAlg != TPM_ALG_NULL)
11591 hashAlg = in->hashAlg;
11604 Copyright © TCG 2006-2013
11624 in->handle,
11625 &in->auth,
11626 &out->sequenceHandle);
11633 Copyright © TCG 2006-2013
11659 Copyright © TCG 2006-2013
11734 Copyright © TCG 2006-2013
11787 if(in->hashAlg == TPM_ALG_NULL)
11790 return ObjectCreateEventSequence(&in->auth, &out->sequenceHandle);
11793 return ObjectCreateHashSequence(in->hashAlg, &in->auth, &out->sequenceHandle);
11800 Copyright © TCG 2006-2013
11836 Copyright © TCG 2006-2013
11906 Copyright © TCG 2006-2013
11996 object = ObjectGet(in->sequenceHandle);
12001 if(object->attributes.eventSeq == SET)
12011 CryptUpdateDigest2B(&hashObject->state.hashState[i], &in->buffer.b);
12019 if(hashObject->attributes.hashSeq == SET)
12022 if(hashObject->attributes.firstBlock == CLEAR)
12025 hashObject->attributes.firstBlock = SET;
12029 if(TicketIsSafe(&in->buffer.b))
12030 hashObject->attributes.ticketSafe = SET;
12033 CryptUpdateDigest2B(&hashObject->state.hashState[0], &in->buffer.b);
12039 Copyright © TCG 2006-2013
12061 else if(object->attributes.hmacSeq == SET)
12066 CryptUpdateDigest2B(&hashObject->state.hmacState, &in->buffer.b);
12076 Copyright © TCG 2006-2013
12116 Copyright © TCG 2006-2013
12207 Copyright © TCG 2006-2013
12301 object = ObjectGet(in->sequenceHandle);
12304 object->attributes.hashSeq == CLEAR
12305 && object->attributes.hmacSeq == CLEAR)
12308 if(object->attributes.hashSeq == SET)
12314 CryptUpdateDigest2B(&hashObject->state.hashState[0], &in->buffer.b);
12316 out->result.t.size
12318 CryptGetContextAlg(&hashObject->state.hashState[0]));
12319 CryptCompleteHash2B(&hashObject->state.hashState[0], &out->result.b);
12321 if(hashObject->attributes.firstBlock == CLEAR)
12325 if(TicketIsSafe(&in->buffer.b))
12326 hashObject->attributes.ticketSafe = SET;
12329 out->validation.tag = TPM_ST_HASHCHECK;
12330 out->validation.hierarchy = in->hierarchy;
12331 if(in->hierarchy == TPM_RH_NULL)
12334 out->validation.digest.t.size = 0;
12340 Copyright © TCG 2006-2013
12389 else if(object->attributes.ticketSafe == CLEAR)
12392 out->validation.hierarchy = TPM_RH_NULL;
12393 out->validation.digest.t.size = 0;
12398 TicketComputeHashCheck(out->validation.hierarchy,
12399 &out->result, &out->validation);
12410 CryptUpdateDigest2B(&hashObject->state.hmacState, &in->buffer.b);
12412 out->result.t.size =
12414 CryptGetContextAlg(&hashObject->state.hmacState.hashState));
12415 CryptCompleteHMAC2B(&(hashObject->state.hmacState), &out->result.b);
12417 out->validation.tag = TPM_ST_HASHCHECK;
12418 out->validation.hierarchy = TPM_RH_NULL;
12419 out->validation.digest.t.size = 0;
12423 object->attributes.evict = SET;
12431 Copyright © TCG 2006-2013
12459 Copyright © TCG 2006-2013
12543 Copyright © TCG 2006-2013
12645 hashObject = (HASH_OBJECT *)ObjectGet(in->sequenceHandle);
12647 if(hashObject->attributes.eventSeq != SET)
12650 if(in->pcrHandle != TPM_RH_NULL)
12653 if(!PCRIsExtendAllowed(in->pcrHandle))
12660 // state will have to change if this is a state-saved PCR regardless
12665 if(gp.orderlyState != SHUTDOWN_NONE && PCRIsStateSaved(in->pcrHandle))
12673 out->results.count = 0;
12682 Copyright © TCG 2006-2013
12715 CryptUpdateDigest2B(&hashObject->state.hashState[i], &in->buffer.b);
12717 out->results.digests[out->results.count].hashAlg = hashAlg;
12718 CryptCompleteHash(&hashObject->state.hashState[i],
12720 (BYTE *) &out->results.digests[out->results.count].digest);
12722 if(in->pcrHandle != TPM_RH_NULL)
12723 PCRExtend(in->pcrHandle, hashAlg,
12725 (BYTE *) &out->results.digests[out->results.count].digest);
12726 out->results.count++;
12730 hashObject->attributes.evict = SET;
12738 Copyright © TCG 2006-2013
12781 number. These values may be considered privacy-sensitive, because they would aid in the correlation…
12790 which the bits are added is implementation-dependent.
12812 Copyright © TCG 2006-2013
12828 Copyright © TCG 2006-2013
12843 …ic area with a given Name is selfconsistent and associated with a valid sensitive area. If a relyi…
12858 has not validated that the public area is associated with a matched sensitive area, then the public
12868 Copyright © TCG 2006-2013
12968 Copyright © TCG 2006-2013
13071 result = FillInAttestInfo(in->signHandle,
13072 &in->inScheme,
13073 &in->qualifyingData,
13087 ObjectGetName(in->objectHandle,
13090 ObjectGetQualifiedName(in->objectHandle,
13096 result = SignAttestInfo(in->signHandle,
13097 &in->inScheme,
13099 &in->qualifyingData,
13100 &out->certifyInfo,
13106 Copyright © TCG 2006-2013
13130 &out->signature);
13139 if(in->signHandle != TPM_RH_NULL)
13148 Copyright © TCG 2006-2013
13191 Copyright © TCG 2006-2013
13241 user-provided qualifying data
13301 Copyright © TCG 2006-2013
13410 name.t.size = ObjectGetName(in->objectHandle, &name.t.name);
13411 // Re-compute ticket
13412 TicketComputeCreation(in->creationTicket.hierarchy, &name,
13413 &in->creationHash, &ticket);
13415 if(!Memory2BEqual(&ticket.digest.b, &in->creationTicket.digest.b))
13419 result = FillInAttestInfo(in->signHandle, &in->inScheme, &in->qualifyingData,
13433 certifyInfo.attested.creation.creationHash = in->creationHash;
13439 Copyright © TCG 2006-2013
13477 result = SignAttestInfo(in->signHandle,
13478 &in->inScheme,
13480 &in->qualifyingData,
13481 &out->certifyInfo,
13482 &out->signature);
13490 if(in->signHandle != TPM_RH_NULL)
13499 Copyright © TCG 2006-2013
13527 Copyright © TCG 2006-2013
13622 Copyright © TCG 2006-2013
13726 result = FillInAttestInfo(in->signHandle,
13727 &in->inScheme,
13728 &in->qualifyingData,
13743 hashAlg = in->inScheme.details.any.hashAlg;
13748 &in->PCRselect,
13752 quoted.attested.quote.pcrSelect = in->PCRselect;
13758 Copyright © TCG 2006-2013
13797 result = SignAttestInfo(in->signHandle,
13798 &in->inScheme,
13800 &in->qualifyingData,
13801 &out->quoted,
13802 &out->signature);
13807 if(in->signHandle != TPM_RH_NULL)
13816 Copyright © TCG 2006-2013
13861 Copyright © TCG 2006-2013
13918 user-provided qualifying data – may be zero-length
13966 Copyright © TCG 2006-2013
14072 session = SessionGet(in->sessionHandle);
14074 if(session->attributes.isAudit == CLEAR)
14079 result = FillInAttestInfo(in->signHandle,
14080 &in->inScheme,
14081 &in->qualifyingData,
14099 Copyright © TCG 2006-2013
14136 auditInfo.attested.sessionAudit.sessionDigest = session->u2.auditDigest;
14138 if(g_exclusiveAuditSession == in->sessionHandle)
14146 result = SignAttestInfo(in->signHandle,
14147 &in->inScheme,
14149 &in->qualifyingData,
14150 &out->auditInfo,
14151 &out->signature);
14156 if(in->signHandle != TPM_RH_NULL)
14165 Copyright © TCG 2006-2013
14190 The way that the TPM tracks that the digest is clear is vendor -dependent. The reference
14204 Copyright © TCG 2006-2013
14302 Copyright © TCG 2006-2013
14404 result = FillInAttestInfo(in->signHandle,
14405 &in->inScheme,
14406 &in->qualifyingData,
14439 Copyright © TCG 2006-2013
14472 result = SignAttestInfo(in->signHandle,
14473 &in->inScheme,
14475 &in->qualifyingData,
14476 &out->auditInfo,
14477 &out->signature);
14481 if(in->signHandle != TPM_RH_NULL)
14496 Copyright © TCG 2006-2013
14532 correlate the obfuscated values with the clear -text values.
14538 Copyright © TCG 2006-2013
14627 standard TPM-generated attestation block
14639 Copyright © TCG 2006-2013
14741 result = FillInAttestInfo(in->signHandle,
14742 &in->inScheme,
14743 &in->qualifyingData,
14766 result = SignAttestInfo(in->signHandle,
14772 Copyright © TCG 2006-2013
14796 &in->inScheme,
14798 &in->qualifyingData,
14799 &out->timeInfo,
14800 &out->signature);
14805 if(in->signHandle != TPM_RH_NULL)
14814 Copyright © TCG 2006-2013
14832 …Mgenerated keys are only useful for a single operation. Some of these single-use keys are used in …
14855 pseudo-random values for the ephemeral keys. Instead of keeping the full value of the key in memory…
14857 new pseudo-random value.
14858 Using the counter to generate pseudo-random private ephemeral keys greatly simplifies tracking of k…
14871 Copyright © TCG 2006-2013
14919 a signing operation; values of i are 0 to 2n-1
14962 Copyright © TCG 2006-2013
14983 Copyright © TCG 2006-2013
15033 octet array used to derive x-coordinate of a base point
15084 least-significant 16 bits of commitCount
15090 Copyright © TCG 2006-2013
15212 eccKey = ObjectGet(in->signHandle);
15214 if(eccKey->publicArea.type != TPM_ALG_ECC)
15217 if(eccKey->publicArea.objectAttributes.restricted == SET)
15219 if(eccKey->publicArea.objectAttributes.sign != SET)
15222 eccKey->publicArea.parameters.eccDetail.scheme.scheme))
15228 if(in->s2.t.size)
15232 if((in->s2.t.size == 0) != (in->y2.t.size == 0))
15238 Copyright © TCG 2006-2013
15315 eccKey->publicArea.parameters.eccDetail.curveID);
15325 eccKey->publicArea.parameters.eccDetail.curveID,
15326 &eccKey->name))
15329 if(in->s2.t.size != 0)
15333 MemoryCopy2B(&P2.y.b, &in->y2.b, sizeof(P2.y.t.buffer));
15337 hashResults = CryptHashBlock(eccKey->publicArea.nameAlg,
15338 in->s2.t.size,
15339 in->s2.t.buffer,
15340 p->size,
15351 if(!CryptEccIsPointOnCurve(eccKey->publicArea.parameters.eccDetail.curveID,
15354 if(eccKey->attributes.publicOnly == SET)
15361 if(in->P1.t.size > 4)
15368 Copyright © TCG 2006-2013
15409 pP1 = &in->P1.t.point;
15410 if(!CryptEccIsPointOnCurve(eccKey->publicArea.parameters.eccDetail.curveID,
15418 result = CryptCommitCompute(&out->K.t.point,
15419 &out->L.t.point,
15420 &out->E.t.point,
15421 eccKey->publicArea.parameters.eccDetail.curveID,
15424 &eccKey->sensitive.sensitive.ecc,
15428 out->K.t.size = TPMS_ECC_POINT_Marshal(&out->K.t.point, NULL, NULL);
15429 out->L.t.size = TPMS_ECC_POINT_Marshal(&out->L.t.point, NULL, NULL);
15430 out->E.t.size = TPMS_ECC_POINT_Marshal(&out->E.t.point, NULL, NULL);
15433 out->counter = CryptCommit();
15442 Copyright © TCG 2006-2013
15456 TPM2_EC_Ephemeral() creates an ephemeral key for use in a two-phase key exchange protocol.
15464 Copyright © TCG 2006-2013
15532 least-significant 16 bits of commitCount
15538 Copyright © TCG 2006-2013
15607 in->curveID,
15610 CryptEccPointMultiply(&out->Q.t.point, in->curveID, &r, NULL);
15612 out->counter = CryptCommit();
15621 Copyright © TCG 2006-2013
15652 The sensitive area of the symmetric object is required to allow verification of the symmetric
15659 Copyright © TCG 2006-2013
15738 Copyright © TCG 2006-2013
15845 signObject = ObjectGet(in->keyHandle);
15847 if(signObject->publicArea.objectAttributes.sign != SET)
15849 // If it doesn't have a sensitive area loaded
15852 signObject->attributes.publicOnly == SET
15853 && signObject->publicArea.type == TPM_ALG_KEYEDHASH
15858 result = CryptVerifySignature(in->keyHandle, &in->digest, &in->signature);
15862 hierarchy = ObjectGetHierarchy(in->keyHandle);
15865 || signObject->publicArea.nameAlg == TPM_ALG_NULL)
15869 out->validation.tag = TPM_ST_VERIFIED;
15870 out->validation.hierarchy = TPM_RH_NULL;
15871 out->validation.digest.t.size = 0;
15880 Copyright © TCG 2006-2013
15898 name.t.size = ObjectGetName(in->keyHandle, &name.t.name);
15900 TicketComputeVerified(hierarchy, &in->digest, &name, &out->validation);
15909 Copyright © TCG 2006-2013
15960 Copyright © TCG 2006-2013
16052 Copyright © TCG 2006-2013
16159 signKey = ObjectGet(in->keyHandle);
16162 in->validation.digest.t.size != 0
16163 || signKey->publicArea.objectAttributes.restricted == SET)
16166 TicketComputeHashCheck(in->validation.hierarchy, &in->digest, &ticket);
16167 if(!Memory2BEqual(&in->validation.digest.b, &ticket.digest.b))
16173 result = CryptSelectSignScheme(in->keyHandle, &in->inScheme);
16183 result = CryptSign(in->keyHandle, &in->inScheme, &in->digest, &out->signature);
16189 Copyright © TCG 2006-2013
16208 Copyright © TCG 2006-2013
16260 Copyright © TCG 2006-2013
16304 Copyright © TCG 2006-2013
16389 Copyright © TCG 2006-2013
16490 in->auditAlg != TPM_ALG_NULL
16491 && in->auditAlg != gp.auditHashAlg)
16494 if(in->setList.count != 0 || in->clearList.count != 0)
16497 gp.auditHashAlg = in->auditAlg;
16507 for(i = 0; i < in->setList.count; i++)
16509 if(CommandAuditSet(in->setList.commandCodes[i]))
16512 for(i = 0; i < in->clearList.count; i++)
16514 if(CommandAuditClear(in->clearList.commandCodes[i]))
16525 Copyright © TCG 2006-2013
16546 Copyright © TCG 2006-2013
16563 In TPM 1.2, an Event was hashed using SHA-1 and then the 20-octet digest was extended to a PCR
16576 an authorization policy. The platform-specific specifications determine which PCR may be controlled…
16582 If a platform-specific specification indicates that PCR are grouped, then all the PCR in the group …
16585 modifies (Extends or resets) a PCR unless the platform-specific specification explicitly excludes t…
16592 A platform-specific specification may designate a set of PCR that are under control of the TCB. The…
16604 Copyright © TCG 2006-2013
16655 the bank-specific data to be extended
16695 Copyright © TCG 2006-2013
16767 Copyright © TCG 2006-2013
16867 data left over. In either case, it will cause an unmarshaling error and this
16871 if(in->pcrHandle == TPM_RH_NULL)
16874 if(!PCRIsExtendAllowed(in->pcrHandle))
16878 if(PCRIsStateSaved(in->pcrHandle) && gp.orderlyState != SHUTDOWN_NONE)
16886 for(i = 0; i < in->digests.count; i++)
16888 PCRExtend(in->pcrHandle, in->digests.digests[i].hashAlg,
16889 CryptGetHashDigestSize(in->digests.digests[i].hashAlg),
16890 (BYTE *) &in->digests.digests[i].digest);
16899 Copyright © TCG 2006-2013
16940 Copyright © TCG 2006-2013
17016 Copyright © TCG 2006-2013
17114 if(in->pcrHandle != TPM_RH_NULL)
17117 if(!PCRIsExtendAllowed(in->pcrHandle))
17121 if(PCRIsStateSaved(in->pcrHandle) && gp.orderlyState != SHUTDOWN_NONE)
17129 out->digests.count = HASH_COUNT;
17134 out->digests.digests[i].hashAlg = hash;
17136 CryptUpdateDigest2B(&hashState, &in->eventData.b);
17138 (BYTE *) &out->digests.digests[i].digest);
17139 if(in->pcrHandle != TPM_RH_NULL)
17140 PCRExtend(in->pcrHandle, hash, size,
17141 (BYTE *) &out->digests.digests[i].digest);
17150 Copyright © TCG 2006-2013
17185 Copyright © TCG 2006-2013
17266 Copyright © TCG 2006-2013
17314 PCRRead(&in->pcrSelectionIn, &out->pcrValues, &out->pcrUpdateCounter);
17315 out->pcrSelectionOut = in->pcrSelectionIn;
17323 Copyright © TCG 2006-2013
17365 Copyright © TCG 2006-2013
17460 Copyright © TCG 2006-2013
17537 out->allocationSuccess = PCRAllocate(&in->pcrAllocation, &out->maxPCR,
17538 &out->sizeNeeded, &out->sizeAvailable);
17539 // if re-configuration succeeds, set the flag to indicate PCR configuration is
17541 if(out->allocationSuccess == YES)
17550 Copyright © TCG 2006-2013
17566 A policy may only be associated with a PCR that has been defined by a platform-specific specificati…
17569 A platform-specific specification may group PCR so that they share a common policy. In such case, a
17574 PCR will be set to the default value defined in the platform-specific specification.
17597 Copyright © TCG 2006-2013
17679 Copyright © TCG 2006-2013
17766 if(in->authPolicy.t.size != CryptGetHashDigestSize(in->policyDigest))
17769 if(!PCRBelongsPolicyGroup(in->pcrNum, &groupIndex))
17773 gp.pcrPolicies.hashAlg[groupIndex] = in->policyDigest;
17774 gp.pcrPolicies.policy[groupIndex] = in->authPolicy;
17784 Copyright © TCG 2006-2013
17799 An authValue may only be associated with a PCR that has been defined by a platform-specific
17801 authorization for pcrNum, the TPM shall return TPM_RC_VALUE. A platform-specific specification may
17802 group PCR so that they share a common authorization value. In such case, a pcrNum that selects any …
17811 Copyright © TCG 2006-2013
17882 Copyright © TCG 2006-2013
17955 if(!PCRBelongsAuthGroup(in->pcrHandle, &groupIndex))
17958 // state clear data. If this is the case, Check if NV is available.
17969 gc.pcrAuthValues.auth[groupIndex] = in->auth;
17977 Copyright © TCG 2006-2013
18002 TPM_RC_LOCALITY is returned because the reset attributes are defined on a per -locality basis.
18008 Copyright © TCG 2006-2013
18072 Copyright © TCG 2006-2013
18145 if(!PCRIsResetAllowed(in->pcrHandle))
18149 if(PCRIsStateSaved(in->pcrHandle) && gp.orderlyState != SHUTDOWN_NONE)
18158 PCRSetValue(in->pcrHandle, 0);
18161 PCRChanged(in->pcrHandle);
18169 Copyright © TCG 2006-2013
18184 Measurement (D-CRTM) measurement sequence. On receipt of this indication, the TPM will initialize an
18188 A platform-specific specification may allow this indication before TPM2_Startup().
18200 Copyright © TCG 2006-2013
18287 // slot numbers and handle numbers. To handle the general case, scan for
18317 Copyright © TCG 2006-2013
18341 Copyright © TCG 2006-2013
18416 pAssert(hashObject->attributes.eventSeq);
18423 CryptUpdateDigest(&hashObject->state.hashState[i], dataSize, data);
18432 Copyright © TCG 2006-2013
18453 the platform-specific specifications as resettable by this event to the value indicated in the plat…
18463 index for CRTM PCR designated by a platform-specific
18472 initialization value specified in the platform-specific specification
18480 a platform-specific specification excludes modifications of PCR[DRTM] from causing an increment.
18481 A platform-specific specification may allow an H-CRTM Event Sequence before TPM2_Startup(). If so,
18482 _TPM_Hash_End will complete the digest, initialize PCR[0] with a digest-size value of 4, and then e…
18483 the H-CRTM Event Sequence data into PCR[0].
18496 Copyright © TCG 2006-2013
18613 CryptCompleteHash2B(&hashObject->state.hashState[i], &digest.b);
18615 // If this is H-DRTM, copy to HCRM PCR
18626 Copyright © TCG 2006-2013
18658 Copyright © TCG 2006-2013
18707 Copyright © TCG 2006-2013
18740 is non-zero, then the TPM shall return TPM_RC_EXPIRED.
18788 Copyright © TCG 2006-2013
18844 PolicyUpdate() uses two hashes because arg2 and arg3 are variable-sized and the concatenation of
18853 Copyright © TCG 2006-2013
18930 Copyright © TCG 2006-2013
18981 implementation-specific representation of the expiration time of
19007 Copyright © TCG 2006-2013
19051 time limit on authorization set by authorizing object. This 32-bit
19088 Copyright © TCG 2006-2013
19112 Copyright © TCG 2006-2013
19231 implementation-specific time value, used to indicate to
19239 the command was non-zero; this ticket will use the
19243 Copyright © TCG 2006-2013
19267 expiration indicates a time in the past or expiration is non-zero but no
19272 authObject need to have sensitive portion loaded
19363 expiration = (in->expiration < 0)
19364 ? -(in->expiration) : in->expiration;
19374 session = SessionGet(in->policySession);
19375 authObject = ObjectGet(in->authObject);
19385 if(session->attributes.isTrialPolicy == CLEAR)
19388 authTimeout = expiration * 1000 + session->startTime;
19390 &in->cpHashA, &in->nonceTPM,
19400 Copyright © TCG 2006-2013
19474 // Re-compute the digest being signed
19493 This 32-bit value is set to zero if the expiration
19512 authHash.t.size = CryptStartHash(CryptGetSignHashAlg(&in->auth),
19515 CryptUpdateDigest2B(&hashState, &in->nonceTPM.b);
19517 CryptUpdateDigestInt(&hashState, sizeof(UINT32), (BYTE*) &in->expiration);
19519 CryptUpdateDigest2B(&hashState, &in->cpHashA.b);
19521 CryptUpdateDigest2B(&hashState, &in->policyRef.b);
19526 result = CryptVerifySignature(in->authObject, &authHash, &in->auth);
19532 entityName.t.size = EntityGetName(in->authObject, &entityName.t.name);
19535 PolicyContextUpdate(TPM_CC_PolicySigned, &entityName, &in->policyRef,
19536 &in->cpHashA, authTimeout, session);
19538 // Create ticket and timeout buffer if in->expiration < 0 and this is not
19541 // when expiration is non-zero.
19543 in->expiration < 0
19544 && session->attributes.isTrialPolicy == CLEAR
19551 Copyright © TCG 2006-2013
19591 // TPM-specific.
19593 // array and it may not be aligned to accept a 64-bit value. The method
19594 // used has the side-effect of making the returned value a big-endian,
19595 // 64-bit value that is byte aligned.
19596 out->timeout.t.size = sizeof(UINT64);
19597 UINT64_TO_BYTE_ARRAY(authTimeout, out->timeout.t.buffer);
19599 TicketComputeAuth(TPM_ST_AUTH_SIGNED, EntityGetHierarchy(in->authObject),
19600 authTimeout, &in->cpHashA, &in->policyRef, &entityName,
19601 &out->policyTicket);
19607 out->timeout.t.size = 0;
19609 out->policyTicket.tag = TPM_ST_AUTH_SIGNED;
19610 out->policyTicket.hierarchy = TPM_RH_NULL;
19611 out->policyTicket.digest.t.size = 0;
19620 Copyright © TCG 2006-2013
19634 This command includes a secret-based authorization to a policy. The caller proves knowledge of the
19672 Copyright © TCG 2006-2013
19781 implementation-specific time value used to indicate to
19790 the command was non-zero
19796 Copyright © TCG 2006-2013
19900 expiration = (in->expiration < 0)
19901 ? -(in->expiration) : in->expiration;
19911 session = SessionGet(in->policySession);
19913 if(session->attributes.isTrialPolicy == CLEAR)
19916 authTimeout = expiration * 1000 + session->startTime;
19918 &in->cpHashA, &in->nonceTPM,
19927 entityName.t.size = EntityGetName(in->authHandle, &entityName.t.name);
19930 PolicyContextUpdate(TPM_CC_PolicySecret, &entityName, &in->policyRef,
19936 Copyright © TCG 2006-2013
19984 &in->cpHashA, authTimeout, session);
19986 // Create ticket and timeout buffer if in->expiration < 0 and this is not
19989 // when expiration is non-zero.
19991 in->expiration < 0
19992 && session->attributes.isTrialPolicy == CLEAR
19996 // TPM-specific.
19998 // array and it may not be aligned to accept a 64-bit value. The method
19999 // used has the side-effect of making the returned value a big-endian,
20000 // 64-bit value that is byte aligned.
20001 out->timeout.t.size = sizeof(UINT64);
20002 UINT64_TO_BYTE_ARRAY(authTimeout, out->timeout.t.buffer);
20004 TicketComputeAuth(TPM_ST_AUTH_SECRET, EntityGetHierarchy(in->authHandle),
20005 authTimeout, &in->cpHashA, &in->policyRef,
20006 &entityName, &out->policyTicket);
20011 out->timeout.t.size = 0;
20013 out->policyTicket.tag = TPM_ST_AUTH_SECRET;
20014 out->policyTicket.hierarchy = TPM_RH_NULL;
20015 out->policyTicket.digest.t.size = 0;
20024 Copyright © TCG 2006-2013
20060 Copyright © TCG 2006-2013
20162 Copyright © TCG 2006-2013
20269 session = SessionGet(in->policySession);
20276 if(session->attributes.isTrialPolicy)
20278 // Restore timeout data. The format of timeout buffer is TPM-specific.
20281 if(in->timeout.t.size != sizeof(UINT64))
20283 timeout = BYTE_ARRAY_TO_UINT64(in->timeout.t.buffer);
20286 &in->cpHashA, NULL,
20294 // Re-generate policy ticket by input parameters
20295 TicketComputeAuth(in->ticket.tag, in->ticket.hierarchy, timeout, &in->cpHashA,
20296 &in->policyRef, &in->authName, &ticketToCompare);
20302 Copyright © TCG 2006-2013
20336 if(!Memory2BEqual(&in->ticket.digest.b, &ticketToCompare.digest.b))
20341 if(in->ticket.tag == TPM_ST_AUTH_SIGNED)
20343 else if(in->ticket.tag == TPM_ST_AUTH_SECRET)
20350 PolicyContextUpdate(commandCode, &in->authName, &in->policyRef,
20351 &in->cpHashA, timeout, session);
20359 Copyright © TCG 2006-2013
20415 Copyright © TCG 2006-2013
20484 Copyright © TCG 2006-2013
20575 session = SessionGet(in->policySession);
20577 for(i = 0; i < in->pHashList.count; i++)
20580 session->attributes.isTrialPolicy == SET
20581 || (Memory2BEqual(&session->u2.policyDigest.b,
20582 &in->pHashList.digests[i].b))
20591 session->u2.policyDigest.t.size = CryptStartHash(session->authHashAlg,
20594 MemorySet(session->u2.policyDigest.t.buffer, 0,
20595 session->u2.policyDigest.t.size);
20596 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
20600 for(i = 0; i < in->pHashList.count; i++)
20603 CryptUpdateDigest2B(&hashState, &in->pHashList.digests[i].b);
20606 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
20617 Copyright © TCG 2006-2013
20633 Copyright © TCG 2006-2013
20714 Copyright © TCG 2006-2013
20790 Copyright © TCG 2006-2013
20896 session = SessionGet(in->policySession);
20898 if(session->attributes.isTrialPolicy == CLEAR)
20901 if(session->pcrCounter != 0 && session->pcrCounter != gr.pcrCounter)
20904 PCRComputeCurrentDigest(session->authHashAlg, &in->pcrs, &pcrDigest);
20907 if(in->pcrDigest.t.size != 0)
20909 if(!Memory2BEqual(&in->pcrDigest.b, &pcrDigest.b))
20916 pcrDigest = in->pcrDigest;
20925 CryptStartHash(session->authHashAlg, &hashState);
20927 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
20933 Copyright © TCG 2006-2013
20969 pcrSize = TPML_PCR_SELECTION_Marshal(&in->pcrs, &buffer, NULL);
20974 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
20976 if(session->attributes.isTrialPolicy == CLEAR)
20978 session->pcrCounter = gr.pcrCounter;
20987 Copyright © TCG 2006-2013
21026 Copyright © TCG 2006-2013
21095 Copyright © TCG 2006-2013
21198 session = SessionGet(in->policySession);
21201 marshalSize = TPMA_LOCALITY_Marshal(&in->locality, &buffer, NULL);
21207 TPMA_LOCALITY_Marshal(&session->commandLocality, &buffer, NULL);
21229 Copyright © TCG 2006-2013
21301 CryptStartHash(session->authHashAlg, &hashState);
21303 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
21309 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
21313 TPMA_LOCALITY_Unmarshal(&session->commandLocality, &buffer,
21322 Copyright © TCG 2006-2013
21396 The signed arithmetic operations are performed using twos-compliment.
21402 written. It is possible to use this change in the NV Index to create a write-once Index.
21408 Copyright © TCG 2006-2013
21504 Copyright © TCG 2006-2013
21618 nvBuffer[sizeof(in->operandB.t.buffer)];
21629 NvGetIndexInfo(in->nvIndex, &nvIndex);
21631 session = SessionGet(in->policySession);
21633 if(session->attributes.isTrialPolicy == CLEAR)
21638 result = NvReadAccessChecks(in->authHandle, in->nvIndex);
21641 if((nvIndex.publicArea.dataSize - in->offset) < in->operandB.t.size)
21645 NvGetIndexData(in->nvIndex, &nvIndex, in->offset,
21646 in->operandB.t.size, nvBuffer);
21647 switch(in->operation)
21653 Copyright © TCG 2006-2013
21727 case TPM_EO_EQ:
21729 if(CryptCompare(in->operandB.t.size, nvBuffer,
21730 in->operandB.t.size, in->operandB.t.buffer)
21733 case TPM_EO_NEQ:
21735 if(CryptCompare(in->operandB.t.size, nvBuffer,
21736 in->operandB.t.size, in->operandB.t.buffer)
21739 case TPM_EO_SIGNED_GT:
21741 if(CryptCompareSigned(in->operandB.t.size, nvBuffer,
21742 in->operandB.t.size, in->operandB.t.buffer)
21745 case TPM_EO_UNSIGNED_GT:
21747 if(CryptCompare(in->operandB.t.size, nvBuffer,
21748 in->operandB.t.size, in->operandB.t.buffer)
21751 case TPM_EO_SIGNED_LT:
21753 if(CryptCompareSigned(in->operandB.t.size, nvBuffer,
21754 in->operandB.t.size, in->operandB.t.buffer)
21757 case TPM_EO_UNSIGNED_LT:
21759 if(CryptCompare(in->operandB.t.size, nvBuffer,
21760 in->operandB.t.size, in->operandB.t.buffer)
21763 case TPM_EO_SIGNED_GE:
21765 if(CryptCompareSigned(in->operandB.t.size, nvBuffer,
21766 in->operandB.t.size, in->operandB.t.buffer)
21769 case TPM_EO_UNSIGNED_GE:
21771 if(CryptCompare(in->operandB.t.size, nvBuffer,
21772 in->operandB.t.size, in->operandB.t.buffer)
21775 case TPM_EO_SIGNED_LE:
21777 if(CryptCompareSigned(in->operandB.t.size, nvBuffer,
21778 in->operandB.t.size, in->operandB.t.buffer)
21781 case TPM_EO_UNSIGNED_LE:
21783 if(CryptCompare(in->operandB.t.size, nvBuffer,
21784 in->operandB.t.size, in->operandB.t.buffer)
21787 case TPM_EO_BITSET:
21795 Copyright © TCG 2006-2013
21886 for (i = 0; i < in->operandB.t.size; i++)
21887 if((nvBuffer[i] & in->operandB.t.buffer[i])
21888 != in->operandB.t.buffer[i])
21892 case TPM_EO_BITCLEAR:
21896 for (i = 0; i < in->operandB.t.size; i++)
21897 if((nvBuffer[i] & in->operandB.t.buffer[i]) != 0)
21908 argHash.t.size = CryptStartHash(session->authHashAlg, &hashState);
21910 CryptUpdateDigest2B(&hashState, &in->operandB.b);
21912 CryptUpdateDigestInt(&hashState, sizeof(UINT16), &in->offset);
21914 CryptUpdateDigestInt(&hashState, sizeof(TPM_EO), &in->operation);
21919 CryptStartHash(session->authHashAlg, &hashState);
21921 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
21927 nvName.t.size = EntityGetName(in->nvIndex, &nvName.t.name);
21930 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
21938 Copyright © TCG 2006-2013
22001 The signed arithmetic operations are performed using twos-compliment.
22009 Copyright © TCG 2006-2013
22094 Copyright © TCG 2006-2013
22202 // The time and clock vales are the first two 64-bit values in the clock
22203 if(in->offset < <K>sizeof(UINT64) + sizeof(UINT64))
22213 session = SessionGet(in->policySession);
22215 if(session->attributes.isTrialPolicy == CLEAR)
22219 result = TimeGetRange(in->offset, in->operandB.t.size, &infoData);
22222 switch(in->operation)
22224 case TPM_EO_EQ:
22226 if(CryptCompare(in->operandB.t.size, infoData,
22227 in->operandB.t.size, in->operandB.t.buffer) != 0)
22230 case TPM_EO_NEQ:
22232 if(CryptCompare(in->operandB.t.size, infoData,
22238 Copyright © TCG 2006-2013
22311 in->operandB.t.size, in->operandB.t.buffer)
22314 case TPM_EO_SIGNED_GT:
22316 if(CryptCompareSigned(in->operandB.t.size, infoData,
22317 in->operandB.t.size, in->operandB.t.buffer)
22320 case TPM_EO_UNSIGNED_GT:
22322 if(CryptCompare(in->operandB.t.size, infoData,
22323 in->operandB.t.size, in->operandB.t.buffer)
22326 case TPM_EO_SIGNED_LT:
22328 if(CryptCompareSigned(in->operandB.t.size, infoData,
22329 in->operandB.t.size, in->operandB.t.buffer)
22332 case TPM_EO_UNSIGNED_LT:
22334 if(CryptCompare(in->operandB.t.size, infoData,
22335 in->operandB.t.size, in->operandB.t.buffer)
22338 case TPM_EO_SIGNED_GE:
22340 if(CryptCompareSigned(in->operandB.t.size, infoData,
22341 in->operandB.t.size, in->operandB.t.buffer)
22344 case TPM_EO_UNSIGNED_GE:
22346 if(CryptCompare(in->operandB.t.size, infoData,
22347 in->operandB.t.size, in->operandB.t.buffer)
22350 case TPM_EO_SIGNED_LE:
22352 if(CryptCompareSigned(in->operandB.t.size, infoData,
22353 in->operandB.t.size, in->operandB.t.buffer)
22356 case TPM_EO_UNSIGNED_LE:
22358 if(CryptCompare(in->operandB.t.size, infoData,
22359 in->operandB.t.size, in->operandB.t.buffer)
22362 case TPM_EO_BITSET:
22366 for (i = 0; i < in->operandB.t.size; i++)
22368 (infoData[i] & in->operandB.t.buffer[i])
22369 != in->operandB.t.buffer[i])
22373 case TPM_EO_BITCLEAR:
22381 Copyright © TCG 2006-2013
22452 for (i = 0; i < in->operandB.t.size; i++)
22453 if((infoData[i] & in->operandB.t.buffer[i]) != 0)
22464 argHash.t.size = CryptStartHash(session->authHashAlg, &hashState);
22466 CryptUpdateDigest2B(&hashState, &in->operandB.b);
22468 CryptUpdateDigestInt(&hashState, sizeof(UINT16), &in->offset);
22470 CryptUpdateDigestInt(&hashState, sizeof(TPM_EO), &in->operation);
22475 CryptStartHash(session->authHashAlg, &hashState);
22477 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
22483 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
22491 Copyright © TCG 2006-2013
22544 Copyright © TCG 2006-2013
22624 Copyright © TCG 2006-2013
22708 session = SessionGet(in->policySession);
22709 if(session->commandCode != 0 && session->commandCode != in->code)
22711 if(!CommandIsImplemented(in->code))
22717 CryptStartHash(session->authHashAlg, &hashState);
22719 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
22723 CryptUpdateDigestInt(&hashState, sizeof(TPM_CC), &in->code);
22725 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
22727 session->commandCode = in->code;
22735 Copyright © TCG 2006-2013
22761 Copyright © TCG 2006-2013
22829 Copyright © TCG 2006-2013
22898 session = SessionGet(in->policySession);
22902 CryptStartHash(session->authHashAlg, &hashState);
22904 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
22908 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
22910 session->attributes.isPPRequired = SET;
22918 Copyright © TCG 2006-2013
22959 Copyright © TCG 2006-2013
23034 Copyright © TCG 2006-2013
23132 session = SessionGet(in->policySession);
23136 in->cpHashA.t.size != 0
23137 && session->u1.cpHash.t.size != 0
23138 && !Memory2BEqual(&in->cpHashA.b, &session->u1.cpHash.b)
23142 if(in->cpHashA.t.size != CryptGetHashDigestSize(session->authHashAlg))
23148 CryptStartHash(session->authHashAlg, &hashState);
23150 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
23154 CryptUpdateDigest2B(&hashState, &in->cpHashA.b);
23156 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
23158 session->u1.cpHash = in->cpHashA;
23159 session->attributes.iscpHashDefined = SET;
23166 Copyright © TCG 2006-2013
23182 Copyright © TCG 2006-2013
23249 Copyright © TCG 2006-2013
23321 Copyright © TCG 2006-2013
23422 session = SessionGet(in->policySession);
23425 if(in->nameHash.t.size != 0 && session->u1.cpHash.t.size != 0)
23428 if(in->nameHash.t.size != CryptGetHashDigestSize(session->authHashAlg))
23434 CryptStartHash(session->authHashAlg, &hashState);
23436 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
23440 CryptUpdateDigest2B(&hashState, &in->nameHash.b);
23442 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
23444 session->attributes.iscpHashDefined = CLEAR;
23446 session->u1.cpHash = in->nameHash;
23454 Copyright © TCG 2006-2013
23530 the new parent. In that case, the authorizing entity would approve the policyDigest of equation (31…
23536 Copyright © TCG 2006-2013
23621 Copyright © TCG 2006-2013
23718 session = SessionGet(in->policySession);
23720 if(session->u1.cpHash.t.size != 0)
23723 if(session->commandCode != 0)
23727 session->u1.cpHash.t.size = CryptStartHash(session->authHashAlg, &hashState);
23729 CryptUpdateDigest2B(&hashState, &in->objectName.b);
23731 CryptUpdateDigest2B(&hashState, &in->newParentName.b);
23733 CryptCompleteHash2B(&hashState, &session->u1.cpHash.b);
23737 session->u2.policyDigest.t.size
23738 = CryptStartHash(session->authHashAlg, &hashState);
23740 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
23744 if(in->includeObject == YES)
23745 CryptUpdateDigest2B(&hashState, &in->objectName.b);
23751 Copyright © TCG 2006-2013
23779 CryptUpdateDigest2B(&hashState, &in->newParentName.b);
23781 CryptUpdateDigestInt(&hashState, sizeof(TPMI_YES_NO), &in->includeObject);
23783 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
23785 session->attributes.iscpHashDefined = CLEAR;
23787 session->commandCode = TPM_CC_Duplicate;
23795 Copyright © TCG 2006-2013
23856 Copyright © TCG 2006-2013
23947 Copyright © TCG 2006-2013
24057 session = SessionGet(in->policySession);
24059 hashAlg = BYTE_ARRAY_TO_UINT16(in->keySign.t.name);
24065 if(digestSize != (in->keySign.t.size - 2))
24068 if(session->attributes.isTrialPolicy == CLEAR)
24072 if(!Memory2BEqual(&session->u2.policyDigest.b,
24073 &in->approvedPolicy.b))
24081 CryptUpdateDigest2B(&hashState, &in->approvedPolicy.b);
24087 Copyright © TCG 2006-2013
24125 CryptUpdateDigest2B(&hashState, &in->policyRef.b);
24128 // re-compute TPMT_TK_VERIFIED
24129 TicketComputeVerified(in->checkTicket.hierarchy, &authHash,
24130 &in->keySign, &ticket);
24132 if(!Memory2BEqual(&in->checkTicket.digest.b, &ticket.digest.b))
24137 MemorySet(session->u2.policyDigest.t.buffer, 0,
24138 session->u2.policyDigest.t.size);
24140 PolicyContextUpdate(TPM_CC_PolicyAuthorize, &in->keySign, &in->policyRef,
24149 Copyright © TCG 2006-2013
24181 Copyright © TCG 2006-2013
24249 Copyright © TCG 2006-2013
24324 session = SessionGet(in->policySession);
24329 CryptStartHash(session->authHashAlg, &hashState);
24331 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
24335 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
24337 session->attributes.isAuthValueNeeded = SET;
24338 session->attributes.isPasswordNeeded = CLEAR;
24346 Copyright © TCG 2006-2013
24389 Copyright © TCG 2006-2013
24455 Copyright © TCG 2006-2013
24530 session = SessionGet(in->policySession);
24534 CryptStartHash(session->authHashAlg, &hashState);
24536 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
24540 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
24542 session->attributes.isPasswordNeeded = SET;
24543 session->attributes.isAuthValueNeeded = CLEAR;
24551 Copyright © TCG 2006-2013
24566 to perform the actions required to pre-compute the authPolicy for an object.
24572 Copyright © TCG 2006-2013
24644 Copyright © TCG 2006-2013
24698 session = SessionGet(in->policySession);
24699 out->policyDigest = session->u2.policyDigest;
24707 Copyright © TCG 2006-2013
24739 A typical use case is a simple policy for the first write during manufacturing provisioning that wo…
24747 Copyright © TCG 2006-2013
24820 Copyright © TCG 2006-2013
24915 session = SessionGet(in->policySession);
24918 if(session->attributes.checkNvWritten == SET)
24921 (session->attributes.nvWrittenState == SET)
24922 != (in->writtenSet == YES)))
24927 session->attributes.checkNvWritten = SET;
24928 session->attributes.nvWrittenState = (in->writtenSet == YES);
24934 CryptStartHash(session->authHashAlg, &hashState);
24936 CryptUpdateDigest2B(&hashState, &session->u2.policyDigest.b);
24940 CryptUpdateDigestInt(&hashState, sizeof(TPMI_YES_NO), &in->writtenSet);
24942 CryptCompleteHash2B(&hashState, &session->u2.policyDigest.b);
24950 Copyright © TCG 2006-2013
24963 Copyright © TCG 2006-2013
24983 The command will create and load a Primary Object. The sensitive area is not returned.
24986 Since the sensitive data is not returned, the key cannot be reloaded.
25019 Copyright © TCG 2006-2013
25063 the sensitive data, see Part 1 Sensitive Values
25147 Copyright © TCG 2006-2013
25175 sensitiveDataOrigin is CLEAR when 'sensitive. data' is an Empty
25176 Buffer, or is SET when 'sensitive. data' is not empty; fixedTPM,
25179 restricted, decrypt and sign attributes; attempt to inject sensitive data
25199 size of public auth policy or sensitive auth value does not match
25200 digest size of the name algorithm sensitive data size for the keyed
25205 a storage key with no symmetric algorithm specified; or non-storage
25260 sensitive;
25266 (in->inPublic.t.publicArea.objectAttributes.sensitiveDataOrigin == SET)
25267 != (in->inSensitive.t.sensitive.data.t.size == 0 ))
25273 result = PublicAttributesValidation(FALSE, in->primaryHandle,
25274 &in->inPublic.t.publicArea);
25277 // Validate the sensitive area values
25278 if( MemoryRemoveTrailingZeros(&in->inSensitive.t.sensitive.userAuth)
25279 > CryptGetHashDigestSize(in->inPublic.t.publicArea.nameAlg))
25285 Copyright © TCG 2006-2013
25337 result = CryptCreateObject(in->primaryHandle, &in->inPublic.t.publicArea,
25338 &in->inSensitive.t.sensitive,&sensitive);
25342 FillInCreationData(in->primaryHandle, in->inPublic.t.publicArea.nameAlg,
25343 &in->creationPCR, &in->outsideInfo, &out->creationData,
25344 &out->creationHash);
25346 out->outPublic = in->inPublic;
25348 ObjectComputeName(&(out->outPublic.t.publicArea), &out->name);
25350 TicketComputeCreation(EntityGetHierarchy(in->primaryHandle), &out->name,
25351 &out->creationHash, &out->creationTicket);
25354 result = ObjectLoad(in->primaryHandle, &in->inPublic.t.publicArea, &sensitive,
25355 &out->name, in->primaryHandle, TRUE, &out->objectHandle);
25363 Copyright © TCG 2006-2013
25406 Copyright © TCG 2006-2013
25486 Copyright © TCG 2006-2013
25575 select = (in->state == YES);
25579 switch(in->enable)
25584 case TPM_RH_PLATFORM:
25585 case TPM_RH_PLATFORM_NV:
25586 if(in->authHandle != TPM_RH_PLATFORM)
25592 case TPM_RH_OWNER:
25594 in->authHandle != TPM_RH_PLATFORM
25595 && in->authHandle != TPM_RH_OWNER)
25598 gc.shEnable == FALSE && in->state == YES
25599 && in->authHandle != TPM_RH_PLATFORM)
25606 case TPM_RH_ENDORSEMENT:
25608 in->authHandle != TPM_RH_PLATFORM
25609 && in->authHandle != TPM_RH_ENDORSEMENT)
25612 gc.ehEnable == FALSE && in->state == YES
25613 && in->authHandle != TPM_RH_PLATFORM)
25626 Copyright © TCG 2006-2013
25697 switch(in->enable)
25699 case TPM_RH_OWNER:
25702 case TPM_RH_ENDORSEMENT:
25705 case TPM_RH_PLATFORM:
25708 case TPM_RH_PLATFORM_NV:
25731 if(select == CLEAR && in->enable != TPM_RH_PLATFORM_NV)
25733 ObjectFlushHierarchy(in->enable);
25745 Copyright © TCG 2006-2013
25771 Copyright © TCG 2006-2013
25852 Copyright © TCG 2006-2013
25943 in->authPolicy.t.size != 0
25944 && in->authPolicy.t.size != CryptGetHashDigestSize(in->hashAlg))
25955 switch(in->authHandle)
25957 case TPM_RH_OWNER:
25958 gp.ownerAlg = in->hashAlg;
25959 gp.ownerPolicy = in->authPolicy;
25963 case TPM_RH_ENDORSEMENT:
25964 gp.endorsementAlg = in->hashAlg;
25965 gp.endorsementPolicy = in->authPolicy;
25969 case TPM_RH_PLATFORM:
25970 gc.platformAlg = in->hashAlg;
25971 gc.platformPolicy = in->authPolicy;
25986 Copyright © TCG 2006-2013
26027 Copyright © TCG 2006-2013
26091 Copyright © TCG 2006-2013
26197 // Re-initialize PCR policies
26213 Copyright © TCG 2006-2013
26233 In the reference implementation, ehProof is a non-volatile value from the RNG. It is allowed that t…
26235 ehProof can be generated on an as-needed basis or made a non-volatile value.
26243 Copyright © TCG 2006-2013
26307 Copyright © TCG 2006-2013
26431 Copyright © TCG 2006-2013
26507 Copyright © TCG 2006-2013
26571 Copyright © TCG 2006-2013
26698 Copyright © TCG 2006-2013
26774 Copyright © TCG 2006-2013
26803 Copyright © TCG 2006-2013
26874 Copyright © TCG 2006-2013
26948 if(in->auth == TPM_RH_LOCKOUT && in->disable == NO)
26951 if(in->disable == YES)
26964 Copyright © TCG 2006-2013
26996 Copyright © TCG 2006-2013
27067 Copyright © TCG 2006-2013
27162 if( MemoryRemoveTrailingZeros(&in->newAuth)
27166 switch(in->authHandle)
27168 case TPM_RH_OWNER:
27169 gp.ownerAuth = in->newAuth;
27172 case TPM_RH_ENDORSEMENT:
27173 gp.endorsementAuth = in->newAuth;
27176 case TPM_RH_PLATFORM:
27177 gc.platformAuth = in->newAuth;
27181 case TPM_RH_LOCKOUT:
27182 gp.lockoutAuth = in->newAuth;
27196 Copyright © TCG 2006-2013
27227 occur, the authorization failure counter will be decremented by one. This property is called “self-
27228 Self-healing shall not cause the count of failed attempts to decrement below zero.
27229 The count of failed attempts, the lockout interval, and self-healing interval are settable using
27248 Copyright © TCG 2006-2013
27312 Copyright © TCG 2006-2013
27387 Copyright © TCG 2006-2013
27421 Copyright © TCG 2006-2013
27509 Copyright © TCG 2006-2013
27577 gp.maxTries = in->newMaxTries;
27578 gp.recoveryTime = in->newRecoveryTime;
27579 gp.lockoutRecovery = in->lockoutRecovery;
27594 Copyright © TCG 2006-2013
27643 Copyright © TCG 2006-2013
27721 Copyright © TCG 2006-2013
27799 for(i = 0; i < in->setList.count; i++)
27803 if(CommandIsImplemented(in->setList.commandCodes[i]))
27804 PhysicalPresenceCommandSet(in->setList.commandCodes[i]);
27806 for(i = 0; i < in->clearList.count; i++)
27811 if(CommandIsImplemented(in->clearList.commandCodes[i]))
27812 PhysicalPresenceCommandClear(in->clearList.commandCodes[i]);
27822 Copyright © TCG 2006-2013
27837 algorithmSet setting is a vendor-dependent value.
27854 Copyright © TCG 2006-2013
27897 a TPM vendor-dependent value indicating the
27925 Copyright © TCG 2006-2013
27982 gp.algorithmSet = in->algorithmSet;
27992 Copyright © TCG 2006-2013
28051 The system may attempt to abandon the firmware upgrade by using a zero-length buffer in
28061 when the power interruption occurred. In such case, the TPM firmware may be reset to one of two oth…
28078 Copyright © TCG 2006-2013
28088 The TPM is required to accept the previous firmware as either a vendor -provided update or as
28092 data block in a TPM vendor-specific manner), the TPM will complete the upgrade process. If the TPM …
28139 Copyright © TCG 2006-2013
28183 A loaded key is used rather than a hard-coded key to reduce the amount of memory needed for this
28184 key data in case more than one vendor key is needed.
28190 Copyright © TCG 2006-2013
28276 Copyright © TCG 2006-2013
28324 Copyright © TCG 2006-2013
28339 fuData is vendor-specific. This command is only possible following a successful
28359 Copyright © TCG 2006-2013
28434 Copyright © TCG 2006-2013
28488 Copyright © TCG 2006-2013
28504 would be the first block given to the TPM in case of a failure recovery. If the TPM2_FirmwareRead
28524 Copyright © TCG 2006-2013
28594 Copyright © TCG 2006-2013
28644 Copyright © TCG 2006-2013
28690 Copyright © TCG 2006-2013
28759 Copyright © TCG 2006-2013
28876 // the update of state reset data. If this is the case, check if NV is
28890 out->context.savedHandle = in->saveHandle;
28893 fingerprintSize = sizeof(out->context.sequence);
28898 switch(HandleGetType(in->saveHandle))
28900 case TPM_HT_TRANSIENT:
28907 Copyright © TCG 2006-2013
28983 *object = ObjectGet(in->saveHandle);
28985 (OBJECT *)(out->context.contextBlob.t.buffer
28991 out->context.contextBlob.t.size = integritySize +
29002 out->context.sequence = gr.objectContextID;
29008 out->context.savedHandle = 0x80000001;
29011 else if(object->attributes.stClear == SET)
29013 out->context.savedHandle = 0x80000002;
29017 out->context.savedHandle = 0x80000000;
29020 out->context.hierarchy = ObjectDataGetHierarchy(object);
29023 case TPM_HT_HMAC_SESSION:
29024 case TPM_HT_POLICY_SESSION:
29027 *session = SessionGet(in->saveHandle);
29032 out->context.contextBlob.t.size = integritySize +
29038 MemoryCopy(out->context.contextBlob.t.buffer
29046 Copyright © TCG 2006-2013
29111 sizeof(out->context.contextBlob.t.buffer)
29112 - integritySize - fingerprintSize);
29117 // SessionContextSave() will flush the in-memory context
29119 result = SessionContextSave(out->context.savedHandle, &contextID);
29122 out->context.sequence = contextID;
29124 out->context.hierarchy = TPM_RH_NULL;
29135 MemoryCopy(out->context.contextBlob.t.buffer + integritySize,
29136 &out->context.sequence, sizeof(out->context.sequence),
29137 sizeof(out->context.contextBlob.t.buffer) - integritySize);
29139 ComputeContextProtectionKey(&out->context, &symKey, &iv);
29141 CryptSymmetricEncrypt(out->context.contextBlob.t.buffer + integritySize,
29144 out->context.contextBlob.t.size - integritySize,
29145 out->context.contextBlob.t.buffer + integritySize);
29149 ComputeContextIntegrity(&out->context, &integrity);
29151 buffer = out->context.contextBlob.t.buffer;
29163 Copyright © TCG 2006-2013
29195 Copyright © TCG 2006-2013
29266 Copyright © TCG 2006-2013
29395 handleType = HandleGetType(in->context.savedHandle);
29402 buffer = in->context.contextBlob.t.buffer;
29403 size = (INT32) in->context.contextBlob.t.size;
29408 ComputeContextIntegrity(&in->context, &ingerityToCompare);
29414 Copyright © TCG 2006-2013
29491 ComputeContextProtectionKey(&in->context, &symKey, &iv);
29493 CryptSymmetricDecrypt(in->context.contextBlob.t.buffer + integritySize,
29496 in->context.contextBlob.t.size - integritySize,
29497 in->context.contextBlob.t.buffer + integritySize);
29499 MemoryCopy(&fingerprint, in->context.contextBlob.t.buffer + integritySize,
29502 if(fingerprint != in->context.sequence)
29507 case TPM_HT_TRANSIENT:
29511 *outObject = (OBJECT *)(in->context.contextBlob.t.buffer
29514 in->context.savedHandle = TRANSIENT_FIRST;
29517 if(!HierarchyIsEnabled(in->context.hierarchy))
29521 result = ObjectContextLoad(outObject, &out->loadedHandle);
29527 SequenceDataImportExport(ObjectGet(out->loadedHandle),
29531 case TPM_HT_POLICY_SESSION:
29532 case TPM_HT_HMAC_SESSION:
29536 *session = (SESSION *)(in->context.contextBlob.t.buffer
29540 // the update of state reset data. If this is the case, check if NV is
29547 Copyright © TCG 2006-2013
29603 if(!SessionIsSaved(in->context.savedHandle))
29607 result = SessionContextLoad(session, &in->context.savedHandle);
29610 out->loadedHandle = in->context.savedHandle;
29629 Copyright © TCG 2006-2013
29681 Copyright © TCG 2006-2013
29747 Copyright © TCG 2006-2013
29821 switch(HandleGetType(in->flushHandle))
29823 case TPM_HT_TRANSIENT:
29824 if(!ObjectIsPresent(in->flushHandle))
29827 ObjectFlush(in->flushHandle);
29829 case TPM_HT_HMAC_SESSION:
29830 case TPM_HT_POLICY_SESSION:
29832 !SessionIsLoaded(in->flushHandle)
29833 && !SessionIsSaved(in->flushHandle)
29838 if(in->flushHandle == g_exclusiveAuditSession)
29841 SessionFlush(in->flushHandle);
29859 Copyright © TCG 2006-2013
29916 …l TPM memory is non volatile and not subject to endurance issues. In such case, there is no moveme…
29925 Copyright © TCG 2006-2013
29955 Copyright © TCG 2006-2013
30035 Copyright © TCG 2006-2013
30145 evictObject = ObjectGet(in->objectHandle);
30148 evictObject->attributes.temporary == SET
30149 || evictObject->attributes.stClear == SET
30150 || evictObject->attributes.publicOnly == SET
30156 evictObject->attributes.evict == SET
30157 && evictObject->evictHandle != in->persistentHandle
30161 if(in->auth == TPM_RH_PLATFORM)
30164 if(evictObject->attributes.evict == CLEAR)
30173 Copyright © TCG 2006-2013
30230 if(evictObject->attributes.ppsHierarchy == CLEAR)
30233 if(!NvIsPlatformPersistentHandle(in->persistentHandle))
30238 else if(in->auth == TPM_RH_OWNER)
30241 if(evictObject->attributes.ppsHierarchy == SET)
30245 evictObject->attributes.evict == CLEAR
30246 && !NvIsOwnerPersistentHandle(in->persistentHandle)
30258 if(evictObject->attributes.evict == CLEAR)
30263 result = NvAddEvictObject(in->persistentHandle, evictObject);
30269 NvDeleteEntity(evictObject->evictHandle);
30278 Copyright © TCG 2006-2013
30303 privacy sensitive. The values may be read without authorization because the TCB will not disclose
30312 Copyright © TCG 2006-2013
30374 Copyright © TCG 2006-2013
30411 out->currentTime.time = g_time;
30412 TimeFillInfo(&out->currentTime.clockInfo);
30420 Copyright © TCG 2006-2013
30446 If the value of Clock after the update makes the volatile and non-volatile versions of
30448 the non-volatile version of TPMS_CLOCK_INFO.clock before returning.
30455 Copyright © TCG 2006-2013
30525 Copyright © TCG 2006-2013
30591 ((1ULL << NV_CLOCK_UPDATE_INTERVAL)- 1)
30596 if(in->newTime > 0xFFFF000000000000ULL
30597 || in->newTime < go.clock)
30603 go.clock = in->newTime;
30606 if((in->newTime & CLOCK_UPDATE_MASK) > (clockNow & CLOCK_UPDATE_MASK))
30620 Copyright © TCG 2006-2013
30648 If the frequency tolerance of the TPM's input clock is +/-10 percent, then the TPM will return
30654 The interpretation of “fine” and “coarse” adjustments is implementation-specific.
30668 Copyright © TCG 2006-2013
30738 Copyright © TCG 2006-2013
30771 TimeSetAdjustRate(in->rateAdjust);
30782 Copyright © TCG 2006-2013
30856 Copyright © TCG 2006-2013
30987 manufacturer-specific values
30996 Copyright © TCG 2006-2013
31013 parameter. The range of the returned handles is determined by the handle type (the most-significant
31041 specific commands are implemented, the vendor-specific command attribute with the lowest
31042 commandIndex, is returned after the non-vendor-specific (base) command.
31068 property is a 32-bit value. The properties are returned in groups. Each property group is on a 256v…
31094 Copyright © TCG 2006-2013
31109 If no next capability exists, the TPM will return a zero-length list and moreData will have a value…
31115 Copyright © TCG 2006-2013
31201 Copyright © TCG 2006-2013
31294 out->capabilityData.capability = in->capability;
31295 switch(in->capability)
31297 case TPM_CAP_ALGS:
31298 out->moreData = AlgorithmCapGetImplemented((TPM_ALG_ID) in->property,
31299 in->propertyCount, &out->capabilityData.data.algorithms);
31301 case TPM_CAP_HANDLES:
31302 switch(HandleGetType((TPM_HANDLE) in->property))
31304 case TPM_HT_TRANSIENT:
31306 out->moreData = ObjectCapGetLoaded((TPM_HANDLE) in->property,
31307 in->propertyCount,
31308 &out->capabilityData.data.handles);
31310 case TPM_HT_PERSISTENT:
31312 out->moreData = NvCapGetPersistent((TPM_HANDLE) in->property,
31313 in->propertyCount,
31314 &out->capabilityData.data.handles);
31316 case TPM_HT_NV_INDEX:
31318 out->moreData = NvCapGetIndex((TPM_HANDLE) in->property,
31319 in->propertyCount,
31320 &out->capabilityData.data.handles);
31322 case TPM_HT_LOADED_SESSION:
31324 out->moreData = SessionCapGetLoaded((TPM_HANDLE) in->property,
31325 in->propertyCount,
31326 &out->capabilityData.data.handles);
31328 case TPM_HT_ACTIVE_SESSION:
31330 out->moreData = SessionCapGetSaved((TPM_HANDLE) in->property,
31331 in->propertyCount,
31332 &out->capabilityData.data.handles);
31338 Copyright © TCG 2006-2013
31412 case TPM_HT_PCR:
31414 out->moreData = PCRCapGetHandles((TPM_HANDLE) in->property,
31415 in->propertyCount,
31416 &out->capabilityData.data.handles);
31418 case TPM_HT_PERMANENT:
31420 out->moreData = PermanentCapGetHandles(
31421 (TPM_HANDLE) in->property,
31422 in->propertyCount,
31423 &out->capabilityData.data.handles);
31431 case TPM_CAP_COMMANDS:
31432 out->moreData = CommandCapGetCCList((TPM_CC) in->property,
31433 in->propertyCount,
31434 &out->capabilityData.data.command);
31436 case TPM_CAP_PP_COMMANDS:
31437 out->moreData = PhysicalPresenceCapGetCCList((TPM_CC) in->property,
31438 in->propertyCount, &out->capabilityData.data.ppCommands);
31440 case TPM_CAP_AUDIT_COMMANDS:
31441 out->moreData = CommandAuditCapGetCCList((TPM_CC) in->property,
31442 in->propertyCount,
31443 &out->capabilityData.data.auditCommands);
31445 case TPM_CAP_PCRS:
31447 if(in->property != 0)
31449 out->moreData = PCRCapGetAllocation(in->propertyCount,
31450 &out->capabilityData.data.assignedPCR);
31452 case TPM_CAP_PCR_PROPERTIES:
31453 out->moreData = PCRCapGetProperties((TPM_PT_PCR) in->property,
31454 in->propertyCount,
31455 &out->capabilityData.data.pcrProperties);
31457 case TPM_CAP_TPM_PROPERTIES:
31458 out->moreData = TPMCapGetProperties((TPM_PT) in->property,
31459 in->propertyCount,
31460 &out->capabilityData.data.tpmProperties);
31463 case TPM_CAP_ECC_CURVES:
31464 out->moreData = CryptCapGetECCCurve((TPM_ECC_CURVE
31465 ) in->property,
31466 in->propertyCount,
31467 &out->capabilityData.data.eccCurves);
31470 case TPM_CAP_VENDOR_PROPERTY:
31481 Copyright © TCG 2006-2013
31502 Copyright © TCG 2006-2013
31525 Copyright © TCG 2006-2013
31587 Copyright © TCG 2006-2013
31639 Copyright © TCG 2006-2013
31650 Non-volatile Storage
31660 An Index may have an Index-specific authValue and authPolicy. The authValue may be used to authorize
31711 Copyright © TCG 2006-2013
31726 When an NV counter is created, the TPM shall initialize the 8-octet counter value with a number tha…
31731 occasionally update the non-volatile version of the counter. An orderly shutdown is one occasion to
31732 update the non-volatile count. If the difference between the volatile and non-volatile version of t…
31738 non-volatile counter and set that as the current count.
31748 counter is the sum of both the volatile and non-volatile parts. If so, then the TPM may initialize …
31754 highest value. In this search, the TPM would use the sum of the non -volatile and RAM portions of
31762 Copyright © TCG 2006-2013
31864 Copyright © TCG 2006-2013
31883 Copyright © TCG 2006-2013
31959 Copyright © TCG 2006-2013
32039 'auth->size' or 'publicInfo->authPolicy. size' is larger than the digest
32040 size of 'publicInfo->nameAlg', or 'publicInfo->dataSize' is not
32041 consistent with 'publicInfo->attributes'.
32061 nameSize = CryptGetHashDigestSize(in->publicInfo.t.nvPublic.nameAlg);
32072 if(in->authHandle == TPM_RH_PLATFORM && gc.phEnableNV == CLEAR)
32074 attributes = in->publicInfo.t.nvPublic.attributes;
32079 && (in->publicInfo.t.nvPublic.dataSize != 8))
32083 in->publicInfo.t.nvPublic.authPolicy.t.size != 0
32084 && in->publicInfo.t.nvPublic.authPolicy.t.size != nameSize)
32087 MemoryRemoveTrailingZeros(&in->auth);
32088 if(in->auth.t.size > nameSize)
32095 Copyright © TCG 2006-2013
32235 Copyright © TCG 2006-2013
32284 in->publicInfo.t.nvPublic.attributes.TPMA_NV_PLATFORMCREATE == SET
32285 && in->authHandle == TPM_RH_OWNER
32288 in->publicInfo.t.nvPublic.attributes.TPMA_NV_PLATFORMCREATE == CLEAR
32289 && in->authHandle == TPM_RH_PLATFORM
32297 in->publicInfo.t.nvPublic.attributes.TPMA_NV_POLICY_DELETE == SET
32298 && TPM_RH_PLATFORM != in->authHandle
32304 in->publicInfo.t.nvPublic.attributes.TPMA_NV_EXTEND == SET
32305 && in->publicInfo.t.nvPublic.dataSize != nameSize
32309 if(NvIsUndefinedIndex(in->publicInfo.t.nvPublic.nvIndex))
32313 result = NvDefineIndex(&in->publicInfo.t.nvPublic, &in->auth);
32323 Copyright © TCG 2006-2013
32351 Copyright © TCG 2006-2013
32422 Copyright © TCG 2006-2013
32507 NvGetIndexInfo(in->nvIndex, &nvIndex);
32514 in->authHandle == TPM_RH_OWNER
32519 NvDeleteEntity(in->nvIndex);
32527 Copyright © TCG 2006-2013
32541 This command allows removal of a platform-created NV Index that has TPMA_NV_POLICY_DELETE
32579 Copyright © TCG 2006-2013
32651 Copyright © TCG 2006-2013
32727 NvGetIndexInfo(in->nvIndex, &nvIndex);
32733 NvDeleteEntity(in->nvIndex);
32741 Copyright © TCG 2006-2013
32756 not privacy-sensitive and no authorization is required to read this data.
32762 Copyright © TCG 2006-2013
32837 Copyright © TCG 2006-2013
32893 NvGetIndexInfo(in->nvIndex, &nvIndex);
32895 out->nvPublic.t.nvPublic = nvIndex.publicArea;
32897 out->nvName.t.size = NvGetName(in->nvIndex, &out->nvName.t.name);
32905 Copyright © TCG 2006-2013
32952 Copyright © TCG 2006-2013
33035 Copyright © TCG 2006-2013
33136 NvGetIndexInfo(in->nvIndex, &nvIndex);
33139 result = NvWriteAccessChecks(in->authHandle, in->nvIndex);
33150 if((in->data.t.size + in->offset) > nvIndex.publicArea.dataSize)
33156 && in->data.t.size < nvIndex.publicArea.dataSize)
33162 return NvWriteIndexData(in->nvIndex, &nvIndex, in->offset,
33168 Copyright © TCG 2006-2013
33179 in->data.t.size, in->data.t.buffer);
33187 Copyright © TCG 2006-2013
33236 If TPMA_NV_ORDERLY is SET, and the difference between the volatile and non-volatile versions of this
33237 field is greater than MAX_ORDERLY_COUNT, then the non-volatile version of the counter is updated.
33241 TPM_NV_COUNTER both SET, then in the Event of a non-orderly shutdown, the non-volatile value
33248 past the maximum allowed value (MAX_ORDERLY_COUNT), the non-volatile version of the count is
33255 Copyright © TCG 2006-2013
33326 Copyright © TCG 2006-2013
33427 result = NvWriteAccessChecks(in->authHandle, in->nvIndex);
33431 NvGetIndexInfo(in->nvIndex, &nvIndex);
33441 NvGetIntIndexData(in->nvIndex, &nvIndex, &countValue);
33460 Copyright © TCG 2006-2013
33483 return NvWriteIndexData(in->nvIndex, &nvIndex, 0, 8, &countValue);
33490 Copyright © TCG 2006-2013
33551 Copyright © TCG 2006-2013
33628 Copyright © TCG 2006-2013
33735 result = NvWriteAccessChecks(in->authHandle, in->nvIndex);
33739 NvGetIndexInfo(in->nvIndex, &nvIndex);
33743 // If the Index is not-orderly, or if this is the first write, NV will
33760 NvGetIndexData(in->nvIndex, &nvIndex, 0,
33766 Copyright © TCG 2006-2013
33809 CryptUpdateDigest2B(&hashState, &in->data.b);
33814 return NvWriteIndexData(in->nvIndex, &nvIndex, 0,
33822 Copyright © TCG 2006-2013
33851 Copyright © TCG 2006-2013
33931 Copyright © TCG 2006-2013
34035 result = NvWriteAccessChecks(in->authHandle, in->nvIndex);
34039 NvGetIndexInfo(in->nvIndex, &nvIndex);
34043 // If the Index is not-orderly, or if this is the first write, NV will
34066 Copyright © TCG 2006-2013
34085 NvGetIntIndexData(in->nvIndex, &nvIndex, &bitValue);
34087 bitValue |= in->bits;
34090 return NvWriteIndexData(in->nvIndex, &nvIndex, 0, 8, &bitValue);
34097 Copyright © TCG 2006-2013
34127 Copyright © TCG 2006-2013
34201 Copyright © TCG 2006-2013
34305 result = NvWriteAccessChecks(in->authHandle, in->nvIndex);
34315 NvGetIndexInfo(in->nvIndex, &nvIndex);
34317 // can not be write-locked
34326 NvWriteIndexInfo(in->nvIndex, &nvIndex);
34332 Copyright © TCG 2006-2013
34350 Copyright © TCG 2006-2013
34392 Copyright © TCG 2006-2013
34459 Copyright © TCG 2006-2013
34531 Copyright © TCG 2006-2013
34573 If authorization sessions are present, they are checked before the read -lock status of the NV Index
34586 Copyright © TCG 2006-2013
34681 Copyright © TCG 2006-2013
34776 NvGetIndexInfo(in->nvIndex, &nvIndex);
34780 result = NvReadAccessChecks(in->authHandle, in->nvIndex);
34784 if((in->size + in->offset) > nvIndex.publicArea.dataSize)
34788 out->data.t.size = in->size;
34790 NvGetIndexData(in->nvIndex, &nvIndex, in->offset, in->size, out->data.t.buffer);
34798 Copyright © TCG 2006-2013
34831 Copyright © TCG 2006-2013
34906 Copyright © TCG 2006-2013
35010 result = NvReadAccessChecks(in->authHandle, in->nvIndex);
35022 NvGetIndexInfo(in->nvIndex, &nvIndex);
35023 // if TPMA_NV_READ_STCLEAR is not set, the index can not be read-locked
35030 NvWriteIndexInfo(in->nvIndex, &nvIndex);
35038 Copyright © TCG 2006-2013
35061 approval while other commands may use policy that is not command -dependent.
35072 Copyright © TCG 2006-2013
35145 Copyright © TCG 2006-2013
35225 NvGetIndexInfo(in->nvIndex, &nvIndex);
35228 MemoryRemoveTrailingZeros(&(in->newAuth));
35230 if(in->newAuth.t.size > CryptGetHashDigestSize(nvIndex.publicArea.nameAlg))
35234 nvIndex.authValue = in->newAuth;
35236 NvWriteIndexInfo(in->nvIndex, &nvIndex);
35244 Copyright © TCG 2006-2013
35270 Copyright © TCG 2006-2013
35332 user-provided qualifying data
35395 Copyright © TCG 2006-2013
35513 // the reporting of clock info. If this is the case, check if NV is
35526 NvGetIndexInfo(in->nvIndex, &nvIndex);
35529 result = NvReadAccessChecks(in->authHandle, in->nvIndex);
35534 if((in->size + in->offset) > nvIndex.publicArea.dataSize)
35542 Copyright © TCG 2006-2013
35610 result = FillInAttestInfo(in->signHandle,
35611 &in->inScheme,
35612 &in->qualifyingData,
35626 NvGetName(in->nvIndex, &certifyInfo.attested.nv.indexName.t.name);
35628 certifyInfo.attested.nv.nvContents.t.size = in->size;
35630 certifyInfo.attested.nv.offset = in->offset;
35632 NvGetIndexData(in->nvIndex, &nvIndex,
35633 in->offset, in->size,
35641 result = SignAttestInfo(in->signHandle,
35642 &in->inScheme,
35644 &in->qualifyingData,
35645 &out->certifyInfo,
35646 &out->signature);
35651 if(in->signHandle != TPM_RH_NULL)
35660 Copyright © TCG 2006-2013