@@ -43,7 +43,7 @@ static void usage(void)
4343{
4444 printf ("Expected usage:\n" );
4545 printf ("./examples/timestamp/signed_timestamp [-ecc] [-aes/xor]\n" );
46- printf ("* -ecc: Use RSA or ECC for EK /AIK\n" );
46+ printf ("* -ecc: Use RSA or ECC for SRK /AIK\n" );
4747 printf ("* -aes/xor: Use Parameter Encryption\n" );
4848}
4949
@@ -66,15 +66,13 @@ int TPM2_Timestamp_TestArgs(void* userCtx, int argc, char *argv[])
6666 PolicySecret_Out policySecret ;
6767 byte maxOutput [MAX_RESPONSE_SIZE ];
6868 } cmdOut ;
69- WOLFTPM2_KEY endorse ; /* EK */
7069 WOLFTPM2_KEY storage ; /* SRK */
7170 WOLFTPM2_KEY aik ; /* AIK */
7271 TPMI_ALG_PUBLIC alg = TPM_ALG_RSA ; /* TPM_ALG_ECC */
7372 TPM_ALG_ID paramEncAlg = TPM_ALG_NULL ;
7473 WOLFTPM2_SESSION tpmSession ;
7574 TPMA_SESSION sessionAttributes ;
7675
77- XMEMSET (& endorse , 0 , sizeof (endorse ));
7876 XMEMSET (& storage , 0 , sizeof (storage ));
7977 XMEMSET (& aik , 0 , sizeof (aik ));
8078 XMEMSET (& tpmSession , 0 , sizeof (tpmSession ));
@@ -123,17 +121,6 @@ int TPM2_Timestamp_TestArgs(void* userCtx, int argc, char *argv[])
123121 printf ("TPM2_ReadClock: success\n" );
124122
125123
126- /* Create Endorsement Key, also called EK */
127- rc = wolfTPM2_CreateEK (& dev , & endorse , alg );
128- if (rc != TPM_RC_SUCCESS ) {
129- printf ("wolfTPM2_CreateEK: Endorsement failed 0x%x: %s\n" ,
130- rc , TPM2_GetRCString (rc ));
131- goto exit ;
132- }
133- printf ("wolfTPM2_CreateEK: Endorsement 0x%x (%d bytes)\n" ,
134- (word32 )endorse .handle .hndl , endorse .pub .size );
135-
136-
137124 /* Create Storage Key, also called SRK */
138125 rc = getPrimaryStoragekey (& dev , & storage , alg );
139126 if (rc != TPM_RC_SUCCESS ) {
@@ -151,10 +138,6 @@ int TPM2_Timestamp_TestArgs(void* userCtx, int argc, char *argv[])
151138 printf ("TPM2_StartAuthSession: sessionHandle 0x%x\n" ,
152139 (word32 )tpmSession .handle .hndl );
153140
154- /* Set the endorsement password (blank) */
155- rc = wolfTPM2_SetAuthPassword (& dev , 0 , NULL );
156- if (rc != 0 ) goto exit ;
157-
158141 /* Set PolicySecret for our session to enable use of the Endorsement Hierarchy */
159142 XMEMSET (& cmdIn .policySecret , 0 , sizeof (cmdIn .policySecret ));
160143 cmdIn .policySecret .authHandle = TPM_RH_ENDORSEMENT ;
@@ -166,7 +149,7 @@ int TPM2_Timestamp_TestArgs(void* userCtx, int argc, char *argv[])
166149 }
167150 printf ("TPM2_policySecret success\n" ); /* No use of the output */
168151
169- /* At this stage, the EK is created and NULL password has already been set
152+ /* At this stage, the SRK is created and NULL password has already been set
170153 * The EH is enabled through policySecret over the active TPM session and
171154 * the creation of Attestation Identity Key (AIK) under the EH can take place.
172155 */
@@ -183,7 +166,7 @@ int TPM2_Timestamp_TestArgs(void* userCtx, int argc, char *argv[])
183166 (word32 )aik .handle .hndl , aik .pub .size );
184167
185168
186- /* set NULL password auth for using EK */
169+ /* set (the default) NULL password auth for using EH */
187170 wolfTPM2_SetAuthPassword (& dev , 0 , NULL );
188171
189172 /* set auth for using the AIK */
@@ -202,7 +185,7 @@ int TPM2_Timestamp_TestArgs(void* userCtx, int argc, char *argv[])
202185 (void )sessionAttributes ;
203186#endif
204187
205- /* At this stage: The EK is created, AIK is created and loaded,
188+ /* At this stage: The SRK is created, AIK is created and loaded,
206189 * Endorsement Hierarchy is enabled through policySecret,
207190 * the use of the loaded AIK is enabled through its usageAuth.
208191 * Invoking attestation of the TPM time structure can take place.
@@ -255,7 +238,6 @@ int TPM2_Timestamp_TestArgs(void* userCtx, int argc, char *argv[])
255238 }
256239
257240 wolfTPM2_UnloadHandle (& dev , & aik .handle );
258- wolfTPM2_UnloadHandle (& dev , & endorse .handle );
259241 wolfTPM2_UnloadHandle (& dev , & tpmSession .handle );
260242
261243 wolfTPM2_Cleanup (& dev );
0 commit comments