Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: mtm/mtm_counter.c

Issue 660204: Upgrade to tpm-emulator version 0.7. (Closed)
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mtm/mtm_commands.h ('k') | mtm/mtm_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mtm/mtm_counter.c
diff --git a/mtm/mtm_counter.c b/mtm/mtm_counter.c
new file mode 100644
index 0000000000000000000000000000000000000000..03718771a0c0472c7fdeb801174ce0194a6a8d5d
--- /dev/null
+++ b/mtm/mtm_counter.c
@@ -0,0 +1,47 @@
+/* Software-based Mobile Trusted Module (MTM) Emulator
+ * Copyright (C) 2004-2010 Mario Strasser <mast@gmx.net>
+ *
+ * This module is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * This module is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * $Id$
+ */
+
+#include "mtm_commands.h"
+#include "tpm/tpm_handles.h"
+#include "tpm/tpm_commands.h"
+
+TPM_RESULT MTM_ReleaseCounter(TPM_COUNT_ID countID, TPM_AUTH *auth1)
+{
+ int i = HANDLE_TO_INDEX(countID);
+ info("MTM_ReleaseCounter()");
+ if (i == MTM_COUNTER_SELECT_BOOTSTRAP
+ || i == MTM_COUNTER_SELECT_RIMPROTECT
+ || i == MTM_COUNTER_SELECT_STORAGEPROTECT) {
+ debug("MTM counters cannot be released");
+ return TPM_FAIL;
+ }
+ return TPM_ReleaseCounter(countID, auth1);
+}
+
+TPM_RESULT MTM_ReleaseCounterOwner(TPM_COUNT_ID countID, TPM_AUTH *auth1)
+{
+ int i = HANDLE_TO_INDEX(countID);
+ info("MTM_ReleaseCounterOwner()");
+ if (i == MTM_COUNTER_SELECT_BOOTSTRAP
+ || i == MTM_COUNTER_SELECT_RIMPROTECT
+ || i == MTM_COUNTER_SELECT_STORAGEPROTECT) {
+ debug("MTM counters cannot be released");
+ return TPM_FAIL;
+ }
+ return TPM_ReleaseCounterOwner(countID, auth1);
+}
+
+
« no previous file with comments | « mtm/mtm_commands.h ('k') | mtm/mtm_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698