| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 Tspi_Context_Close(hContext); | 191 Tspi_Context_Close(hContext); |
| 192 exit(result); | 192 exit(result); |
| 193 } | 193 } |
| 194 | 194 |
| 195 /*Define NV space*/ | 195 /*Define NV space*/ |
| 196 result = Tspi_NV_DefineSpace(hNVStore, 0, 0); | 196 result = Tspi_NV_DefineSpace(hNVStore, 0, 0); |
| 197 | 197 |
| 198 #ifdef NV_LOCKED | 198 #ifdef NV_LOCKED |
| 199 if (TSS_ERROR_CODE(result)== TPM_E_BADINDEX) | 199 if (TSS_ERROR_CODE(result)== TPM_E_BADINDEX) |
| 200 { | 200 { |
| 201 » print_success(nameOfFunction, result); | 201 » » print_success(nameOfFunction, result); |
| 202 print_end_test(nameOfFunction); | 202 print_end_test(nameOfFunction); |
| 203 Tspi_Context_FreeMemory(hContext, NULL); | 203 Tspi_Context_FreeMemory(hContext, NULL); |
| 204 Tspi_Context_Close(hContext); | 204 Tspi_Context_Close(hContext); |
| 205 exit(0); | 205 exit(0); |
| 206 } | 206 } |
| 207 else{ | 207 else{ |
| 208 print_error("Tspi_NV_DefineSpace", result); | 208 print_error("Tspi_NV_DefineSpace", result); |
| 209 print_end_test(nameOfFunction); | 209 print_end_test(nameOfFunction); |
| 210 if ( result == TSS_SUCCESS ) { |
| 211 #ifdef CLEAR_TEST_INDEX |
| 212 Tspi_Context_GetTpmObject(hContext, &hTPM); |
| 213 Tspi_GetPolicyObject(hTPM, TSS_POLICY_USAGE, &hPolicy); |
| 214 Tspi_Policy_SetSecret( hPolicy, TESTSUITE_OWNER_SECRET_M
ODE, |
| 215 TESTSUITE_OWNER_SECRET_LEN, TESTSUITE_OW
NER_SECRET); |
| 216 Tspi_NV_ReleaseSpace(hNVStore); |
| 217 #endif |
| 218 Tspi_Context_FreeMemory(hContext, NULL); |
| 219 Tspi_Context_Close(hContext); |
| 220 exit(-1); |
| 221 } |
| 210 Tspi_Context_FreeMemory(hContext, NULL); | 222 Tspi_Context_FreeMemory(hContext, NULL); |
| 211 Tspi_Context_Close(hContext); | 223 Tspi_Context_Close(hContext); |
| 212 if ( result == TSS_SUCCESS ) | |
| 213 exit(-1); | |
| 214 exit(result); | 224 exit(result); |
| 215 } | 225 } |
| 216 | 226 |
| 217 #else | 227 #else |
| 218 if (result== TSS_SUCCESS) | 228 if (result== TSS_SUCCESS) |
| 219 { | 229 { |
| 220 print_success(nameOfFunction, result); | 230 print_success(nameOfFunction, result); |
| 221 print_end_test(nameOfFunction); | 231 print_end_test(nameOfFunction); |
| 222 | 232 |
| 223 #ifdef CLEAR_TEST_INDEX | 233 #ifdef CLEAR_TEST_INDEX |
| (...skipping 10 matching lines...) Expand all Loading... |
| 234 } | 244 } |
| 235 else{ | 245 else{ |
| 236 print_error("Tspi_NV_DefineSpace", result); | 246 print_error("Tspi_NV_DefineSpace", result); |
| 237 print_end_test(nameOfFunction); | 247 print_end_test(nameOfFunction); |
| 238 Tspi_Context_FreeMemory(hContext, NULL); | 248 Tspi_Context_FreeMemory(hContext, NULL); |
| 239 Tspi_Context_Close(hContext); | 249 Tspi_Context_Close(hContext); |
| 240 exit(result); | 250 exit(result); |
| 241 } | 251 } |
| 242 #endif | 252 #endif |
| 243 } | 253 } |
| OLD | NEW |