* \brief properties
* @author Seiji Munetoh <munetoh@users.sourceforge.jp>
* @date 2010-11-26
- * cleanup 2011-01-22 SM
+ * cleanup 2012-01-05 SM
*
* Reason (Remidiation) of validation fail
*
void freeReason(OPENPTS_REASON *reason) {
/* check */
if (reason == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return;
}
xfree(reason->message);
xfree(reason);
- return; // PTS_SUCCESS;
+ return;
}
/**
int freeReasonChain(OPENPTS_REASON *reason) {
/* check */
if (reason == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return PTS_FATAL;
}
OPENPTS_REASON *reason;
int len;
- // DEBUG("addReason - [%s]\n", message);
-
/* check */
if (ctx == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return PTS_FATAL;
}
- len = strlen(message);
-
+ len = strlen(message);
start = ctx->reason_start;
end = ctx->reason_end;
reason = (OPENPTS_REASON *) xmalloc(sizeof(OPENPTS_REASON));
if (reason == NULL) {
- ERROR("no memory");
+ LOG(LOG_ERR, "no memory");
return PTS_FATAL;
}
memset(reason, 0, sizeof(OPENPTS_REASON));
reason->pcr = pcr;
reason->message = xmalloc(len +1);
if (reason->message == NULL) {
- ERROR("no memory");
+ LOG(LOG_ERR, "no memory");
xfree(reason);
return PTS_FATAL;
}
reason->message[len] = 0;
ctx->reason_count++;
- // DEBUG("addReason - done %d [%s]\n", ctx->reason_count, reason->message);
-
return PTS_SUCCESS;
}
*/
#define MAX_REASON_SIZE 2048
int addReason(OPENPTS_CONTEXT *ctx, int pcr, const char *format, ...) {
- char buf[MAX_REASON_SIZE +1]; // TODO size
int rc;
+ char buf[MAX_REASON_SIZE +1]; // TODO size
va_list list;
- va_start(list, format);
/* check */
if (ctx == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return PTS_FATAL;
}
+ va_start(list, format);
vsnprintf(buf, MAX_REASON_SIZE, format, list);
rc = addReason_old(ctx, pcr, (char *)buf);
NULL, /* PCR9 Unused */
"Trusted Execution Database"
};
-#else // TPM v1.2, PC Linux, TODO add other type of platform?
+#else // TPM v1.2, PC Linux, TODO add other type of platform?
char *reason_pcr_hints[] = {
"CRTM, BIOS and Platform Extensions",
"Platform Configuration",
"IPL Code (usually the MBR)",
"IPL Code Configuration and Data (for use by the IPL code)",
"State Transition and Wake Events",
- "Host Platform Manufacturer Control", // v1.1"Reserved for future usage. Do not use.",
+ "Host Platform Manufacturer Control", // v1.1"Reserved for future usage. Do not use.",
"OS Kernels (GRUB-IMA)",
NULL, /* PCR9 Unused */
"Applications (LINUX-IMA)", /* PCR10 */
/* check */
if (ctx == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return;
}
reason = ctx->reason_start;
}
}
}
-
-
-// TODO add freeReason()