OLD | NEW |
1 /* TPM Device Driver Library for the TPM-Emulator package | 1 /* Software-based Trusted Platform Module (TPM) Emulator |
2 * Copyright (C) 2004 Mario Strasser <mast@gmx.net>, | 2 * Copyright (C) 2004-2010 Mario Strasser <mast@gmx.net> |
3 * Swiss Federal Institute of Technology (ETH) Zurich | |
4 * | 3 * |
5 * This module is free software; you can redistribute it and/or modify | 4 * This module is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License as published | 5 * it under the terms of the GNU General Public License as published |
7 * by the Free Software Foundation; either version 2 of the License, | 6 * by the Free Software Foundation; either version 2 of the License, |
8 * or (at your option) any later version. | 7 * or (at your option) any later version. |
9 * | 8 * |
10 * This module is distributed in the hope that it will be useful, | 9 * This module is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
14 * | 13 * |
15 * $Id$ | 14 * $Id: test_tddl.c 364 2010-02-11 10:24:45Z mast $ |
16 */ | 15 */ |
17 | 16 |
18 #include <stdio.h> | 17 #include <stdio.h> |
19 #include <tddl.h> | 18 #include <tddl.h> |
20 | 19 |
21 const char *get_error(TSS_RESULT res) | 20 const char *get_error(TSS_RESULT res) |
22 { | 21 { |
23 switch (res) { | 22 switch (res) { |
24 case TDDL_SUCCESS: | 23 case TDDL_SUCCESS: |
25 return "success"; | 24 return "success"; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 for (i = 0; i < buf_size; i++) printf("%02x ", buf[i]); | 144 for (i = 0; i < buf_size; i++) printf("%02x ", buf[i]); |
146 printf("\n"); | 145 printf("\n"); |
147 | 146 |
148 res = Tddli_Close(); | 147 res = Tddli_Close(); |
149 if (res != TDDL_SUCCESS) { | 148 if (res != TDDL_SUCCESS) { |
150 printf("Error: Tddli_Close() failed: %s (%04x)\n", get_error(res), res); | 149 printf("Error: Tddli_Close() failed: %s (%04x)\n", get_error(res), res); |
151 return -1; | 150 return -1; |
152 } | 151 } |
153 return 0; | 152 return 0; |
154 } | 153 } |
OLD | NEW |