| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 236 |
| 237 #ifdef CLEAR_TEST_INDEX | 237 #ifdef CLEAR_TEST_INDEX |
| 238 Tspi_Context_GetTpmObject(hContext, &hTPM); | 238 Tspi_Context_GetTpmObject(hContext, &hTPM); |
| 239 Tspi_GetPolicyObject(hTPM, TSS_POLICY_USAGE, &hPolicy); | 239 Tspi_GetPolicyObject(hTPM, TSS_POLICY_USAGE, &hPolicy); |
| 240 Tspi_Policy_SetSecret(hPolicy, TESTSUITE_OWNER_SECRET_MODE, | 240 Tspi_Policy_SetSecret(hPolicy, TESTSUITE_OWNER_SECRET_MODE, |
| 241 TESTSUITE_OWNER_SECRET_LEN, TESTSUITE_OWNER_SECRET); | 241 TESTSUITE_OWNER_SECRET_LEN, TESTSUITE_OWNER_SECRET); |
| 242 Tspi_NV_ReleaseSpace(hNVStore); | 242 Tspi_NV_ReleaseSpace(hNVStore); |
| 243 #endif | 243 #endif |
| 244 | 244 |
| 245 #ifdef NV_LOCKED | 245 #ifdef NV_LOCKED |
| 246 if (TSS_ERROR_CODE(result)== TPM_E_AUTH_CONFLICT) | 246 if (TSS_ERROR_CODE(result) != TPM_E_AUTH_CONFLICT) |
| 247 #else | 247 #else |
| 248 if (TSS_ERROR_CODE(result)== TSS_SUCCESS) | 248 if (TSS_ERROR_CODE(result) != TSS_SUCCESS) |
| 249 #endif | 249 #endif |
| 250 { | 250 { |
| 251 print_error("Tspi_NV_WriteValue", result); | 251 print_error("Tspi_NV_WriteValue", result); |
| 252 Tspi_Context_FreeMemory(hContext, NULL); | 252 Tspi_Context_FreeMemory(hContext, NULL); |
| 253 Tspi_Context_Close(hContext); | 253 Tspi_Context_Close(hContext); |
| 254 exit(result); | 254 exit(result); |
| 255 } | 255 } |
| 256 | 256 |
| 257 result = Testsuite_Transport_Final(hContext, hSigningKey); | 257 result = Testsuite_Transport_Final(hContext, hSigningKey); |
| 258 if (TSS_ERROR_CODE(result)== TSS_SUCCESS) | 258 if (TSS_ERROR_CODE(result)== TSS_SUCCESS) |
| 259 { | 259 { |
| 260 print_success(nameOfFunction, result); | 260 print_success(nameOfFunction, result); |
| 261 print_end_test(nameOfFunction); | 261 print_end_test(nameOfFunction); |
| 262 Tspi_Context_FreeMemory(hContext, NULL); | 262 Tspi_Context_FreeMemory(hContext, NULL); |
| 263 Tspi_Context_Close(hContext); | 263 Tspi_Context_Close(hContext); |
| 264 exit(0); | 264 exit(0); |
| 265 } else { | 265 } else { |
| 266 print_error(nameOfFunction, result); | 266 print_error(nameOfFunction, result); |
| 267 print_end_test(nameOfFunction); | 267 print_end_test(nameOfFunction); |
| 268 Tspi_Context_FreeMemory(hContext, NULL); | 268 Tspi_Context_FreeMemory(hContext, NULL); |
| 269 Tspi_Context_Close(hContext); | 269 Tspi_Context_Close(hContext); |
| 270 if ( result == TSS_SUCCESS ) | 270 if ( result == TSS_SUCCESS ) |
| 271 exit(-1); | 271 exit(-1); |
| 272 exit(result); | 272 exit(result); |
| 273 } | 273 } |
| 274 } | 274 } |
| OLD | NEW |