OLD | NEW |
1 /* | 1 /* |
2 * The Initial Developer of the Original Code is Intel Corporation. | 2 * The Initial Developer of the Original Code is Intel Corporation. |
3 * Portions created by Intel Corporation are Copyright (C) 2007 Intel Corporatio
n. | 3 * Portions created by Intel Corporation are Copyright (C) 2007 Intel Corporatio
n. |
4 * All Rights Reserved. | 4 * All Rights Reserved. |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License as published by | 7 * it under the terms of the GNU General Public License as published by |
8 * the Free Software Foundation; either version 2 of the License, or | 8 * the Free Software Foundation; either version 2 of the License, or |
9 * (at your option) any later version. | 9 * (at your option) any later version. |
10 * | 10 * |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 { | 186 { |
187 print_error("Tspi_SetAttribUint32 for setting data size", result
); | 187 print_error("Tspi_SetAttribUint32 for setting data size", result
); |
188 print_error_exit(nameOfFunction, err_string(result)); | 188 print_error_exit(nameOfFunction, err_string(result)); |
189 Tspi_Context_FreeMemory(hContext, NULL); | 189 Tspi_Context_FreeMemory(hContext, NULL); |
190 Tspi_Context_Close(hContext); | 190 Tspi_Context_Close(hContext); |
191 exit(result); | 191 exit(result); |
192 } | 192 } |
193 | 193 |
194 /*Define NV space*/ | 194 /*Define NV space*/ |
195 result = Tspi_NV_DefineSpace(hNVStore, 0, 0); | 195 result = Tspi_NV_DefineSpace(hNVStore, 0, 0); |
| 196 |
| 197 /* Set password */ |
| 198 Tspi_Policy_SetSecret(hPolicy, TESTSUITE_OWNER_SECRET_MODE, |
| 199 TESTSUITE_OWNER_SECRET_LEN, |
| 200 TESTSUITE_OWNER_SECRET); |
| 201 Tspi_TPM_SetStatus(hTPM, TSS_TPMSTATUS_RESETLOCK, 1); |
196 | 202 |
| 203 #ifdef CLEAR_TEST_INDEX |
| 204 if (result== TSS_SUCCESS) |
| 205 { |
| 206 Tspi_Context_GetTpmObject(hContext, &hTPM); |
| 207 Tspi_GetPolicyObject(hTPM, TSS_POLICY_USAGE, &hPolicy); |
| 208 Tspi_Policy_SetSecret( hPolicy, TESTSUITE_OWNER_SECRET_MODE, |
| 209 TESTSUITE_OWNER_SECRET_LEN, TESTSUITE_OW
NER_SECRET); |
| 210 Tspi_NV_ReleaseSpace(hNVStore); |
| 211 } |
| 212 #endif |
197 #ifdef NV_LOCKED | 213 #ifdef NV_LOCKED |
198 if (TSS_ERROR_CODE(result)== TPM_E_AUTHFAIL) | 214 if (TSS_ERROR_CODE(result)== TPM_E_AUTHFAIL) |
199 { | 215 { |
200 print_success(nameOfFunction, result); | 216 print_success(nameOfFunction, result); |
201 print_end_test(nameOfFunction); | 217 print_end_test(nameOfFunction); |
202 Tspi_Context_FreeMemory(hContext, NULL); | 218 Tspi_Context_FreeMemory(hContext, NULL); |
203 Tspi_Context_Close(hContext); | 219 Tspi_Context_Close(hContext); |
204 exit(0); | 220 exit(0); |
205 } | 221 } |
206 else{ | 222 else{ |
(...skipping 19 matching lines...) Expand all Loading... |
226 print_error("Tspi_NV_DefineSpace", result); | 242 print_error("Tspi_NV_DefineSpace", result); |
227 print_end_test(nameOfFunction); | 243 print_end_test(nameOfFunction); |
228 Tspi_Context_FreeMemory(hContext, NULL); | 244 Tspi_Context_FreeMemory(hContext, NULL); |
229 Tspi_Context_Close(hContext); | 245 Tspi_Context_Close(hContext); |
230 if ( result == TSS_SUCCESS ) | 246 if ( result == TSS_SUCCESS ) |
231 exit(-1); | 247 exit(-1); |
232 exit(result); | 248 exit(result); |
233 } | 249 } |
234 #endif | 250 #endif |
235 } | 251 } |
OLD | NEW |