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

Side by Side Diff: mtm/mtm_integrity.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 unified diff | Download patch
« no previous file with comments | « mtm/mtm_handles.c ('k') | mtm/mtm_marshalling.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Software-based Mobile Trusted Module (MTM) Emulator
2 * Copyright (C) 2004-2010 Mario Strasser <mast@gmx.net>
3 *
4 * This module is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published
6 * by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
8 *
9 * This module is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * $Id$
15 */
16
17 #include "mtm_structures.h"
18 #include "mtm_data.h"
19 #include "tpm/tpm_commands.h"
20
21 TPM_RESULT MTM_Extend(TPM_PCRINDEX pcrNum, TPM_DIGEST *inDigest,
22 TPM_PCRVALUE *outDigest)
23 {
24 info("MTM_Extend()");
25 if (mtmData.permanent.data.verifiedPCRs.pcrSelect[pcrNum >> 3] & (1 << (pcrNum & 7))) {
26 return TPM_BAD_LOCALITY;
27 }
28 return TPM_Extend(pcrNum, inDigest, outDigest);
29 }
30
31 TPM_RESULT MTM_PCR_Reset(TPM_PCR_SELECTION *pcrSelection)
32 {
33 int i;
34 info("MTM_PCR_Reset()");
35 for (i = 0; i < pcrSelection->sizeOfSelect * 8; i++) {
36 if ((pcrSelection->pcrSelect[i >> 3] & (1 << (i & 7)))
37 && (mtmData.permanent.data.verifiedPCRs.pcrSelect[i >> 3] & (1 << (i & 7 )))) {
38 return TPM_FAIL;
39 }
40 }
41 return TPM_PCR_Reset(pcrSelection);
42 }
43
OLDNEW
« no previous file with comments | « mtm/mtm_handles.c ('k') | mtm/mtm_marshalling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698