OLD | NEW |
(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_commands.h" |
| 18 #include "tpm/tpm_handles.h" |
| 19 #include "tpm/tpm_commands.h" |
| 20 |
| 21 TPM_RESULT MTM_ReleaseCounter(TPM_COUNT_ID countID, TPM_AUTH *auth1) |
| 22 { |
| 23 int i = HANDLE_TO_INDEX(countID); |
| 24 info("MTM_ReleaseCounter()"); |
| 25 if (i == MTM_COUNTER_SELECT_BOOTSTRAP |
| 26 || i == MTM_COUNTER_SELECT_RIMPROTECT |
| 27 || i == MTM_COUNTER_SELECT_STORAGEPROTECT) { |
| 28 debug("MTM counters cannot be released"); |
| 29 return TPM_FAIL; |
| 30 } |
| 31 return TPM_ReleaseCounter(countID, auth1); |
| 32 } |
| 33 |
| 34 TPM_RESULT MTM_ReleaseCounterOwner(TPM_COUNT_ID countID, TPM_AUTH *auth1) |
| 35 { |
| 36 int i = HANDLE_TO_INDEX(countID); |
| 37 info("MTM_ReleaseCounterOwner()"); |
| 38 if (i == MTM_COUNTER_SELECT_BOOTSTRAP |
| 39 || i == MTM_COUNTER_SELECT_RIMPROTECT |
| 40 || i == MTM_COUNTER_SELECT_STORAGEPROTECT) { |
| 41 debug("MTM counters cannot be released"); |
| 42 return TPM_FAIL; |
| 43 } |
| 44 return TPM_ReleaseCounterOwner(countID, auth1); |
| 45 } |
| 46 |
| 47 |
OLD | NEW |