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