| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Licensed Materials - Property of IBM | 3 * Licensed Materials - Property of IBM |
| 4 * | 4 * |
| 5 * trousers - An open source TCG Software Stack | 5 * trousers - An open source TCG Software Stack |
| 6 * | 6 * |
| 7 * (C) Copyright International Business Machines Corp. 2004-2006 | 7 * (C) Copyright International Business Machines Corp. 2004-2006 |
| 8 * | 8 * |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 if (getenv("TCSD_FOREGROUND") == NULL) | 39 if (getenv("TCSD_FOREGROUND") == NULL) |
| 40 openlog(szDescriptor, LOG_NDELAY|LOG_PID, TSS_SYSLOG_LVL); | 40 openlog(szDescriptor, LOG_NDELAY|LOG_PID, TSS_SYSLOG_LVL); |
| 41 memset(temp, 0, sizeof(temp)); | 41 memset(temp, 0, sizeof(temp)); |
| 42 | 42 |
| 43 for (i = 0; (unsigned long)i < sizeOfBlob; i++) { | 43 for (i = 0; (unsigned long)i < sizeOfBlob; i++) { |
| 44 if ((i > 0) && ((i % 16) == 0)) { | 44 if ((i > 0) && ((i % 16) == 0)) { |
| 45 if (getenv("TCSD_FOREGROUND") != NULL) | 45 if (getenv("TCSD_FOREGROUND") != NULL) |
| 46 fprintf(stdout, "%s %s\n", szDescriptor, temp); | 46 fprintf(stdout, "%s %s\n", szDescriptor, temp); |
| 47 else | 47 else |
| 48 » » » » syslog(LOG_DEBUG, temp); | 48 » » » » syslog(LOG_DEBUG, "%s", temp); |
| 49 memset(temp, 0, sizeof(temp)); | 49 memset(temp, 0, sizeof(temp)); |
| 50 } | 50 } |
| 51 snprintf(&temp[(i%16)*3], 4, "%.2X ", blob[i]); | 51 snprintf(&temp[(i%16)*3], 4, "%.2X ", blob[i]); |
| 52 } | 52 } |
| 53 | 53 |
| 54 if (i == sizeOfBlob) { | 54 if (i == sizeOfBlob) { |
| 55 if (getenv("TCSD_FOREGROUND") != NULL) | 55 if (getenv("TCSD_FOREGROUND") != NULL) |
| 56 fprintf(stdout, "%s %s\n", szDescriptor, temp); | 56 fprintf(stdout, "%s %s\n", szDescriptor, temp); |
| 57 else | 57 else |
| 58 » » » syslog(LOG_DEBUG, temp); | 58 » » » syslog(LOG_DEBUG, "%s", temp); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 void | 62 void |
| 63 LogTPMERR(TSS_RESULT result, char *file, int line) | 63 LogTPMERR(TSS_RESULT result, char *file, int line) |
| 64 { | 64 { |
| 65 if (getenv("TSS_DEBUG_OFF") == NULL) | 65 if (getenv("TSS_DEBUG_OFF") == NULL) |
| 66 fprintf(stderr, "%s %s %s:%d: 0x%x\n", "LOG_RETERR", "TPM", file
, line, result); | 66 fprintf(stderr, "%s %s %s:%d: 0x%x\n", "LOG_RETERR", "TPM", file
, line, result); |
| 67 } | 67 } |
| 68 | 68 |
| 69 TSS_RESULT | 69 TSS_RESULT |
| 70 LogTDDLERR(TSS_RESULT result, char *file, int line) | 70 LogTDDLERR(TSS_RESULT result, char *file, int line) |
| 71 { | 71 { |
| 72 if (getenv("TSS_DEBUG_OFF") == NULL) | 72 if (getenv("TSS_DEBUG_OFF") == NULL) |
| 73 fprintf(stderr, "%s %s %s:%d: 0x%x\n", "LOG_RETERR", APPID, file
, line, result); | 73 fprintf(stderr, "%s %s %s:%d: 0x%x\n", "LOG_RETERR", APPID, file
, line, result); |
| 74 | 74 |
| 75 return (result | TSS_LAYER_TDDL); | 75 return (result | TSS_LAYER_TDDL); |
| 76 } | 76 } |
| 77 | 77 |
| 78 TSS_RESULT | 78 TSS_RESULT |
| 79 LogTCSERR(TSS_RESULT result, char *file, int line) | 79 LogTCSERR(TSS_RESULT result, char *file, int line) |
| 80 { | 80 { |
| 81 if (getenv("TSS_DEBUG_OFF") == NULL) | 81 if (getenv("TSS_DEBUG_OFF") == NULL) |
| 82 fprintf(stderr, "%s %s %s:%d: 0x%x\n", "LOG_RETERR", APPID, file
, line, result); | 82 fprintf(stderr, "%s %s %s:%d: 0x%x\n", "LOG_RETERR", APPID, file
, line, result); |
| 83 | 83 |
| 84 return (result | TSS_LAYER_TCS); | 84 return (result | TSS_LAYER_TCS); |
| 85 } | 85 } |
| 86 | 86 |
| 87 #endif | 87 #endif |
| OLD | NEW |