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

Unified Diff: mtm/mtm_eviction.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_data.c ('k') | mtm/mtm_handles.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mtm/mtm_eviction.c
diff --git a/mtm/mtm_eviction.c b/mtm/mtm_eviction.c
new file mode 100644
index 0000000000000000000000000000000000000000..a7aa53edc3427c9744bef21decf9450fabb4efa7
--- /dev/null
+++ b/mtm/mtm_eviction.c
@@ -0,0 +1,39 @@
+/* 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 "mtm_handles.h"
+#include "tpm/tpm_commands.h"
+
+TPM_RESULT MTM_FlushSpecific(TPM_HANDLE handle,
+ TPM_RESOURCE_TYPE resourceType)
+{
+ MTM_KEY_DATA *key;
+
+ info("MTM_FlushSpecific()");
+ debug("handle = %08x, resourceType = %08x", handle, resourceType);
+ if (resourceType == TPM_RT_KEY) {
+ key = mtm_get_key(handle);
+ if (key != NULL) {
+ free_MTM_KEY_DATA((*key));
+ memset(key, 0, sizeof(*key));
+ tpm_invalidate_sessions(handle);
+ return TPM_SUCCESS;
+ }
+ }
+ return TPM_FlushSpecific(handle, resourceType);
+}
+
« no previous file with comments | « mtm/mtm_data.c ('k') | mtm/mtm_handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698