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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 print_error("Tspi_SetAttribUint32 for setting data size", result
); | 227 print_error("Tspi_SetAttribUint32 for setting data size", result
); |
228 print_error_exit(nameOfFunction, err_string(result)); | 228 print_error_exit(nameOfFunction, err_string(result)); |
229 Tspi_Context_FreeMemory(hContext, NULL); | 229 Tspi_Context_FreeMemory(hContext, NULL); |
230 Tspi_Context_Close(hContext); | 230 Tspi_Context_Close(hContext); |
231 exit(result); | 231 exit(result); |
232 } | 232 } |
233 | 233 |
234 /*Define NV space*/ | 234 /*Define NV space*/ |
235 result = Tspi_NV_DefineSpace(hNVStore, 0, 0); | 235 result = Tspi_NV_DefineSpace(hNVStore, 0, 0); |
236 | 236 |
| 237 #ifdef CLEAR_TEST_INDEX |
| 238 if (result== TSS_SUCCESS) |
| 239 { |
| 240 Tspi_Context_GetTpmObject(hContext, &hTPM); |
| 241 Tspi_GetPolicyObject(hTPM, TSS_POLICY_USAGE, &hPolicy); |
| 242 Tspi_Policy_SetSecret( hPolicy, TESTSUITE_OWNER_SECRET_MODE, |
| 243 TESTSUITE_OWNER_SECRET_LEN, TESTSUITE_OW
NER_SECRET); |
| 244 Tspi_NV_ReleaseSpace(hNVStore); |
| 245 } |
| 246 #endif |
237 #ifdef NV_LOCKED | 247 #ifdef NV_LOCKED |
238 if (TSS_ERROR_CODE(result)== TPM_E_AUTH_CONFLICT) | 248 if (TSS_ERROR_CODE(result)== TPM_E_AUTH_CONFLICT) |
239 { | 249 { |
240 print_success(nameOfFunction, result); | 250 print_success(nameOfFunction, result); |
241 print_end_test(nameOfFunction); | 251 print_end_test(nameOfFunction); |
242 Tspi_Context_FreeMemory(hContext, NULL); | 252 Tspi_Context_FreeMemory(hContext, NULL); |
243 Tspi_Context_Close(hContext); | 253 Tspi_Context_Close(hContext); |
244 exit(0); | 254 exit(0); |
245 } | 255 } |
246 else{ | 256 else{ |
(...skipping 19 matching lines...) Expand all Loading... |
266 print_error("Tspi_NV_DefineSpace", result); | 276 print_error("Tspi_NV_DefineSpace", result); |
267 print_end_test(nameOfFunction); | 277 print_end_test(nameOfFunction); |
268 Tspi_Context_FreeMemory(hContext, NULL); | 278 Tspi_Context_FreeMemory(hContext, NULL); |
269 Tspi_Context_Close(hContext); | 279 Tspi_Context_Close(hContext); |
270 if ( result == TSS_SUCCESS ) | 280 if ( result == TSS_SUCCESS ) |
271 exit(-1); | 281 exit(-1); |
272 exit(result); | 282 exit(result); |
273 } | 283 } |
274 #endif | 284 #endif |
275 } | 285 } |
OLD | NEW |