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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 print_error("Tspi_SetAttribUint32 for setting data size", result
); | 190 print_error("Tspi_SetAttribUint32 for setting data size", result
); |
191 print_error_exit(nameOfFunction, err_string(result)); | 191 print_error_exit(nameOfFunction, err_string(result)); |
192 Tspi_Context_FreeMemory(hContext, NULL); | 192 Tspi_Context_FreeMemory(hContext, NULL); |
193 Tspi_Context_Close(hContext); | 193 Tspi_Context_Close(hContext); |
194 exit(result); | 194 exit(result); |
195 } | 195 } |
196 | 196 |
197 /*Define NV space*/ | 197 /*Define NV space*/ |
198 result = Tspi_NV_DefineSpace(hNVStore, 0, 0); | 198 result = Tspi_NV_DefineSpace(hNVStore, 0, 0); |
199 | 199 |
| 200 #ifdef CLEAR_TEST_INDEX |
| 201 if (result== TSS_SUCCESS) |
| 202 { |
| 203 Tspi_Context_GetTpmObject(hContext, &hTPM); |
| 204 Tspi_GetPolicyObject(hTPM, TSS_POLICY_USAGE, &hPolicy); |
| 205 Tspi_Policy_SetSecret( hPolicy, TESTSUITE_OWNER_SECRET_MODE, |
| 206 TESTSUITE_OWNER_SECRET_LEN, TESTSUITE_OW
NER_SECRET); |
| 207 Tspi_NV_ReleaseSpace(hNVStore); |
| 208 } |
| 209 #endif |
200 #ifdef NV_LOCKED | 210 #ifdef NV_LOCKED |
201 if (TSS_ERROR_CODE(result)== TPM_E_BAD_DATASIZE | 211 if (TSS_ERROR_CODE(result)== TPM_E_BAD_DATASIZE |
202 ||TSS_ERROR_CODE(result)==TPM_E_BAD_PARAM_SIZE) | 212 ||TSS_ERROR_CODE(result)==TPM_E_BAD_PARAM_SIZE) |
203 { | 213 { |
204 print_success(nameOfFunction, result); | 214 print_success(nameOfFunction, result); |
205 print_end_test(nameOfFunction); | 215 print_end_test(nameOfFunction); |
206 Tspi_Context_FreeMemory(hContext, NULL); | 216 Tspi_Context_FreeMemory(hContext, NULL); |
207 Tspi_Context_Close(hContext); | 217 Tspi_Context_Close(hContext); |
208 exit(0); | 218 exit(0); |
209 } | 219 } |
(...skipping 21 matching lines...) Expand all Loading... |
231 print_error("Tspi_NV_DefineSpace", result); | 241 print_error("Tspi_NV_DefineSpace", result); |
232 print_end_test(nameOfFunction); | 242 print_end_test(nameOfFunction); |
233 Tspi_Context_FreeMemory(hContext, NULL); | 243 Tspi_Context_FreeMemory(hContext, NULL); |
234 Tspi_Context_Close(hContext); | 244 Tspi_Context_Close(hContext); |
235 if ( result == TSS_SUCCESS ) | 245 if ( result == TSS_SUCCESS ) |
236 exit(-1); | 246 exit(-1); |
237 exit(result); | 247 exit(result); |
238 } | 248 } |
239 #endif | 249 #endif |
240 } | 250 } |
OLD | NEW |